An empty (begin) is not valid r5rs syntax, yet it's now accepted by both the interpreter and the compiler.
I don't like language extensions like this that offer little in the way of utility but will screw up people porting code from gambit to other implementations, in the same way that PLT's mapping of () to '() screwed up people moving from PLT to gambit (I don't know whether PLT still does that).
Brad
Afficher les réponses par date
On 4-Dec-08, at 8:54 PM, Bradley Lucier wrote:
An empty (begin) is not valid r5rs syntax, yet it's now accepted by both the interpreter and the compiler.
Did you try it?
% gsi Gambit v4.3.2
(list 11 (begin) 22)
*** ERROR IN (console)@1.10 -- Ill-formed special form: begin
Empty begins are illegal in expression context (as in the example above) and valid in "command" context as in this example:
% gsi Gambit v4.3.2
(begin) (let ((x 11)) (begin) 22)
22
So Gambit conforms to the R5RS spec closely...
The bug that was fixed is that an empty begin in expression context used to give a segmentation violation, now it gives an error message.
Marc
On Dec 4, 2008, at 10:38 PM, Marc Feeley wrote:
On 4-Dec-08, at 8:54 PM, Bradley Lucier wrote:
An empty (begin) is not valid r5rs syntax, yet it's now accepted by both the interpreter and the compiler.
Did you try it?
Well, yes, actually I did.
Empty begins are illegal in expression context (as in the example above) and valid in "command" context as in this example:
Sorry, I missed the syntax expansion
<definition> => (begin <definition>*) <other things here>
and this is what I tried. It's been a hard day ...
Brad