←back to thread

Hofstadter on Lisp (1983)

(gist.github.com)
372 points Eric_WVGG | 3 comments | | HN request time: 0.476s | source
Show context
susam ◴[] No.41862994[source]
In case anyone else is confused by what the functions named "oval" and "snot" mean in the following example:

  > (cond ((eq (oval pi) pie) (oval (snot pie pi)))
  (t (eval (snoc (rac pi) pi))))
I realised after a few seconds that they are meant to be "eval" and "snoc" instead. The above code should be written as the following instead:

  (cond ((eq (eval pi) pie)
         (eval (snoc pie pi)))
        (t (eval (snoc (rac pi) pi))))
This article has been a fascinating read, by the way. Kudos to the maintainer of the Gist post. I am also sharing these corrections as comments on the Gist post.

EDIT #1: Downloaded a copy of the original Scientific American article from https://www.jstor.org/stable/24968822 and confirmed that indeed the functions "oval" and "snot" are misspellings of "eval" and "snoc".

EDIT #2: Fixed typo in this comment highlighted by @fuzztester below.

replies(2): >>41863410 #>>41863652 #
1. fuzztester ◴[] No.41863652[source]
>confirmed that indeed the functions "oval" and "snot" are misspellings of "eval" and "snot".

Correction of your correction:

confirmed that indeed the functions "oval" and "snot" are misspellings of "eval" and "snoc".

And I guess snoc is cons reversed and rac is car reversed.

replies(2): >>41864153 #>>41874145 #
2. susam ◴[] No.41864153[source]
> Correction of your correction

Thanks! Fixed.

> And I guess snoc is cons reversed and rac is car reversed.

Indeed! That's exactly how those functions are introduced in the article. Quoting from the article:

> The functions rdc and snoc are analogous to cdr and cons, only backwards.

3. Xen9 ◴[] No.41874145[source]
re: riccar e

https://it.m.wikipedia.org/wiki/Ricercare