0224: "LISP"

This forum is for the individual discussion thread that goes with each new comic.

Moderators: Moderators General, Magistrates, Prelates

Re: Neato

Postby riley » Fri Feb 16, 2007 10:21 pm UTC

khmer wrote:
space_raptor wrote:Well, the cool drawing makes up for the obscure (to some of us) subject.

I have no experience with LISP. Anyone care to briefly summarize why it's so good?

Also, I think it would be really cool if the speed of light was a lot slower, but still the same relative to everything else. You could turn on a light and watch the light crawl across the room. Tres cool.


How would you see the light before it arrived at your eyes?


You wouldn't, but you would still see it crawl across the room after it arrived at your eyes..

and you could practically stop time (in front of you) by taking a step backwards. Sweet.
riley
 
Posts: 16
Joined: Sat Jan 13, 2007 12:39 am UTC

Postby Tacroy » Fri Feb 16, 2007 10:24 pm UTC

An appropriate quote in reference to the alt text:
Jamie Zawinski wrote:Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.

Probably explains why the Standard Model is so kludgy.
Tacroy
 
Posts: 5
Joined: Mon Sep 04, 2006 5:51 am UTC

Re: Neato

Postby Yakk » Fri Feb 16, 2007 10:35 pm UTC

space_raptor wrote:I have no experience with LISP. Anyone care to briefly summarize why it's so good?


LISP belongs to the family of languages known as "functional".

The idea of a functional language is it consists of functions that take arguements and return results. The genius is that the functions, by default, don't have side effects.

If a function doesn't have side effects, then if you evaluate the same function more than once on the same arguements, you should be guaranteed to get exactly the same answer.

A LISP program is a function that is evaluated.

In comparison, a procedural language is about statements that change the machine state. Nearly every statement modifies some external state (ie, x=5; changes the value stored in x), and your program tries to describe what steps need to be taken to solve the problem.

The rules that bind a LISP function are important -- because the result of a pure functional function call are determined only by the arguements, you can cache the results of every pure functional function. Not only that, because the results don't depend on anything except the arguements, you can parallelize any two function calls that aren't feeding their result into each other.

Doing this in procedural languages is considered hard enough that modern compiler writers don't do it. The closest I've seen is pragma preprocessing directives -- and they essentially explicitly tell the compiler exactly what kinds of cacheing and parallelization can be done.

...

Now don't get me wrong. That isn't the only reason why functional languages are cool. For one thing, LISP isn't purely functional.

So what else is cool about LISP in particular?

LISP is a list processor. Everything is a list, or a list of lists, or a list of lists of lists. Well, actually everything is a binary tree which is usually interpited as a list.

The LISP engine interprits your code. It is quite common to write interpriters that run in the LISP engine and interprit other lists -- and LISP is designed so that this works.

LISP doesn't "natively" support iteration. Instead, tail-end recursion is done, and the compiler is smart enough to optimize it out.

...

Note that some of the above claims about LISP may be about some varient of Scheme. It has been a while, and I may have mixed up features of the two languages.

In short: LISP is cool because it is an example of one of the 3 fundamental ways to program a computer effectively (declariative, procedural and functional). LISP is cool because it is a list processing language, and language-symbols can be manipulated within the language itself. LISP is cool because it descends from a nigh-assembly language on the PDP-11, an early computer -- it is a functional assembly! LISP is cool because it contains many ideas that can be used to make other programming languages infintely more powerful.

And finally LISP is cool because it makes you think about programming differently than many other languages. If you haven't written a program in make/prolog, C++/Java, and Haskall/LISP (3 categories, each with a pair of examples) you probably have a really slanted idea about what programming can be about.

Finally, LISP is cool because it stands for Lost In Several Parethesis, which describes debugging the code. :)
User avatar
Yakk
 
Posts: 10036
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Postby Oort » Fri Feb 16, 2007 11:07 pm UTC

Maybe Star Trek or Dune would be a better source of obscure references.

Not that there's anything wrong with the nonobscure. 2001 was awesome.
User avatar
Oort
 
Posts: 522
Joined: Fri Sep 29, 2006 10:18 pm UTC

Postby nahtanoj999 » Fri Feb 16, 2007 11:41 pm UTC

The God I know uses C++
User avatar
nahtanoj999
 
Posts: 36
Joined: Fri Feb 16, 2007 11:23 pm UTC

