[racket-dev] New error messages for *SL

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Jul 12 08:58:57 EDT 2011

I am with your initial thoughts. 

I find this inconsistency disturbing. 

I also wish to use BSL as a language that is isomorphic to the kind of mathematics that students see in middle school and high school. (I think of structs as generalized Cartesian points, i.e., something comprehensible in principle.) In this world, a zero-arity function doesn't exist. (Yes, I should introduce vectors right here and now.) 

If the author of a teachpack wishes to break this convention (to hell with Matthias's stupid ideas of helping kids with their math) that's fine. But such teachpacks should have to extend the grammar explicitly. 

-- Matthias




On Jul 12, 2011, at 8:45 AM, Matthew Flatt wrote:

> At Mon, 11 Jul 2011 18:28:56 -0400, Guillaume Marceau wrote:
>> On Thu, Jul 7, 2011 at 12:44 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
>>> * ASL incorrectly specifies >= 1 arguments required for functions and
>>>   function calls (i.e., functions and call are not common syntax at
>>>   that point).
>>> 
>> 
>> Stephen pointed out that function calls in BSL can invoke functions of
>> zero arguments. You can't define such a function, but if you get it
>> from a library, it works fine.
>> 
>> Should I document the grammar for function calls as (name expression
>> ...) thorough?
> 
> My initial reaction was that a 0-ary function call is a syntax error,
> but a teachpack might extend the grammar by introducing a binding that
> works without arguments. That is, the 0-ary extension is part of the
> teachpack, not the grammar.
> 
> But it seems that 0-ary function calls are not syntax errors after all
> (in any Recent version of DrRacket). For example, BSL accepts
> 
> (define (f x)
>   (cons))
> 
> and complain only when `f' is called. I'm not sure whether it's better
> to try to fix that or leave it alone (maybe it's not causing any
> trouble) and adapt the grammar somehow.
> 
> I write "somehow" because calling a (not pre-)defined function with 0
> argument is a syntax error. For example, BSL rejects
> 
> (define (f x)
>   (f))
> 
> as a syntax error.
> 
> 
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev




Posted on the dev mailing list.