Hi,
I have an ASDF system called cl-lambda-shorthand that I was wondering if you would be interested in hosting. It was developed by myself, Justin Dubs, and is under the MIT license.
Basically, it provides a shorthand for anonymous functions by making use of the #L dispatching macro character. This way you can say:
(mapcar #L(+ 1) '(1 2 3) '(4 5 6)) => (6 8 10)
or
(mapcar #L(+ _ (* 2 _)) '(1 2 3) '(4 5 6)) => (9 12 15)
It also provides shorthand for defining 'constantly' functions (ie. #L5 == (lambda (&rest args) 5)) and more.
Thank you, Justin Dubs
"If you want to make an apple pie from scratch, you must first create the universe." - Carl Sagan
Justin Dubs jtdubs@eos.ncsu.edu writes:
I have an ASDF system called cl-lambda-shorthand that I was wondering if you would be interested in hosting. It was developed by myself, Justin Dubs, and is under the MIT license.
Well - the real question is if you think this merits a project of its own :-)
Erik, Nikodemus, what do you think?
I sometimes wonder if we should create an "extensions" umbrella project for this kind of thing.
In any case, if you think that this merits a project of its own, I do not see any major (nor minor) problem.
Now, completely unrelated to that issue:
Basically, it provides a shorthand for anonymous functions by making use of the #L dispatching macro character. This way you can say:
(mapcar #L(+ 1) '(1 2 3) '(4 5 6)) => (6 8 10)
Well. What happens with
(mapcar #L(- 1) '(1 2 3) '(4 5 6))
or
(mapcar #L(/ 2) '(1 2 3) '(4 5 6))
?
or
(mapcar #L(+ _ (* 2 _)) '(1 2 3) '(4 5 6)) => (9 12 15)
So the first _ is the first variable, and the second one the second? To be honest, this does not seem to me to be such a good idea.
Regards, Mario.
Justin Dubs jtdubs@eos.ncsu.edu writes:
I have an ASDF system called cl-lambda-shorthand that I was wondering if you would be interested in hosting. It was developed by myself, Justin Dubs, and is under the MIT license.
Well - the real question is if you think this merits a project of its own :-)
I really don't know if it merits being it's own project. I find it to be useful on occasion, and I thought it was possible that others might as well. I can host it myself, starting in a few months, if you guys don't want it.
Erik, Nikodemus, what do you think?
I sometimes wonder if we should create an "extensions" umbrella project for this kind of thing.
In any case, if you think that this merits a project of its own, I do not see any major (nor minor) problem.
Now, completely unrelated to that issue:
Basically, it provides a shorthand for anonymous functions by making use of the #L dispatching macro character. This way you can say:
(mapcar #L(+ 1) '(1 2 3) '(4 5 6)) => (6 8 10)
Well. What happens with
(mapcar #L(- 1) '(1 2 3) '(4 5 6))
or
(mapcar #L(/ 2) '(1 2 3) '(4 5 6))
If no positional or anonymous arguments are found in the form (I'll explain what they are in a bit), then a lambda is created which takes a &rest parameter and #'apply's the function to the rest of the form and the &rest parameter.
So:
#L(- 1 2 3) => (lambda (&rest #:REST01) (declare (ignore #:REST01)) (apply #'- 1 2 3 #:REST01))
(mapcar #L(- 1) '(1 2 3) '(4 5 6)) => (-4 -6 -8) (mapcar #L(/ 2) '(1 2 3) '(4 5 6)) => (1/2 1/5 1/9)
If you wanted a function to divide something by two, you would use #L(/ _ 2)...
(mapcar #L(+ _ (* 2 _)) '(1 2 3) '(4 5 6)) => (9 12 15)
So the first _ is the first variable, and the second one the second? To be honest, this does not seem to me to be such a good idea.
If you saw the rest of the syntax, it might make more sense. The form after the #L is checked for anonymous arguments (ie. '_') and postional arguments (ie. $2, $5 and $10). You can only use one of the two kinds of arguments in a given form.
Anonymous arguments become parameters of the generated lambda in left-to-right order.
Positional arguments become parameters of the generated lambda at offsets corresponding with their numbers.
So, if you want control over where things end up, you can do this:
#L(- $2 $1) => (lambda (x y) (- y x)) #L(- $3 $1) => (lambda (x unused y) (- y x)) #L(list $1 $1) => (lambda (x) (list x x))
If the form after the #L is an atom, then it generates a constantly function:
#L5 => (lambda (&rest args) 5) #Lx => (lambda (&rest args) x)
I hope that makes things more clear. As to whether or not you guys want to host it and where you want to host it, it doesn't really matter to me one way or the other. Let me know what you think the right thing to do it, and I'll go with it.
Justin Dubs
jtdubs@ncsu.edu writes:
Justin Dubs jtdubs@eos.ncsu.edu writes:
I have an ASDF system called cl-lambda-shorthand that I was wondering if you would be interested in hosting. It was developed by myself, Justin Dubs, and is under the MIT license.
Well - the real question is if you think this merits a project of its own :-)
I really don't know if it merits being it's own project. I find it to be useful on occasion, and I thought it was possible that others might as well. I can host it myself, starting in a few months, if you guys don't want it.
Before we stray into a misunderstanding: you asked if we wanted to host it, and I replied, do you want us to host it? If you want us to host it, we will host it. It is your decision - sorry if this sounds like splitting hairs, but clear communication and statement of intent is important.
The comment on whether it merits its own project was not us rejecting it, but essentially brainstorming on the status and size of the project. Again, my criticisms are mine, and not any "official" position.
[...]
I hope that makes things more clear.
Indeed.
As to whether or not you guys want to host it and where you want to host it, it doesn't really matter to me one way or the other. Let me know what you think the right thing to do it, and I'll go with it.
If it doesn't matter to you, why should we host it? We do not collect software, we provide hosting.
Regards, Mario.
On Sat, 10 Apr 2004, Mario Mommer wrote:
The comment on whether it merits its own project was not us rejecting it, but essentially brainstorming on the status and size of the project. Again, my criticisms are mine, and not any "official" position.
Ditto here. Officially:
* The project has been approved.
* It will be created once you say that "yes, I want separate hosting for it". Alternatively you could eg. say "hmm, actually i have / will have other smallish utilities, so jdubs-utils might be more appropriate", or whatever. In which case the corresponding action will be taken.
Cheers,
-- Nikodemus Siivola
The more I think about it, the more it seems I'd be better off just throwing up a page on cliki and hosting the actual code myself. It's just a small utility and doesn't really need hosting as it's not in development anymore. It's pretty much done.
I think I misunderstood the purpose of common-lisp.net. I thought the goal was to become something akin a central repository of all lisp-related code. I realize now that you guys just want to provide hosting for projects that need it.
I'll be in touch when I get my real project to a more useful point. Sorry to have wasted your time.
Justin Dubs
"One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs." - Robert Firth
On Apr 10, 2004, at 5:06 AM, Nikodemus Siivola wrote:
On Sat, 10 Apr 2004, Mario Mommer wrote:
The comment on whether it merits its own project was not us rejecting it, but essentially brainstorming on the status and size of the project. Again, my criticisms are mine, and not any "official" position.
Ditto here. Officially:
The project has been approved.
It will be created once you say that "yes, I want separate hosting for it". Alternatively you could eg. say "hmm, actually i have / will have other smallish utilities, so jdubs-utils might be more appropriate", or whatever. In which case the corresponding action will be taken.
Cheers,
-- Nikodemus Siivola
I have an ASDF system called cl-lambda-shorthand that I was wondering if you would be interested in hosting. It was developed by myself, Justin Dubs, and is under the MIT license.
Approved, though I echo most of Marios thoughs here. As an alternative I'd point out the possibility to make you a personal umbrella project "jdubbs-utils" (it's not without precedent, after all).
Cheers,
-- Nikodemus Siivola