noinline proc build_felix (xargs:list[string])
{
if xargs.len.int < 2 do
println$ "Usage: flx_build [debug]";
println$ "Execute from directory containing repository";
println$ "Uses build/release to create build/trial";
System::exit(1);
done
var v = varray xargs;
var boot_package = xargs . 1; // <-----------
var debug = xargs.len.int == 3;
flx_build (boot_package, debug);
}
This pretends a list is an array, and gives an error:
In assignment (_ctor_size<5863>[size] (_ctor_size<5863>[uint]
literal[uint](1))) = (-<6127>[size] (/*proj*/(case 1 of
bool)(unsafe_get_mv_1660<99804>), literal[size](1)));
Expected primitive _ctor_size<5863> to have property lvalue
In /Users/johnskaller/felix/build/release/share/lib/std/datatype/list.fdoc:
line 191, cols 6 to 5
190: | Cons (_,?t), ?i => unsafe_get (t, i - 1uz)
191: ;
*
192:
The actual function indicated is:
//$ get n'th element
pure fun unsafe_get: list[T] * size -> T =
| Cons (?h,_), 0uz => h
| Cons (_,?t), ?i => unsafe_get (t, i - 1uz)
;
however this works on a simple test:
noinline fun f() =>
list ('0','1','2','xx3','4')
;
var y = #f . 3;
println$ y;
The function called is indeed the right one, I just cannot
see why it fails in one case and not the other.
It is in fact assigning something to the "1" after the ".".
--
john skaller
[email protected]
http://felix-lang.org
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language