• Re: Why is it ok to have an empty begin but no empty lambda?

    From Tristan Wibberley@tristan.wibberley+netnews2@alumni.manchester.ac.uk to comp.lang.scheme on Sat Mar 2 13:18:01 2024
    From Newsgroup: comp.lang.scheme

    On 30/10/2023 15:50, ceving wrote:
    Marc Nieper-Wi|fkirchen schrieb am Montag, 30. Oktober 2023 um 15:05:05 UTC+1:
    Because there are at least two different `begin's.

    Wow: one symbol with two different meanings. This sounds broken.

    I think it's because (lambda...) is a way to construct a value, and
    (begin...) is a way to sequence actions.

    The term 'lambda' as it applies to logic was described by a group of
    logicians working on systems in general that might not have an atom for *unspecified* so helpfully in scheme if you are to use lambda and return *unspecified* you must do so by explicitly defining the value of the
    lambda in term of something that may be *unspecified*. It's possible the scheme language designers didn't appreciate the meaning in logic but
    just followed habits of their forebears.

    Some languages incorporate a lambda more wrongly and allow an implicit *unspecified* because they're actually incorporating a stateful monad
    because they followed *fewer* habits of their forebears.


    cf. imperative vs pure functional languages.



    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Tristan Wibberley@tristan.wibberley+netnews2@alumni.manchester.ac.uk to comp.lang.scheme on Sat Mar 2 15:02:26 2024
    From Newsgroup: comp.lang.scheme

    On 30/10/2023 15:50, ceving wrote:
    Marc Nieper-Wi|fkirchen schrieb am Montag, 30. Oktober 2023 um 15:05:05 UTC+1:
    Because 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.

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Lawrence D'Oliveiro@ldo@nz.invalid to comp.lang.scheme on Sun Mar 3 00:02:16 2024
    From Newsgroup: comp.lang.scheme

    On Sat, 2 Mar 2024 13:18:01 +0000, Tristan Wibberley wrote:

    The term 'lambda' as it applies to logic was described by a group of logicians ...

    ++-calculus was first created by Alonzo Church. This was around the same
    time Alan Turing formulated his rCLTuring machinerCY to represent computation. The two theories turned out to be equally capable in this regard.

    ++-calculus also offers an interesting way to deal with paradoxes, of the
    kind that scare mathematicians so much: it represents them as an endless
    loop. This is something we are well familiar with in computer science, and itrCOs not something that scares us.
    --- Synchronet 3.22a-Linux NewsLink 1.2