Search found 406 matches

by gugamilare
Tue Jan 10, 2012 2:26 pm
Forum: Common Lisp
Topic: let vs setf in regards to macros
Replies: 4
Views: 6711

Re: let vs setf in regards to macros

How about this?

Code: Select all

(defmacro foo-mac (name)
  `(format t "mac ~A: ~S~%" ,name *b*))
With this code, you get the value of *b* at evaluation time, while, with your code, you get the value of *b* at macro-expansion time.
by gugamilare
Mon Nov 28, 2011 9:58 am
Forum: Common Lisp
Topic: Convert Scheme to Lisp (Recursive)
Replies: 5
Views: 5997

Re: Convert Scheme to Lisp (Recursive)

After created in the labels funtions, loop can be called only one time as the second argument. That is not true, you can call the function loop as many times as you want, either inside it's own body, inside the body of another function created in the macro labels or inside the body of labels itself...
by gugamilare
Mon Nov 28, 2011 7:12 am
Forum: Common Lisp
Topic: Convert Scheme to Lisp (Recursive)
Replies: 5
Views: 5997

Re: Convert Scheme to Lisp (Recursive)

I guess what confused you is the macro let. In scheme, this:

Code: Select all

(let loop ((var1 value1) ... (varN valueN))
  <body>)
is a way of creating loops. It's Common Lisp equivalent would be:

Code: Select all

(labels ((loop (var1 ... varN)
            <body>))
  (loop value1 ... valueN))
by gugamilare
Thu Nov 10, 2011 10:16 am
Forum: Common Lisp
Topic: Help for building a board
Replies: 5
Views: 6626

Re: Help for building a board

Wait, you need to be careful here. This is not going to work because it modifies literal data. You have to construct the list in running time: (defun do-board (n) (loop for i from 1 to n collect (loop repeat i append (list '* '* '*)))) or (defun do-board (n) (loop for i from 1 to n collect (loop rep...
by gugamilare
Sat Nov 05, 2011 1:14 pm
Forum: Common Lisp
Topic: HELP, Developing a pacman
Replies: 3
Views: 4858

Re: HELP, Developing a pacman

I could help you later if you want the ghosts to chase the Pacman as well.
by gugamilare
Sat Nov 05, 2011 1:13 pm
Forum: Common Lisp
Topic: HELP, Developing a pacman
Replies: 3
Views: 4858

Re: HELP, Developing a pacman

If you opt for creating a GUI game, you can use Lispbuilder. There is a nice manual about how to use it. I think you can find images easily on the web. You can either make a console-based game to concentrate yourself on the logic of the game first and then transform it into a graphic one, or you can...
by gugamilare
Sun Oct 02, 2011 6:07 pm
Forum: Emacs
Topic: Emacs vs Other CL Implementations
Replies: 2
Views: 17384

Re: Emacs vs Other CL Implementations

Emacs is not an implementation, it is just an editor. You can use it to run Emacs Lisp code, which is not Common Lisp.

The best open source implementations are Clozure CL and SBCL.

Take a look in this thread about environments.
by gugamilare
Mon Sep 26, 2011 5:47 pm
Forum: Common Lisp
Topic: Generating lists of given length
Replies: 3
Views: 5148

Re: Generating lists of given length

Can you at least show us an attempt to solve the problem?
by gugamilare
Wed Aug 10, 2011 5:23 pm
Forum: Common Lisp
Topic: problem with allegro cl..
Replies: 1
Views: 3005

Re: problem with allegro cl..

I guess you'll need to change the keyboard layout in Windows' control panel, and then change it back when you stop programming. There is an option to leave an icon in the notification area so that you can change it back and forth easier. If you have trouble, someone else can teach you how to find it...
by gugamilare
Thu Jul 28, 2011 7:05 pm
Forum: Common Lisp
Topic: newbie at lisp - please help
Replies: 6
Views: 6516

Re: newbie at lisp - please help

Take a look at this thread.