Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Lisp Question

Name: Anonymous 2016-09-07 18:50

What would be the result of
(consp (car (cadr '`(,@(list "abc")))))
???

Is it guaranteed to be that? Explain your answer.

Name: Anonymous 2016-09-07 18:51

got me when change in SBCL version resulted into change to reader output.

Name: Anonymous 2016-09-07 20:36

Name: Anonymous 2016-09-08 1:10

>>1
You always need to chain macros with the simple steps(complex expressions can confuse the compiler).
Break this into 2-4 macros with the innermost list macro.
e.g. macro1= macro2=macro3

Name: Anonymous 2016-09-08 1:11

if it's lisp, it's shit

Name: Anonymous 2016-09-08 8:26

Only LGBTQ will go to heaven, heterosexuals will go straight to hell

Name: Anonymous 2016-09-08 11:29

>>6
What does this have to do with Lisp?

Name: Anonymous 2016-09-08 13:08

Name: Anonymous 2016-09-08 13:59

i don't understand the point of the question when i could just paste it into a REPL

Name: Anonymous 2016-09-08 14:01

>>9

different REPLs will give different results.

Name: Anonymous 2016-09-08 14:41

>>11
Chec'kem

Name: W.T. CRACKERS 2016-09-08 15:54

This ain't an lisp question, but an common lisp question.

Name: Anonymous 2016-09-08 22:22

s-expressions and macros make Common Lisp an acceptable Lisp

Name: Anonymous 2016-09-09 5:53

'`(,@(list "abc"))
You're quoting a backquoted expression, and there are some implementation differences in how backquote is implemented, and how it's printed. Some parts will stay the same as much as its guaranteed by the ANSI CL standard and some will change. Here's an example of a part that won't be portable:
* (first '`(abc))
QUOTE
* (first '`(abc ,(list)))
SB-IMPL::BACKQ-LIST

* '`(abc ,(list))
`(ABC NIL)
* '`(abc nil)
'(ABC NIL)

The printer will turn that SB-IMPL::BACKQ-LIST into `, but you can always examine the list yourself. It will be different for a different implementation. This doesn't prevent you from writing macros that write macros because once it's all expanded, it will all work the same, but if you're trying to dissect the generated code programmatically you will encounter surprises like this one.

Name: Anonymous 2016-09-09 6:31

>>14
there are some implementation differences in how backquote is implemented
Consider this: A pack of wild implementation differences.

Savage, slavering implementation differences nearing your source code. Trampling your lisp macros. Raping your code walker.

And you can't do shit since they're savages. The subtle difference grabs your project and fucks it with its heisenbug stick.

The primal implementation differences finally dominate your lisp environment. They produce confusing errors all around and you are forced to be their slave.

Such is the downfall of Lisp Programmer.

Name: Anonymous 2016-09-10 13:57

>>15
;_;

Name: Anonymous 2016-09-10 20:39

It's UB

Don't change these.
Name: Email:
Entire Thread Thread List