[r6rs-discuss] R6 counterproposal
pc at p-cos.net
Mon May 28 16:41:36 EDT 2007
On 28 May 2007, at 22:01, Thomas Lord wrote:
> Joe Marshall wrote:
>> So am I right in assuming that you were thinking of FEXPRs in the
>> general case rather than the way SCM uses the term?
> SCM fexprs can't (in general) be expanded until run-time so I'm
> not sure what you are asking. Hobbit (the compiler that come's
> with SCM) compiles only a subset of programs, as far as I recall.
> Actually, it's useful that SCM's fexprs have this property: it makes
> it possible to write domain-specific incremental (re-)compilers
> in Scheme.
> Fexprs just add a new rule to application: if the first position
> of an
> application points to a fexpr, arguments are unevaluated but
> the result an expression which is itself evaluated.
> I'd like fexprs in combination with first-class environments
> which are reified if and only if their lexical scope includes
> a call "(the-environment)".
Since any call in a lexical scope can be an invocation of an fexpr,
and since any fexpr may result in a call to (the-environment), it is
statically undecidable whether reification is necessary or not. So in
the general case, you will always need to reify them. Static analysis
of the involved fexprs doesn't help you in the general case because
they are Turing-complete.
That's the gist of Mitchell Wand's paper "The Theory of Fexprs is
Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
Vrije Universiteit Brussel, Programming Technology Lab
Pleinlaan 2, B-1050 Brussel, Belgium
More information about the r6rs-discuss