Search found 406 matches
- Fri Feb 10, 2012 5:28 am
- Forum: Common Lisp
- Topic: Get a list of variables currently in scope
- Replies: 6
- Views: 8005
Re: Get a list of variables currently in scope
Maybe a macro: (defmacro with-tests (vars &body body) `(let ,vars (flet ((get-all-test-results () (list ,@(mapcar #'first vars)))) ,@body))) (defun test-conditions (state) (with-tests ((test-1 (list "Test 1 Name" (lambda (state) <<<run tests on state return a value>>>))) (test-2 (list ...
- Fri Feb 10, 2012 5:23 am
- Forum: Common Lisp
- Topic: A fundamental syntax confusion
- Replies: 2
- Views: 4491
Re: A fundamental syntax confusion
There is a special evaluation for lambda (see the Notes in its specification ). For instance: ((lambda (x) (+ x 3)) 5) is the same as (funcall #'(lambda (x) (+ x 3)) 5) or (let ((x 5)) (+ x 3)) Your code is equivalent to (defparameter *test-symbol* (let ((x (lambda (y) (format t "y: ~a~&&qu...
- Thu Feb 09, 2012 2:16 pm
- Forum: Common Lisp
- Topic: Get a list of variables currently in scope
- Replies: 6
- Views: 8005
Re: Get a list of variables currently in scope
There is no portable way of doing that. The only way to do that would be using a macro with an &env argument and inspecting it to know what symbols are in scope. However, "environments" differ from implementation to implementation. Of course, you can try to do that using tools provided...
- Sat Feb 04, 2012 7:47 am
- Forum: Common Lisp
- Topic: Controlling the P in REPL
- Replies: 6
- Views: 8377
Re: Controlling the P in REPL
I thought so, but I wasn't sure
I'm curious, are you implementing AKS primality test?
I'm curious, are you implementing AKS primality test?
- Fri Feb 03, 2012 7:48 am
- Forum: Common Lisp
- Topic: Controlling the P in REPL
- Replies: 6
- Views: 8377
Re: Controlling the P in REPL
To suppress the output is very easy, just call: (time (progn (prime-list 0 200000) nil)) Let me present another criticism to your code. I don't know what your objective is, but, if you are trying to implement prime-list efficiently, you are not doing a good job because your algorithm is highly innef...
- Wed Feb 01, 2012 12:19 pm
- Forum: Common Lisp
- Topic: Lisp
- Replies: 9
- Views: 17700
Re: Lisp
Mario 64 was made in Lisp as well.
- Sat Jan 28, 2012 9:00 pm
- Forum: The Lounge
- Topic: .
- Replies: 5
- Views: 21784
Re: Common Lisp as a replacement for Java
There are some neat frameworks for web applications. My favorite is weblocks, though I haven't used it much.
- Sat Jan 28, 2012 7:19 am
- Forum: Common Lisp
- Topic: Help reduce nested lambdas
- Replies: 9
- Views: 13111
Re: Help reduce nested lambdas
Your solution looks cool But he can use return-from to force map-product to exit.Ramarren wrote:EDIT: Of course, map-product doesn't exactly do what you want, since it doesn't short-curcuit when it finds the first counter-example. You can do something like this (minimally tested):
- Fri Jan 27, 2012 5:34 pm
- Forum: Common Lisp
- Topic: Help reduce nested lambdas
- Replies: 9
- Views: 13111
Re: Help reduce nested lambdas
This is possible with alexandria's map-product. I don't think it is possible with standard Common Lisp only.
- Fri Jan 27, 2012 5:33 pm
- Forum: The Lounge
- Topic: Introduction
- Replies: 1
- Views: 7020
Re: Introduction
Hello and wellcome