Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 28 |
Nodes: | 6 (0 / 6) |
Uptime: | 43:41:10 |
Calls: | 422 |
Calls today: | 1 |
Files: | 1,024 |
Messages: | 90,185 |
From my recent postings in other newsgroups: A generator for
a Mandelbrot set image written in a LISP similar to the HG LISP I used
in 1981 on my Pet 2001 as I remember it.
[extract kept as example, rest snipped]
(SETQ MANDELBROT
(LAMBDA (X Y)
(PROGN
(SETQ C 126)
(SETQ Z (LIST X Y))
(SETQ A Z)
(SETQ ITERATE
(LAMBDA ()
(COND ((OR (< C 32) (> (CABS Z) 2))
(- 126 C))
(T
(PROGN
(SETQ TEMP-CMUL (CMUL Z Z))
(SETQ TEMP-CADD (CADD A TEMP-CMUL))
(SETQ Z TEMP-CADD)
(SETQ C (- C 1))
(ITERATE))))))
(ITERATE))))
I was never a fan of “parenthesis pileup” layout. Try this for comparison:
(SETQ MANDELBROT
(LAMBDA (X Y)
(PROGN
(SETQ C 126)
(SETQ Z (LIST X Y))
(SETQ A Z)
(SETQ ITERATE
(LAMBDA ()
(COND
((OR (< C 32) (> (CABS Z) 2))
(- 126 C)
)
(T
(PROGN
(SETQ TEMP-CMUL (CMUL Z Z))
(SETQ TEMP-CADD (CADD A TEMP-CMUL))
(SETQ Z TEMP-CADD)
(SETQ C (- C 1))
(ITERATE)
) ; PROGN
)
) ; COND
) ; LAMBDA
) ; ITERATE
(ITERATE)
) ; PROGN
) ; LAMBDA
) ; MANDELBROT
Eww!
Turns out it’s a bit strange: you have to position the cursor *on* an opening parenthesis in order for it to highlight the corresponding closer, but *after* the closing parenthesis for it to highlight the corresponding opener.
Turns out it’s a bit strange: you have to position the cursor *on* an
opening parenthesis in order for it to highlight the corresponding closer, >> but *after* the closing parenthesis for it to highlight the corresponding
opener.
Actually, "point" is never "on" a character, it's always between characters. So in both cases "point" needs to be outside of the parenthesis.
It's perfectly symmetrical.
It's just that the cursor by default is a block drawn on the character
that follows the actual placement of "point". Try to switch to a bar
cursor and that should be more clear.
Turns out it’s a bit strange: you have to position the cursor *on* an
opening parenthesis in order for it to highlight the corresponding
closer, but *after* the closing parenthesis for it to highlight the
corresponding opener.
Actually, "point" is never "on" a character, it's always between
characters. So in both cases "point" needs to be outside of the
parenthesis.
It's just that the cursor by default is a block drawn on the character
that follows the actual placement of "point". Try to switch to a bar
cursor and that should be more clear.