Sujet : Re: TeX and Pascal [was Re: The joy of FORTRAN]
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : alt.folklore.computers comp.os.linux.miscDate : 30. Sep 2024, 22:27:34
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vdf546$2cn51$7@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Pan/0.160 (Toresk; )
On Mon, 30 Sep 2024 13:52:08 -0700, John Ames wrote:
With ST, it's "objects all the way down" (at least 'til you hit that
magic ignore-the-man-behind-the-curtain barrier that every HLL has at
some point, which is still admirably low compared to most "friendly"
languages,) and the underlying design makes it possible to examine and
modify even a substantial portion of the runtime itself.
This gives it a kind of self-similar quality that reminds me of Lisp -
nothing is magic, even the "magic" bits (the primitives generally have
a "reference" version in pure ST, when possible,) and everything's made
from the same kind of stuff. That's what I find appealing about it; I
haven't worked with it enough to say whether it's truly *useful,* but
in its own way it *is* beautiful.
I have had only minimal exposure to Smalltalk, and I can certainly
appreciate aspects of its design.
However, I had a great deal of trouble finding any kind of description of
its actual syntax. I think the original Smalltalk systems were heavily
oriented towards entering pieces of code directly into the GUI
environment, with no notion of code contained in actual text files.
Here’s an example of a simple function-returning-a-function that
demonstrates lexical binding, and also shows that not everything has to be
a class:
f := [:n||i| i := n. [i := i + 1. i printNl]].
f1 := f value: 5.
f2 := f value: 2.
f1 value.
f2 value.
f1 value.
f2 value.
Output:
6
3
7
4