chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] Would it be hard to make csc catch this equivalence?


From: Jörg F . Wittenberger
Subject: [Chicken-hackers] Would it be hard to make csc catch this equivalence?
Date: 24 May 2013 12:09:09 +0200

Try to compile this code, csc will complain about a known
procedure called with the wrong number of arguments:

(let ((x (lambda (y) (+ y 1)))) (x 2 3))

Now try this equivalent code, csc will happily accept it.
(Thus converting the compile-time error into a run-time error.)

((lambda (x) (x 2 3)) (lambda (y) (+ y 1)))

Practical consequence: when writing macros, one will have
to keep in mind, that chicken will not catch the error
in the second case.  I dunno how many possible optimizations
become a causality that way.  But I'd love to off-load my
brain from tracking that one.

Would it be hard to make csc catch this one.  At least for
the case of immediate application in known context?


Best

/Jörg



...........





reply via email to

[Prev in Thread] Current Thread [Next in Thread]