<dnhester26>
Inside a macro which expands to a lambda function I have a return statement. I'm getting this compile error "error: return for unknown block: NIL". Can anyone give me some guidance? Just to add in case this helps, the body is inside the lambda function, but there are other things happening with the macro and the lambda function is setf'ed to something as part of the macro.
<beach>
(RETURN ...) is a macro that expands to (RETURN-FROM NIL ...).
<beach>
So you need a block named NIL to use RETURN.
<dnhester26>
I thought that as long as it was inside a lambda function, it would return from that lambda function
<dnhester26>
How can I name a block as NIL? read the spec about block?
<beach>
You can expand to (LAMBDA (...) (BLOCK NIL ...)) instead of just (LAMBDA (...) ...).
<dnhester26>
ok, thanks, will try that now
contrapunctus is now known as fugata
<beach>
And let's work on some terminology. There is no such thing as a "lambda function". The macro probably expands to a "lambda expression" which is then turned into a function through evaluation.
<beach>
And the only time the term "statement" is used, rather than "form" is when it is part of a TAGBODY.
<dnhester26>
ah, that worked. Thanks beach!
<beach>
Sure.
<dnhester26>
thanks for the terminology teaching as well!
<beach>
Pleasure.
slyrus has joined #commonlisp
<dnhester26>
Since you are here, I'm curious about something else. I read in CL Recipes "or example, I also rarely mention structures (the ones defined by DEFSTRUCT) anyhwere in the book because I view them as an historical artefact superseded by CLOS"
<dnhester26>
Yet I've seen in a bunch of places by fukamachi that he uses structs, and those projects in particular have benchmarks that are usually much faster than the compared libraries. I thought it was because structs would provide more efficiency, is that not correct?
<beach>
That depends a lot on the Common Lisp implementation...
<dnhester26>
I guess this is probably more an implementation question
<dnhester26>
yeah, that's what I thought
<beach>
But the way structs are defined is so that it is possible to generate fast code for them.
<beach>
Couple that with the fact that most Common Lisp implementations don't work very hard with standard classes to make them fast, and you have your observation.
<beach>
But the semantics of structs are such that I don't use them myself and that's probably the reason for the quote.
fugata is now known as contrapunctus
<dnhester26>
Ok, I never used them. I was wondering if I was just writing very inefficient code, but I thought that I'll worry about optimizing later when I run into issues because I doubt this will be the bottleneck in my application
<beach>
But I can tell you that in SICL, struct types have the same memory layout and the same properties as standard classes, and the semantics are well defined.
<dnhester26>
ok, thanks for the explanation
spdegabrielle has joined #commonlisp
<beach>
Yes, that's the way to do it. Use standard classes to begin with and optimize with structs only if and when needed.
<dnhester26>
Ah, so in SCIL classes will be as fast hopefully as structs in other implementations, or will structs be as slower as classes in other implementations
<dnhester26>
s/structs be as slower/structs be slower
<beach>
Somewhere in between. We have worked harder on generic dispatch, so generic dispatch will be faster than in other implementations.
<dnhester26>
cool for SICL
<dnhester26>
thanks so much for the guidance
<beach>
Sure.
rkazak has joined #commonlisp
bjorkintosh has quit [Remote host closed the connection]
slyrus has quit [Ping timeout: 252 seconds]
<beach>
I made a web page of all the SICL-related papers we have published. Generic dispatch was already in 2014 as I recall.
<beach>
Plus, we invented a type of call-site optimization that I think and hope will make things faster in general.
<dnhester26>
ah thanks for the link, I see I've only ever read two of the papers from the browser's history
<dnhester26>
Btw, I don't think that link is included in other places in the page, I usually navigated around looking for things to read, in particular here http://metamodular.com/Common-Lisp/common-lisp.html
<ixelp>
Common Lisp
<beach>
I don't expect you to read them. I was just showing stuff we have invented to make things faster.
<beach>
You may be right.
contrapunctus is now known as fugata
<dnhester26>
ah ok, thanks. I do enjoy reading them, just want to prioritize Keene, AMOP, on Lisp, and others before hand
<beach>
Yes, you are better off with documents meant for users of the language.
pfdietz has joined #commonlisp
<beach>
These documents are for people who work on Common Lisp implementations.
fugata is now known as contrapunctus
<dnhester26>
I think "which makes is easy to prove correctness" should be "which makes it easy to prove correctness" in http://metamodular.com/SICL/
<ixelp>
SICL documents
<beach>
Sounds right, but I can't change it now.
<beach>
It has been published.
<beach>
Oh, wait, on the web page?
<beach>
I can fix that.
contrapunctus is now known as fugata
fugata is now known as contrapunctus
contrapunctus is now known as fugata
fugata is now known as contrapunctus
<dnhester26>
yeah the webpage, that's why I added the link. Just ctrl+f in the page or cmd+f
yitzi has quit [Ping timeout: 272 seconds]
tam has joined #commonlisp
contrapunctus is now known as fugata
<beach>
Hmm, I can't find the page.... :(
slyrus has joined #commonlisp
bitspook has joined #commonlisp
<beach>
Found it.
<dnhester26>
I don't know if it was here or in reddit but I read that the editor in zetalisp? or some lisp machine (I don't quite remember) is better than what we have with emacs+slime today because of certain features. Does anyone know what feature(s) that was?
<dnhester26>
Sorry, just read that, glad you found it.
yitzi has joined #commonlisp
yitzi has quit [Client Quit]
yitzi has joined #commonlisp
<beach>
Fix it I think. Thank you.
<dnhester26>
I was thinking about it earlier, and now since I was in your website I re-read http://metamodular.com/Common-Lisp/cl-editor.html but I'm not sure if what you mention is one of them or not. I never had it, so I don't know what I'm missing...
<ixelp>
Editor for Common Lisp code
<dnhester26>
Glad I could help with something!
slyrus has quit [Ping timeout: 260 seconds]
<beach>
I don't know what those features were, but I know that Emacs+SLIME is not a particularly good editing environment for Common Lisp code.
<beach>
Emacs does not "know" the role of each symbol, so syntax highlighting is done based only on global properties like the package.
<beach>
That's why you get syntax highlighting of PROG1 in (LET ((PROG1 ...)) ...) even though PROG1 here is not a Common Lisp operator. It is just a lexical variable.
<beach>
I need to go do some incremental dinner preparations. I'll be back in 10 minutes or so.
<dnhester26>
ok, thanks!
bjorkintosh has joined #commonlisp
bjorkintosh has joined #commonlisp
bjorkintosh has quit [Changing host]
rkazak has quit [Ping timeout: 248 seconds]
shmorg83 has joined #commonlisp
<beach>
So our plan is to include an incremental compiler in the editor so that we can figure out the role of each symbol, and highlight accordingly.
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
<beach>
And this feature will open all kinds of possibilities, like renaming a lexical variable in all places it is defined and used, even if the same name is used for something else, like a function.
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
slyrus has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
<beach>
... or find all the uses of a particular function, even when the same name is used as a lexical variable.
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
<beach>
Imagine, for instance, putting the cursor or the mouse pointer on a lexical variable, and get all the occurrences of it highlighted, say in boldface or some colored ink.
dnhester26 has quit [Remote host closed the connection]
slyrus has quit [Ping timeout: 244 seconds]
dnhester26 has joined #commonlisp
dnhester_ has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester_ has quit [Remote host closed the connection]
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #commonlisp
<aeth>
The implementation should track all callers of a particular function or macro. Not just to help editor refactoring, but also so macros and inline functions upon recompilation can also update the callers so nothing is ever using a stale definition.
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #commonlisp
attila_lendvai has quit [Read error: Connection reset by peer]
ebrasca has joined #commonlisp
kpg has quit [Ping timeout: 252 seconds]
slyrus has joined #commonlisp
slyrus has quit [Ping timeout: 244 seconds]
olnw has joined #commonlisp
amb007 has quit [Ping timeout: 265 seconds]
shka has quit [Quit: Konversation terminated!]
shka has joined #commonlisp
slyrus has joined #commonlisp
slyrus has quit [Ping timeout: 260 seconds]
rkazak has quit [Ping timeout: 252 seconds]
slyrus has joined #commonlisp
kpg has joined #commonlisp
amb007 has joined #commonlisp
slyrus has quit [Ping timeout: 252 seconds]
gorignak has joined #commonlisp
shka has quit [Quit: Konversation terminated!]
shka has joined #commonlisp
Pixel_Outlaw has quit [Remote host closed the connection]
rkazak has joined #commonlisp
Pixel_Outlaw has joined #commonlisp
mwnaylor has quit [Remote host closed the connection]
mwnaylor has joined #commonlisp
dino_tutter has joined #commonlisp
mgl has quit [Ping timeout: 252 seconds]
kpg has quit [Read error: Connection reset by peer]
spdegabrielle has quit [Quit: Connection closed for inactivity]
wacki has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pve has quit [Quit: leaving]
slyrus has joined #commonlisp
amb007 has quit [Ping timeout: 276 seconds]
alternateved has quit [Remote host closed the connection]
shka has quit [Quit: Konversation terminated!]
attila_lendvai has joined #commonlisp
slyrus has quit [Ping timeout: 265 seconds]
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #commonlisp
slyrus has joined #commonlisp
donleo has quit [Ping timeout: 276 seconds]
slyrus has quit [Ping timeout: 246 seconds]
yitzi has joined #commonlisp
jon_atack has joined #commonlisp
slyrus has joined #commonlisp
jonatack has quit [Ping timeout: 272 seconds]
slyrus has quit [Ping timeout: 252 seconds]
dino_tutter has quit [Ping timeout: 245 seconds]
attila_lendvai_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 248 seconds]