Comments on: Lisp, documenting my encounter with, step #1 http://ave1.org/2019/lisp-documenting-my-encounter-with-step-1/ Tue, 06 Oct 2020 17:02:26 +0000 http://polimedia.us hourly 1 By: Hunchentoot: acceptor code review « The Tar Pit http://ave1.org/2019/lisp-documenting-my-encounter-with-step-1/#comment-374 Hunchentoot: acceptor code review « The Tar Pit Thu, 10 Oct 2019 11:30:46 +0000 http://ave1.org/?p=247#comment-374 [...] begin with my own version of (ac)counting the functions in acceptor.lisp. First, we read all the top-level S-expressions in the [...] [...] begin with my own version of (ac)counting the functions in acceptor.lisp. First, we read all the top-level S-expressions in the [...]

]]>
By: lispm http://ave1.org/2019/lisp-documenting-my-encounter-with-step-1/#comment-261 lispm Thu, 08 Aug 2019 16:40:18 +0000 http://ave1.org/?p=247#comment-261 Well, you took a spec-like thing to learn a language. There starts your problem. But why not... Actual Lisp books for learning the language: ANSI CL from Paul Graham, Practical Common Lisp by Peter Seibel, Successful Lisp: How to understand and use Common Lisp by David Lamkins, Lisp 3rd Edition, Winston/Horn, Common Lisp: A gentle introduction to symbolic computation by Touretzy , .... and a bunch of others... Well, you took a spec-like thing to learn a language. There starts your problem. But why not... Actual Lisp books for learning the language: ANSI CL from Paul Graham, Practical Common Lisp by Peter Seibel, Successful Lisp: How to understand and use Common Lisp by David Lamkins, Lisp 3rd Edition, Winston/Horn, Common Lisp: A gentle introduction to symbolic computation by Touretzy , .... and a bunch of others...

]]>
By: spyked http://ave1.org/2019/lisp-documenting-my-encounter-with-step-1/#comment-240 spyked Tue, 30 Jul 2019 06:02:28 +0000 http://ave1.org/?p=247#comment-240 What I'm saying is that if you're trying to understand the thing from first principles, maybe starting from each x, `, ' and destructuring-bind is not such a great idea. Aside from some basic syntax (i.e. what do the parens and the period denote) and a few functions (car, cdr and cons), you need to first look at how the evaluation machine works and get at least an intuition of how things are laid out in memory. Otherwise this'll boil down to a very frustrating exercise in reading Mandarin. Having said that, the Hyperspec is as far as I can tell so bad as learning material because it's mostly prescriptive, not descriptive, i.e. it's the system *implementer* who needs to "accommodate the language on X hardware" and ensure that top-level progn forms are handled this and not that way. You might be better off starting with McCarthy's Lisp manual, then building up from there. Which isn't to say that this Hyperspec review is in itself a bad idea, I for one have really enjoyed reading so far. What I'm saying is that if you're trying to understand the thing from first principles, maybe starting from each x, `, ' and destructuring-bind is not such a great idea. Aside from some basic syntax (i.e. what do the parens and the period denote) and a few functions (car, cdr and cons), you need to first look at how the evaluation machine works and get at least an intuition of how things are laid out in memory. Otherwise this'll boil down to a very frustrating exercise in reading Mandarin.

Having said that, the Hyperspec is as far as I can tell so bad as learning material because it's mostly prescriptive, not descriptive, i.e. it's the system *implementer* who needs to "accommodate the language on X hardware" and ensure that top-level progn forms are handled this and not that way. You might be better off starting with McCarthy's Lisp manual, then building up from there.

Which isn't to say that this Hyperspec review is in itself a bad idea, I for one have really enjoyed reading so far.

]]>
By: ave1 http://ave1.org/2019/lisp-documenting-my-encounter-with-step-1/#comment-239 ave1 Tue, 30 Jul 2019 04:48:10 +0000 http://ave1.org/?p=247#comment-239 Spyked, now you are doing it again.... Spyked, now you are doing it again....

]]>
By: spyked http://ave1.org/2019/lisp-documenting-my-encounter-with-step-1/#comment-235 spyked Sat, 27 Jul 2019 13:56:48 +0000 http://ave1.org/?p=247#comment-235 > Let's explain something with the most convoluted example we can think of. Apparently Lispers have <a href="http://thetarpit.org/posts/y06/097-hunchentoot-iii.html#comment1" rel="nofollow">this tendency</a> to come up with weird toy examples, huh? > Next, from the existence of this helper function in the documentation, can I then conclude that no standard function has been specified to generate a sequence of consecutive integers? Not AFAIK. I don't recall ever using a specific function for this purpose myself. > this also be done with special syntax? note to self: this list function is a good candidate for a next post Likbez on "list" versus quotation: list is generally used to build lists whose elements have been evaluated beforehand, i.e. when the call was made. Meanwhile, quotes, quasiquotes (the backquote thingie) and unquotes (the comma thingie) are used to define (usually compile-time) expressions and control the evaluation within them. For example: > (defparameter x 1) X > (list x 2 3) (1 2 3) > '(x 2 3) (X 2 3) > `(,x 2 3) Note however a fundamental difference between how they work: > (defparameter *a-list* nil) *A-LIST* > (defun f(x) (push (list x 'a 'b) *a-list*)) F > (f 1) (f 2) ((2 A B) (1 A B)) > (setf (cadar *a-list*) 'd) D > *a-list* ((2 D B) (1 A B)) > (defun g (x) (push `(,x a b) *a-list*)) G > (setq *a-list* nil) (g 1) (g 2) ((2 A B) (1 A B)) > (setf (cadar *a-list*) 'd) D > *a-list* ((2 D B) (1 D B)) > Let's explain something with the most convoluted example we can think of.

