-----------------------------------------------------------
New Message on cochindotnet
-----------------------------------------------------------
From: bindjinn
Message 9 in Discussion
Generics is a cool idea comming from microsoft research, which they might actually
implement. Chjeck it out: Think of c++ template style polymorphism. What makes it
cool is that type resolution is done at byte-compile time. Since il instructions are
already 'type less' and the byte-compiling already includes type checking, this
shouldn't be too expensive.
The Author even talks about polymorphic c#.
A cool feature of functional languages is that you can pass arround functions
just like you would any other objects. so in f# is could write something like this
open System let apply f x = f x in
let square x = x*x in
Console.writeline (apply square 10)
Another interesting thing about functional languages is that it all boils down to
functions and the their application on other objects (including functions). By this
the above program can be written as:
(Simply replacing the let constructs with functions)
open System
let _ =
(function apply -> function square ->
Console.WriteLine (apply square 10))
(function f -> function a -> (f a))
(function x -> (x*x)) (this works in ocaml but i cant get it to work in f# so dont
bother trying to run it) A little explanation may be in order.In ml functions are
considered to be single parameter. A function can be written as. (function p -> r)
You can apply a value v to this funcion by (function p -> r) v What happens is that
value v to the parameter p and and returns the context
so now any reference to the name p withen r will be replaced by v. If a function has
more than one parameter you can write
((function (p1) -> (function -> (p2) ->(returns)))) (v1)) (v2)
(the brackets aren't necessary they are here to show you the order in which things
will happen) I hope this makes some sense.:-)
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/cochindotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]