Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

.NET Languages

Name: Anonymous 2007-08-01 6:24 ID:EwJeI4MZ

Which one do you like? I have narrowed my choice down to Nemerle, Boo and F#. I really like Nemerle, but it's the least active of these, F# looks nice and is supported by Microsoft, Boo kinda failed to excite me, but isn't bad.

DISCUSS!

Name: Anonymous 2007-08-09 6:13 ID:kvvVswIR

>>20
Yeah, I don't think it's possible. Anyway, I figured out an alternative solution..

The problem was that there is this class that gets input from two sources and puts it together, one source sets up data, other requests it. As some data can be quite heavy and possibly never requested it's not a good idea to calculate it upfront. So, the idea was to, besides other data, set up also functions and later if required respond with what they return, that didn't work out so well. Alternative solution:

    class Test
        public static m1 () : IEnumerable
            WriteLine ("HI2U FROM m1")
            for (mutable i = 0; i <= 3; i++)
                yield i.ToString ()
        public static Main () : void
            def a = ArrayList ()
            a.Add ("foo")
            a.Add (42)
            a.Add (m1 ())
            WriteLine ("BEGIN MATCH")
            def loop (i = 0) : void
                if (a.Count == i)
                    WriteLine ("END MATCH")
                else
                    match (a[i] : object)
                        | _ is string =>
                            WriteLine ("string GET")
                        | _ is int =>
                            WriteLine ("int GET")
                        | _ is IEnumerable =>
                            WriteLine ("IEnumerable GET")
                            //foreach (z in a[i] :> IEnumerable)
                                //WriteLine (z);
                        | _ =>
                            WriteLine ("DUNNO LOL")
                    loop (i + 1)
            loop ()


When you run this notice that there isn't "HI2U FROM m1", although you do m1 (), only when you uncomment foreach you see it.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List