Apparently Lispers have this tendency to come up with weird toy examples, huh?

> Next, from the existence of this helper function in the documentation, can I then conclude that no standard function has been specified to generate a sequence of consecutive integers?

Not AFAIK. I don't recall ever using a specific function for this purpose myself.

> this also be done with special syntax? note to self: this list function is a good candidate for a next post

Likbez on "list" versus quotation: list is generally used to build lists whose elements have been evaluated beforehand, i.e. when the call was made. Meanwhile, quotes, quasiquotes (the backquote thingie) and unquotes (the comma thingie) are used to define (usually compile-time) expressions and control the evaluation within them. For example:

> (defparameter x 1)
X
> (list x 2 3)
(1 2 3)
> '(x 2 3)
(X 2 3)
> `(,x 2 3)

Note however a fundamental difference between how they work:

> (defparameter *a-list* nil)
*A-LIST*
> (defun f(x)
(push (list x 'a 'b) *a-list*))
F
> (f 1) (f 2)
((2 A B) (1 A B))
> (setf (cadar *a-list*) 'd)
D
> *a-list*
((2 D B) (1 A B))
> (defun g (x)
(push `(,x a b) *a-list*))
G
> (setq *a-list* nil) (g 1) (g 2)
((2 A B) (1 A B))
> (setf (cadar *a-list*) 'd)
D
> *a-list*
((2 D B) (1 D B))

]]>
By: Mircea Popescu http://ave1.org/2019/lisp-documenting-my-encounter-with-step-1/#comment-234 Mircea Popescu Sat, 27 Jul 2019 10:09:05 +0000 http://ave1.org/?p=247#comment-234 The bash counting has gotta be the more insulting thing to happen to the lisp ecosystem in weeks. The bash counting has gotta be the more insulting thing to happen to the lisp ecosystem in weeks.

]]>
By: ave1 http://ave1.org/2019/lisp-documenting-my-encounter-with-step-1/#comment-233 ave1 Sat, 27 Jul 2019 08:50:35 +0000 http://ave1.org/?p=247#comment-233 Mircea Popescu, So then let's try to count the functions, with bash. All functions in the hyperspec have a title with CLHS: Function blabla. Simple bash line; sed -n "s/CLHS: Function \(.*\)/\1/p" * | tr ', ' '\n'|sed '/^$/d' | wc -l GIves a count of: 438 functions! Mircea Popescu, So then let's try to count the functions, with bash. All functions in the hyperspec have a title with CLHS: Function blabla. Simple bash line;

sed -n "s/CLHS: Function \(.*\)/\1/p" * | tr ', ' '\n'|sed '/^$/d' | wc -l

GIves a count of: 438 functions!

]]>
By: Mircea Popescu http://ave1.org/2019/lisp-documenting-my-encounter-with-step-1/#comment-232 Mircea Popescu Sat, 27 Jul 2019 07:21:13 +0000 http://ave1.org/?p=247#comment-232 > First, the nearly, these numbers should be easy enough to determine exactly You are absolutely right ; and cop-out however they might attempt, the lisp folks are guilty of perlthought here, no question about it. The likely reason 1st generation started doing it (in the 90s) was the perception that precise numbers are scary to [imbecile] undergrads, based as it was in fact, derived from direct experience in US "colleges" ; and then the <b>guilty</b> expectation that imbecile undergrads are all the undergrads, and that the goal of education is socialism and no imbecile left behind instead of republic, painful & humiliating evisceration of imbeciles and the cult of the elite ; and so they "adapted". By now this continues out of mere inertia, the imbecile undergrads just continue the world they saw, which was the subset of the world that <a href="http://trilema.com/2013/the-disadvantage-of-teaching-people-the-alphabet-and-nothing-more-is-that-you-have-to-somehow-put-up-with-a-bunch-of-retards-that-can-now-express-themselves-in-writing/" rel="nofollow">the guilty showed them</a>, an inconsequential and fundamentally <a href="http://trilema.com/2016/the-herd-of-independent-minds-or-has-the-avantgarde-its-own-mass-culture/?b=In%20sum&e=al.#select" rel="nofollow">false</a> subset of the actual world. > First, the nearly, these numbers should be easy enough to determine exactly

You are absolutely right ; and cop-out however they might attempt, the lisp folks are guilty of perlthought here, no question about it.

The likely reason 1st generation started doing it (in the 90s) was the perception that precise numbers are scary to [imbecile] undergrads, based as it was in fact, derived from direct experience in US "colleges" ; and then the guilty expectation that imbecile undergrads are all the undergrads, and that the goal of education is socialism and no imbecile left behind instead of republic, painful & humiliating evisceration of imbeciles and the cult of the elite ; and so they "adapted".

By now this continues out of mere inertia, the imbecile undergrads just continue the world they saw, which was the subset of the world that the guilty showed them, an inconsequential and fundamentally false subset of the actual world.

]]>