On Mon, 2006-10-02 at 10:36 +1000, Jonathan Kelly wrote:

> fun jseek: file * long * int -> int = 'std::fseek($1, $2, $3)';

> val x = jseek(fil, 0L, 2);
> // uncommenting out the following to stop previous being elided
> //print "jseek returned ";
> //print x;
> //endl;

Two things to notice. First, jseek is a fun not a gen,
so the compiler assumes it is a pure function.

Second, you're initialising an unused val from the
function .. so Felix is eliding it. Just think you'd
written:

val x = sin y;

and not used x .. what's the point wasting time calculating
sin y?

You can solve this three ways:

(a) make x a var (iable)
(b) make jseek a gen (erator)
(c) write

        ignore(jseek(fil,0L,2))


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to