Postby FiddleMath » Sat Feb 17, 2007 12:11 am UTC

I think the point "language symbols can be manipulated directly" should be emphasized here, a lot. In Lisp, every function call is of the form (function-name arg-1 arg-2 ... ). (A few things are shorthand for this, but this is generally true.)

But functions aren't the only things that you can supply as the first element of a Lisp form; oh no. The first element can also be a macro. Lisp macros are not like, say, C preprocessor macros, which do simple text replacement. Lisp macros are elements of the language itself. When you code a Lisp macro, you're actually giving instructions about how to process the form begun by that macro when encountered later in the program. These instructions may use the full power of the language itself upon the language - effectively, you can automatically bootstrap any language features you want to have, and make them a library.

If you have ever tried to hack features into another language, and you then later learn Lisp, this is a sun-appearing-from-behind-clouds, trumpets-blowing-and-angels-singing revelation.
User avatar
FiddleMath
 
Posts: 245
Joined: Wed Oct 11, 2006 7:46 am UTC
Location: Madison, WI

Postby 3.14159265... » Sat Feb 17, 2007 12:21 am UTC

It was kinda hard to understand how a speech impediment was assumed to be the language from which the universe was made of, and more confusingly that god says nah we made it outa shiny spherical things.

Then I read this forum, and realized I was computer illiterate.
"The best times in life are the ones when you can genuinely add a "Bwa" to your "ha""- Chris Hastings
User avatar
3.14159265...
Irrational (?)
 
Posts: 2413
Joined: Thu Jan 18, 2007 12:05 am UTC
Location: Ajax, Canada

Postby John DeSavage » Sat Feb 17, 2007 12:28 am UTC

"My God... It's full of 'cars'"

With this joke, I believe you have singlehandedly optimized the Qwantz Equation

I salute you, sir.
John DeSavage
 
Posts: 24
Joined: Sat Feb 17, 2007 12:21 am UTC

Postby John DeSavage » Sat Feb 17, 2007 12:50 am UTC

Hmm.. on second though, the set of people who can quote 2001 and the set of people who know LISP probably have a large intersection. Maybe a joke about LISP and, uh... monster trucks would be better.

...

I tried to resist typing "or women", but failed.
John DeSavage
 
Posts: 24
Joined: Sat Feb 17, 2007 12:21 am UTC

Postby tylerni7 » Sat Feb 17, 2007 1:37 am UTC

It was kinda hard to understand how a speech impediment was assumed to be the language from which the universe was made of, and more confusingly that god says nah we made it outa shiny spherical things.


Well in all fairness, the programming language is Perl, and the shiny things are Pearls.
tylerni7
 
Posts: 70
Joined: Tue Oct 03, 2006 10:51 pm UTC
Location: Wouldn't you like to know you crazy stalker

Great

Postby rbnn » Sat Feb 17, 2007 1:43 am UTC

One of the most brilliant and funny single comics ever.
rbnn
 
Posts: 5
Joined: Tue Jan 02, 2007 8:36 pm UTC

Postby bugmenot » Sat Feb 17, 2007 2:55 am UTC

If you have ever tried to hack features into another language, and you then later learn Lisp, this is a sun-appearing-from-behind-clouds, trumpets-blowing-and-angels-singing revelation.

*COUGH* Forth *COUGH*
bugmenot
 
Posts: 17
Joined: Wed Dec 27, 2006 7:22 am UTC

Postby Pau! » Sat Feb 17, 2007 6:40 am UTC

lani wrote:For a good part of this comic, I thought he was referring to the speech impediment.


