Hi Nicolas and all,
I just updated to the recent CVS version and found out it is actually
broken. "make libs" fails.
I have traced the problem to changes in builtins.c (patch with changes in
question is attached).
The problem is that $sblit always return null but "blit" in String.nml
checks for null and throws an exception if $sblit returns that. I.e. it
always fails.
Not sure that just removing the check is a good idea. Also not sure if
$ablit is in workable state now.
Hope you'll fix that soon :)
Best regards,
Vadim.
Index: vm/builtins.c
===================================================================
RCS file: /cvsroot/neko/vm/builtins.c,v
retrieving revision 1.67
diff -u -r1.67 builtins.c
--- vm/builtins.c 22 Dec 2008 13:48:04 -0000 1.67
+++ vm/builtins.c 30 Aug 2010 10:26:05 -0000
@@ -121,7 +121,7 @@
}
/**
- $ablit : dst:array -> dst_pos:int -> src:array -> src_pos:int -> len:int -> array
+ $ablit : dst:array -> dst_pos:int -> src:array -> src_pos:int -> len:int -> void
<doc>
Copy [len] elements from [src_pos] of [src] to [dst_pos] of [dst].
An error occurs if out of arrays bounds.
@@ -140,7 +140,7 @@
if( dpp < 0 || spp < 0 || ll < 0 || dpp + ll < 0 || spp + ll < 0 || dpp + ll > val_array_size(dst) || spp + ll > val_array_size(src) )
neko_error();
memmove(val_array_ptr(dst)+dpp,val_array_ptr(src)+spp,ll * sizeof(value));
- return val_true;
+ return val_null;
}
/**
@@ -288,11 +288,11 @@
if( dpp < 0 || spp < 0 || ll < 0 || dpp + ll < 0 || spp + ll < 0 || dpp + ll > val_strlen(dst) || spp + ll > val_strlen(src) )
neko_error();
memmove(val_string(dst)+dpp,val_string(src)+spp,ll);
- return val_true;
+ return val_null;
}
/**
- $sfind : src:string -> pos:int -> pat:string -> int
+ $sfind : src:string -> pos:int -> pat:string -> int?
<doc>
Return the first position starting at [pos] in [src] where [pat] was found.
Return null if not found. Error if [pos] is outside [src] bounds.
@@ -506,7 +506,7 @@
}
/**
- $closure : function -> any* -> function
+ $closure : function -> object -> any* -> function
<doc>Build a closure by applying a given number of arguments to a function</doc>
**/
static value builtin_closure( value *args, int nargs ) {
--
Neko : One VM to run them all
(http://nekovm.org)