Felix current says that if you write
requires X
it means to put all the floating insertions tagged X into the output,
in order of writing within the two fixed places for insertions
(header and body).
Because the semantics is set-like, errors are not possible.
If you mis-spell X, you just get nothing, because an empty
set is a valid set.
Originally the idea was you could tag a lot of things X,
in particular the prototype of a C function and the definition.
Then requiring X would drag in both.
however this also means you cannot do this:
fun f .. requires Unix;
fun f .. requires Windows;
as a way of selecting alternate implementations.
You get both.
I am thinking to change the semantics so floating tag names
must be unique, and then making requires fail if it cannot
find a unique tag.
Perhaps also:
fun f .. provided Unix;
fun f .. provided Windows;
since we don't want a failure here, we just want to elide
all but one definition. At present you have to use
a conditional with a constant condition to do conditional
compilation.
Selection like this is quite distinct from requirements.
Both express dependencies, but in the opposite direction.
A requires B
means that to make A work you have to drag in B.
Whereas with conditional compilation, you're not actually
saying
this f requires Unix
Nope. You're actually saying:
Unix requires this f.
The Unix tag is not a dependency. Its a goal.
Its the function f here that's the dependency.
Hmmm ..
Unix requires
fun f:int -> int = "f($1)"
requires header "include <f.h>"
;
--
john skaller
[email protected]
http://felix-lang.org
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
DESIGN Expert tips on starting your parallel project right.
http://goparallel.sourceforge.net/
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language