Me too :(

I was very confused.

And, to be totally honest, I still don't get it.
"Materialism and vanity are tools of youth and fear. We'll grow up. " Sarah Lyons
User avatar
Pau!
Dutiful Sycophant
 
Posts: 213
Joined: Wed Sep 06, 2006 2:20 am UTC
Location: Ottawa

Postby screech » Sat Feb 17, 2007 8:02 am UTC

Oort wrote:Maybe Star Trek or Dune would be a better source of obscure references.

Not that there's anything wrong with the nonobscure. 2001 was awesome.


Is it really that nonobscure? I'm pretty sure it's not in the movie...

Maybe it's the type of person on this forum...
alitheiapsis wrote:HEY NOW DON'T TALK SHIT ABOUT BRONTOSAURUSES
User avatar
screech
 
Posts: 200
Joined: Wed Feb 07, 2007 5:20 am UTC

Re: Neato

Postby DuSTman » Sat Feb 17, 2007 1:20 pm UTC

riley wrote:and you could practically stop time (in front of you) by taking a step backwards. Sweet.


The problem with that is that if light were so slow you could "stop" it by walking backwards, you'd keep walking into people because they were closing on you quicker than the light they give off.
User avatar
DuSTman
 
Posts: 192
Joined: Sat Nov 04, 2006 7:11 am UTC
Location: Lancaster, UK

Postby Fieari » Sat Feb 17, 2007 8:03 pm UTC

The question is, if it's full of 'car's, is it ALSO full of 'cdr's, or does God prefer the former to the latter? Is the universe weighted more heavily in one direction than the latter?
Surely it is as ridiculous to consider sqrt(-1) "imaginary" because you can't use it to count pieces of chalk as to consider the number 200 imaginary because by itself it cannot express the location of one point with reference to another. -Isaac Asimov
Fieari
 
Posts: 86
Joined: Mon Jan 29, 2007 2:16 am UTC

Postby SpitValve » Sat Feb 17, 2007 8:08 pm UTC

If light went at 1 m/s, and special relativity wasn't broken, then you could run around however you wanted without breaking anything. No matter how hard you pushed you wouldn't go faster than 1 m/s, but everything else would contract, allowing you to go places faster...
User avatar
SpitValve
Not a mod.
 
Posts: 5105
Joined: Tue Sep 26, 2006 9:51 am UTC
Location: I got Seoul

Postby Pathway » Sat Feb 17, 2007 8:38 pm UTC

SpitValve wrote:If light went at 1 m/s, and special relativity wasn't broken, then you could run around however you wanted without breaking anything. No matter how hard you pushed you wouldn't go faster than 1 m/s, but everything else would contract, allowing you to go places faster...


But no one else would see you go any faster than 1 m/s. When you arrived and decelerated, so much time would have passed that it would be pointless to be wherever you were.
User avatar
Pathway
Leon Sumbitches...?
 
Posts: 647
Joined: Sun Oct 15, 2006 5:59 pm UTC

Postby Andrew » Sat Feb 17, 2007 9:16 pm UTC

Pathway wrote:
SpitValve wrote:If light went at 1 m/s, and special relativity wasn't broken, then you could run around however you wanted without breaking anything. No matter how hard you pushed you wouldn't go faster than 1 m/s, but everything else would contract, allowing you to go places faster...


But no one else would see you go any faster than 1 m/s. When you arrived and decelerated, so much time would have passed that it would be pointless to be wherever you were.


I'm sure society would adjust to cope.
User avatar
Andrew
 
Posts: 619
Joined: Tue Jan 02, 2007 9:59 pm UTC
Location: Manchester, UK

Postby Pathway » Sat Feb 17, 2007 10:57 pm UTC

I think we'd all die. Because, come to think of it, wouldn't any food you tried to eat be rotted away before you could get to it? This is assuming chemical processes would proceed at their normal rate. But if they didn't, you'd also be screwed.
User avatar
Pathway
Leon Sumbitches...?
 
Posts: 647
Joined: Sun Oct 15, 2006 5:59 pm UTC

Postby sskroeder » Sat Feb 17, 2007 11:24 pm UTC

NB: i know no LISP -- only 'enjoyed' Haskell

I get that "My God - It's full of 'car's " is a reference to 2001 -- but i don't get it -- what is "cars" refering to...

Is CARs something important in LISP or ?

Can somebody please elaborate ?
sskroeder
 
Posts: 2
Joined: Sat Feb 17, 2007 11:20 pm UTC

Postby Toeofdoom » Sun Feb 18, 2007 1:47 am UTC

Pathway wrote:I think we'd all die. Because, come to think of it, wouldn't any food you tried to eat be rotted away before you could get to it? This is assuming chemical processes would proceed at their normal rate. But if they didn't, you'd also be screwed.


so you run up to a tree with fruit on it. and if everyone and everything happens to die, you just run around in circles until new edible things evolve. society would work fine, just in a different way. or if the food happened to be moving too, it would be fine.
Hawknc wrote:Gotta love our political choices here - you can pick the unionised socially conservative party, or the free-market even more socially conservative party. Oh who to vote for…I don't know, I think I'll just flip a coin and hope it explodes and kills me.

Website
User avatar
Toeofdoom
The (Male) Skeleton Guitarist
 
Posts: 3444
Joined: Wed Jan 10, 2007 10:06 am UTC
Location: Melbourne, Australia

Postby Fieari » Sun Feb 18, 2007 2:03 am UTC

sskroeder wrote:NB: i know no LISP -- only 'enjoyed' Haskell

I get that "My God - It's full of 'car's " is a reference to 2001 -- but i don't get it -- what is "cars" refering to...

Is CARs something important in LISP or ?

Can somebody please elaborate ?


LISP, standing either for LISt Processing or Lots of Irritating Stupid Parenthesis, depending on who you ask, is based around... well, lists. Singly Linked lists, if you know the term from a CompSci class. "car" accesses the data element at the current pointer (so to speak), while "cdr" accesses the next pointer. This isn't the best way to describe it. Generally, you think of CAR as being the first element of the list, and CDR as being everything else. A series of CDRs will get you out to the middle of the list, and a CAR will access the element, which may be another list, which you'll CDR through to find what you want, and then CAR to get it, and so on.
Surely it is as ridiculous to consider sqrt(-1) "imaginary" because you can't use it to count pieces of chalk as to consider the number 200 imaginary because by itself it cannot express the location of one point with reference to another. -Isaac Asimov
Fieari
 
Posts: 86
Joined: Mon Jan 29, 2007 2:16 am UTC

Postby kertrats » Sun Feb 18, 2007 2:30 am UTC

In other words...

if you have a list:

Code: Select all
(define ls '(3 4 cat -1 (63 drives (cat) 4) cat (four)))
; forgive me if the syntax isn't exactly right, it's been awhile


And you want to get out the string "drives", you'll say:

Code: Select all
(cadaddddr ls) --> drives


which is short for:

Code: Select all
(car (cdr (car (cdr (cdr (cdr (cdr ls)))))))
kertrats
 
Posts: 36
Joined: Fri Nov 17, 2006 5:46 am UTC

Re: Neato

Postby EvanED » Sun Feb 18, 2007 5:15 am UTC

Yakk wrote:
space_raptor wrote:I have no experience with LISP. Anyone care to briefly summarize why it's so good?


(The following appeared near the bottom of the previous message --Evan)
Note that some of the above claims about LISP may be about some varient of Scheme. It has been a while, and I may have mixed up features of the two languages.


In fact, most of what you said applies a lot more to Scheme than to Common Lisp. However, the two languages are close enough that there is still a lot of common ground.

(In addition, there are sort of two main philosophies about how to teach CS. Many universities teach Java or C++, but some (including most of the "better" ones) teach either Lisp or (at least in CMU's case) ML. In the universities that teach Lisp, I think it's nearly universal that they use Scheme rather than Common Lisp, and the usual textbook for this course emphasizes the functional programming components of Scheme even more than Scheme itself does.)

(snip)

The rules that bind a LISP function are important -- because the result of a pure functional function call are determined only by the arguements, you can cache the results of every pure functional function. Not only that, because the results don't depend on anything except the arguements, you can parallelize any two function calls that aren't feeding their result into each other.

Doing this in procedural languages is considered hard enough that modern compiler writers don't do it. The closest I've seen is pragma preprocessing directives -- and they essentially explicitly tell the compiler exactly what kinds of cacheing and parallelization can be done.


Of course, it's not entirely clear that this is indeed a benefit, because it's at least sometimes the case that allowing mutation could open up algorithms that run faster than ones that are not allowed to mutate.

In fact, FiddleMath and maybe someone else linked to the book Practical Common Lisp in last comic's thread, and that says in the intro that characterizing at least Common Lisp as functional is somewhat of a misnomer, and that writing code with side effects is not uncommon. (It also says that some other dialects, such as Scheme, put much more emphasis on the functional aspects, and actively discourage non-functional programming for at least a lot of tasks.)

LISP is a list processor. Everything is a list, or a list of lists, or a list of lists of lists. Well, actually everything is a binary tree which is usually interpited as a list.


This isn't necessarily true. Common Lisp has arrays (called vectors), strings, hash tables, and other similar data structures just like any other language.

Again, Scheme seems to emphasize lists more than other dialects, and doesn't seem to come with hash tables. (It does have vectors though.)

The LISP engine interprits your code.


Lisp code can be (and often is) compiled.

It is quite common to write interpriters that run in the LISP engine and interprit other lists -- and LISP is designed so that this works.


The point here is that you can make what looks like a new language in lists, and because the parsing of those lists is built into the Lisp environment, processing these lists is made very easy.

LISP doesn't "natively" support iteration. Instead, tail-end recursion is done, and the compiler is smart enough to optimize it out.


Both Common Lisp and Scheme support iteration directly. Scheme has the "do" macro, and Common Lisp has a large number of loop forms. (Though again, Scheme and the common sources for learning it, de-emphasize things like loops.)

(Compilers for traditional languages will also optimize tail recursion, so this isn't so much a benefit of Lisp. It's probably still worth pointing out though because it's used a lot more in functional or functionalish languages because you do a lot more recursion than in imperative programming.)
EvanED
 
Posts: 3765
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Postby EvanED » Sun Feb 18, 2007 5:30 am UTC

To throw my hat into the ring, I would list two main benefits to Lisp:

1. Macros give you flexibility not present in any other language I've seen. It's heads and shoulders above C++ (the next highest contender in this area), which itself is noticeably above anything else I know. See FiddleMath's post for a good description about macros.

2. The syntax is, for the most part, pretty easy. It took over 5 years from the standardization of C++ until a compiler claimed full compliance with the standard. In fact, there is STILL only the one compiler that claims full compliance.* The parts of Scheme I've seen are a lot cleaner than Common Lisp, to the point where you can show someone most of the syntax and semantics they'll use of Scheme in a day, and it's possible to write an interpreter for this subset of Scheme on a couple pages. (Granted, if you write it in Lisp there is already a LOT of work done for you, but it still should serve to illustrate simplicity.) This is one of the reasons why I think it's as popular at colleges as it is; you can spend your time trying to teach programming rather than teaching people C++ or Java syntax at the same time. It allows you to isolate the steps.



* The major sticking point is something called 'export', which gives the illusion ("illusion" being a key word) of separate compilation for templates. There are two compilers that support it. One is Comeau's compiler (the one I mentioned above), the other is Intel's. Intel's compiler disables support by default and makes you enable it with a command line flag, classifying it as a highly-experimental feature. Both compliers use the same front end, made by the company EDG. EDG has said that implementing 'export' took more time than implementing the entire Java front end they offer.

Edit: google "Beating the Averages" for an essay by a guy named Paul Graham for what he says about Lisp. Some parts of the essay I find obnoxious, but it's probably worth reading.
EvanED
 
Posts: 3765
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Postby william » Sun Feb 18, 2007 5:53 pm UTC

EvanED wrote:Edit: google "Beating the Averages" for an essay by a guy named Paul Graham for what he says about Lisp. Some parts of the essay I find obnoxious, but it's probably worth reading.

http://www.paulgraham.com/avg.html
Also, most of Paul's other essays are also worth reading.
SexyTalon wrote:A pile of shit can call itself a delicious pie, but that doesn't make it true.
User avatar
william
Not a Raptor. Honest.
 
Posts: 2418
Joined: Sat Oct 14, 2006 5:02 pm UTC
Location: Chapel Hill, NC

Postby Yakk » Mon Feb 19, 2007 6:17 pm UTC

Thanks Evan. :)

I remembered one of the two had a manual the size of a phone book (LISP), and the other had a manual the size of a magazine (Scheme), but couldn't remember which was which.

What I took most from my exposure was
1> The language letting you rewrite the language is a good thing.
2> Restrictions on what a chunk of code is allowed to do, that the language can understand let the language do really powerful things.

Edit: for grammer and seplling
Last edited by Yakk on Thu Feb 22, 2007 7:56 pm UTC, edited 1 time in total.
User avatar
Yakk
 
Posts: 10036
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Postby EvanED » Mon Feb 19, 2007 9:35 pm UTC

Yakk wrote:Thanks Evan. :)

I remembered one of the two had a manual the size of a phone book (LISP), and the other had a manual the size of a magasize (Scheme), but couldn't remember which was which.


Yeah, Common Lisp is the big one. ;-)

(And reading Practical Common Lisp... it's a lot uglier a language than the impression I had of it. There's a fair amount of undefined parts and inconsistencies.)

What I took most from my exposure was
1> The language letting you rewrite the language is a good thing.
2> Restrictions on what a chunk of code that the language can understand let the language do really powerful things.


Quoted for truth. ;-)
EvanED
 
