Search found 127 matches

by wvxvw
Fri Jun 01, 2012 10:34 am
Forum: Common Lisp
Topic: Importing packages in SLIME
Replies: 2
Views: 2700

Re: Importing packages in SLIME

I have the same Emacs 23.2.1, but older SLIME 2010-07-21 and SBCL is 1.0.40.0.debian. It's the same Debian Squeeze.
I actually solved it with help from Stackoverflow. When using shadow-import it just worked. idk why.
by wvxvw
Fri Jun 01, 2012 4:24 am
Forum: Common Lisp
Topic: Importing packages in SLIME
Replies: 2
Views: 2700

Importing packages in SLIME

There's something I can't understand about importing symbols or entire packages when in SLIME's REPL. Suppose I want to use a socket, my inferior lisp program is SBCL, so I want to import several symbols from it, what I tried: (import 'sb-bsd-sockets:host-ent-address) (import 'sb-bsd-sockets:get-hos...
by wvxvw
Sun May 27, 2012 1:47 pm
Forum: Common Lisp
Topic: how to avoid this stackoverflow?
Replies: 2
Views: 2270

Re: how to avoid this stackoverflow?

The stack overflow is caused by the REPL trying to print the object (but it's fine to have it like you designed it, it doesn't cause stack overflow on its own). You will need to define method print-object to prevent recursive printing of A. While defining it, you will need to take care of *print-cir...
by wvxvw
Sun May 27, 2012 5:53 am
Forum: Common Lisp
Topic: Combine &key and &optional arguments in macro
Replies: 6
Views: 3614

Re: Combine &key and &optional arguments in macro

Thanks, I've red that, but I can't make any legitimate use of the &whole keyword, unless I'm not passing any arguments, including your example (it doesn't compile for me, if any arguments are given). So, what I'm trying to understand is: (most probably) I'm doing something wrong, but I don't know wh...
by wvxvw
Fri May 25, 2012 2:41 am
Forum: Common Lisp
Topic: Combine &key and &optional arguments in macro
Replies: 6
Views: 3614

Re: Combine &key and &optional arguments in macro

Sorry, this actually does something strange for me... it complains about me not passing in the correct number of arguments, and it says that no more then 0 (zero) arguments are expected to satisfy the lambda list containing &whole. I.e. the code as you posted it won't work for me (won't create a has...
by wvxvw
Wed May 23, 2012 1:31 pm
Forum: Common Lisp
Topic: Combine &key and &optional arguments in macro
Replies: 6
Views: 3614

Re: Combine &key and &optional arguments in macro

The thing is - those optional arguments are what SBCL adds on top of the standard make-hash-table arguments, and I'd like to keep them in the macro just the same way they appear in the original function. As a general rule [...] Yup, I've noticed - which makes them pretty much mandatory, in the contr...
by wvxvw
Tue May 22, 2012 10:56 am
Forum: Common Lisp
Topic: Combine &key and &optional arguments in macro
Replies: 6
Views: 3614

Combine &key and &optional arguments in macro

I was trying to come up with a macro that would pass all arguments to the function it calls, but I can't figure out how to pass them (the function has both &key and &optional arguments) (defmacro populated-hash-table ((;; &optional ;; hash-function weakness synchronized &key (test ''eq) (size 1000) ...
by wvxvw
Thu May 17, 2012 1:01 am
Forum: Common Lisp
Topic: hunchentoot: trouble dispatching requests
Replies: 8
Views: 7989

Re: hunchentoot: trouble dispatching requests

Glad you get it right! And, by the way, the function that randomizes the list (of recipes I presume) could've been better ;) For my tests the below runs about 3 times faster for lists of length of 4 and will run even faster for longer lists, proportionally to their length: (defun randomize-list (x &...
by wvxvw
Mon May 14, 2012 1:52 am
Forum: Common Lisp
Topic: hunchentoot: trouble dispatching requests
Replies: 8
Views: 7989

Re: hunchentoot: trouble dispatching requests

(setq hunchentoot:*dispatch-table* `(,(hunchentoot:create-regex-dispatcher "\\/services\\/save\\/[^\\/]+" 'save-from-raw-post) #| more dispatchers here |#)) (defun save-from-raw-post () "Accepts the request to \\/services\\/save\\/[^\\/]+ and generates response. Successful response will contain new...
by wvxvw
Fri May 11, 2012 2:04 pm
Forum: Common Lisp
Topic: hunchentoot: trouble dispatching requests
Replies: 8
Views: 7989

Re: hunchentoot: trouble dispatching requests

Does it have to be yet another HTML page? I mean, if the purpose of the exercise is to generate HTML page in response to a request, then, you probably, upon generating the page, need to send redirect headers (like "location: new-page.html") + make sure that hunchentoot has a handler for static files...