Search found 85 matches

by marcoxa
Sun Jan 05, 2014 7:40 am
Forum: Common Lisp
Topic: Conflict between iterate and cl-containers
Replies: 4
Views: 5835

Re: Conflict between iterate and cl-containers

The real question is:

Are you sure you need ITERATE? I.e., are you sure you couldn't just use LOOP?

Cheers
--
MA
by marcoxa
Wed Jan 01, 2014 7:06 am
Forum: Common Lisp
Topic: Enumerated types in Common Lisp
Replies: 1
Views: 2536

Enumerated types in Common Lisp

Hello,

I just made available a little library that implements yet another^n DEFENUM in Common Lisp. Here is a link to the blog post: http://within-parens.blogspot.gr/2014/0 ... in-cl.html

Cheers and Happy New Year
--
MA
by marcoxa
Thu Dec 12, 2013 1:39 pm
Forum: Common Lisp
Topic: Conflict between iterate and cl-containers
Replies: 4
Views: 5835

Re: Conflict between iterate and cl-containers

Look at SHADOW and SHADOWING-IMPORT.
by marcoxa
Sun Dec 08, 2013 3:40 am
Forum: Common Lisp
Topic: How do i convert c++ class to lisp?
Replies: 1
Views: 3199

Re: How do i convert c++ class to lisp?

With care and understanding that C++ "hiding rules" are not the same as CL. Plus, and this is the biggie, methods (or "member functions" in C++) are *NOT* part of a class definition. CLOS classes are essentially "data only classes" (something that some SW engineer does not grasp as useful, but I dig...
by marcoxa
Fri Dec 06, 2013 4:53 am
Forum: Common Lisp
Topic: remove-duplicates and if
Replies: 2
Views: 3657

Re: remove-duplicates and if

Your spec is not complete. Why do you want to keep (A B C) only? Do you want to keep the first? Do you want to keep all the (A B C)? Do you want to remove only the duplicates of length other than 3? Assuming you want to keep all entries of length equal 3, here is a solution that should give you a hi...
by marcoxa
Fri Nov 29, 2013 12:48 am
Forum: Common Lisp
Topic: Defining setf behavior (Or is there an easier way?)
Replies: 9
Views: 11491

Re: Defining setf behavior (Or is there an easier way?)

Sure.

BTW. Your version behaves more like (SETF GETHASH). It's a design choice.

MA
by marcoxa
Thu Nov 28, 2013 2:57 pm
Forum: Common Lisp
Topic: Defining setf behavior (Or is there an easier way?)
Replies: 9
Views: 11491

Re: Defining setf behavior (Or is there an easier way?)

Using GETHASH does not change the basic issue. The easy solution is to use a SEFT definition (defun (setf cadsoc) (v key alist) (let ((kv (assoc key alist))) (if kv (setf (cdr kv) v) (error "Key ~S not found in a-list." key)))) Now you can do: CL-USER 2 > (defvar l (acons 42 'a ())) L CL-USER 3 > al...
by marcoxa
Thu Nov 28, 2013 8:55 am
Forum: Common Lisp
Topic: [ANN] Fixed problem with NEW-OP and XHTMLambda repositories.
Replies: 0
Views: 2682

[ANN] Fixed problem with NEW-OP and XHTMLambda repositories.

People pointed out that some git repositories of mine on common-lisp.net were not clonable. I fixed the problem and now you should be able to clone the repositories for NEW-OP (http://common-lisp.net/project/new-op) and XHTMΛ (http://common-lisp.net/project/xhtmlambda)

Cheers
--
MA
by marcoxa
Thu Nov 21, 2013 1:31 pm
Forum: Common Lisp
Topic: Arranging code classes and scripts
Replies: 2
Views: 3668

Re: Arranging code classes and scripts

You can do whatever you want as long as it makes sense (TM) YMMV, etc etc.

Having said that, I came to like the one-class one-file organization of Java. Alas, with multimethods and generic functions there isn't a natural breakdown like that in CL.

Cheers
--
MA
by marcoxa
Sun Nov 10, 2013 7:53 am
Forum: Common Lisp
Topic: In lisp which is faster a defun or a defmacro
Replies: 6
Views: 7004

Re: In lisp which is faster a defun or a defmacro

It depends on the kind of code you are producing with a macro.