On 23/08/2013, at 1:50 PM, srean wrote:
>
> On Thu, Aug 22, 2013 at 9:35 PM, john skaller <[email protected]>
> wrote:
>
> On 23/08/2013, at 10:03 AM, srean wrote:
>
> > I have a simpler question, could naming scheme of $1, $2 be made more
> > informative, that is allow more verbose identifiers. I find them as a wart
> > in an otherwise pleasant syntax of Felix. Of course to do this one would
> > have to name the arguments in the signature, I think thats a good thing
> > anyway as far as readability and comprehension(human) is concerned.
>
> I agree, actually I suggest if you use:
>
> fun f: int * int -> int
>
> it stays with numbers but if you use
>
> fun f(x:int,y:int) : int = """ f ($x. $y) """;
>
> it goes with names.
>
> This would have to apply to type variables as well.
>
>
> I like this a lot.
Really. Then I suggest you implement it :-)
It can be done in user space, no need to touch the compiler.
I take it you can write Scheme? So it is done in Scheme,
just add a new grammar extension. The action codes are written
in Scheme. All you need to do is save the argument names in
an "array" and then parse the string, replacing
$name
with
$digits
and then the compiler won't know the difference.
--
john skaller
[email protected]
http://felix-lang.org
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language