Felix type A -> B is a function and A --> B is a C function.
If you have the type
A * B --> C
this normally should be the C function type:
C (f)(A, B)
i.e. with separated arguments. Of course this is a hack because this:
(A * B) --> C
would be a different type:
C (f) (A * B) // where the C type of A * B is used, a tuple type
breaking the rule that () are only used for grouping .. still it is only a
small hack ;)
However I have found a bug: the special hackery doesn't take arrays into
account. This type:
A * A --> C
is reduced to
A ^ 2 --> C
and then we get
C (f) (A ^ 2) // tuple type A * A is argument
Looks like the special hackery doesn't recognise A ^ 2 as a reduced
form of A * A. I'm not sure what would be done if the argument
we *actually* an array (as opposed to just one or two elements).
I ran into this implementing darray, which is a dynamic array
of unbounded length. Will fix. BTW: I used a C function because
it is lightweight (one pointer) and doesn't need garbage collection:
a Felix function would use a closure, and invoking them requires
cloning the closure object (because closures are not re-entrant).
--
john skaller
[email protected]
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language