On Wed, Aug 15, 2012 at 5:02 PM, john skaller <skal...@users.sourceforge.net
> wrote:
>
> On 16/08/2012, at 5:51 AM, Dobes Vandermeer wrote:
>
> > stuple_cons_pattern := stuple_pattern ",," stuple_pattern =># //
> <---------------
> > "`(pat_tuple_cons ,_sr ,_1 ,_3)";
>
> > Er, yes, but perhaps we should agree on something first?
>
> I chose ,, for symmetry with **. I chose ** because it is available.
> It seemed sane to do:
>
> * **
> , ,,
>
> but there's an extension to sums to think about:
>
> + ++
>
> and i have no idea how the value operation looks!
>
Here are some other ideas, put in your votes / thoughts!
Ellipsis is used in a few languages to indicate "and the rest". Java in
particular does it this way.
Ellipsis infix: type a**b and pattern a ... b
Ellipsis suffix: type a * b ... , pattern a, b ...
Scala uses the "star" suffix in a pattern to match the "rest" of an array
Star suffix: type a * b* and pattern a , b*
Also sums are normally decomposed using separate cases rather than a single
case, so things will be very different there. A unary operator might be
needed rather than a binary one?
The operation on a sum is seems like a kind of "shift" where we're dropping
the first alternative, rather than splitting it?
fun sum_str[X] : X -> string = match x in
| case 0 of X ?x => str(x)
| _ => sum_str( shift(x) )
Maybe these would be funny questions to put on
http://programmers.stackexchange.com/?as=1 and see what suggestions come
back.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language