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

Re: [Scheme-reports] 5.1 programs

On Thu, May 19, 2011 at 9:14 AM, Andy Wingo <wingo@x> wrote:
> The docs say:
>  Program parts other than expressions that are present at the top
>  levele of a program can be interpreted declaratiely.  They cause
>  bindings to be created in the top level environment or modify the
>  value of existing top-level bindings.  Expressions occurring at the
>  top level of a program are interpreted imperatively; they are executed
>  in order when the program is invoked or loaded and typically perform
>  some kind of initialization.
> I don't think that "declaratively" is right here.  A definition can
> cause a side effect, viz:
>  (define foo (begin (delete-file "bar") 1))
> Furthermore order and scope is unclear.

Yes, the definition is declarative, specifically because the order
and scope of the expression evaluating to its value is unclear.

There are some very uncommon semantics such as those
supported by SCM, where syntax can retroactively modify
preceding definitions, which are technically allowed in R5RS.
We need very strong motivation to break backwards compatibility
with R5RS (though this may be such a case).

> Funally the result of invoking a continuation captured at the toplevel
> is not mentioned.  On purpose?

Yes.  Have you ever seen a sane proposal for specifying
this that all implementations could easily support?! :O


Scheme-reports mailing list