[Coco] XLISP!!!!!
Willard Goosey
goosey at virgo.sdc.org
Tue May 31 16:51:46 EDT 2011
On Tue, May 31, 2011 at 08:58:21PM +0100, Manny wrote:
> I would just use (setq) all of the time... But for local variables, you can
> use (let (var val) ... ) Hold on, let me check this works for Xlisp... Ack.
> No, it doesn't have a (let) function.
See, that's like (set) and (setq)! Did CL really need _another_ way to
do variable assignment?
It doesn't help that xlisp's error reporting isn't very detailed. You
type in some complicated function, it goes wrong somewhere, and xlisp
tells you there was an error in your function and spits the whole thing
back at you!
> As I'm still learning lisp, I've noticed you don't need an apostrophe in front
> of numbers. (Found this out by playing around a bit a couple of weeks ago.)
> As per your example below (setq bar '100) can be (setq bar 100). There are
> set rules for how and when to use the apostrophe, but I'm still learning them.
> There's gotta be somewhere online that tell us something...
Err, yeah, that makes sense. I'm starting to remember some things from
my "Principles of Programming Languages" class, but that was many snows
ago. Perhaps I'll re-read what the textbook had to say about lisp.
> Xlisp looks to be C-like with some of the functions. In Common Lisp (with
> recursion:)
> When I transfer that to Xlisp, I get a stack overflow with Xlisp1, but works
> fine for Xlisp2:
Well, xlisp1 is for Level 1, it has a truly tiny data allocation. Lisp
has always been a bit memory-hungry. It's extremely dynamic memory
allocation concept doesn't really mesh well with OS-9's strong belief in
static memory allocation.
Xlisp definetely does have a bit of C influence. To me, this isn't
entirely a bad thing as it looks a little-less alien than Common Lisp.
The C influence probably crept in because it was written in C.
I'm one of those people who strongly believe that the first program a
person writes in a new programming language is Hello World, so I like
that Xlisp freely admits to having regular I/O functions. :-)
>
> (defun first-w (num)
> (cond
> ((== num 0) 0)
> (t (princ num)
> (princ " ")
> (first-w (- num 1)))))
> I'm guessing a language like this is why they decided to do Common Lisp... :)
According to wikipedia, a number of embedded lisp's are decended from
xlisp so it's worth learning, even if it isn't Common Lisp. If you ever
need to hack up some fooLisp, you'll be, "Oh, this is just xlisp with
some custom vars and functions!"
Willard
--
Willard Goosey goosey at sdc.org
Socorro, New Mexico, USA
I search my heart and find Cimmeria, land of Darkness and the Night.
-- R.E. Howard
More information about the Coco
mailing list