How deal list function arguments in translate and compile ?
Subject: How deal list function arguments in translate and compile ?
From: Niitsuma Hirotaka
Date: Fri, 19 Jun 2009 17:28:56 +0900
>Can you please create a bug report?
>See: http://sourceforge.net/tracker/?atid=104933&group_id=4933
I add
https://sourceforge.net/tracker/?func=detail&aid=2808861&group_id=4933&atid=104933
> Try omitting the mode_declare(completearray(...)), i.e.
> wf(v) := v[1] + v[2];
> I think that is translated into working code.
> (Note that return(...) is not needed; the return value is the value
> of the last expression evaluated.)
>
> Hope this helps,
Thnak you advice.
Without completearray, it woks.
wf(v):=v[1]+v[2]
translate(wf)
wf([1,2]) /*->3 ok*/
wf(v):=block(return(v[1]+v[2]))
translate(wf)
wf([1,2]) /*->3 ok*/