jackdaniel changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
eddof13 has joined #commonlisp
notzmv has joined #commonlisp
rtypo has quit [Ping timeout: 246 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Oladon has quit [Quit: Leaving.]
tibfulv has quit [Remote host closed the connection]
eddof13 has joined #commonlisp
tibfulv has joined #commonlisp
eddof13 has quit [Client Quit]
fosskers has joined #commonlisp
thuna` has quit [Read error: Connection reset by peer]
coderdan has joined #commonlisp
fosskers has quit [Remote host closed the connection]
fosskers has joined #commonlisp
Gleefre has quit [Remote host closed the connection]
karlosz has quit [Quit: karlosz]
waleee has quit [Ping timeout: 244 seconds]
bilegeek has joined #commonlisp
lucasta has joined #commonlisp
jsomedon has joined #commonlisp
<jsomedon> hello folks, I am following "on lisp" book, in the Appendix: package chapter there is this code: `in-package 'mine :use 'common-lisp`, but when I run this in sbcl, I get error. Any idea?
<fosskers> jsomedon it should be sufficient to have `(in-package :mine)`
<|3b|> assuming parentheses are correct, does a package named "MINE" exist?
<fosskers> `(:use :cl)` is often used within a `defpackage` block
<|3b|> and IN-PACKAGE doesn't accept :USE
<jsomedon> hmm I am not sure if `mine` exists or not. I was just following the book.
<jsomedon> so, probably this code example is ancient syntax?
<|3b|> if (find-package 'mine) returns NIL, it does not
<fosskers> If you're just trying to run a one-off file, `(in-package :cl-user)` is probably also fine.
<|3b|> usually you would create it with something like (defpackage #:mine (:use #:cl))
<jsomedon> I see, just ran that and it's nil. So, what does in-package do? Based on waht I read, it looks like it's making a new package?
<|3b|> in-package sets the current package
<jsomedon> oh
<|3b|> defpackage or (more rarely) make-package would create one
<jsomedon> I see, that naming makes sense
<fosskers> sets the current package == sets the current namespace w.r.t. actually calling functions in the repl
<|3b|> possibly it should have been (make-package 'mine :use 'common-lisp)
<jsomedon> hmm okay, I guess that's why I should go ask people online while reading books..
<jsomedon> is there anyway I could have like auto completion on tab on sbcl repl ?
<|3b|> slime or sly should give you at least part or that
* |3b| isn't sure what the default configuration is in repl though, might not be exactly tab?
<|3b|> ah, you said sbcl repl
<|3b|> if you aren't using emacs or some other smart editor that can complete things, i'm not sure
<jsomedon> talking about slime/sly, which one is recommended? Is it so that slime isn't actively developed and the author forked sly from slime?
<fosskers> I use Sly and quite enjoy it. The "stickers" feature is great.
<jsomedon> yeah, for now I am just running sbcl directly, didn't take deep look into toolings yet
<fosskers> The editor integration is really what completes the "interactive development" experience.
<patrix> https://joaotavora.github.io/sly/#Introduction (it has a paragraph that explains why it exists)
<ixelp> SLY User Manual, version 1.0.42
tyson2 has quit [Remote host closed the connection]
<|3b|> i think it was more about how conservative the maintainers of slime are (or were?)
<|3b|> slime is still maintained as far as i know
<jsomedon> so kinda like debian vs arch?
<patrix> more like debian vs ubuntu or something like that
<jsomedon> I see
<patrix> sly stickers... I should look into that...
<|3b|> sly has some nice features, last i looked it was still missing 1 or 2 things i wanted from slime though
<jsomedon> and for common lisp implementation, sbcl is recommended? I also see people use clozure cl?
<|3b|> generally they both have the important features though
<jsomedon> I see, so can't go wrong with either of them
* |3b| meany slime/sly, but applies to implementations too
<jsomedon> ah yes I see
<|3b|> pretty much any CL implementation is good enough for getting started, they all have their own strengths
<|3b|> sbcl is probably the most popular currently
<jsomedon> so, sbcl is for performance?
<|3b|> something like that
<|3b|> ccl is known for fast compilation and reasonably good performance
<patrix> unless you're on apple silicon, then best to avoid Clozure or Allegro
<jsomedon> oh
coderdan has quit [Remote host closed the connection]
<jsomedon> I do have a m1 macbook
coderdan has joined #commonlisp
<patrix> as they are not available natively yet, so they are very slow or possibly broken
<patrix> sbcl works great for me on M1
<jsomedon> oh
<|3b|> and looking at on-lisp, it does seem to just be wrong/old there :/
<patrix> it *is* old lol
<jsomedon> haha okay
<jsomedon> patrix: so not all implementations have native m1 support yet?
<patrix> correct
<|3b|> that behavior of in-package is from before CL was specfied
<|3b|> or rather, before the ansi spec
<jsomedon> I see. So I should expect a lot of incompatible syntax from this book
<fosskers> When was it published?
<fosskers> 1993
<fosskers> And the current standard came out in 1994
<|3b|> it seems to be slightly older than the ansi standard, but not much older, so should generally be more or less OK
Devon has joined #commonlisp
<jsomedon> based on what he says in preface, it seems to conform to ansi version though
<jsomedon> ah, seems like it's before ansi
<Devon> '(a b #+|| . c) => (A B C); should this be an error?
<|3b|> Devon: looks right?
<|3b|> well, maybe
<Devon> LOL, way fishy
<|3b|> odd thing to do at best
<|3b|> as far as i can tell, it should not be an error, but i'm not completely sure C should be there
* |3b| leans toward it being correct though
<|3b|> actually it depends on whether :|| is in *features*, since in that case it would be an error
<|3b|> and without it there, (#-|| . c) would be an error
<jsomedon> do quicklisp and asdf do the same work? are they kinda like cabal and stack?
<|3b|> #+ is specified to set *read-suppress* and call READ, *read-suppress* is specified to "suppress" the error from misplaced .
<|3b|> jsomedon: quicklisp is implemented in terms of asdf
<fosskers> asdf -> package definition mechanism. quicklisp -> package fetching
<|3b|> asdf builds/loads/etc things, ql notices when ql fails to find something and then tries to download it and then tells asdf to try again
<jsomedon> so.. if I installed quicklisp, I don't need to manually install asdf again?
<fosskers> correct
<|3b|> asdf is usually included with the implementation, so shouldn't need installed either way
<jsomedon> by implementation, you mean like sbcl comes with asdf bundled together?
<|3b|> installing ql will generally arrange for asdf to be loaded by default along with ql
<|3b|> right
<jsomedon> oh
<|3b|> (require 'asdf) would load it if your init file doesn't already do so
<jsomedon> init file, you mean quicklisp init file?
<|3b|> you might or might not want to install asdf manually if you need a newer version for example though
<|3b|> the lisp init file, .sbclrc or similar
<jsomedon> ohh
<|3b|> which is probably configured to load quicklisp if you installed quicklisp
<|3b|> and if quicklisp is loaded, asdf is loaded
<jsomedon> ah yes saw that showing up after installing quicklisp
<jsomedon> so, this init file, I guess I can put whatever lisp code there and it will get executed?
<|3b|> more or less
habamax has joined #commonlisp
<jsomedon> `#-quicklisp` is this special syntax? I see this in init file and it's not a comment
<|3b|> #+ and #- are (dispatching) reader macros, which you can think of as special syntax
<jsomedon> ah thanks
<|3b|> (CL syntax is programmable by the user, and those work the same way user defined syntax would, so not exactly "special" syntax)
<jsomedon> probably I will run into that in later chapter of the book
<jsomedon> hah I see, so hard to define what special means exactly
<|3b|> (note that 'special' also has a specific technical meaning in relation to variables, which is unrelated to the use here, and which does have a precise definition)
Sario has quit [Quit: WeeChat 3.0]
Sario has joined #commonlisp
<jsomedon> *scratch my head*
<|3b|> roughly, #-quicklisp means "if the keyword symbol :quicklisp is in *features*, ignore the next form"
<|3b|> and it is presumably being used to avoid loading ql twice, since loading it would add that symbol
<jsomedon> oh
<|3b|> similarly, #+quicklisp would say to ignore the next form if the symbol isn't found
<jsomedon> a form is a ()
<|3b|> (and hopefully someone will correct me if i described those backwards)
<jsomedon> a form is a (...)
jobhdez has joined #commonlisp
<|3b|> anything, could be a symbol, string, list, literal vector, etc
<jsomedon> uh, in that case, a form is a expression
<jsomedon> ?
<jobhdez> for those building common lisp compilers how are you generating efficient assembly?
coderdan has quit [Remote host closed the connection]
<|3b|> well, to start with i probably wasn't being precise with "form", and should have said "object"
coderdan has joined #commonlisp
<|3b|> and this is happening at "read" time, where "expression" isn't really a thing
<jsomedon> oh
<|3b|> CL specifies interpretation of source text in 2 stages: first it READs the sequence of characters in the source into lisp objects like symbols, numbers, lists, strings, etc
<|3b|> #+ and #- happen at that step
<jsomedon> so it's parsing the source
<|3b|> if you had called READ yourself, that is the only step, and the result might bever be evaluated, so "expression" isn't meaningful
lucasta has quit [Quit: Leaving]
<jsomedon> so read time, reads source text and out put some.. ast?
<|3b|> the result of READ could be EVALuated or COMPILEd, in which case parts of it would be considered expressions
<|3b|> right
<jsomedon> so, is stage 2, that's following read time, either evaluation or compilation?
<jsomedon> read time + (eval | comp) time, like this?
<|3b|> usually we talk about lisp as if it were the AST, so when i say (foo bar 123) i mean a list containing the symbols FOO and BAR and the number 123, rather than the sequence of characters ( f o o space ...
coderdan has quit [Remote host closed the connection]
<|3b|> right, REPL is short for READ EVAL PRINT LOOP
coderdan has joined #commonlisp
<|3b|> it READs something, passes the result to EVAL, passes result of that to PRINT, and then loops
<jsomedon> I see, there is certainly no print loop after comp, so I can't have rcpl, lol
<|3b|> (loop (print (eval (read)))) ;; very approximately
<jsomedon> so, the macro, not the reader macro but the macro, works in (read|comp)time?
<|3b|> you could, (loop (print (funcall (compile nil (read))))) ;; even more approximately
<|3b|> READer macros work during READ (including #+)
<|3b|> normal and compiler macros happen during evaluation and/or compilation
<|3b|> (expanding normal macros is pretty much the only specified requirement of compilation)
<jsomedon> oh
<|3b|> (and when i talk in all caps, it is because by default the READ step converts things to uppercase when creating symbols, so the source read turns into a symbol named by a string "READ", and it makes a convenient way to distinguish code from prose)
<jsomedon> oh
<jsomedon> just to distinguish them, no other special purpose?
<|3b|> just to distinguish them, in irc
<jsomedon> I guess, that means, these two code are same when compiled: `(setq foo 1)` vs `SETQ FOO 1`
<jsomedon> ?
<jsomedon> ah I mean `(SETQ FOO 1)`
<jsomedon> and this too? `(SeTQ FoO 1)`
Krystof has quit [Ping timeout: 245 seconds]
<|3b|> (read-from-string "(setq foo 1)") -> (SETQ FOO 1)
<|3b|> but yes
<jsomedon> seems like a pretty fun way to annoy my code reviewer
<|3b|> (again, configurable by the user, so a particular call to READ might behave differently, but default is to uppercase)
<|3b|> normal CL code writes things all lowercase
<jsomedon> ah
<|3b|> but when CL reads it back to you, it is (usually) in all uppercase
<|3b|> PRINTs it back to rather
<jsomedon> I see
<|3b|> trying to be precise about this stuff can be annoying :/
<jsomedon> haha
<|3b|> (but missing the precise details can make it very confusing when you build a slightly wrong mental model)
<jsomedon> I see, and I appreciate you taking effort making it clear and precise
notzmv has quit [Ping timeout: 246 seconds]
<jsomedon> > Organizes everything into a modern system structure with ASDF and named-readtables
<jsomedon> I just found a so called up-to-dated code example repo of on lisp, and it says this in readme, but I have no idea what this words mean?
<|3b|> (and note that using SETQ is somewhat out of style these days, probably more common to just always use SETF)
<jsomedon> ah
<|3b|> "with ASDF" means you can use asdf to load it
<jsomedon> and, named-readtables?
<|3b|> "named-readtables" is a way of managing the configurability of the reader i previously mentioned
<jsomedon> oh
<|3b|> CL mostly combines that configurability into "readtables", and named-readtables is a library for managing them
<jsomedon> I see
<|3b|> probably don't need to worry too much about reader configurability for now, fairly uncommon feature
<jsomedon> I see
<|3b|> (loses a bit of usefulness since it tends to interact poorly with editor support, since editors don't know about all the changes you made to syntax)
Devon has quit [Ping timeout: 245 seconds]
<|3b|> can still be very nice when you need some specific domain-specific language though
habamax has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1)]
habamax has joined #commonlisp
<jsomedon> if my sbcl init file already have those quicklisp related code, do I still need to run `(load "~/quicklisp/setup.lisp")` in sbcl repl?
* |3b| is going back AFK again, but there are usually people around who will answer things if you wait for a bit
* |3b| would not expect that to be needed
<jsomedon> I see, was double checking, I see bunch of name redefined warning in repl when I run this
notzmv has joined #commonlisp
coderdan has quit [Remote host closed the connection]
habamax has quit [Remote host closed the connection]
jobhdez has quit [Quit: Client closed]
coderdan has joined #commonlisp
<doulos05> Has anybody had success getting cl-cffi-gtk to work on an M1 Silicon Mac? I'm getting a "Maximum interrupt nesting depth error
<doulos05> It happens for my code and also for their example. Same error
habamax has joined #commonlisp
szkl has quit [Quit: Connection closed for inactivity]
amb007 has joined #commonlisp
hnOsmium0001 has quit [Quit: WeeChat 3.8]
yvm has joined #commonlisp
euandreh has quit [Ping timeout: 245 seconds]
euandreh has joined #commonlisp
jakky has quit [Quit: Connection closed for inactivity]
yvm has quit [Ping timeout: 260 seconds]
coderdan has quit [Remote host closed the connection]
ec_ has joined #commonlisp
ec has quit [Ping timeout: 240 seconds]
slyrus_ has joined #commonlisp
speskk0 has joined #commonlisp
MetaYan_ has joined #commonlisp
lacedaemon has joined #commonlisp
les_ has joined #commonlisp
Spawns has joined #commonlisp
jaimelm_ has joined #commonlisp
bike_ has joined #commonlisp
cognemo_ has joined #commonlisp
shka has joined #commonlisp
speskk has quit [*.net *.split]
rendar has quit [*.net *.split]
fe[nl]ix has quit [*.net *.split]
Spawns_Carpeting has quit [*.net *.split]
slyrus has quit [*.net *.split]
bike has quit [*.net *.split]
cognemo has quit [*.net *.split]
bird_ has quit [*.net *.split]
les has quit [*.net *.split]
jsatk_ has quit [*.net *.split]
iquites has quit [*.net *.split]
MetaYan has quit [*.net *.split]
jaimelm has quit [*.net *.split]
mht-wtf has quit [*.net *.split]
speskk0 is now known as speskk
mingus has joined #commonlisp
rgherdt has joined #commonlisp
jsatk_ has joined #commonlisp
mht-wtf has joined #commonlisp
bird_ has joined #commonlisp
mingus1 has joined #commonlisp
mingus has quit [Ping timeout: 245 seconds]
mingus1 is now known as mingus
AetherWind has joined #commonlisp
iquites has joined #commonlisp
igemnace has joined #commonlisp
rgherdt_ has joined #commonlisp
rgherdt has quit [Ping timeout: 246 seconds]
azimut has quit [Ping timeout: 240 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
ec_ has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
amb007 has joined #commonlisp
habamax has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1.50)]
<resttime> Is there way to introspect the lexical environment from within the lexicial environment? Example, like a common pattern is to define a macro WITH-* to wrap some execution within with some cleanup code. Could the execution within know it's being "wrapped" and print it out?
<mfiano> Also see pandoric macros and related concepts in Let Over Lambda
neshtea has joined #commonlisp
dino_tutter has joined #commonlisp
pkal has quit [Remote host closed the connection]
<resttime> Ohh hmmm seems kinda like OOP messages on closures. What about more generic like in a DEFUN (defun foo () (introspect-modify-env) (do-stuff)), could introspect-modify-env know when the function scope ends and run some code after? Kinda like a finalizer when an object is GC'd, except for this it's a "finalizer" that runs at the end of the scope. Use case I'm imagining isgetting rid of the WITH-*
<resttime> macro to deal with allocating and deleting foreign memory. Maybe something that could be considered a scope_guard in C++
<neshtea> Hey everyone. I'm getting started with CL after years of Clojure and various
<neshtea> Schemes. Right now, I'm trying to debug an error and could use some help. I'm
<neshtea> using clack (with hunchentoot) and am trying to define routes using tiny-routes.
<neshtea> What I have can be found here
<ixelp> Example app with clack and tiny-routes · GitHub
<neshtea> works fine -- I can start the webserver and visit localhost:8080 and it shows me
<neshtea> the "alive and well" message. However, everytime I visit the page, I get the
<neshtea> condition "Error while parsing arguments to DESTRUCTURING-BIND" (see the gist
<neshtea> for the full error). I've already verified that it only happens when using the
<neshtea> routes defined with tiny-routes. Can anyone help?
<neshtea> (ahh sorry for effing up the format, the message was prewritten in anther buffer :( P
<neshtea> For better readability: Hey everyone. I'm getting started with CL after years of Clojure and various Schemes. Right now, I'm trying to debug an error and could use some help. I'm using clack (with hunchentoot) and am trying to define routes using tiny-routes. What I have can be found here https://gist.github.com/neshtea/e61ba4b92cbf795cec6b91e2cf97fc1b. This all works fine -- I can start the webserver and visit local
<neshtea> it shows me the "alive and well" message. However, everytime I visit the page, I get the condition "Error while parsing arguments to DESTRUCTURING-BIND" (see the gist for the full error). I've already verified that it only happens when using the routes defined with tiny-routes. Can anyone help?
<ixelp> Example app with clack and tiny-routes · GitHub
<beach> neshtea: You need to debug this the usual way. You look at the backtrace (using SLIME for instance), you hit RETURN on the offending stack frame to see the variables, and you hit v to get to the source location.
rgherdt_ is now known as rgherdt
<neshtea> beach: Thanks, I'm already on it. I can't really wrap my head around it -- I only see that some point the resonse is NIL but am not proficient enough to go further. I though maybe this was a known type of thing since it fails on the examples given in the tiny-routes example repo.
<beach> Oh, I see. I don't know anything about the application, so I can't help with that.
<neshtea> beach: Thanks anyway!
<resttime> neshtea: One difference I see is that it's missing the request param when DEFINE-GET
<neshtea> resttime: You are right, but it doesn't seem to make a difference either way.
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
Gleefre has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
bilegeek has quit [Quit: Leaving]
blackshuck has joined #commonlisp
amb007 has quit [Ping timeout: 240 seconds]
Lycurgus has joined #commonlisp
blackshuck has quit [Remote host closed the connection]
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
Lycurgus has quit [Quit: Tschüss]
jeffrey has joined #commonlisp
pkal has joined #commonlisp
AetherWind has quit [Ping timeout: 246 seconds]
AetherWind has joined #commonlisp
rendar has joined #commonlisp
rendar has quit [Changing host]
rendar has joined #commonlisp
blackshuck has joined #commonlisp
habamax has joined #commonlisp
yitzi has quit [Remote host closed the connection]
sco1 has quit [Quit: ZNC 1.8.2 - https://znc.in]
sco1_ has joined #commonlisp
cosimone has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 245 seconds]
Lord_of_Life has joined #commonlisp
edgar-rft has quit [*.net *.split]
phileasfogg has quit [*.net *.split]
jello_pudding has quit [*.net *.split]
jmiven has quit [*.net *.split]
gjvc has quit [*.net *.split]
cinerion has quit [*.net *.split]
alip has quit [*.net *.split]
nxtr has quit [*.net *.split]
pl has quit [*.net *.split]
boigahs has quit [*.net *.split]
phoe has quit [*.net *.split]
bike_ is now known as bike
edgar-rft has joined #commonlisp
jello_pudding has joined #commonlisp
jmiven has joined #commonlisp
gjvc has joined #commonlisp
pl has joined #commonlisp
cinerion has joined #commonlisp
phoe has joined #commonlisp
boigahs has joined #commonlisp
nxtr has joined #commonlisp
alip has joined #commonlisp
phileasfogg has joined #commonlisp
phileasfogg has quit [Max SendQ exceeded]
rumraisin has joined #commonlisp
rumraisin is now known as phileasfogg
kagevf has quit [Ping timeout: 250 seconds]
kagevf has joined #commonlisp
rgherdt has quit [Ping timeout: 260 seconds]
fosskers has quit [Ping timeout: 260 seconds]
blackshuck has quit [Remote host closed the connection]
rtypo has joined #commonlisp
<doulos05> Looks like nobody has had any luck with the cl-cffi-gtk bindings on an M1 Mac?
cosimone has quit [Ping timeout: 256 seconds]
karlosz has joined #commonlisp
jsomedon has quit [Quit: Connection closed for inactivity]
fosskers has joined #commonlisp
kevingal has joined #commonlisp
yitzi has joined #commonlisp
<mfiano> I would guess the number of users in general is quite low, as a lot of us write our own stacks. It's the Lisp blessing/curse. Raise a bug with the author maybe?
rgherdt has joined #commonlisp
<yitzi> There hasn't been any activity there for at least 2 years. Not sure how much traction you'll get.
<yitzi> Maybe try cl-gtk4 instead?
attila_lendvai_ has joined #commonlisp
fosskers has quit [Ping timeout: 256 seconds]
fosskers has joined #commonlisp
tyson2 has joined #commonlisp
jonatack has quit [Read error: Connection reset by peer]
jon_atack has joined #commonlisp
tevo has quit [Read error: Connection reset by peer]
tevo has joined #commonlisp
euandreh has quit [Remote host closed the connection]
azimut has joined #commonlisp
samebchase has quit [Quit: Ping timeout (120 seconds)]
samebchase has joined #commonlisp
<Josh_2> Hi :trumpet:
alendvai__ has joined #commonlisp
jmdaemon has quit [Ping timeout: 246 seconds]
fosskers has quit [Ping timeout: 260 seconds]
attila_lendvai_ has quit [Ping timeout: 256 seconds]
edgar-rft is now known as trumpet
<trumpet> Hi Josh_2!
<Josh_2> :joy:
trumpet is now known as edgar-rft
<Josh_2> It makes more sense if you have emojify on
amb007 has joined #commonlisp
alendvai__ has quit [Ping timeout: 256 seconds]
lucasta has joined #commonlisp
lucasta has quit [Remote host closed the connection]
lucasta has joined #commonlisp
gko` has quit [Remote host closed the connection]
gko` has joined #commonlisp
<doulos05> Yeah, guess I'll have to rewrite it for gtk4...
<Josh_2> Not that is helps but qt is very well supported because commonqt is developed by one of the commercial lisp vendors
<Josh_2> can't remember which one though, maybe lispworks :shrug:
habamax has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1.50)]
ldb has joined #commonlisp
<ldb> good morning everyone
tyson2 has quit [Remote host closed the connection]
White_Flame has quit [Remote host closed the connection]
<beach> Hello ldb.
White_Flame has joined #commonlisp
cosimone has joined #commonlisp
knusbaum has quit [Max SendQ exceeded]
dino_tutter has quit [Ping timeout: 245 seconds]
knusbaum has joined #commonlisp
tyson2 has joined #commonlisp
jello_pudding has quit [Ping timeout: 258 seconds]
hrberg has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
hrberg has joined #commonlisp
cosimone has quit [Ping timeout: 256 seconds]
<Josh_2> Mornin'
cage has joined #commonlisp
thuna` has joined #commonlisp
nij- has joined #commonlisp
<nij-> Hello! I wonder why we need compiler macros.
<ixelp> CLHS: Macro DEFINE-COMPILER-MACRO
<nij-> And I can see how it is different from a macro.
<nij-> But in the end macros and compiler macros are for rewritting lisp forms.. I don't see how the compiler macros are necessary given that we have macros.
<gilberth> You cannot FUNCALL a macro.
<bike> if square was a macro the (funcall #'square x) example wouldn't work, and neither would apply, and neither could you pass square to anything
tyson2 has quit [Remote host closed the connection]
<ldb> back in the days, people were not bother by the inconsistency between compiled and interpreted behavior
<ldb> and the time required to compile a program did matter
<nij-> bike gilberth - on the other hand, in the case of macros, we have the underlying macro functions that we can funcall and pass, right?
yvm has joined #commonlisp
<ldb> so it is like, the function version is for debugging and is slower, the compiler macro is for production release
<gilberth> Also for passing it along.
<bike> nij-: No
<bike> the macro function operates on forms, not values. you can't use it like a function.
<bike> if you had (defmacro square (x) `(* ,x ,x)) and did (funcall (macro-function 'square) 7) you'd get an error.
<bike> and (funcall (macro-function 'square) 7 nil) would get you the list (* 7 7) rather than 49.
<jcowan> Compiler macros give you the ability to add your own compiler optimizations, because they are defined concurrently with functions.
eddof13 has joined #commonlisp
Lycurgus has joined #commonlisp
<jcowan> For example, you could have a compiler macro for CONCATENTATE that notices when the arguments are literal strings and does the concatenation at compile time. This of course does not replace all calls to CONCATENATE, which would simply do no transformation.
<jcowan> Probably reasonable compilers already do this. But if they didn't, you can Make It So.
<gilberth> Mostly for optimizations. And it also is about keeping things being a function proper. Imagine e.g. (defun mul (x y) (* x y)) and (define-compiler-macro mul (&whole whole x y) (cond ((eql x 1) y) ((eql y 1) x) (t whole))) That would be a use case.
<gilberth> You still can say (mapcar 'mul '(1 2 3) '(4 5 6)) fine. e.g. But (mul 1 42) will compile as just 42.
triffid has quit [Remote host closed the connection]
<jcowan> Hmm. Do you usually write 'mul? I would always write #'mul.
<gilberth> And (mul 10 23) would compile as a function call to MUL.
<ldb> maclisp habit
<gilberth> jcowan: I grew lazy with time :-)
* jcowan nods
<gilberth> OTOH I still write #'(lambda ...) instead of just (lambda ...) :-)
<gilberth> Because (mapcar (lambda ...) ...) didn't work with CLtL1.
<jcowan> I pretty much dropped #'lambda, probably under Scheme influence (although it's really an ISLisp feature and only accidentally a Scheme one)
<ldb> ever since emacs supported straight (lambda .. s
Lycurgus has quit [Quit: Tschüss]
tyson2 has joined #commonlisp
triffid has joined #commonlisp
<jcowan> It also removess the anomaly that (lambda ...) is a major part of the language but is not a form.
<jcowan> How about literal arrays, do you usually quote them (other than strings) or not? I think that is also a post-CLtL1 feature
<gilberth> Yes, in CLtL1 vectors were not self-evaluating.
<gilberth> What puzzles me is that I grew the habit of saying ':FOO instead of :FOO. Perhaps I have read too much CADR code.
tyson2 has quit [Remote host closed the connection]
AetherWind has quit [Quit: leaving]
dino_tutter has joined #commonlisp
NotThatRPG has quit [Ping timeout: 245 seconds]
tevo has quit [Ping timeout: 250 seconds]
tevo has joined #commonlisp
<nij-> I see..
<nij-> I can see the use cases now. Though theoretically it seems that macros+functions can still make compiler functions obsolete.
<Josh_2> Just had another problem with bknr
<Josh_2> :sob:
<Josh_2> Seemed convenient at the time but seems I have paid the price
<nij-> Btw, why doesn't the form return 80? https://bpa.st/M3ZA
<ixelp> View paste M3ZA
shka has quit [Ping timeout: 260 seconds]
<nij-> I've altered the compiler macro definition a bit.. but the result doesn't change accordingly ^
<bike> why would it be 80?
<bike> oh, the 1-
<bike> the inner (square 3) expands into (expt 3 2) because 3 is an atom. then in the outer compiler macro, arg has length 3, so it just returns (square (expt 3 2)).
<Josh_2> zstd just compressed my 714mb bknr store to 4.4mb
<Josh_2> :facepalm:
lucasta has quit [Remote host closed the connection]
kevingal has quit [Ping timeout: 256 seconds]
<jcowan> nij-: Suppose you write an ordinary macro FOO that optimizes certain cases and then falls back to FOO*. You can call FOO and get good results, but #'FOO will not work; you have to write #'FOO*. One way to solve this problem is to extend CL to allow macro names in operand position so that (APPLY #'FOO ...) invokes FOO with a &whole of NIL, which normally cannot happen, and let FOO return #FOO* in that case.
<jcowan> er, #'FOO*
ldb has quit [Ping timeout: 256 seconds]
Brucio-61 has quit [Quit: Application exit]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Oladon has joined #commonlisp
eddof13 has joined #commonlisp
yvm has quit [Ping timeout: 246 seconds]
NotThatRPG has joined #commonlisp
<NotThatRPG> gilberth: Just joining. I note what you say about emacs and ... I just upgraded my emacs and now it's nagging me to replace my (lamda()...)'s with #'(lambda()...)'s
ldb has joined #commonlisp
yvm has joined #commonlisp
<Josh_2> jcowan: I think a better example of a compiler macro is one that optimizes for keys passed to a function call
waleee has joined #commonlisp
<jcowan> Sure. My example was chosen for simplicity, not practicality. Another case is where one argument is a symbol that says what to do with the other arguments: as long as the symbol is a constant, a compiler macro can eliminate the ad hoc run time dispatch.
<NotThatRPG> My biggest use case is to stave off unreachable code warnings in macroexpansions!
ldb has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1)]
Fade is now known as Fade
Oladon has quit [Quit: Leaving.]
tyson2 has joined #commonlisp
semz has quit [Quit: ZNC 1.8.2+deb2build5 - https://znc.in]
semz has joined #commonlisp
yvm has quit [Ping timeout: 240 seconds]
<gilberth> NotThatRPG: I was no talking about Emacs. Rather that (lambda ...) was no form with CLtL1 and that with CLtL2 there is a LAMBDA macro which turns (lambda ...) into #'(lambda ...). Being olde I am used to that CLtL1 behavior and thus still have the habit to say #' in front of LAMBDA. I have no idea what Emacs does here for I try to expose me to elisp as little as possible.
<NotThatRPG> gilberth: Ah! I was confused. Probably because of ldb saying "ever since emacs supported straight lambda...
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
bjorkintosh has quit [Quit: Leaving]
<prokhor> question: i would like to read out toplevel functions out of lisp files of various implementations and dialects, filtering out all comments. how do i prevent the reader from complaining and throwing errors?
<prokhor> (especially as i want it to recognise/filter comments)
<prokhor> i use clisp btw...
bjorkintosh has joined #commonlisp
bjorkintosh has joined #commonlisp
bjorkintosh has quit [Changing host]
tyson2 has quit [Remote host closed the connection]
shka has joined #commonlisp
neshtea has quit [Remote host closed the connection]
neshtea has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 28.2]
cage has joined #commonlisp
cage has quit [Client Quit]
igemnace has quit [Read error: Connection reset by peer]
<yitzi> What do you mean by a dialect?
igemnace has joined #commonlisp
jmdaemon has joined #commonlisp
bjorkintosh has quit [Ping timeout: 244 seconds]
<prokhor> yitzi: e.g. sceme (guile etc)...
<prokhor> also: older implementations, which basically only have the syntax in common
cosimone has joined #commonlisp
<prokhor> i wan to build a program which can print out all dependencies of complex lisp systems of any flavor...
<bike> you're going to have a pretty hard time making the same program run as both scheme and common lisp. they are different languages.
<yitzi> That seems difficult. Just use the reader of the dialect. In the case of CL READ should be fine. If you want advanced capabilities such as source tracking use Eclector.
cosimone has quit [Read error: Connection reset by peer]
tyson2 has joined #commonlisp
<yitzi> As bike said
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cosimone has joined #commonlisp
nij- has quit [Ping timeout: 246 seconds]
eddof13 has joined #commonlisp
morganw has joined #commonlisp
NotThatRPG has quit [Quit: Textual IRC Client: www.textualapp.com]
NotThatRPG has joined #commonlisp
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
Oladon has joined #commonlisp
mingus has quit [Quit: mingus]
bjorkintosh has joined #commonlisp
bjorkintosh has joined #commonlisp
bjorkintosh has quit [Changing host]
tibfulv has quit [Remote host closed the connection]
Brucio-61 has joined #commonlisp
tibfulv has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
cbjuju has joined #commonlisp
cbjuju has quit [Ping timeout: 246 seconds]
thonkpod has quit [Ping timeout: 245 seconds]
thonkpod has joined #commonlisp
neshtea has quit [Ping timeout: 245 seconds]
neshtea has joined #commonlisp
neshtea has quit [Remote host closed the connection]
neshtea has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
neshtea has quit [Ping timeout: 246 seconds]
Oladon has quit [Quit: Leaving.]
neshtea has joined #commonlisp
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
neshtea has quit [Ping timeout: 256 seconds]
cbjuju has joined #commonlisp
neshtea has joined #commonlisp
neshtea has quit [Ping timeout: 245 seconds]
dra has joined #commonlisp
dra has quit [Changing host]
dra has joined #commonlisp
cosimone has quit [Read error: Connection reset by peer]
neshtea has joined #commonlisp
cbjuju has quit [Read error: Connection reset by peer]
blackshuck has joined #commonlisp
neshtea has quit [Remote host closed the connection]
neshtea has joined #commonlisp
neshtea has quit [Remote host closed the connection]
neshtea has joined #commonlisp
neshtea has quit [Ping timeout: 260 seconds]
NotThatRPG has quit [Ping timeout: 256 seconds]
neshtea has joined #commonlisp
igemnace has quit [Quit: WeeChat 4.0.2]
neshtea has quit [Ping timeout: 256 seconds]
neshtea has joined #commonlisp
neshtea has quit [Ping timeout: 246 seconds]
neshtea has joined #commonlisp
blackshuck has quit [Remote host closed the connection]
blackshuck has joined #commonlisp
neshtea has quit [Remote host closed the connection]
neshtea has joined #commonlisp
<fitzsim> mfiano: pushed ppc64/ppc64le support to lispgames/cl-sdl2 master branch
<fitzsim> I found a less obnoxious workaround for Uint8 etc. not being recognized; it seems that on ppc64 clang's inttypes.h overrides the GNU one, resuting c2ffi not generating entries for uint8_t, uint16_t, uint32_t, uint64_t
<fitzsim> mfiano: I don't have permission to fork cl-autowrap into lispgames; can you grant me that permission? I have the patch ready for it
neshtea has quit [Ping timeout: 244 seconds]
neshtea has joined #commonlisp
blackshuck has quit [Remote host closed the connection]
dino_tutter has quit [Ping timeout: 260 seconds]
blackshuck has joined #commonlisp
blackshuck has quit [Remote host closed the connection]
blackshuck has joined #commonlisp
blackshuck has quit [Remote host closed the connection]
eddof13 has joined #commonlisp
morganw has quit [Remote host closed the connection]
neshtea has quit [Ping timeout: 260 seconds]
shka has quit [Ping timeout: 245 seconds]
neshtea has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
neshtea has quit [Ping timeout: 256 seconds]
rgherdt has quit [Remote host closed the connection]
neshtea has joined #commonlisp
tyson2 has joined #commonlisp
neshtea has quit [Ping timeout: 260 seconds]
cosimone has joined #commonlisp
neshtea has joined #commonlisp
jeffrey has quit [Ping timeout: 245 seconds]
neshtea has quit [Ping timeout: 240 seconds]
Gleefre has quit [Remote host closed the connection]
neshtea has joined #commonlisp
cosimone has quit [Ping timeout: 256 seconds]
neshtea has quit [Ping timeout: 246 seconds]
neshtea has joined #commonlisp
habamax has joined #commonlisp
<prokhor> bike: yitzi: I dont want to run them (i am not that of a noogb ;) ) i want to build a database which function calls whick other, which modules - and most importantly: get a feasible order how to load the single source files.
neshtea has quit [Ping timeout: 256 seconds]
<prokhor> i've founf eclector in the meantime...
<prokhor> so i would be very glad, if someone could point me to a short, concise tutorial on how to handle errors & recover from them...
<prokhor> all i need is: how to identify atoms and arguments and how they are connected...
neshtea has joined #commonlisp
amb007 has joined #commonlisp
neshtea has quit [Ping timeout: 246 seconds]
amb007 has quit [Ping timeout: 260 seconds]
neshtea has joined #commonlisp
dra has quit [Quit: Leaving]
neshtea has quit [Remote host closed the connection]
neshtea has joined #commonlisp
neshtea has quit [Ping timeout: 260 seconds]
neshtea has joined #commonlisp