Sujet : Re: Church numerals in early lisp implementations?
De : sgonedes1977 (at) *nospam* gmail.com (steve)
Groupes : comp.lang.lispDate : 18. May 2024, 10:00:04
Autres entêtes
Message-ID : <87ed9zft2z.fsf@gmail.com>
References : 1 2 3
User-Agent : Gnus/5.13 (Gnus v5.13)
Julieta Shem <
jshem@yaxenu.org> writes:
Alan Bawden <alan@csail.mit.edu> writes:
>
< > Julieta Shem <
jshem@yaxenu.org> writes:
< >
< > McCarthy wrote this in ``History of Lisp''.
< >
< > > Numbers were originally implemented in LISP I as lists of atoms, and
< > > this proved too slow for all but the simplest computations.
< >
< > Was that Church numerals?
< >
< > Certainly not.
< >
< > The "atoms" is question were probably machine words containing the
< > digits of the number in some suitable base. I would guess base 2^36 or
< > 2^35, depending on how they chose to represent negative numbers --
< > similar to the way GMP still works today. But I don't know for sure.
< > I've never seen this documented anywhere.
>
Do you know if they have big numbers in those early implementations?
(Why would they use a list of things?) I'm now thinking that by ``list
of atoms'' (and with the light of from your post) they were supporting
big numbers.
it goes back to the CAR and CDR register.
Their algorithms were perhaps naive, explaining ``the too
slow for all but the simplest computations''. Thanks!
lisp was about the lambda and the closure. lexical scope possible. the
concept of numbers were not issues.
https://en.wikipedia.org/wiki/S-expressionthink of vixie tubes - how many numbers? infinite (with many tubes and a
cary flag )
vixie tubes are russian, soviet, Ukraine and therefor hard to get (very expensive; very
hard to trade for evil LEDs (photo dio). I have one for a heating mantel.
just set the timer function ..
(let ((x 5))
(funcall (lambda () (print x))))
(let ((y 3))
(funcall (lambda (x) (+ x y)) 3))
=> 6
(let ((y 'a))
(funcall (lambda (x) (list x y)) 3))
=> (3 a)
;; This is the best option but symbols and funcall took a lot of
;; hardware. notice the ``shadowing'' ; the set operator violates the
;; pure lambda . the pure lambda would be the programming language
;; called scheme. it is designed for specification not for efficiency.
;; I dunno it seems to be a french thing (RS5) (?)
;; apply was written by Guy Steele; (initially).
https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://en.wikipedia.org/wiki/Guy_L._Steele_Jr.&ved=2ahUKEwjhur3l25aGAxWthIkEHcPtACMQFnoECC8QAQ&usg=AOvVaw0oeV0gO0WRACOWzK2hZByX
(set 'number-1 (lambda ()
(lambda () 3)))
(funcall (funcall number-1))
=> 3
that would be 3 closures - or three LEDs.
;; in scheme
((lambda () ... ))
blah blah...
The (( means evaluate. scheme is not a bad language; but CL dives right
in.