James Dennett wrote:
Thanks for the insight. Felix must also perform a little semantic analysis while parsing because function names (though prefixed with 'fun') and certain keywords, such as 'list' and 'typeclass' are appended with square-bracketed material: fun f[T1,T2] typeclass[T1,T2] list[int] It might be better to separate things with keywords and whitespace, terminated with a period or parenthesised. Compare: fun new_function[T] (x:T,y:T):T = { ... } with new_function :: forall T. (T,T) -> T new_function x y = ... and new_function :: (forall a.) => (a,a) -> a new_function x y = ... with only a minimal knowledge of the semantics, which is more readable? (The original form is certainly compact.) Note: in the Haskell form of the last function, the function type signature (declaration) may be left out because the types may be inferred; this is also true for the types and the return type in Felix, in most cases: fun new_function (x,y) = { ... } Felix does allow ML-style syntax: fun new_function : (T,T) -> T = | (?x,?y) => ... which is readable but is limited to match expressions since it has no other way to resolve the names of the parameters, as an alternative form of: fun new_function(x:T,y:T):T = match (x,y) with | (?n,?m) => ... and I do not know whether it allows type constraints: fun new_function[T] : (T,T) -> T ...
|
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Felix-language mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/felix-language
