libera/commonlisp - IRC Chatlog
Search
7:35:31
hayley
I am fairly sure some molecule with one carbon atom and three oxygen atoms would not be a metal.
9:44:20
pve
Hi! Is it correct that only the &aux lambda list keyword can occur after (.. &key key1 key2 ..) in a destructuring lambda list?
9:46:08
specbot
Destructuring Lambda Lists: http://www.lispworks.com/reference/HyperSpec/Body/03_de.htm
9:49:13
pve
beach: Thanks. And implementations are not allowed to come up with additional lambda list keywords?
11:01:52
pjb
Unfortunately, why the implementation may declare additionnal keywords, the standard doesn't provide a way to know their syntax: do they take 0, 1 or more parameters? Are they changing the parameter kind, or are they just qualifying a "normal" parameter"?
11:03:04
jackdaniel
since they are implementation specific, then their purpose is also implementation specific, so there wouldn't be much benefit from knowing how many parameters they take programmatically (if you don't understand semantics of them)
11:03:16
pjb
(mandatory-1 &unboxed mandatory-2 &others like-rest &fast-key key-1 key-2 &and-some-more-p &and-this a b c)
11:04:03
pjb
jackdaniel: it's not a semantic question, it's a syntactic question. You want to be able to parse lambda-lists, to write macros correctly.
11:08:56
jackdaniel
pjb: if you don't understand the operator (or a lambda list keyword) semantics, then you may at most do moon-walking
11:09:29
jackdaniel
because it in theory may turn around any assumption you will bake into the moonwalker
11:20:30
lisp123
pjb: do you mean implementations don't specify the syntax of additional lambda list keywords?
11:30:25
pjb
lisp123: yes. The standard only provides a way to let them declare the new lambda list keywords via the lambda-list-keywords constant variable.
11:31:01
pjb
#+ccl lambda-list-keywords --> (&optional &rest &aux &key &allow-other-keys &body &environment &whole ccl::&lexpr ccl::&lap)
11:31:58
pjb
but it should be something like: ((&optional *) (&rest 1) (&aux *) (&key *) (&allow-other-keys 0) (&body *) (&environment 1) (&whole 1) (ccl::&lexpr ???) (ccl::&lap ???))
11:33:21
pjb
in the case of macro, you can macroexpand and code walk to learn how the various parameters to the macro are used.
11:33:55
pjb
If a parameter appears in a binding as variable or function name, you know it's not evaluated, but will be bound or fbound.
11:35:18
pjb
Of course, it may also be used at macroexpansion-time so you may miss some information, but in the context of code walking it is enough.
11:48:56
SR-71
I came across this https://viniciusmo.github.io/blog/2013/02/04/programming-challenges-minesweeper/.
12:53:51
beach
pjb: It is actually even worse. Some lambda-list keywords can appear anywhere in the list, and some can appear more than once, so the task of parsing the lambda list becomes very difficult indeed.
12:58:21
beach
I came up with an extensible parser; each implementation would add rules to the parser. Then, at least we could have a library that does most of the work in an implementation-independent way.
12:58:44
beach
Otherwise, jackdaniel is right. We are doomed to have a parser for each implementation.
12:59:07
beach
Yes, but I am not happy with the result, so I am still thinking about this problem from time to time.
13:54:24
Josh_2
I think in the future perhaps I will just use BKNR for a backup, although its probably easier to use cl-store to save transaction information to the disk/postgres