[gambit-list] Macro to use ??? character as ?lambda?

James Baker cycle.code.media at gmail.com
Mon Oct 27 19:23:41 EDT 2014


It does work on linux, note that the path in the shebang line may be
different for your environment.

jamesb at debian:/tmp$ cat test.scm
#!/usr/local/Gambit-C/bin/scheme-r5rs -:s

(define-syntax λ (syntax-rules () ((_ param body ...) (lambda param body
...))))

(define square (λ (x) (* x x)))
(println (square 42))

jamesb at debian:/tmp$ ./test.scm
1764



On Tue, Oct 28, 2014 at 10:18 AM, Roy Pfund <roypfund at gmail.com> wrote:

> That may work on OS X, but I just tested it does not work on linux : (
>
>
> On Sunday, October 26, 2014, James Baker <cycle.code.media at gmail.com>
> wrote:
>
>> Not really gambit specific but it works like this:
>>
>> #!/usr/local/Gambit-C/bin/scheme-r5rs -:s
>>
>> On Mon, Oct 27, 2014 at 1:49 PM, Roy Pfund <roypfund at gmail.com> wrote:
>>
>>> The shebang "#!/usr/bin/env scheme-r5rs -:s" doesn't even call Gambit,
>>> an gives the following error:
>>>
>>> /usr/bin/env: scheme-r5rs -:s: No such file or directory
>>>
>>>
>>> On Sun, Oct 26, 2014 at 9:31 PM, James Baker <cycle.code.media at gmail.com
>>> > wrote:
>>>
>>>> I dont use them but I think for memory scheme-r5rs and the like only
>>>> set case sensitivity and keyword preferences, it wont make syntax-rules /
>>>> syntax-case available to you for that you would still need tell it to load
>>>> eg.
>>>>
>>>> scheme-r5rs -:s
>>>>
>>>>
>>>>
>>>> On Mon, Oct 27, 2014 at 1:20 PM, Roy Pfund <roypfund at gmail.com> wrote:
>>>>
>>>>> I'm using scheme-r5rs not the regular gsi and your solution doesn't
>>>>> work;
>>>>>
>>>>> So does anyone know how I can set "standard Scheme mode" just like the
>>>>> command line option "-:s" from within a executable scheme file??
>>>>>
>>>>> On Sun, Oct 26, 2014 at 4:58 PM, James Baker <
>>>>> cycle.code.media at gmail.com> wrote:
>>>>>
>>>>>> I know its not exactly what you asked for, but I found this gambit
>>>>>> specific trick recently.
>>>>>>
>>>>>> (##include "~~/lib/_gambit#.scm")
>>>>>> (define-runtime-syntax λ (##make-alias-syntax '##lambda))
>>>>>>
>>>>>> Which you can use as normal:
>>>>>>
>>>>>> > (define square (λ (x) (* x x)))
>>>>>> > square
>>>>>> #<procedure #2 square>
>>>>>> > (square 42)
>>>>>> 1764
>>>>>> >
>>>>>>
>>>>>> James
>>>>>>
>>>>>> On Mon, Oct 27, 2014 at 5:20 AM, Roy Pfund <roypfund at gmail.com>
>>>>>> wrote:
>>>>>> > From http://stackoverflow.com/a/26570837/144020 I tried the
>>>>>> following:
>>>>>> >
>>>>>> > (define-syntax λ (syntax-rules () ((_ param body ...) (lambda param
>>>>>> body
>>>>>> > ...))))
>>>>>> >
>>>>>> > It works! but ONLY IF you call the script from the gsi not with
>>>>>> >
>>>>>> > #!/usr/bin/env scheme-r5rs
>>>>>> >
>>>>>> > Does anyone know I can set the command line OPTION s|S "set
>>>>>> standard Scheme
>>>>>> > mode" from within a scheme file??
>>>>>> >
>>>>>> > _______________________________________________
>>>>>> > Gambit-list mailing list
>>>>>> > Gambit-list at iro.umontreal.ca
>>>>>> > https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>>>>>> >
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> ------------------------------
>>>>>  RoyPfund at gmail.com
>>>>>  AT1-ROY-BOY1
>>>>> (281-769-2691)
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>> ------------------------------
>>>  RoyPfund at gmail.com
>>>  AT1-ROY-BOY1
>>> (281-769-2691)
>>>
>>
>>
>
> --
>
> ------------------------------
>  RoyPfund at gmail.com
>  AT1-ROY-BOY1
> (281-769-2691)
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20141028/d160f546/attachment.htm>


More information about the Gambit-list mailing list