This is strange.  What it used to say, at some point, was that the
argument to return had to be wrapped in parentheses, i.e. return(x).
That's because return() itself is a macro which does all the proper
cleanup and calls the current continuation.  C_return() is just an
alias to the return() macro, and as you probably noticed, 99% of
existing code uses return().  However, C_return() will work as well.

I can only guess that the instruction to use C_return() was put in
there to force people to use the parens, to avoid the case where you
say 'return x' instead of 'return(x)'.

Perhaps someone else knows definitively why this was changed.

On 8/28/07, Will M Farr <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> In my copy of chicken (SVN, revision 5752), the way to return an
> object at the end of a foreign-lambda* is by using return(obj).  The
> wiki manual, however, says that I should use C_return(obj), as in
>
> (define my-strlen
>    (foreign-lambda* int ((c-string str))
>      "int n = 0;
>       while(*(str++)) ++n;
>       C_return(n);") )
>
> Which of these is the canonical one?  I'd be happy to change one of
> them (foreign-lambda* macro or wiki) to match the other.
>
> Thanks,
> Will
>
>
> _______________________________________________
> Chicken-users mailing list
> [email protected]
> http://lists.nongnu.org/mailman/listinfo/chicken-users
>


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to