Search found 209 matches

by Jasper
Tue Jun 22, 2010 9:28 am
Forum: Common Lisp
Topic: Persisting data in hash table to and from disk
Replies: 7
Views: 11418

Re: Persisting data in hash table to and from disk

Any idea what the better libraries for serialization are? Cliki seems a little light on it .I used cl-store before, that seems to work fine. There'd seem to be two types of serialization one might want, one is storing (parts of) the state lisp is in, and the other to just store objects. In the latte...
by Jasper
Sun Jun 20, 2010 5:08 am
Forum: Common Lisp
Topic: Upoad button to upload a file
Replies: 4
Views: 4733

Re: Upoad button to upload a file

In what? On the web, an native application? What libraries are you using? What sort of content?

If you didn't think of including any of these in your comment asking, i don't think you're ready to implement this at all.
by Jasper
Thu Jun 10, 2010 12:02 pm
Forum: Common Lisp
Topic: Lisp functions and very new to lisp
Replies: 10
Views: 11443

Re: Lisp functions and very new to lisp

Okey, sorry if we got a bit sidetracked.(That was silly) Is LISTP, EQL allowed? I honestly don't know how to do those functions without being able to differentiate between atoms and lists, and comparing atoms. Here is how i'd one of those.(Presumably defun is allowed) (defun in-list (item list) (whe...
by Jasper
Thu Jun 10, 2010 5:47 am
Forum: Other Dialects
Topic: Debugging Lisp Function. Any Help out There?
Replies: 10
Views: 26701

Re: Debugging Lisp Function. Any Help out There?

You're misunderstanding how a body and cond works. Are you using some book like PCL ? Just trying stuff is inefficient, there are texts to explain it to you. Cond goes like (cond (cond ..body..) (cond ...body..) ..etc..) Only the body of the first clause that returns true is actually executed. Each ...
by Jasper
Wed Jun 09, 2010 8:30 am
Forum: Other Dialects
Topic: Debugging Lisp Function. Any Help out There?
Replies: 10
Views: 26701

Re: Debugging Lisp Function. Any Help out There?

What are you editing with? I suggest something that helps with indentation, it'll kindah show you how it is usually done. (Usually used with Tab) About 'syntax'.(insofar lisp has it) Having the whitespace only Spaces and Newlines is handy too. (In linux, and emacs in .emacs (setq indent-tabs-mode ni...
by Jasper
Wed Jun 09, 2010 8:14 am
Forum: Common Lisp
Topic: Lisp functions and very new to lisp
Replies: 10
Views: 11443

Re: Lisp functions and very new to lisp

if ( condition_a ) { do_a } else { if ( condition_b ) { do_b } else { do_c } } Is a big ugly way doing COND. ... ? ... : ... is an ugly way of wishing Cs IF could go into expressions. (wtf @distinction) And member functions are an ugly way of saying you want WITH-SLOTS and conflating it with oop. D...
by Jasper
Wed Jun 09, 2010 7:37 am
Forum: Common Lisp
Topic: Copy parts of a list into a new list [solved]
Replies: 3
Views: 3608

Re: Copy parts of a list into a new list [solved]

Actually, i'd use alexandria : (remove-if (alexandria:curry #'find #\e) *foo*) ( currying is useful when the equivalent lambda form very simple.)Note that the default :test, #'eql works too, but there might be some performance advantage in using char=, unfortunately type declarations don't seem powe...
by Jasper
Tue Jun 08, 2010 11:24 am
Forum: Other Dialects
Topic: Debugging Lisp Function. Any Help out There?
Replies: 10
Views: 26701

Re: Debugging Lisp Function. Any Help out There?

Strictly speaking it isn't debugging. It just doesn't implement what * does. Actually, look at it, ? and * are treated exactly the same. (Assuming the latter MATCH definition in OP.) For it to implement what * you want it to do, it must be able to go forward in the in the list, and it is apparent it...
by Jasper
Mon Jun 07, 2010 8:39 am
Forum: Other Dialects
Topic: Debugging Lisp Function. Any Help out There?
Replies: 10
Views: 26701

Re: Debugging Lisp Function. Any Help out There?

Indenting that MATCH function, it doesn't seem like correct use of the COND and SETQ macro, and the parenthesis don't match.(Please indent your code and use the \[code\] tags) (defun match (pattern1 pattern2) (cond ((or (atom pattern1) (atom pattern2)) (match-atom pattern1 pattern2)) (cond ((generic...
by Jasper
Mon May 31, 2010 6:44 am
Forum: Common Lisp
Topic: Special functions
Replies: 5
Views: 4648

Re: Special functions

Don't think that is thread-proof though. Don't think CL special functions inbuild, perhaps that is treating variables and functions differently arbitrary. No great loss though.. Btw, below example doesn't really show off specialness, but it could be done by flet. We do treat functions and variables ...