chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] [PATCH] [5] Aggressively reject definitions in exp


From: felix . winkelmann
Subject: Re: [Chicken-hackers] [PATCH] [5] Aggressively reject definitions in expression contexts (#1309)
Date: Sun, 11 Dec 2016 22:58:50 +0100

I don't know, but reading what you wrote in the ticket ("... this will
require quite a bit of rework and hardcoding all defining forms into the
compiler (which we have to do already anyway, to make internal defines
work)...") makes me cringe.

It's the responsibility of the defining forms to expand into something
that results in proper local (or nonlocal) definitions, not a matter of
the compiler, and it is up to the user to use them in a proper
context.

So I think this patch doesn't really solve the problem, just avoids it by
enforcing overly strict behaviour that shouldn't be necessary. What should
be solved is properly handling the inner "begin" in a body, which is clearly
broken and indicated in the ticket.

Note that some defining forms always have toplevel semantics
("define-constant",
 "define-external"), regardless of context. The same applies to
 "define-inline"
(it might be interesting to allow this locally, but we don't have the
machinery in the compiler for this.)


felix




reply via email to

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