Posts: 3765
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Postby space_raptor » Fri Feb 23, 2007 3:00 pm UTC

EvanED, Yakk, FiddleMath, Fieari-

Thanks guys.

"car" accesses the data element at the current pointer

Ohhhhhhhhhhhhh.

It's full of "cars".

Heh.
User avatar
space_raptor
 
Posts: 1497
Joined: Fri Nov 17, 2006 5:02 pm UTC
Location: Calgary

Postby smocc » Fri Feb 23, 2007 4:51 pm UTC

You're all wrong. God programs like Mel
Dogs with diabetes need less love
User avatar
smocc
 
Posts: 78
Joined: Mon Feb 12, 2007 4:26 pm UTC
Location: New Delhi, India

Postby william » Fri Feb 23, 2007 8:50 pm UTC

smocc wrote:You're all wrong. God programs like Mel

Only Satan programs that way.
SexyTalon wrote:A pile of shit can call itself a delicious pie, but that doesn't make it true.
User avatar
william
Not a Raptor. Honest.
 
Posts: 2418
Joined: Sat Oct 14, 2006 5:02 pm UTC
Location: Chapel Hill, NC

Postby pinguis » Sat Feb 24, 2007 12:45 am UTC

screech wrote:
Oort wrote:Maybe Star Trek or Dune would be a better source of obscure references.

