Search found 64 matches

by qbg
Mon Oct 13, 2008 12:47 pm
Forum: Common Lisp
Topic: The library situation (warning: mini-rant)
Replies: 24
Views: 43194

Re: The library situation (warning: mini-rant)

Perhaps it is more of an issue with OS X; McCLIM builds for me under Linux, same with most of the ASDF-Install libraries I have, though sometimes in building I get an error and choosing the retry installation restart works. Additionally, for distributing software to end users, if you are sending the...
by qbg
Mon Oct 13, 2008 10:30 am
Forum: Common Lisp
Topic: Efficiency, Delayed Computation and Lambda
Replies: 3
Views: 8556

Re: Efficiency, Delayed Computation and Lambda

What will probably happen in most implementations is that the lambdas will become compiled closures, which a closure being simply a code vector and an environment. The code vector is going to be constant, so all what you are consing are the environments, which in most cases will probably not be too ...
by qbg
Mon Oct 13, 2008 10:23 am
Forum: Common Lisp
Topic: Tree expression shortener; seperator
Replies: 10
Views: 28680

Re: Tree expression shortener; seperator

What it seems that you want here are reader macros. The possible problem then is that it might make the underlying tree harder to see.
by qbg
Sun Oct 12, 2008 9:51 am
Forum: Common Lisp
Topic: How to convert this Scheme code ?
Replies: 4
Views: 10483

Re: How to convert this Scheme code ?

[edit] SBCL gave quite unhelpful (to a newbie like myself, anyway) advice as well... is debugging Lisp always so tricky? Are you talking about something like this for PAIR-POW (from the first post)? ; in: LAMBDA NIL ; ((RESULT (PAIR-POW P (TRUNCATE (/ N 2))))) ; ; caught ERROR: ; illegal function c...
by qbg
Sat Oct 11, 2008 12:55 pm
Forum: Common Lisp
Topic: Please help my head get around 'deftype'
Replies: 23
Views: 42677

Re: Please help my head get around 'deftype'

For functions you could do something like this: (defmacro defun* (name limited-lambda-list &body body) "Like defun, but saves type information. Special lambda lists (&optional, &key, etc.) not supported Lambda list treated like that of defmethod; ((integer a) b (integer c)) would yi...
by qbg
Fri Oct 10, 2008 10:41 am
Forum: Common Lisp
Topic: Beginner question
Replies: 4
Views: 9881

Re: Beginner question

Jasper wrote:]
Hmm, is there an read-integer-from-string and such? (year "'hax0519") -> 'HAX ; 4
Function PARSE-INTEGER
by qbg
Mon Oct 06, 2008 9:29 pm
Forum: Common Lisp
Topic: How to turn function into a list?
Replies: 11
Views: 24223

Re: How to turn function into a list?

In the CL reference appendix, I found a function that can change a function into a list of strings format: (defun h(x) (* 2 x)) H CL-USER> (function-lambda-expression 'h) (LAMBDA (X) (DECLARE (SYSTEM::IN-DEFUN H)) (BLOCK H (* 2 X))) #(NIL NIL NIL NIL ((DECLARATION OPTIMIZE DECLARATION))) H CL-USER>...
by qbg
Mon Oct 06, 2008 7:34 pm
Forum: Common Lisp
Topic: Poll: Which Lisp implementations do you use?
Replies: 32
Views: 93591

Re: Poll: Which Lisp implementations do you use?

I just tried out ClozureCL on Linux-x86 (from trunk), and I like it so far. Compiler is fast, the code produced in reasonably fast, smaller initial image than SBCL. After loading McCLIM and the demos, ROOM showed it was using only ~28 megs (while SBCL would use ~56 megs). The output from some of its...
by qbg
Sat Oct 04, 2008 4:21 pm
Forum: Common Lisp
Topic: How to turn function into a list?
Replies: 11
Views: 24223

Re: How to turn function into a list?

Thanks Dan, Having browsed through 'Painters and Hackers' by Paul Graham I decided to try Lisp and picked up 'Ansi Common Lisp' by PG. I was excited to read in the first chapter about Lisp programming being 'real time.' What I took that to probably mean, was something like being able to use the REP...
by qbg
Sun Sep 28, 2008 1:57 pm
Forum: Common Lisp
Topic: Please help my head get around 'deftype'
Replies: 23
Views: 42677

Re: Please help my head get around 'deftype'

You can do #1 with a SATISFIES type. You create a predicate function, say something-list-p, then the type would be (satisfies something-list-p).

Unfortunately, it probably wouldn't help the compiler and it has to run the function each time you want to check an object for that type...