Search found 45 matches

by saulgoode
Fri Oct 07, 2011 12:24 am
Forum: Scheme
Topic: Help with scheme code.
Replies: 1
Views: 7986

Re: Help with scheme code.

Do I have to convert the string into the list and then back again to make the code work or should I try to reverse the string as a string? While not necessary, it would certainly simplify things. Accumulative recursion just means that an extra parameter is passed to your function each time it is ca...
by saulgoode
Sun Oct 02, 2011 12:09 am
Forum: Scheme
Topic: Macros
Replies: 6
Views: 24179

Re: Macros

The same code works with Guile (substituting for the square brackets):

Code: Select all

(define-syntax setvar
  (syntax-rules ()
    ((setvar var value)
      (define var value) )))
by saulgoode
Fri Sep 09, 2011 11:14 am
Forum: The Lounge
Topic: Whats your view of Lisp in the large picture?
Replies: 1
Views: 7588

Re: Whats your view of Lisp in the large picture?

I would break the big picture down into three different parts. There are the Algol-like imperative languages in which the main paradigm is to pass arguments to a function. Then there is the Lisp family where functions are applied to a set of arguments. And then there are the object-oriented language...
by saulgoode
Sun Sep 04, 2011 8:04 pm
Forum: Common Lisp
Topic: please help me understand this lisp function
Replies: 7
Views: 9316

Re: please help me understand this lisp function

*If N is returned, then the element was not found in the tree. It's this part that confuses me. It seems like N could be returned if elmt = E. If the left branch of N is a leaf then, by the convention adopted, that leaf's element is equal to N's element (and so if the element of that leaf is equal ...
by saulgoode
Fri Aug 19, 2011 6:26 pm
Forum: Common Lisp
Topic: (incf x) slower than (setf x (+ x 1))?
Replies: 5
Views: 6366

Re: (incf x) slower than (setf x (+ x 1))?

sylwester wrote:Why do we have incf/decf if not for speed?
For code readability/conciseness?

Try writing the 'setf' equivalent to
  • (incf (aref myarray (incf indx)))
by saulgoode
Tue Jul 12, 2011 7:59 am
Forum: Common Lisp
Topic: What does clisp do behind the scene if you give it (* 2 2 2)
Replies: 10
Views: 10503

Re: What does clisp do behind the scene if you give it (* 2 2 2)

Anyways, I am arguing that his definition of what "simpler" is is rather ambiguous. does simpler mean an answer with the least characters? Because by that logic a much much simpler solution would have been: >'8 or does simpler mean speed, or memory efficiency? If both answers are equivale...
by saulgoode
Mon May 16, 2011 1:05 am
Forum: Scheme
Topic: Help with result printing
Replies: 2
Views: 9537

Re: Help with result printing

Could you post the code you are using?
by saulgoode
Thu May 12, 2011 12:20 pm
Forum: Emacs Lisp
Topic: Seeding PRNG
Replies: 3
Views: 11291

Re: Seeding PRNG

There are some LISP extensions on the Emacs wiki which might serve as a basis for generating your own predetermined random numbers. But otherwise I think you are out of luck.
by saulgoode
Mon Apr 25, 2011 12:24 pm
Forum: Scheme
Topic: Cracker Barrel Game Solution
Replies: 1
Views: 8039

Re: Cracker Barrel Game Solution

The author appears to be using some slightly non-standard symbols, but nothing that is not easily corrected.

Try defining the following equivalents before running the code:

Code: Select all

(define null nil)
(define true #t)
(define false #f)
by saulgoode
Tue Apr 12, 2011 11:56 am
Forum: Other Dialects
Topic: Which Lisp?
Replies: 3
Views: 13795

Re: Which Lisp?

I would recommend spending a little time with How To Design Programs which is based on the Scheme dialect ("DrScheme" to be precise). It will probably start out a little too simplistic given your experience level, but it is quick way to get started without have to learn a lot of different ...