Search found 613 matches

by ramarren
Thu Jan 12, 2012 1:08 am
Forum: Common Lisp
Topic: Save and load a SBCL image from/to emacs
Replies: 1
Views: 4139

Re: Save and load a SBCL image from/to emacs

SBCL cannot save an image if there are multiple threads running, and Slime by default uses a separate thread for communicating with a listener. Unless you use an alternative communication mode saving an image from that state would be difficult. You could try arranging the core to save itself after k...
by ramarren
Fri Jan 06, 2012 2:42 pm
Forum: Common Lisp
Topic: avoiding eval in a macro
Replies: 3
Views: 5297

Re: avoiding eval in a macro

I'm not very deep into CL yet and struggling with this problem: You probably shouldn't be nesting DEFMACRO then. Or ever, nesting macro definitions generally and definitely directly is not really a good idea, because keeping track of scope is difficult. In your case the variable body in the scope o...
by ramarren
Mon Dec 19, 2011 8:47 am
Forum: Common Lisp
Topic: accessing children in CLOS?
Replies: 2
Views: 4238

Re: accessing children in CLOS?

Instances of classes are first class, so they can be stored in collections in the same way as any other object. Why would you think you need to create names for instances? This seems to indicate confusion about fairly basic concepts of programming, and you might want to read a book starting from the...
by ramarren
Thu Dec 15, 2011 12:51 am
Forum: The Lounge
Topic: Why is this forum so weird?
Replies: 2
Views: 7898

Re: Why is this forum so weird?

Recently there has been a severe influx of Markov chain generated spam, and it is possible that your initial post has been caught in the filtering by mistake. Please repost it if so.
by ramarren
Wed Dec 14, 2011 12:39 am
Forum: Common Lisp
Topic: Recursive Version of let?
Replies: 5
Views: 6743

Re: Recursive Version of let?

There is LET*. It is not recursive as such, since recursive means being defined by itself, which, unlike functions, is an extremely rare use case for variables, but it does what you want in your example.
by ramarren
Tue Dec 06, 2011 9:07 am
Forum: Common Lisp
Topic: Simple issue Trees in Lisp
Replies: 7
Views: 17505

Re: Simple issue Trees in Lisp

The return value of your function is a list. You have two recursive calls, which means two lists. As I said, you need APPEND to append those two lists together. And then use CONS twice nested to add the number of leaves and the node to the result of that.
by ramarren
Tue Dec 06, 2011 5:55 am
Forum: Common Lisp
Topic: CFFI and Python DLL
Replies: 1
Views: 3841

Re: CFFI and Python DLL

I have never tried doing anything like that, but googling doesn't seem to show anything about using those dlls in that way. It looks as if those programs just package the interpreter with the code, which means that functions defined in Python are not exposed in the sense of being directly callable u...
by ramarren
Tue Dec 06, 2011 5:41 am
Forum: Common Lisp
Topic: Simple issue Trees in Lisp
Replies: 7
Views: 17505

Re: Simple issue Trees in Lisp

You have to think what is being passed to the function. It is either a NIL, representing an non-existent leaf, or a list of one, two or three elements. This are the only two possibilities, which means that the conditional only needs two branches, not three as in your attempt. A convenient fact about...
by ramarren
Mon Dec 05, 2011 12:10 pm
Forum: Common Lisp
Topic: Simple issue Trees in Lisp
Replies: 7
Views: 17505

Re: Simple issue Trees in Lisp

Please use code tags in the future. There is a Code button above the editing are which can be used to display preformatted text like ascii-trees and code. I have also moved the topic to Common Lisp subforum, since I am assuming Common Lisp from the presence of DEFUN. If it is a different dialect of ...
by ramarren
Mon Dec 05, 2011 11:50 am
Forum: Common Lisp
Topic: REPL - loading a file
Replies: 1
Views: 3964

Re: REPL - loading a file

You can load a file from REPL using LOAD function. This also works anywhere, although directly loading files is fairly rare, since for programmatic uses you would use a system definition facility . The typical way to develop Common Lisp code with Emacs is to use slime (which is best installed using ...