freenode/#clasp - IRC Chatlog
Search
14:44:37
kpoeck
scymtym I have another question regarding the backquote/unquote handling in Eclector
14:44:37
Colleen
kpoeck: drmeister said 20 hours, 38 minutes ago: We can change the order files are built - or take functions out and move them around to improve the situation.
14:47:39
kpoeck
If I look at https://github.com/s-expressionists/Eclector/blob/master/code/reader/macro-functions.lisp#L321 in sems that within #' backqouote/unquote are not allowed
14:49:16
kpoeck
Effectively when I try to compile foundation.lsp in clasp I get an error caught ERROR: Splicing unquote is illegal in the function reader macro.
14:50:26
kpoeck
When I modify sharpsign-single-quote to use (with-forbidden-quasiquotation ('sharpsign-single-quote nil nil) .)
14:52:47
kpoeck
To the question. Is a form like "(fset 'cons-cdr #'(lambda (def env) `(cdr ,(cadr def))) t)" really acceptable?
15:15:41
kpoeck
I should have started with a summary: I can't compile "foundation.lsp" in clasp using latest eclector
15:15:44
drmeister
You are trying to do this in foundation.lsp - right? It's difficult to think about because it's really early in the bootstrapping and the capabilities are very primitive.
15:16:02
scymtym
kpoeck: i had a hard time extracting the rules for backquote and unquote from the spec. it is possible that some of my interpretations are not optimal. i need to gather some context before replying properly
15:17:16
drmeister
And this code was already there - it's that the new eclector doesn't handle it...
15:17:16
drmeister
https://github.com/clasp-developers/clasp/blob/dev/src/lisp/kernel/lsp/foundation.lsp#L321
15:17:57
kpoeck
so (fset 'cons-cdr #'(lambda (def env) `(cdr ,(cadr def))) t) throws ERROR: Splicing unquote is illegal in the function reader macro.
15:19:02
scymtym
drmeister: i believe you can ignore clasp and its bootstrapping for the question at hand. the question is whether (eclector.reader:read-from-string "#'(lambda () `(,bar))") should signal an error
15:20:21
scymtym
drmeister: yes, i changed the rules from "backquote is forbidden unless allowed" to "backquote is allowed unless forbidden" to accommodate custom reader macros that interoperate with backquote (i.e. iterate's #L)
15:20:45
scymtym
all that said, (eclector.reader:read-from-string "#'(lambda () `(,@bar))") doesn't signal an error for me
15:21:48
drmeister
Here's what I know about implementing backquote - (1) tricky, tricky, tricky. (2) I implemented clasp's by slavishly copying what was in the appendix of "Common Lisp The Language" by Guy Steele. (3) Fare has many thoughts on implementing backquote and he has a very sophisticated implementation somewhere.
15:23:28
kpoeck
scymtym Inside sharpsign-single-quote what does (with-forbidden-quasiquotation ('sharpsign-single-quote :keep t) ..) precisely mean?
15:25:25
kpoeck
as I said, if I change that to with-forbidden-quasiquotation ('sharpsign-single-quote nil nil) .) no error is signaled
15:26:33
scymtym
kpoeck: 'sharpsign-single-quote is the context for error messages. :keep means backquote is allowed if it was allowed in the input surrounding the #' form. t means unquote without another surrounding backquote is not allowed
15:27:45
scymtym
kpoeck: i would like to understand that as well. as i wrote above, (eclector.reader:read-from-string "#'(lambda () `(,@bar))") doesn't signal an error for me
15:28:48
kpoeck
So perhaps in (eclector.reader:read-from-string "#'(lambda () `(,@bar))") works, since there is no context disallowing backquote?
15:30:42
scymtym
maybe one of the toplevel READ functions should reset the backquote context but doesn't
15:35:29
kpoeck
drmeister: If I put a (core:btcl) inside build-failure in clasp-builder.lsp, will that work?
15:39:10
drmeister
Or you can go here and add more: https://github.com/clasp-developers/clasp/blob/dev/src/core/debugger.cc#L2198
15:39:49
drmeister
The idea behind core:safe-backtrace is that it needs to stay absolutely bullet-proof and not invoke any Lisp code.
15:56:24
kpoeck
safe-backtrace is in https://gist.github.com/kpoeck/66c96c1a03bb3a643521f7e14e408226
15:59:11
drmeister
37: (_SHARPSIGN-SINGLE-QUOTE^ECLECTOR.READER^FN^^ #<IOSTREAM-STREAM 0x1266d51d9> #\'[39] COMMON-LISP::NIL )
16:04:41
scymtym
the error message is from COMMA and there doesn't seem to be a BACKQUOTE invocation between SHARPSIGN-SINGLE-QUOTE and COMMA, so that is strange but explains the error
16:07:15
kpoeck
But why would (eclector.reader:read-from-string "#'(lambda () `(,@bar))") than work?
16:09:56
scymtym
kpoeck: it works because the nesting is #' » ` » , i.e. #' disallows comma, but ` allows comma again. however, the backtrace looks as if the nesting was #' » , which doesn't make sense given the source code you linked
16:14:29
scymtym
how about that: https://github.com/clasp-developers/clasp/blob/dev/src/lisp/kernel/lsp/evalmacros.lsp#L31
16:17:38
scymtym
that explains all observations, but we are back to square one: is `(… #',…) allowed?
16:44:19
kpoeck
What I for sure like is (core:safe-backtrace) inside of build-failure, since that gives a backtrace before aborting
16:44:49
kpoeck
I also believe build-failure should also only be used while compiling, not loading, so will send both changes as a pr
16:55:02
drmeister
I'm thinking of writing a CANDO-USER:LAZY-INITIALIZE-LPARALLELS and call that every time I'm about to do anything with lparallel.
16:56:47
drmeister
I need something that will allow multiple quicklisp systems to depend on lparallels where there is a coordinated mechanisms to initialize lparallels
17:08:07
kpoeck
Regarding this problematic pattern, it is also in https://github.com/clasp-developers/clasp/blob/dev/src/lisp/kernel/lsp/foundation.lsp#L329
17:08:43
kpoeck
Foundation.lsp and evalmacros.lsp are compiled with forked processes, so it is a bit random with error comes first
17:13:05
kpoeck
Failing that, I just replaced the cruicial #' with (function ) and that seems to work as well (and no need for list operations)
17:14:34
kpoeck
Yes, and what use is to impose a criteria on `#', when there is existing code that uses that pattern
17:16:14
kpoeck
I don't have the energy to make pull request for the quicklisp universe to change `#', to `(function ,)
17:18:08
kpoeck
By error I started 2 different clasp compiles with 8 forks each one, lets take that as a stress test for my computer
18:59:44
Bike
that makes no sense though, why does my bordeaux threads asd not match the one that's been on github since last year