Post by cevingPost by Marc Nieper-WiÃkirchenBecause there are at least two different `begin's.
Wow: one symbol with two different meanings. This sounds broken.
Sorry for my other post whose context should have been an earlier
question but which is missing from my newsserver.
For this question, I did an experiment, and it looks like the special
meaning is only for a specific local context, in a define with a
subsequent (values...) expression.
This plurality is caused by the surrounding context and can be expressed
with a single meaning for 'begin' albeit a more complex one than you
would consider in order to not be broken. In particular the behaviour of
'if' that you seemed concerned about is to support programming styles
that suit the simpler meaning of 'begin' that you seem to want.
I am interested to know of programming languages that have no symbols
with meanings that can be expressed such that two different effects can
result from its use in two different contexts, and I don't mean things
that they refer to as symbols, but things which are actually symbols in
general.
I suspect there's no suitable language that satisfies both concerns, in
particular I think elimination of actions must allow the complex
specification of 'begin' in order to also be generally useful, yet
allowing only actions so that symbols can only have a simpler meaning
than has 'begin' will make a language too limited to serve scheme
programmers' purposes.
Perhaps it is the existence of an explicit syntax-checking threshold and
that (begin ...) causes either syntax pass or syntax fail depending on
context? This is common, and often especially desirable, where humans
will use the language.
Personally I don't see why begin shouldn't have always required either
no action and its return value been *unspecified* or always required at
least one action even if it were the nil action, *unspecified*. The
justification for requiring at least one action given in the guile help
is outside the philosophy that allows (if a b) to exist instead of (if a
b *unspecified*), which is that the language is not pure functional so
expressions can have some kind of *unspecified* atom for their results.