Search found 613 matches

by ramarren
Mon Feb 20, 2012 11:57 pm
Forum: Common Lisp
Topic: LIST vs TICK in a LET causing a global side-effect?!?
Replies: 6
Views: 7617

Re: LIST vs TICK in a LET causing a global side-effect?!?

To fully understand this you must remember how Common Lisp is processed. The first step is the reading phase, which transforms the text source into a tree of objects. Those objects are first-class language objects, which is how macros work, by operating on that object tree before the evaluation/comp...
by ramarren
Fri Feb 17, 2012 5:38 am
Forum: Common Lisp
Topic: Loop through strings
Replies: 2
Views: 11819

Re: Loop through strings

Please use code tags to post code and post in the correct forum. I assume you are asking about Common Lisp, and have moved the topic there. You seem to be missing basic knowledge about the functioning of the language. You should probably read at least some of Practical Common Lisp or Gentle Introduc...
by ramarren
Tue Feb 14, 2012 10:36 pm
Forum: Common Lisp
Topic: Hunchentoot installation questions... [solved]
Replies: 4
Views: 6633

Re: Hunchentoot installation questions...

Quicklisp resolves dependencies for installation by systems. You used quicklisp to install hunchentoot system, but not hunchentoot-test, which has additional dependencies required for testing. It seems installed under /root/quicklisp/dists/quicklisp/software/hunchentoot-1.2.2/ . This looks as if you...
by ramarren
Sat Feb 04, 2012 3:18 am
Forum: The Lounge
Topic: regex for empty string after a space?
Replies: 4
Views: 12781

Re: regex for empty string after a space?

As far as I can tell the engine Emacs uses for regular expressions doesn't include Perl-style look-around assertions which are necessary for this sort of thing. Depending on exactly what you are doing it might be possible to implement equivalent functionality, or even use shell-command-on-region to ...
by ramarren
Thu Feb 02, 2012 11:48 am
Forum: Common Lisp
Topic: Controlling the P in REPL
Replies: 6
Views: 8042

Re: Controlling the P in REPL

For controlling the printer output see variables in the printer dictionary , especially in this case *print-level*/*print-length* . You could also wrap the form inside TIME with something, I personally wrap large list-generating function with LENGTH as a simple consistency check. You could write a m...
by ramarren
Thu Feb 02, 2012 8:47 am
Forum: Common Lisp
Topic: Too few arguments, whats wrong with my code?
Replies: 2
Views: 4709

Re: Too few arguments, whats wrong with my code?

You should really be using a parentheses-aware editor, like Emacs, although most modern editors support parentheses highlighting. The particular problem is that you have (print "equal") as a third argument to EQUAL function, while you presumably want it to be the execution branch of COND. ...
by ramarren
Sun Jan 29, 2012 12:05 am
Forum: Common Lisp
Topic: Passing &key arguments through to lower levels
Replies: 2
Views: 4438

Re: Passing &key arguments through to lower levels

Please use code tags for posting code samples in the future. Keyword arguments always have a default value, which, if not specified in the argument list, is NIL, which means you can just call ADJOIN with all the arguments. (defun my-adjoin (item list &key key test test-not) (do-something (adjoin...
by ramarren
Sat Jan 28, 2012 8:58 am
Forum: Common Lisp
Topic: Help reduce nested lambdas
Replies: 9
Views: 12489

Re: Help reduce nested lambdas

Oh, I simply did git clone, so I thought I'd have the latest one? It should be the latest one, and the repository linked from the page linked from cliki has map-product: at line 323 . you are calling optest with no arguments Curry is actually somewhat misnamed (see currying ), since what the functi...
by ramarren
Sat Jan 28, 2012 7:40 am
Forum: Common Lisp
Topic: Help reduce nested lambdas
Replies: 9
Views: 12489

Re: Help reduce nested lambdas

gugamilare wrote:But he can use return-from to force map-product to exit.
True. I haven't really thought of that, because while I don't generally obsess about functional programming, I really dislike explicit returns, especially across call frames which would be necessary here.
by ramarren
Sat Jan 28, 2012 5:45 am
Forum: Common Lisp
Topic: Help reduce nested lambdas
Replies: 9
Views: 12489

Re: Help reduce nested lambdas

I used eq because I knew beforehand that the list will only contain numbers and symbols EQ is not defined to work reliably on numbers. It compares pointer equality and some numbers, especially those that do not fit into machine word minus tags, might be multiply instantiated. There isn't really rea...