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

Re: Various comments

This page is part of the web mail archives of SRFI 93 from before July 7th, 2015. The new archives for SRFI 93 contain all messages, not just those from before July 7th, 2015.



Marcin 'Qrczak' Kowalczyk <qrczak@xxxxxxxxxx> writes:

> Jorgen Schaefer <forcer@xxxxxxxxx> writes:
>
>> This feature means _any_ symbol could cause _anything_ to happen.
>
> So what? (cons 1 2) can cause anything to happen because somebody
> might have redefined cons to draw circles on the screen. If some
> library violates common sense, don't use it.

Yes. The difference being that in (cons foo bar), not only CONS
could do weird stuff, but FOO or BAR might just as well.

It's a major change in the semantics of Scheme if it's allowed to
happen outside of the lexical environment of a macro. Common
invariants don't necessarily hold anymore, e.g.

    (+ foo foo) == (* 2 foo)

might be wrong if FOO is such a variable. The implementation can
see this, but can you?

Hence it's bad style to use such variables, unless you have _very_
good reasons. I would very much like to see the restriction of
this to the lexical environment of a macro, as I already wrote in
another mail.

Telling people "this is generally a really bad idea" is an option.

Regards,
        -- Jorgen

-- 
((email . "forcer@xxxxxxxxx") (www . "http://www.forcix.cx/";)
 (gpg   . "1024D/028AF63C")   (irc . "nick forcer on IRCnet"))