Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tuples?



On May 20, 2015 1:32:29 PM CDT, Ori Bernstein <ori@xxxxxxxxxxxxxx> wrote:
>On Wed, 20 May 2015 12:28:53 -0500
>Ryan Gonzalez <rymg19@xxxxxxxxx> wrote:
>
>> I just noticed the language manual mentions tuple literals; however,
>their type is never specified. Are they even fully implemented:
>
>Yep, and in use all over the place. For example, iterating over the
>utf8
>codepoints in a string:
>
>    while str.len != 0
>        (chr, str) = std.striter(str)
>        use(chr)
>    ;;
>
>or command line opt parsing:
>
>    for arg in parsed.args
>        match arg
>        | ('O', arg):   use(arg)
>        | _:            etc
>        ;;
>    ;;
>
>
>Types are specified as '(t0, t1, ..., tN)', for example:
>
>    var x : (int, char, byte[:])
>
>    x = (0xf00, 'c', "str")
>

I didn't realize that. Thanks!

>> 
>> Also:
>> - The home page still says user-defined traits aren't implemented
>> - In example 5.2 of the manual, a function named "intmax" is defined.
>Later on, it is referred to as "max".
>> - In 6.2, the last "const" is misspelled.
>
>I should get that part of the website into (public) git so that I can
>accept pull
>requests...
>
>I've been pretty bad about keeping docs up to date: Writing code is so
>much
>more fun than writing docs.

I know. I've written projects and forgotten about updating the documentation for months...

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

References:
Tuples?Ryan Gonzalez <rymg19@xxxxxxxxx>
Re: Tuples?Ori Bernstein <ori@xxxxxxxxxxxxxx>