[plt-dev] define +1
On Mon, Feb 23, 2009 at 4:54 PM, Ryan Culpepper <ryanc at ccs.neu.edu> wrote:
> On Feb 23, 2009, at 4:01 PM, Jon Rafkind 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?
>
> How about '1+' and '1-' instead?
Or |add1| and |sub1|. The names (without bars) are a little bit
longer, but the definition is shorter in that you don't have to write
it. :)
--
Carl Eastlund