guile-devel
[Top][All Lists]
Advanced

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

Syntax checks


From: Dirk Herrmann
Subject: Syntax checks
Date: Sat, 6 Apr 2002 08:25:52 +0200 (MEST)

Hello everybody,

in the evaluator, there are a lot of syntax checks performed that could
probably better be performed in a previous syntax checking phase, keeping
the evaluator itself free of such checks.

As an example, there is the 'do loop construct: In the body of the do loop
you only have to execute expressions that can have a side effect.  We do
not have a proper analysis for which expressions can have a side effect
and which don't, but there is a simple syntactic criterion that can be
used:  If the expression is not a list, then it is an object or a variable
reference and can't have sideeffects.

Thus, the body of the do loop could be scanned in the macro transformer
and freed of unnecessary expressions.  Then, the corresponding check in
the evaluator could be removed.

I would like to apply such changes, but I have some questions:

* Removing unnecessary expressions from code would change the source in a
way that can't be restored by unmemoizing.  Do we care?  In the long run
we will probably want to allow more transformations on the source anyway
for the sake of optimization.  Then, memoization/unmemoization won't work
and we will have to provide a different mechanism to record the
relationship between transformed code and the source.

* Should warnings be issued when dead code is eliminated from the source?

Best regards
Dirk Herrmann




reply via email to

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