<phoe>
;; it's a pity that SBCL doesn't allow anonymous classes in there
libertyprime has joined #lisp
<no-defun-allowed>
):
cosimone has quit [Ping timeout: 256 seconds]
GuerrillaMonkey has joined #lisp
Involuntary has quit [Read error: Connection reset by peer]
Involuntary has joined #lisp
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 258 seconds]
X-Scale` is now known as X-Scale
GuerrillaMonkey has quit [Ping timeout: 255 seconds]
slyrus has quit [Quit: Leaving]
GuerrillaMonkey has joined #lisp
libertyprime has quit [Read error: Connection reset by peer]
lucasb has quit [Quit: Connection closed for inactivity]
Involuntary has quit [Ping timeout: 256 seconds]
mikecheck has left #lisp ["part"]
libertyprime has joined #lisp
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 240 seconds]
chipolux has joined #lisp
Khisanth has quit [Ping timeout: 258 seconds]
chipolux has quit [Client Quit]
libertyprime has quit [Read error: No route to host]
libertyprime has joined #lisp
random-nick has quit [Ping timeout: 255 seconds]
chipolux has joined #lisp
frodef has quit [Ping timeout: 255 seconds]
Jeanne-Kamikaze has joined #lisp
GuerrillaMonkey has quit [Ping timeout: 256 seconds]
Inline has quit [Ping timeout: 272 seconds]
vms14 has joined #lisp
dumbintel has joined #lisp
Khisanth has joined #lisp
libertyprime has quit [Read error: No route to host]
matzy_ has joined #lisp
libertyprime has joined #lisp
<matzy_>
i have a relatively simple question. just for my own experience of using CL to write back-end APIs, i'm going to setup a react front-end/cl back-end project. I "set up" the back-end (take that lightly, I just followed an example video I found online) that was using the ningle and clack packages for running it
z147 has quit [Quit: z147]
<matzy_>
now i work as a full-stack developer, so i'm obviously familiar with how they work, but my experience with common lisp is limited to working through about 2/3rd's of PCL, I figured I'd learn the rest as I went along. Basically all I want my API to do is create routes the front-end can hit, interact with a sql database, do any data manipulation (if
<matzy_>
necessary) and then send json back to the front-end. I don't want the API sending templates themselves or anything like that back, jjst straight json
sjl has quit [Quit: WeeChat 2.2-dev]
<matzy_>
with that in mind, am i using the right CL tools for the API, or is there something better suited for that/something else I will need that I'm not thinking of now?
prince1 has joined #lisp
<matzy_>
oh yeah, i'm also an emacs user (like 90% of people here I'm sure) and roll my own 2500+ line config that I wrote myself, so maybe that adds a tad bit to my cl experience (I know obviously they are separate languages, but I think I read once that elisp was "inspired" or something by common-lisp, so there's more similarity there than between, say,
<matzy_>
elisp and scheme
Jesin has quit [Quit: Leaving]
prince1 has quit [Ping timeout: 260 seconds]
libertyprime has quit [Read error: No route to host]
dumbintel has quit [Remote host closed the connection]
<_death>
matzy_: sure, that setup could work.. personally I use hunchentoot + a few operators to create "json handlers".. there are other libraries, like https://github.com/joaotavora/snooze
Jesin has joined #lisp
libertyprime has joined #lisp
karlosz has quit [Quit: karlosz]
slyrus__ has joined #lisp
wxie has joined #lisp
slyrus_ has quit [Ping timeout: 258 seconds]
__jrjsmrtn__ has quit [Ping timeout: 255 seconds]
__jrjsmrtn__ has joined #lisp
libertyprime has quit [Read error: No route to host]
<matzy_>
_death I've heard a few people comment (when researching this and reading other forum posts) that why not just use huchentoot, and from the readme and diving into their site, it seems the only downside (if it even is one) is that it does not support all of portable common lisp, whatever the heck that is. from googling all i see is that it's a
<matzy_>
non-emacs interactive lisp IDE. is that correct?
<matzy_>
right, so what is portable common lisp and why does it not support it? "Therefore, it cannot be implemented completely in portable Common Lisp."
<_death>
the documentation conflates portable and standard
<pjb>
matzy_: I don't know what portable CL is. There's conforming CL code. It's code that will run the same on all conforming implementations of CL.
<pjb>
matzy_: it's not possible to write a web server in conforming CL code, because the CL standard doesn't specify anything about sockets.
<_death>
the Common Lisp standard does not cover sockets or threads, but there are libraries that expose such functionality through use of implementation-specific operators
<pjb>
matzy_: there's also the problem of encoding, which the web server would have to deal with itself, instead of relying on CL :external-format, since the values for the later are implementation dependent.
<_death>
using these libraries, you can give better chance for your own code to be portable across the various implementations
<pjb>
matzy_: but apart from listening to the internet and connecting to clients, all the rest of a web server could be written in conforming CL code.
<pjb>
matzy_: the use of those "portability" libraries means that your code can be conforming, relying on those portability libraries to be portable to different implementations, to use those implementation specific features and extensions in a portable way.
<pjb>
matzy_: saying that your code is not portable, is saying that it uses some specific implementation, implementation-specific feature.
<pjb>
matzy_: some people write in sbcl, not in CL. (They use #sbcl, instead of #lisp).
wxie1 has joined #lisp
wxie has quit [Ping timeout: 260 seconds]
wxie1 is now known as wxie
karlosz has joined #lisp
<_death>
since hunchentoot uses such libraries (e.g., usocket and bordeaux-threads) it works on all important Common Lisp implementations today
libertyprime has quit [Read error: Connection reset by peer]
hsaziz has quit [Client Quit]
wxie has quit [Quit: wxie]
libertyprime has joined #lisp
vms14 has quit [Remote host closed the connection]
wxie has joined #lisp
libertyprime has quit [Read error: No route to host]
buffergn0me has joined #lisp
libertyprime has joined #lisp
caltelt has joined #lisp
wxie has quit [Quit: wxie]
wxie has joined #lisp
libertyprime has quit [Read error: No route to host]
shifty has joined #lisp
libertyprime has joined #lisp
nullniverse has joined #lisp
nullniverse has quit [Changing host]
nullniverse has joined #lisp
libertyprime has quit [Read error: No route to host]
prince1 has joined #lisp
libertyprime has joined #lisp
<matzy_>
pjb thanks for sharing all this with me. the last part kinda blew my mind. i write in sbcl and NOT lisp?
prince1 has quit [Ping timeout: 240 seconds]
<matzy_>
i assumed they were all just different flavors of the same language....i do, however, get everything you were talkimw=a=f=fawwww
<matzy_>
(cat jumped on the keyboard) get everything you were talking about regarding portability though, makes perfect sense. and why huchentoot is so commonly suggested. i'm on sbcl like most noobs
libertyprime has quit [Ping timeout: 258 seconds]
prince1 has joined #lisp
prince1 has quit [Ping timeout: 255 seconds]
gravicappa has joined #lisp
wxie has quit [Read error: Connection reset by peer]
wxie has joined #lisp
wxie has quit [Remote host closed the connection]
wxie has joined #lisp
wxie has quit [Quit: wxie]
wxie has joined #lisp
wxie has quit [Client Quit]
wxie has joined #lisp
caltelt has quit [Ping timeout: 260 seconds]
krid has quit [Ping timeout: 255 seconds]
buffergn0me has quit [Ping timeout: 240 seconds]
shifty has quit [Ping timeout: 255 seconds]
slyrus_ has joined #lisp
wxie1 has joined #lisp
Bike has quit [Quit: Lost terminal]
slyrus__ has quit [Ping timeout: 258 seconds]
wxie has quit [Ping timeout: 256 seconds]
wxie1 is now known as wxie
torbo has joined #lisp
nicdev has quit [Ping timeout: 260 seconds]
slyrus has joined #lisp
slyrus_ has quit [Ping timeout: 258 seconds]
wxie1 has joined #lisp
wxie has quit [Ping timeout: 258 seconds]
wxie1 is now known as wxie
akoana has left #lisp ["Leaving"]
libertyprime has joined #lisp
ggole has joined #lisp
ebzzry has joined #lisp
<beach>
Good morning everyone!
sz0 has quit [Quit: Connection closed for inactivity]
matzy_ has quit [Ping timeout: 260 seconds]
Lord_of_Life has quit [Write error: Connection reset by peer]
Lord_of_Life has joined #lisp
torbo has quit [Remote host closed the connection]
wxie has quit [Quit: wxie]
ebzzry has quit [Read error: Connection reset by peer]
leonrwood has joined #lisp
libertyprime has quit [Remote host closed the connection]
gko_ has quit [Ping timeout: 258 seconds]
|Pirx| has quit [Ping timeout: 258 seconds]
leonrwood has quit [Quit: WeeChat 2.6]
orivej has joined #lisp
chipolux has quit [Quit: chipolux]
chipolux has joined #lisp
ebzzry has joined #lisp
buffergn0me has joined #lisp
mrcom has quit [Quit: This computer has gone to sleep]
ebzzry has quit [Ping timeout: 256 seconds]
buffergn0me has quit [Ping timeout: 256 seconds]
mrcom has joined #lisp
shangul has joined #lisp
shka_ has joined #lisp
<ebrasca>
beach: Morning
<ebrasca>
Morning!
<beach>
Hello ebrasca.
_whitelogger has joined #lisp
Jeanne-Kamikaze has quit [Remote host closed the connection]
<ebrasca>
beach: How are you doing? Are you in some beach?
<beach>
I am making slow but steady progress on code generation. But I am also a member of the ELS program committee, so I need to start the referee process soon, probably tomorrow. I am not on a beach, no.
<beach>
ebrasca: What about you?
karlosz has joined #lisp
<ebrasca>
beach: I am fine, I don't think I can go to ELS.
prince1 has joined #lisp
prince1 has quit [Ping timeout: 258 seconds]
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 255 seconds]
v88m has quit [Ping timeout: 240 seconds]
Lord_of_Life_ is now known as Lord_of_Life
<beach>
ebrasca: Sorry to hear that you can't go.
ulrivo has joined #lisp
ulrivo has quit [Remote host closed the connection]
ulrivo has joined #lisp
ulrivo has quit [Client Quit]
vlatkoB has joined #lisp
ulrivo has joined #lisp
ulrivo has quit [Remote host closed the connection]
ulrivo has joined #lisp
ulrivo has quit [Remote host closed the connection]
ulrivo has joined #lisp
ulrivo has quit [Ping timeout: 240 seconds]
KDr23 has joined #lisp
KDr22 has quit [Ping timeout: 255 seconds]
nullman has quit [Ping timeout: 240 seconds]
karlosz has quit [Quit: karlosz]
rippa has joined #lisp
jonatack has joined #lisp
gko_ has joined #lisp
jonatack has quit [Ping timeout: 256 seconds]
sz0 has joined #lisp
knicklux has joined #lisp
makomo has joined #lisp
makomo has quit [Client Quit]
makomo has joined #lisp
prince1 has joined #lisp
jonatack has joined #lisp
prince1 has quit [Ping timeout: 260 seconds]
frodef has joined #lisp
random-nick has joined #lisp
makomo has quit [Quit: WeeChat 2.4]
gareppa has joined #lisp
gareppa has quit [Remote host closed the connection]
<random-nick>
is there a standard-defined way to do arithmetic with overflowing?
<no-defun-allowed>
What do you want to happen on overflow?
<random-nick>
well like in x86
<random-nick>
the overflowed bits get truncated
<random-nick>
I could use CL:LDB but I was wondering if there was another way
<lukego>
good day gentlepeople
<beach>
Hello lukego.
<no-defun-allowed>
SBCL can optimise arithmetic in LDB to do word or byte-wise arithmetic, from memory.
<lukego>
How are you, beach?
<beach>
lukego: Busy as usual. Working on code generation. What about you?
<Shinmera>
random-nick: There is not.
<lukego>
Having a lazy sunday morning fantasizing about doing some Lisp hacking again. I got my installation of sbcl/quicklisp/etc with Nix "just so" so I'm running out of excuses to not write some actual code :)
<Shinmera>
random-nick: If you LOGAND with a mask, SBCL for instance can recognise that you're truncating and optimise it.
<beach>
lukego: Go for it!
* Shinmera
is busy doing marketing for his Lisp game
* jackdaniel
encourages Shinmera to tell us more about it
<lukego>
actually, *really* out of excuses, I noticed now that the last time I sat down to tinker with Lisp I even got org-babel up and running with SLIME :)
<Shinmera>
jackdaniel: I will once I'm done writing up this article! :)
<jackdaniel>
does it have a story?
<lukego>
(amazing what great shape the lisp ecosystem is in these days!)
* jackdaniel
likes only games with a good narrative
<Shinmera>
jackdaniel: Yes, it is narrative-focused.
<jackdaniel>
\o/
<no-defun-allowed>
Hm, SBCL prefers to compile the example (defun f (x) (declare (fixnum x)) (logand #xff (+ x 42))) using boxed fixnum addition and an AND instruction to truncate the value.
<Shinmera>
no-defun-allowed: you need to declare it as an UB-8.
<lukego>
beach: Indeed I shall. I decided that I'll take a detour in life and learn to do electronics, ultimately trying to emulate Marc Battyani, and first step seems to be designing a PCB. In principle I should learn how to use the Kicad GUI for this but it actually seems like doing the schematic design in a custom SEXP notation is pretty sensible low-NIH approach.
<lukego>
I don't suppose anybody happens to have already done a PCB schematics DSL in CL that's worth checking out first?
<beach>
Not me, but that would be a good thing to have.
<jackdaniel>
I know someone who have worked on CL-based DSL -> verilog transpiler
<jackdaniel>
but afaik it is not open soruce
<jackdaniel>
source*
<lukego>
jackdaniel: neat. that'll be my next step. first I wanna make my own custom FPGA dev board to program.
madmuppet006 has joined #lisp
dale has quit [Quit: My computer has gone to sleep]
eta has quit [Quit: Gateway shutdown]
eta has joined #lisp
<aeth>
random-nick: I usually just do MOD of a power of 2
<lukego>
Huh... Turns out that Kicad's internal data format for schematics export is already S-expressions... I'm taking that as a good omen. As seen on the ~5th screenshot on https://kicad.txplore.com/index-p=115.html
markoong has joined #lisp
oxum has quit [Read error: Connection reset by peer]
TanKian has quit [Read error: Connection reset by peer]
TanKian_ has quit [Ping timeout: 258 seconds]
igemnace has joined #lisp
Necktwi has joined #lisp
<scymtym>
Shinmera: nice. i hope it goes well
<Shinmera>
Thanks, me too! :)
APic has joined #lisp
ebzzry has joined #lisp
TanKian has joined #lisp
admich has joined #lisp
theBlackDragon has joined #lisp
cosimone has joined #lisp
prince1 has joined #lisp
bitmapper has joined #lisp
TanKian has quit [Read error: Connection reset by peer]
prince1 has quit [Ping timeout: 240 seconds]
hsaziz has joined #lisp
red-dot has joined #lisp
stepnem_ has joined #lisp
stepnem has quit [Ping timeout: 260 seconds]
__vlgvrs has joined #lisp
lavaflow has quit [Ping timeout: 240 seconds]
lucasb has joined #lisp
_paul0 has quit [Ping timeout: 252 seconds]
<lukego>
hey what's SBCL lingo for EXT:REQUIRED-ARGUMENT?
<phoe>
lukego: what does it do?
<Bike>
what is ext:required-argument
<phoe>
I know of alexandria:required-argument that is named the same but might not do the same thing
<lukego>
I'm dating myself... in CMUCL that's the default value you specify for defstruct slots that need to be initialized at construction time
<lukego>
phoe: Thanks I'll check Alexandria
<phoe>
alexandria:required-argument it is then
<Shinmera>
lukego: I just explicitly define a constructor for the struct.
<Shinmera>
that way the argument can be a required one instead of a karg
izh_ has quit [Quit: Leaving]
<lukego>
ok... I don't remember why I always used that in the past... possibly something about making the compiler happy when specifying a slot-type that isn't (OR NULL ...) and wanting to be clear that it won't be initialized with a wrongly-typed default value...
jmercouris has joined #lisp
ebzzry has quit [Ping timeout: 240 seconds]
<_death>
a plain (error ...) is also ok
<Shinmera>
if I remember correctly if it's required in the constructor the default in the slot can be whatever
TanKian has joined #lisp
jmercouris has quit [Remote host closed the connection]
pjb has quit [Ping timeout: 272 seconds]
<lukego>
_death: yeah. alexandria:required-arg is just an (error ...) and maybe it's so in CMUCL too.
<lukego>
(The real scandal here is that I didn't have alexandria loaded and so didn't see it with my apropos search. Sorted now!)
TanKian has quit [Ping timeout: 258 seconds]
<_death>
I guess a more elaborate version could be require-arg-of-type that sets up a use-value restart
mangul has joined #lisp
<lukego>
seriously, the Lisp ecosystem is in amazing shape these days, everything just works. wow. :)
fanta1 has quit [Quit: fanta1]
* Shinmera
wishes the "everything" extended to his own projects
shangul has quit [Ping timeout: 256 seconds]
<lukego>
great job everybody :)
<Shinmera>
Currently trying to figure out why my game just opens and closes on MacOS without an error or anything, as if it had just closed naturally.
hsaziz has quit [Ping timeout: 255 seconds]
TanKian has joined #lisp
luni has joined #lisp
<phoe>
Is there any way to set the default restart to use in sldb when I press "q"?
TanKian has quit [Ping timeout: 260 seconds]
luni has left #lisp [#lisp]
TanKian has joined #lisp
mangul is now known as shangul
Necktwi has quit [Ping timeout: 240 seconds]
kanru has quit [Ping timeout: 240 seconds]
lavaflow has joined #lisp
TanKian has quit [Ping timeout: 256 seconds]
narimiran has joined #lisp
gareppa has joined #lisp
shka_ has quit [Quit: Konversation terminated!]
FreeBirdLjj has joined #lisp
shka_ has joined #lisp
iAmDecim has joined #lisp
Jeanne-Kamikaze has joined #lisp
prince1 has joined #lisp
<Bike>
phoe: swank:*sldb-quit-restart*
<Bike>
or you could just remap the key
<phoe>
Bike: thanks.
prince1 has quit [Ping timeout: 258 seconds]
random-nick has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
grabarz has joined #lisp
Cymew has joined #lisp
random-nick has joined #lisp
gko_ has quit [Ping timeout: 260 seconds]
Bike has quit [Ping timeout: 256 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
rj0d has joined #lisp
rj0d has left #lisp [#lisp]
dddddd has joined #lisp
Cymew has quit [Quit: Konversation terminated!]
Cymew has joined #lisp
sz0 has quit [Quit: Connection closed for inactivity]
Necktwi has joined #lisp
Cymew has quit [Ping timeout: 258 seconds]
rj0d has joined #lisp
rj0d has quit [Client Quit]
rj0d has joined #lisp
rj0d has quit [Client Quit]
rj0d has joined #lisp
rj0d has quit [Client Quit]
rj0d has joined #lisp
rj0d has quit [Client Quit]
rwcom2 has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
rj0d has joined #lisp
Jeanne-Kamikaze has quit [Ping timeout: 258 seconds]
rwcom has quit [Ping timeout: 260 seconds]
rwcom2 is now known as rwcom
gareppa has quit [Quit: Leaving]
Bike has joined #lisp
nowhere_man has joined #lisp
rj0d has quit [Remote host closed the connection]
karlosz has joined #lisp
frodef has quit [Ping timeout: 240 seconds]
frgo has joined #lisp
nmunro has joined #lisp
vms14 has joined #lisp
prince1 has joined #lisp
<nmunro>
Hi all, first time in here, I'm looking to develop a library for web archiving (it's my day job) and there's not one yet for common lisp that I can find, I have most of the pieces, except gzip decompression, which is a little difficult, since web archives are actually plain text files of concatonated gzip streams, unfortunately the gzip spec says
<nmunro>
that makes a viable compressed file, however decompressing the file makes getting the individual records difficult. Is there a way to read a binary file in plain text mode, getting a series of bytes then decompressing them?
prince1 has quit [Ping timeout: 240 seconds]
igemnace has quit [Remote host closed the connection]
igemnace has joined #lisp
EvW has joined #lisp
<luis>
nmunro: have you tried using chipz?
<nmunro>
I've looked at it, but maybe I've misunderstood how it works
<luis>
Its
<nmunro>
Typically in other languages the pattern is to seek to a byte offset, read the length of the record and decompress the block
<nmunro>
Without decompressing the file as a whole
<luis>
Its documentation has an example where a an octet stream is opened. And you can seek with serf file-position
shifty has joined #lisp
<luis>
Sorry, typing on a touch screen. :-/
<luis>
Setf, not serf.
<nmunro>
It's ok, I use the file-position function in plain text warc files, and that works, however my issues seems to be opening the file in the first place before decompression can begin, I probably have the wrong element-type
chip2n has joined #lisp
<luis>
You want '(unsigned-byte 8)
<nmunro>
I tried that, I get an end of file stacktrace
<nmunro>
Which is what made me think there's something strange going on
<luis>
What's the file size and what offset are you setting?
<luis>
(obvious question, I know)
<nmunro>
So, I was seeking to offset 333 and reading 1043 bytes, the file is 3k in size
<luis>
Use a paste service to show us the code.
<nmunro>
Sure :)
<nmunro>
Is there a preferred paste service here, some places have preferred ones
<nmunro>
the example-extra.warc (plain text) works just fine, but the example.warc.gz is where I'm having issues
admich has quit [Ping timeout: 256 seconds]
shifty has quit [Ping timeout: 260 seconds]
pjb has joined #lisp
<splittist>
nmunro: asdf:system-relative-pathname might be a nicer way of handling your opening defparameters. (I know you don't care at the moment (: )
shifty has joined #lisp
<nmunro>
splittist: I'm relatively new to common lisp, so the suggestion is appreciated :)
whiteline_ has quit [Read error: Connection reset by peer]
whiteline has joined #lisp
frodef has joined #lisp
<luis>
nmunro: could the length be the number of bytes after decompression?
<nmunro>
I'm not 100% sure of the data, I'm trusting the pywb data as it's often used as a reference, but it may not be correct
<nmunro>
The way web archiving works is pretty bad in the tooling and the 'standards' don't practically work and have unofficial extensions to just get things to work
iAmDecim has quit [Ping timeout: 240 seconds]
<luis>
There are some efficiency improvements you could make, like using vectors and read-sequence or even passing the stream directly to chips, but I don't see anything obviously wrong with the reading code itself
<nmunro>
I'd certainly like to know how I could improve using read-sequence, I imagine this is to do with me repeatedly calling read-byte?
grabarz has quit [Ping timeout: 256 seconds]
<nmunro>
I'm going to try to generate my own test data and see if that improves anything
<MichaelRaskin>
I guess alexandria:read-file-into-byte-vector could be a faster way
grabarz has joined #lisp
__vlgvrs is now known as paul0
mnepveu has joined #lisp
grabarz has quit [Client Quit]
mnepveu has quit [Client Quit]
vms14 has quit [Remote host closed the connection]
mnepveu has joined #lisp
mnepveu has quit [Client Quit]
shangul has quit [Ping timeout: 256 seconds]
stepnem_ has quit [Read error: Connection reset by peer]
whiteline has quit [Read error: Connection reset by peer]
<luis>
nmuro: good luck. You could try and do some experiments with a simple gz file too to get the hang of things
<nmunro>
That's very true, I suppose any text content gzip compressed and concatonated together would work just as well!
whiteline has joined #lisp
<nmunro>
So long as the byte offsets for each beginning block and the length are known
stepnem has joined #lisp
theBlackDragon has quit [Remote host closed the connection]
whiteline has quit [Read error: Connection reset by peer]
whiteline has joined #lisp
whiteline_ has joined #lisp
whiteline has quit [Read error: Connection reset by peer]
theBlackDragon has joined #lisp
mnepveu has joined #lisp
nmunro has quit [Ping timeout: 260 seconds]
shka_ has quit [Ping timeout: 255 seconds]
mnepveu has quit []
shifty has quit [Ping timeout: 260 seconds]
oitofelix has joined #lisp
oitofelix has quit [Changing host]
oitofelix has joined #lisp
noobineer has joined #lisp
grabarz has joined #lisp
<oitofelix>
Hello everybody. How can I expand a macrolet?
<_death>
if you're using slime, try C-c M-e (macrostep-expand)
prince1 has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 256 seconds]
Lord_of_Life_ is now known as Lord_of_Life
prince1 has quit [Ping timeout: 255 seconds]
v88m has joined #lisp
ulrivo has joined #lisp
ulrivo has quit [Remote host closed the connection]
karlosz has quit [Quit: karlosz]
sauvin is now known as Boc
luni has joined #lisp
<oitofelix>
pjb: Thanks! I'm doing this in Emacs Lisp. It worked fined after I changed defmacro to cl-defmacro. Now I'm trying to understand why calling macroexpand doesn't work when put directly into the body of macrolet.
<Bike>
oh, is that what you mean? it's because macroexpand is just a function, so it only knows about the environment you pass in (or if you don't pass in an environment, the global environment)
<Bike>
it doesn't know about the local environment created by the macrolet, so it can't expand those macros
ggole has quit [Quit: Leaving]
frodef has quit [Ping timeout: 256 seconds]
<oitofelix>
Bike: So when 'expand is called in the body of 'macrolet it captures macrolet's lexical environment (using the &environment feature of 'defmacro)? Where is this behavior specified exactly? Couldn't find it in ELisp nor Emacs' CL documentation nor in the Hyperspec. Is there another way to capture this environement and pass it to 'macroexpand or the only path is this indirection using a macro definition?
madmuppet006 has quit [Ping timeout: 240 seconds]
<Bike>
It's mentioned in the page on DEFMACRO and in more detail in CLHS 3.4.4, "Macro Lambda Lists"
<Bike>
and no, you pretty much need it from a macro. You can think of the macro environment as ceasing to exist once compilation is finished (because why would it be needed?)
emys has quit [Ping timeout: 256 seconds]
<Bike>
For the same reason, the environment object has dynamic extent, meaning it's undefined behavior if you try to use it once the macro function with the &environment has finished. Though in practice it'll probably work anyway.
<Bike>
What you're trying to do is a bit unusual, can I ask what you have in mind? There might be a better way to do it.
<oitofelix>
Bike: I was trying to test the expansion of a local macro I defined.
slyrus_ has joined #lisp
gravicappa has quit [Ping timeout: 255 seconds]
emys has joined #lisp
<Bike>
ah. well, if your editor doesn't help you'd need something like pjb said, yeah.
slyrus has quit [Ping timeout: 256 seconds]
<oitofelix>
Bike: I'm using GNU Emacs. Do you know any way it could help me out-of-the-box in doing that (to debug ELisp code)?
<Bike>
er, wait, is this elisp you're doing? I'm talking about common lisp, cos that's what the channel's about. What I said might not apply to elisp.
luni has left #lisp [#lisp]
<Bike>
but no, i don't. most people here, including me, use an emacs library/whatever called SLIME, but that's not out of the box.
emys has quit [Ping timeout: 240 seconds]
eeeeeta is now known as eta
eta is now known as eeeeeta
<oitofelix>
Bike: I think it applies. At least it behaves as if it applies, as far as I can tell the difference. I'm asking here because I don't know any channel exclusively dedicated to Emacs Lisp. This is the best approximation I could find.
<oitofelix>
Furthermore I'm profoundly interested in Lisp in general. Understanding the difference between dialects is a plus.
<Bike>
mm. well, be cautious. this is the kind of obscure thing where differences can pop up. and you'd probably want #emacs. they'd be more helpful with using emacs by itself, too.
<Bike>
actually, it looks like elisp doesn't have macrolet, normally?
<oitofelix>
Bike: I tend to think #emacs is not exclusive enough to Emacs Lisp matters. Let me do an experiment to test this hypothesis (for the sake of science). I'll ask the same question there and see with how much time and accuracy it'll be addressed.
<Bike>
well, elisp is an extension language. i imagine people on #emacs are more interested in emacs than in the ins and outs of the language, generally
<Bike>
nonetheless, they know elisp, and i don't
<oitofelix>
I think it depends on how you define "normally". The name-space of the CL package has been sanitized and the package is shipped in the standard distribution and parts of it are documented in the main ELisp programming manual.
<pjb>
oitofelix: there would be ##lisp for lisp in general, which includes emacs lisp. Of course, #emacs should be able to answer, but it's more a #lispcafe -like channel than properly emacs, most of the time…
<pjb>
oitofelix: however, emacs lisp is close to Common Lisp (despite the push to segregate CL stuff with cl- prefixes…).
<aeth>
afaik ##lisp is mostly CL vs. Scheme, but without the hostility that "vs." implies. Probably because #lisp and #scheme got sick of such discussions.
<oitofelix>
pjb: Thanks for the pointer. Really interesting! No luck in #emacs yet, though.
emys has joined #lisp
nowhere_man has quit [Ping timeout: 258 seconds]
<oitofelix>
pjb: Indeed, in my humble experience Emacs is close enough to CL that experienced CL programmers are able to answer more profound questions about it (without even noticing it) than (casual) ELisp programmers. I think it's not as easy to find experienced ELisp programmers to answer questions about the language implementation itself (rather than the API for extending the editor).
emys has quit [Ping timeout: 240 seconds]
terpri has quit [Quit: Leaving]
creoenti has joined #lisp
prince1 has joined #lisp
prince1 has quit [Ping timeout: 255 seconds]
colony has quit [Ping timeout: 256 seconds]
nullniverse has quit [Quit: Leaving]
terpri has joined #lisp
nmunro has joined #lisp
jmercouris has joined #lisp
<nmunro>
I feel like I'm missing something with the following snippet: https://plaster.tymoon.eu/view/1684#1684 in order to copy a subset of a stream, using an offset and length, I need to have a sequence that is of size length+offset and this seems like I've misunderstood something fundamental
<_death>
nmunro: (file-position in offset) and read to an array of length LEN
<pjb>
_death: that wouldn't work on variable-length record files, such as :element-type unsigned-byte…
<jmercouris>
is there something I am missing here? what is the point of the lambda wrapping null?
<pjb>
nmunro: perhaps you'd prefer to use (unsigned-byte 8) or (unsigned-byte 16) or some other fixed-size record like that?
<Bike>
no, that's pointless, but sometimes you just end up writing like that
<_death>
pjb: obviously he should be using (unsigned-byte 8), and doesn't need to test IN, and likely doesn't want to use code-char...
<jmercouris>
yeah I was also wondering about WHEN IN
<_death>
and the array should be an octet array..
<jmercouris>
if I remove compression on my Lisp image, will it start faster?
<jmercouris>
I believe the answer is yes... but how much?
<_death>
jmercouris: measure it
<jmercouris>
not sure how to measure that
<aeth>
(deftype octet () `(unsigned-byte 8)) ; this is probably already done 3-5 times in libraries you already have installed, but another time doesn't hurt if there's not a utility library you're already using that exposes this
<jmercouris>
I could have terminal mark the time, and then the program print the time?
<jmercouris>
diff the two?
<nmunro>
Right, we'll I've tried everything except the octet thing
<_death>
jmercouris: since you want to measure compressed vs. noncompressed time, you can simply have a different "main" program that just exits..
<pjb>
aeth: or /bin/true. Surprising amount of commits are needed for them…
<nmunro>
pjb: I was hoping to avoid filling an object with null data if at all possible, if it isn't possible, so be it
<aeth>
pjb: Well, yes, but I meant that any program you write is technical debt so if your program doesn't exist, then that probably means you found a good-enough alternative that already exists that you are using instead of writing a new one.
<pjb>
nmunro: what are you talking about? We've just explained how to do it, I even pasted the code to do it!
<aeth>
But the more I explain the joke the more this goes into #lispcafe territory...
<pjb>
nmunro: but note however, that code-char WILL produce nulls!
<pjb>
nmunro: happily, most implementations don't return nil for ascii control codes (as they should IMO), so for (unsigned-byte 8), you won't get nulls.
<jmercouris>
turning off core compression results in build failures
<jmercouris>
WHAT?
<jmercouris>
clearing my cache now...
<aeth>
Most things that will give you characters really give you (or null character)s so defending against that is fairly idiomatic.
<_death>
jmercouris: feel free to ignore.. just nostalgia ;)
<jmercouris>
was an interesting read in any case
nmunro has quit [Remote host closed the connection]
<jmercouris>
seemed like nmunro was a bit salty if you ask me
<aeth>
pjb: quicklisp duplicates libraries every update so you can't just wc -l it, you have to filter for duplicates
<aeth>
pjb: and obviously it'll depend on which ones you have installed
<aeth>
I think I counted 5 for me last time I tried
<jmercouris>
here's a question, a tiling WM as I understand it is a tree of nodes
<jmercouris>
with either a horizontal or a vertical split
shifty has joined #lisp
<jmercouris>
AKA, each split is a node with two children
<jmercouris>
let's say we are in a given child, how do we know what is to our left, right, top, or bottom?
jmercouris has quit [Ping timeout: 256 seconds]
koykots has joined #lisp
<_death>
with this model, you seem to have h-nodes (left/right children), v-nodes (up/down children), and w-nodes (leaf nodes containing windows) so if you get a w-node, you can look at the ancestors and their descendants as needed to figure it out
ealfonso has joined #lisp
lucasb has quit [Quit: Connection closed for inactivity]
EvW has quit [Ping timeout: 240 seconds]
Inline has quit [Quit: Leaving]
terpri has quit [Quit: Leaving]
terpri has joined #lisp
koykots has quit [Quit: Lost terminal]
slyrus_ has quit [Quit: Leaving]
grabarz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hsaziz has joined #lisp
illili has quit [Ping timeout: 240 seconds]
MetaYan has quit [Ping timeout: 256 seconds]
prince1 has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
narimiran has quit [Ping timeout: 255 seconds]
igemnace has quit [Quit: WeeChat 2.7.1]
jonatack has quit [Ping timeout: 240 seconds]
random-nick has quit [Ping timeout: 255 seconds]
frodef has quit [Ping timeout: 256 seconds]
hsaziz has quit [Quit: hsaziz]
ealfonso has quit [Remote host closed the connection]