Not that there's anything wrong with the nonobscure. 2001 was awesome.


Is it really that nonobscure? I'm pretty sure it's not in the movie...

Maybe it's the type of person on this forum...

Its not on 2001, its on 2010, the second movie in the series.

See http://imdb.com/title/tt0086837/quotes
pinguis
 
Posts: 1
Joined: Sat Feb 24, 2007 12:37 am UTC

Re: Neato

Postby Bulletmagnet » Sun Feb 25, 2007 10:02 pm UTC

Yakk wrote:
space_raptor wrote:I have no experience with LISP. Anyone care to briefly summarize why it's so good?


LISP belongs to the family of languages known as "functional".

The idea of a functional language is it consists of functions that take arguments and return results. The genius is that the functions, by default, don't have side effects.

(snip...)


Another genius is that functions can return functions. I think they call it "macros".

Disclaimer: I'm a C++/Perl/make wrangler, but when a colleague scratched the surface of Lisp for me I remember the "oooooooh" feeling when I grokked just a tiny bit of what it can do.
Bulletmagnet
 
Posts: 4
Joined: Sun Feb 25, 2007 9:48 pm UTC

Re: Neato

Postby improbable » Mon Feb 26, 2007 2:04 am UTC

Bulletmagnet wrote:
Yakk wrote:
space_raptor wrote:I have no experience with LISP. Anyone care to briefly summarize why it's so good?


