John Clements wrote at 10/26/2010 02:33 AM:
Who thinks it would be helpful, though, if Check Syntax were to, say, underline 
the function position?

Not for the non-beginner languages, please.

After thinking about it for a while, I'm currently of the opinion that one 
serious shortcoming of our syntax is that we fail to distinguish the function 
position from that of the arguments, something that the traditional f(x) 
notation does pretty clearly.

FWIW, when I was first learning non-Scheme Lisps, I visualized the function name as part of the parentheses pair. So, this is atomic syntax for the application of function "myfunc":

   (myfunc                  )

With some background between the parens, and elastic to accommodate arguments, and with the name permanently fixed as part of the left paren. Perhaps the "(myfunc" and its ")" are die-cast metal tags on the ends of a piece of elastic or on parts of a slide rule, though I never thought of it quite that concretely. To reinforce: the ")" are like little handles on the very ends that you can pull and push, and they mark the very ends, too.

When I moved to Scheme, I gave up this fairly physical notion of the syntax, since clearly it would discourage me from thinking about procedures as first-class objects, which Scheme seemed to consider important.

However, if new students are somehow confused by this syntax, and you want to teach the noble lie that procedures always have names, and therefore that students could use the more physical/visual notion of the syntax that always has parentheses... I suggest that the first thing to do is to make the color of the parentheses pair match the color of the procedure name.

Hand-wavey cog-sci: By making parens a different color, as DrRacket does, they are more a different thing than the procedure name things, and then we have to think more about their semantic and spatial relationships with other things.

Optionally, in addition to making parens use the same color as their procedures, you could then use hue or brightness or something to indicate nesting depth or syntactic form identity, always keeping the parens matching their procedure. (You have to explain what the color differences mean, then, and worry about whether they interrupt reading flow too much or complicate looking at more than one syntactic construct thing at a time.)

Or maybe you don't have change anything in DrRacket, and instead simply tell students some physical/visual ways to conceptualize the syntax itself. Students who have trouble remembering the syntax could latch onto conceptualization that works for them, til they no longer need the training wheels. Or til you have to teach that procedure are first-class.

--
http://www.neilvandyke.org/

_________________________________________________
 For list-related administrative tasks:
 http://lists.racket-lang.org/listinfo/dev

Reply via email to