[nem-en] indentation syntax ideas

Philippe Quesnel philippe.quesnel at gmail.com
Sun Oct 30 01:53:19 CEST 2005


ncc/testsuite/positive/indentation-syntax.n compiled fine,

I took this file :
----------------
variant Color {
 | Red
 | Yellow
 | Green
 | Different {
 red : float;
 green : float;
 blue : float;
 }
}

def string_of_color (color)
{
 match (color) {
 | Color.Red => "red"
 | Color.Yellow => "yellow"
 | Color.Green => "green"
//~ | Color.Different (red = r, green = g, blue = b) =>
 | Color.Different (r,g,b) =>
 $ "rgb($r, $g, $b)"
 }
}
-----------------

and changed it to this :

variant Color
 | Red
 | Yellow
 | Green
 | Different
 red : float
 green : float
 blue : float

def string_of_color (color)

 match (color)
 | Color.Red => "red"
 | Color.Yellow => "yellow"
 | Color.Green => "green"
//~ | Color.Different (red = r, green = g, blue = b) =>
 | Color.Different (r,g,b) =>
 $ "rgb($r, $g, $b)"
-------------

and it does not compile.
I tried a couple variations,
the following don't compile either:

---------------
variant Color
 | Red
 | Yellow
 | Green
 | Different
 red : float
 green : float
 blue : float

def string_of_color (color)
{
 match (color) {
 | Color.Red => "red"
 | Color.Yellow => "yellow"
 | Color.Green => "green"
//~ | Color.Different (red = r, green = g, blue = b) =>
 | Color.Different (r,g,b) =>
 $ "rgb($r, $g, $b)"
 }
}
---------------

---------------
variant Color {
 | Red
 | Yellow
 | Green
 | Different {
 red : float;
 green : float;
 blue : float;
 }
}

def string_of_color (color)

 match (color)
 | Color.Red => "red"
 | Color.Yellow => "yellow"
 | Color.Green => "green"
//~ | Color.Different (red = r, green = g, blue = b) =>
 | Color.Different (r,g,b) =>
 $ "rgb($r, $g, $b)"
---------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /mailman/pipermail/devel-en/attachments/20051030/d5e1575a/attachment.html


More information about the devel-en mailing list