Search found 406 matches

by gugamilare
Fri Feb 10, 2012 5:28 am
Forum: Common Lisp
Topic: Get a list of variables currently in scope
Replies: 6
Views: 7881

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 ...
by gugamilare
Fri Feb 10, 2012 5:23 am
Forum: Common Lisp
Topic: A fundamental syntax confusion
Replies: 2
Views: 4465

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...
by gugamilare
Thu Feb 09, 2012 2:16 pm
Forum: Common Lisp
Topic: Get a list of variables currently in scope
Replies: 6
Views: 7881

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...
by gugamilare
Sat Feb 04, 2012 7:47 am
Forum: Common Lisp
Topic: Controlling the P in REPL
Replies: 6
Views: 8272

Re: Controlling the P in REPL

I thought so, but I wasn't sure :)

I'm curious, are you implementing AKS primality test?
by gugamilare
Fri Feb 03, 2012 7:48 am
Forum: Common Lisp
Topic: Controlling the P in REPL
Replies: 6
Views: 8272

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...
by gugamilare
Wed Feb 01, 2012 12:19 pm
Forum: Common Lisp
Topic: Lisp
Replies: 9
Views: 17408

Re: Lisp

Mario 64 was made in Lisp as well.
by gugamilare
Sat Jan 28, 2012 9:00 pm
Forum: The Lounge
Topic: .
Replies: 5
Views: 21436

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.
by gugamilare
Sat Jan 28, 2012 7:19 am
Forum: Common Lisp
Topic: Help reduce nested lambdas
Replies: 9
Views: 12868

Re: Help reduce nested lambdas

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):
Your solution looks cool :D But he can use return-from to force map-product to exit.
by gugamilare
Fri Jan 27, 2012 5:34 pm
Forum: Common Lisp
Topic: Help reduce nested lambdas
Replies: 9
Views: 12868

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.
by gugamilare
Fri Jan 27, 2012 5:33 pm
Forum: The Lounge
Topic: Introduction
Replies: 1
Views: 6932

Re: Introduction

Hello and wellcome :)