LISP belongs to the family of languages known as "functional".

The idea of a functional language is it consists of functions that take arguments and return results. The genius is that the functions, by default, don't have side effects.

(snip...)


Another genius is that functions can return functions. I think they call it "macros".

Disclaimer: I'm a C++/Perl/make wrangler, but when a colleague scratched the surface of Lisp for me I remember the "oooooooh" feeling when I grokked just a tiny bit of what it can do.


You have two separate ideas there.

1. Functions can return functions. In Lisp, functions are data, just like lists, or atoms, and can be put into a function or returned from a function just like any other type of argument.

So, for example, if you had a function that did something to an argument (square root, maybe), and you wanted to apply it to an entire list, you could do it to an entire list by passing it into a function:
Code: Select all
(defun map-list (fn lst) (apply fn lst))


2. Macros, in the simplest way, are code that writes code. When Lisp code gets compiled or interpreted and it sees a macro, it expands the macro (recursively, so macros can contain macros), until all you have is ordinary code, which is evaluated. It's really hard to explain, but once you realize how awesome and powerful it can be, you start to wonder why anyone uses anything else. Then you remember the parenthesis :)
User avatar
improbable
 
Posts: 5
Joined: Sat Oct 21, 2006 7:15 am UTC

Previous

Return to Individual XKCD Comic Threads

Who is online

Users browsing this forum: AluisioASG, Arky, ChronosDragon, fatness, HAL9000, jjjdavidson, Lardy Plans, MobTeeseboose, pelrigg, Pfhorrest, sgkct5844, Sighclops, Smithers, yappobiscuits and 23 guests

cron