Xah Lee can't program a line of Lisp on his own. Most of that code is collected from elsewhere. There are much better resources to learn Emacs Lisp from.
I have no desire to get into a personal argument, but I would like to point out that one contribution he has made for me that have not seen elsewhere is that he has chosen to use Emacs as a text-processing scripting environment in preference to Perl or Python or some other scripting languages. Without commenting on issues of style or idiom I found his write-ups of this experience using the text-editing primitives of…
Practical Emacs Lisp
41–50 of 60 posts
Re: Practical Emacs Lisp
#42Earlier quoted context omitted.
As an emacs beginner, I've landed on his site numerous times, often finding it helpful. The fact that he might or might not have trolled some mailing list is of no concern to me. If you have a better alternative resource, please present it. If you can find technical faults in this resource, you should provide them so the author can correct it and other might learn of them as well. Otherwise, stop trying to justify ad…
> The fact that he might or might not have trolled some mailing list is of no concern to me. It's not meaningless to me. > If you can find technical faults in this resource, you should provide them so the author can correct it and other might learn of them as well. We had extensive discussions with him for years. Literally thousands of posts can be found on comp.lang.lisp. The only Lisp he learned was some imperative…
Not to be trolling myself, but I believe that's part of the "practical" aspect.
You'll find much of the same in "Practical common lisp".
Re: Practical Emacs Lisp
#43Earlier quoted context omitted.
See this Xah Lee Elisp code: (defvar xah-left-brackets '("(" "{" "[" " " "〕" "】" "〗" "〉" "》" "」" "』" "”" "’" "›" "»") "list of right bracket chars.") (progn (setq xah-right-brackets '()) (dotimes (x (- (length xah-brackets) 1)) (when (= (% x 2) 1) (push (char-to-string (elt xah-brackets x)) xah-right-brackets))) (setq xah-right-brackets (reverse xah-right-brackets))) In CL this is just: (defun every-nth (seq start n…
Oh I wasn't arguing that CL loop was a far better solution than while loops (unless you process too long lists). I just became very very+ fond of academic recursive style. Here's a singly-linear variant for fixed steps. (defun ab (l) "I'm too lazy to reverse the result back." (defun _ (l a b f) (if (null l) (if f (list a b) (list b a)) (_ (cdr l) b (cons (car l) a) (not f)))) (_ l nil nil t)) (ab '()) (ab '(1)) (ab '…
#lang racket
(define-syntax-rule (defun name (arg ...) . body)
(define (name arg ...) . body))
(define nil null)
(define t #t)
(defun ab (l)
;; "I'm too lazy to reverse the result back."
(defun _ (l a b f)
(if (null? l)
(if f (list a b) (list b a))
(_ (cdr l) b (cons (car l) a) (not f))))
(_ l nil nil t))
(ab '())
(ab '(1))
(ab '(1 2))
(ab '(1 2 3 4 5 6 7 8 9 10))
;; ((9 7 5 3 1) (10 8 6 4 2))
(ab '(1 2 3 4 5 6 7 8 9 10 11))
;; ((11 9 7 5 3 1) (10 8 6 4 2))
...and you don't need to worry about recursion limits thanks to mandatory TCO.Re: Practical Emacs Lisp
#44Earlier quoted context omitted.
I have no desire to get into a personal argument, but I would like to point out that one contribution he has made for me that have not seen elsewhere is that he has chosen to use Emacs as a text-processing scripting environment in preference to Perl or Python or some other scripting languages. Without commenting on issues of style or idiom I found his write-ups of this experience using the text-editing primitives of…
I would avoid this stuff. His language advocacy is not very convincing and he also fails to understand what grep does.
And the other text is misguided for the most part and reveals a misunderstanding of some basic concepts. tumba, please don't use these texts. I second lispm here. Only read these once you have a solid understanding of described concepts yourself.
Re: Practical Emacs Lisp
#45Earlier quoted context omitted.
Xah Lee has trolled Lisp groups for years. It's well known that much of his 'advice' is useless. The number of bullshit posts by him is a bignum. His comp.lang.lisp trolling is legendary. Nothing 'ad homenim' or mean - just saying how it is.
As an emacs beginner, I've landed on his site numerous times, often finding it helpful. The fact that he might or might not have trolled some mailing list is of no concern to me. If you have a better alternative resource, please present it. If you can find technical faults in this resource, you should provide them so the author can correct it and other might learn of them as well. Otherwise, stop trying to justify ad…
That's the problem, actually - I never saw Xah correct anything he thought "right", no matter how many people presented rational arguments. Granted, I don't follow his writings that much, so maybe it happens; however my general impression is that it's utterly impossible to convince Xah of anything.
On the other hand, his site does provide a certain amount of information. It just mixes good information with bad in a way which makes it very hard for beginners to tell one from the other.
Re: Practical Emacs Lisp
#46Earlier quoted context omitted.
Oh I wasn't arguing that CL loop was a far better solution than while loops (unless you process too long lists). I just became very very+ fond of academic recursive style. Here's a singly-linear variant for fixed steps. (defun ab (l) "I'm too lazy to reverse the result back." (defun _ (l a b f) (if (null l) (if f (list a b) (list b a)) (_ (cdr l) b (cons (car l) a) (not f)))) (_ l nil nil t)) (ab '()) (ab '(1)) (ab '…
Some Schemes - most notably Racket, which I use the most - allow for nested defines. Your code actually is a valid Racket code after polishing the differences in naming and syntax a bit: #lang racket (define-syntax-rule (defun name (arg ...) . body) (define (name arg ...) . body)) (define nil null) (define t #t) (defun ab (l) ;; "I'm too lazy to reverse the result back." (defun _ (l a b f) (if (null? l) (if f (list a…
Re: Practical Emacs Lisp
#47Earlier quoted context omitted.
Oh I wasn't arguing that CL loop was a far better solution than while loops (unless you process too long lists). I just became very very+ fond of academic recursive style. Here's a singly-linear variant for fixed steps. (defun ab (l) "I'm too lazy to reverse the result back." (defun _ (l a b f) (if (null l) (if f (list a b) (list b a)) (_ (cdr l) b (cons (car l) a) (not f)))) (_ l nil nil t)) (ab '()) (ab '(1)) (ab '…
Nested DEFUNs? Not in Lisp. In Common Lisp use LABELS for recursive local functions. I'd avoid recursive code like that as much as possible. I'd write: (defun ab (l) (loop while l collect (pop l) into a while l collect (pop l) into b finally (return (list a b))))
Your last example is nice. I had to read the CLHS loop to have a clue about linearity of multiple termination clauses though :)
ps: funny, while googling I even found some lisp checker with a rule about nested defuns (## define-lisp-pattern nested-defuns)
http://www.cs.northwestern.edu/academics/courses/325/program...
Re: Practical Emacs Lisp
#48Earlier quoted context omitted.
> The fact that he might or might not have trolled some mailing list is of no concern to me. It's not meaningless to me. > If you can find technical faults in this resource, you should provide them so the author can correct it and other might learn of them as well. We had extensive discussions with him for years. Literally thousands of posts can be found on comp.lang.lisp. The only Lisp he learned was some imperative…
> The only Lisp he learned was some imperative crappy style Not to be trolling myself, but I believe that's part of the "practical" aspect. You'll find much of the same in "Practical common lisp".
when he writes:
(let (a b c)
(setq a ...)
...
(setq b ...)
....)
That's basically the style of the past: (prog (a b c)
(setq a ...)
...)
With one difference: then it was usual to program control flows in Lisp with labels and gotos...Re: Practical Emacs Lisp
#49Earlier quoted context omitted.
The way to handle an unhelpful resource is to flag it. Even better would be to submit superior resources. The ad homenim is unproductive because it just makes people dumber and makes mean behavior look normal.
Xah Lee has trolled Lisp groups for years. It's well known that much of his 'advice' is useless. The number of bullshit posts by him is a bignum. His comp.lang.lisp trolling is legendary. Nothing 'ad homenim' or mean - just saying how it is.
I wanted to check this. How easy would it be to find something trolling-like, written by Xah? Turns out it took only 3 tries when searching for "Xah Lee" on googlegroups comp.lang.lisp. The third post I clicked revealed this gem:
there's a good solution to lisp's non-functional ways.
BAN lispers from using list or cons. Everything should be vector/array
instead.
everytime a cons is involved, lispers should get a electric shock.
that will immediately fix majority of lisp's non-functional programing
in practice.
though, i'll have to say, the more i read about Clojure, the better it
seems. It is very functional, the savior of the lisp name.
...I wasted a bit of time on this and I'm not sure it was worth it, but I'm pasting this here to strengthen lispm argument by replacing "it's well known" with a concrete example.Re: Practical Emacs Lisp
#50Earlier quoted context omitted.
Xah Lee has trolled Lisp groups for years. It's well known that much of his 'advice' is useless. The number of bullshit posts by him is a bignum. His comp.lang.lisp trolling is legendary. Nothing 'ad homenim' or mean - just saying how it is.
> It's well known that much of his 'advice' is useless. The number of bullshit posts by him is a bignum. I wanted to check this. How easy would it be to find something trolling-like, written by Xah? Turns out it took only 3 tries when searching for "Xah Lee" on googlegroups comp.lang.lisp. The third post I clicked revealed this gem: there's a good solution to lisp's non-functional ways. BAN lispers from using list or…