libera/#commonlisp - IRC Chatlog
Search
16:13:46
jcowan
Bike: Consider the case in which I am translating some language (Superblub) into Lisp in order to execute it efficiently. When a run-time error takes place, it is reported in Lisp terms rather than in Superblub terms. That is very confusing for the user, who needs to be able to understand program faults according to their mental model, which is based on Superblub, not Lisp.
16:14:50
Bike
oh so by "frontend" you're talkinga bout like a superblub frontend, not necessarily the racket frontend.
16:16:16
jcowan
If you write a front end in Racket, you talk to Racket in syntax objects, which carry along with them Superblub-level source information.
16:17:21
jcowan
e.g. (+ 3 4) is translated by the Racket front end into (%app + 3 4), where %app is a special form representing function application.
16:19:16
jcowan
So if your Superblub language is Basic, then sin(x) would be translated into (%app sin (%var x)), whereas rnd is not (%var rnd) but (%app rnd).
16:25:10
edgar-rft
jcowan: of course it's possible to signal Common Lisp conditions containing line numbers from Superblub code, but it's task of the fornt-end to set that up when transforming the code from Superblub to Lisp.
16:25:23
Bike
uhhuh. so the syntax objects are a bit like CSTs, although CSTs don't have any of the hygeine stuff
16:50:51
Bike
i looked a bit at racket while doin csts stuff. something like syntax->datum and datum->syntax could be useful in writing some macros, but that would require some major and nonconforming reorganization of how CL macros work
19:41:41
jmes
Hey folks, when you define an initialize-instance :after method and you give it a keyword parameter, does that mean you would be able to pass that keyword parameter to make-instance?
19:53:29
pve
jmes: that should be the case, see http://www.lispworks.com/documentation/HyperSpec/Body/07_ag.htm
19:56:19
yitzi
jmes: You can pass any keyword parameter to make-instance. INITIALIZE-INSTANCE and others all have &allow-other-keys.
19:58:21
Shinmera
make-instance must error on unrecognised keyword arguments. A keyword argument is recognised if it is a slot initarg, or if it is defined as a keyword argument on an applicable initialize-instance or shared-initialize method.
20:02:56
Bike
yeah it's a bit confusing. they have allow other keys but that's only because make-instance does this special checking instead of the normal checking.
20:27:56
pjb
Shinmera: that's not true; make-instance takes &rest. It passes them to initialize-instance which takes &rest. It passes them to shared-initialize, which has &key &allow-other-keys !
21:00:47
Bike
there is an entire subsection on the CLHS specifically describing how make-instance and co reject keyword arguments. this is not ambiguous. you cannot pass any keyword to make-instance.
21:01:00
specbot
Declaring the Validity of Initialization Arguments: http://www.lispworks.com/reference/HyperSpec/Body/07_ab.htm
21:01:27
Bike
and of course the page on make-instance says "The initialization arguments are checked within make-instance."
21:05:00
Bike
if you're going to try to out-pedant someone please take the effort to ensure you are saying true things
21:17:05
Bike
don't try to play this off with "yes". i am disagreeing with you. someone said something and you tried to correct them with something false.