Deutsch   English   Français   Italiano  
<utip2g$2i1dd$3@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Lawrence D'Oliveiro <ldo@nz.invalid>
Newsgroups: comp.os.linux.advocacy
Subject: Re: Why Python When There Is Perl?
Date: Fri, 22 Mar 2024 02:06:08 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <utip2g$2i1dd$3@dont-email.me>
References: <17be420c4f90bfc7$63225$1585792$802601b3@news.usenetexpress.com>
	<utd86u$1ipcj$1@solani.org> <86sf0l9h6c.fsf@yaxley.in>
	<l622deFn16lU7@mid.individual.net> <utgk8t$21nsq$7@dont-email.me>
	<l64616F2m1hU2@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 22 Mar 2024 02:06:08 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1d2811be6c706a5fb413e03faa778213";
	logging-data="2688429"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+GN7iASOySanZpd73FPRT6"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:mvZ3PEopYoRWPVsermCv73evo4g=
Bytes: 2810

On 22 Mar 2024 01:43:02 GMT, rbowman wrote:

> As I worked through the exercises I was mentally
> calculating how I would do it in C.

C doesn’t put call frames on the heap, or even allow nested functions
(as standard), so I don’t know how you would handle closures.

> If you want to talk about lexical oddities, there's the 73 stacked up
> parens.

I keep them straight by indentation, e.g.

(defun convert-to-region-codes (beg end)
    "converts alphabetic characters in the selection to “region indicator symbols”."
    (interactive "*r")
    (unless (use-region-p)
        (ding)
        (keyboard-quit)
    ) ; unless
    (let
        (
            deactivate-mark
            (intext (delete-and-extract-region beg end))
            c
        )
        (dotimes (i (- end beg))
            (setq c (elt intext i))
            (cond
                ((and (>= c ?A) (<= c ?Z))
                    (setq c (+ (- c ?A) #x1F1E6))
                )
                ((and (>= c ?a) (<= c ?z))
                    (setq c (+ (- c ?a) #x1F1E6))
                )
            ) ; cond
            (insert-char c)
        ) ; dotimes
    ) ; let
) ; convert-to-region-codes

What makes this sort of idiosyncrasy worthwhile is a thing called
“homoiconicity”. It’s a pretty cool feature, though not obvious at
first sight.

> I shouldn't be so snotty.

No problem. Your impressions are all too common among those new to
Lisp.

> After all I used Forth back in the day and threaded interpreted
> languages are a wonder to behold.

Now there is something that is nowadays only fit to be in a museum ...