Hi everyone.
I made a little addition to the library. The lastcons function... It is very simple and I found myself thinking "that's something that ought to be in alexandria"...
Not knowing the exact procedure to commit to the repo (and "git push" give me a "fatal: The remote end hung up unexpectedly" which is to be expected, I guess...), I send you the patch.
Mathieu Lemoine.
On 5/19/10, Mathieu Lemoine mathieu.lemoine@gmail.com wrote:
Hi everyone.
I made a little addition to the library. The lastcons function... It is very simple and I found myself thinking "that's something that ought to be in alexandria"...
Not knowing the exact procedure to commit to the repo (and "git push" give me a "fatal: The remote end hung up unexpectedly" which is to be expected, I guess...), I send you the patch.
Mathieu Lemoine.
This replicates a lot of code from DEF in alexandria's list.lisp.
I'm looking at this, as at today:
http://common-lisp.net/project/alexandria/darcs/alexandria/lists.lisp
Why not bundle your function into that def macrolet form?
I never realised that lastcar was safe. Should there be a safe- prefix? That was we can also rename lastcons to safe-last, the safe counterpart of cl:last.
Yong.
2010/5/18 Theam Yong Chew senatorzergling@gmail.com:
On 5/19/10, Mathieu Lemoine mathieu.lemoine@gmail.com wrote:
Hi everyone.
I made a little addition to the library. The lastcons function... It is very simple and I found myself thinking "that's something that ought to be in alexandria"...
Not knowing the exact procedure to commit to the repo (and "git push" give me a "fatal: The remote end hung up unexpectedly" which is to be expected, I guess...), I send you the patch.
Mathieu Lemoine.
This replicates a lot of code from DEF in alexandria's list.lisp.
I'm looking at this, as at today:
http://common-lisp.net/project/alexandria/darcs/alexandria/lists.lisp
Why not bundle your function into that def macrolet form?
I never realised that lastcar was safe. Should there be a safe- prefix? That was we can also rename lastcons to safe-last, the safe counterpart of cl:last.
Yong.
I didn't included it into the def from because I need the little if at the beginning (if (endp (cdr list)) list ...) [which is supposed to be safe-endp, actually] which is not part of the def macro... If there is a simple way to include it I agree it would be better, but it looks like it would add garbage to the macro...
Mathieu.
On 18 May 2010 23:29, Mathieu Lemoine mathieu.lemoine@gmail.com wrote:
(Again, sorry about the tardy reply!)
I made a little addition to the library. The lastcons function... It is very simple and I found myself thinking "that's something that ought to be in alexandria"...
Thank you, but ... this already exists in Alexandria, under the name LASTCAR.
Not knowing the exact procedure to commit to the repo (and "git push" give me a "fatal: The remote end hung up unexpectedly" which is to be expected, I guess...), I send you the patch.
For future reference, my preference is:
1. When sending in patches that add in functions, include the docstring of the function in the message body. Makes it easier to see what it is about.
2. Use "git format-patch -1" (as you did) to produce the patch.
3. Remember to include test-cases.
Cheers,
-- nikodemus
On 30 October 2011 14:10, Nikodemus Siivola nikodemus@random-state.net wrote:
I made a little addition to the library. The lastcons function... It is very simple and I found myself thinking "that's something that ought to be in alexandria"...
Thank you, but ... this already exists in Alexandria, under the name LASTCAR.
Sorry, I misread!
Aside from the proper-list requirement, this is actually the same as CL:LAST.
Cheers,
-- Nikodemus
alexandria-devel@common-lisp.net