On 16/08/2008, at 8:27 PM, john skaller wrote:

>
> On 15/08/2008, at 4:08 PM, john skaller wrote:
>>
>>
>> All this is a hack. In theory,
>>
>>      ++x;
>>
>> should be a procedure
>>
>>      proc pre_incr: &t -> void;
>>
>> that is, it should accept a pointer, not a value.
>
> This is now implemented..

There is a bug in the handling of "ref" arguments .. I don't know
what it is. This procedure:

  proc r(x:int, ref y:int)
{
   var z = case 1 of (int + long);
   print$ y; endl;
   y++;
   print $y; endl;
}


work fine when not inlined, but it fails when it is inlined.
Generally, a ref parameter x of type t is actually a pointer to t,
and all the uses in the procedure are replaced by *x, that is,
automagically dereferenced. The argument must be a pointer,
for example:

        var x  = 1;
        r(x, &x);

When inlined, it is exactly the same EXCEPT that if the argument
is the address of a simple variable, the uses are replaced by the
variable. This no longer works ..

--
john skaller
[EMAIL PROTECTED]





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to