Examples:
(import (rnrs)
(shorten))
(map (^(x y) (+ x y)) '(1 2 3 4) '(1 2 3 4)) ;; (map (lambda (x y) (+
x y)) '(1 2 3 4) '(1 2 3 4))
(map (^a a) '(1 2 3 4)) ;; (map (lambda (a) a)
'(1 2 3 4))
(map (^a* a*) '(1 2 3 4)) ;; (map (lambda a* a*)
'(1 2 3 4))
The idea come from "Gauche Devlog - Shorter names
http://blog.practical-scheme.net/gauche/20100428-shorter-names" by
Shiro.
Feedback Welcome.
--
Taro Minowa(Higepon)
http://www.monaos.org/
http://code.google.com/p/mosh-scheme/
http://twitter.com/higepon
> I wrote (shorten) library which provides a short alias for lambda
> expression.
> http://github.com/higepon/Scheme-shorten
>
> Examples:
> (import (rnrs)
> (shorten))
> (map (^(x y) (+ x y)) '(1 2 3 4) '(1 2 3 4)) ;; (map (lambda (x y) (+
> x y)) '(1 2 3 4) '(1 2 3 4))
> (map (^a a) '(1 2 3 4)) ;; (map (lambda (a) a)
> '(1 2 3 4))
> (map (^a* a*) '(1 2 3 4)) ;; (map (lambda a* a*)
> '(1 2 3 4))
>
> The idea come from "Gauche Devlog - Shorter names
> http://blog.practical-scheme.net/gauche/20100428-shorter-names" by
> Shiro.
>
> Feedback Welcome.
Why not use Church's notation? λx λy (+ x y)
If you have reader macros, this can be implemented rather easily.
(Harder would be to implement currying, mixing it with the variable
arity of scheme).
--
__Pascal Bourguignon__
> Why not use Church's notation? λx λy (+ x y)
^ is easier to type than non-ascii λ.
> If you have reader macros, this can be implemented rather easily.
Yes I agree. But we have not reader macro which is portable.
>> Why not use Church's notation? �?x ?y (+ x y)
>
>^ is easier to type than non-ascii ?.
The question mark is ASCII character 63.
On a QWERTY keyboard ? in the bottom row is easier to reach than ^ in
the number row. Can't speak for other keyboard layouts though.
George
>>^ is easier to type than non-ascii ?.
>The question mark is ASCII character 63.
Pascal J. Bourguignon doesn't write ascii 63? but Greek char lambda.
I think that character corruption occurs on your browser.
Cheers.
On 5月14日, 午後12:45, George Neuner <gneun...@comcast.net> wrote:
> On Thu, 13 May 2010 01:12:23 -0700 (PDT), higepon <hige...@gmail.com>
> On Thu, 13 May 2010 01:12:23 -0700 (PDT), higepon <hig...@gmail.com>
> wrote:
>
>>> Why not use Church's notation? ?x ?y (+ x y)
>>
>>^ is easier to type than non-ascii ?.
>
> The question mark is ASCII character 63.
But originally, it was λ, GREEK_LAMBDA, with unicode code 955.
> On a QWERTY keyboard ? in the bottom row is easier to reach than ^ in
> the number row. Can't speak for other keyboard layouts though.
And if you use it a lot you can map it to a key, or an easy keychoard,
trivially either in emacs or X (~/.Xmodmap).
--
__Pascal Bourguignon__
>>>^ is easier to type than non-ascii ?.
>>The question mark is ASCII character 63.
>
>Pascal J. Bourguignon doesn't write ascii 63? but Greek char lambda.
>I think that character corruption occurs on your browser.
Sorry for the confusion.
George