[plt-dev] define +1
Just between us, I like using -1 as a number. ;)
But you can put bars around it:
> (define (|-1| x) (- x 1))
> (|-1| 2)
1
Not sure how helpful that was ...,
Robby
On Mon, Feb 23, 2009 at 3:01 PM, Jon Rafkind <rafkind at cs.utah.edu> wrote:
>> (define (+1 x) x)
> readline::57: define: bad syntax (not an identifier for procedure name, and
> not a nested procedure form) at: 1 in: (define (1 x) x)
>
>> (define (-1 x) x)
> readline::75: define: bad syntax (not an identifier for procedure name, and
> not a nested procedure form) at: -1 in: (define (-1 x) x)
>
> I guess +1 and -1 are parsed as numbers, which aren't included as
> identifiers. Is this fixable?
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-dev
>