Search found 41 matches

by dlweinreb
Sat May 08, 2010 9:29 am
Forum: Common Lisp
Topic: can we search 2 lists at a time?
Replies: 6
Views: 8414

Re: can we search 2 lists at a time?

I'm not sure I understand what's going on here, but if you want dolist to iterate over list a, and then if it's still iterating, iterate over list b, you can usually do:

(dolist (var (append list-1 list-2))
.. body ..)
by dlweinreb
Sat May 08, 2010 9:26 am
Forum: Common Lisp
Topic: let bindings & lambda expressions
Replies: 7
Views: 9003

Re: let bindings & lambda expressions

The basic idea for evaluating a "let" (of one variable, just to keep it simple) is: first, evaluate the init form, in the current environment, and call the result R. Then, make the variable, and make its value be R. So the variable has not yet been created/bound while the init form is bein...
by dlweinreb
Sat May 08, 2010 9:21 am
Forum: Common Lisp
Topic: Deriving classes from two, both derived from one same class
Replies: 4
Views: 6587

Re: Deriving classes from two, both derived from one same class

Yes, it's OK for C to inherit from both A+ and B. He will not "get A twice". He will only get A once. This scenario is usually known as the "diamond pattern", by the way, because of the shape that you get when you diagram it. Now, if all these guys define a method called "m&...
by dlweinreb
Sat May 08, 2010 9:17 am
Forum: Common Lisp
Topic: Multiple ways of doing things
Replies: 4
Views: 6233

Re: Multiple ways of doing things

Frankly, I'm having trouble understanding your examples; I don't understand what they're trying to do. I think you need to expand them more, give some examples of USES of the functions and macros you're defining. However, if your point is just that there are a lot of ways to do things in Common Lisp...
by dlweinreb
Sat May 08, 2010 9:11 am
Forum: Common Lisp
Topic: Using a special readtable for a library
Replies: 5
Views: 7097

Using a special readtable for a library

Suppose I want to write a Lisp library, that's in its own package, and uses its own readtable. I want to be able to load it into Lisp without breaking other packages. So I don't want to simply set *readtable*. Surely there mut be some kind of standard/idiomatic way to do this in Common Lisp? (I have...
by dlweinreb
Sun Jan 31, 2010 8:54 am
Forum: Common Lisp
Topic: I dont get Macros
Replies: 31
Views: 40778

Re: I dont get Macros

The best explanation of macros that I know of is from Practical Common Lisp. See the chapter on writing your own macros, at http://gigamonkeys.com/book/macros-defining-your-own.html . Macros are very different from functions. They are a way to write language extensions and domain-specific languages ...
by dlweinreb
Mon Apr 13, 2009 8:44 pm
Forum: The Lounge
Topic: Thank you.
Replies: 22
Views: 43747

Re: Thank you.

Allow me to join the chorus: thank you! comp.lang.lisp has served well over the years, but it's decaying due to spam, and having a forum structure makes information much more accessible.
by dlweinreb
Mon Apr 13, 2009 8:44 pm
Forum: Common Lisp
Topic: The Future of Lisp
Replies: 25
Views: 41214

Re: The Future of Lisp

Actually he does mention Lisp by name, but what he says is that it was the first "functional programming language". It depends what you mean by "functional", but if you mean no side effects or something like that, well, you could sure do a lot more without side effects than you c...
by dlweinreb
Mon Apr 13, 2009 8:42 pm
Forum: Common Lisp
Topic: Rant: lisp is not C. Get over it.
Replies: 47
Views: 224795

Re: Rant: lisp is not C. Get over it.

By the way, I'd like to respectfully point out that using a sarcastic tone to answer questions from beginners is not such a good idea. One of the reasons people are repelled from using Lisp is that they get the feeling that the community is hostile and unhelpful. I think that's only rarely true (exc...
by dlweinreb
Mon Apr 13, 2009 8:42 pm
Forum: Common Lisp
Topic: A good criticism of the comon lisp language(?)
Replies: 16
Views: 26414

Re: A good criticism of the comon lisp language(?)

@nuntius: When you say "not quite false", I'm not sure what you mean. The reason I set up a separate site was that I had the idea that the conference could have its own site that would act as an extended part of the conference itself. I was hoping that a bunch of active threads would be se...