mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-09 22:17:33 +02:00
Unsafe (length)
This commit is contained in:
parent
488cdf26cc
commit
f091d0267e
3 changed files with 15 additions and 1 deletions
|
@ -836,6 +836,7 @@ object Cyc_set_cell(void *, object l, object val);
|
||||||
object Cyc_set_car(void *, object l, object val);
|
object Cyc_set_car(void *, object l, object val);
|
||||||
object Cyc_set_cdr(void *, object l, object val);
|
object Cyc_set_cdr(void *, object l, object val);
|
||||||
object Cyc_length(void *d, object l);
|
object Cyc_length(void *d, object l);
|
||||||
|
object Cyc_length_unsafe(void *d, object l);
|
||||||
object Cyc_list2vector(void *data, object cont, object l);
|
object Cyc_list2vector(void *data, object cont, object l);
|
||||||
object Cyc_list2string(void *d, object cont, object lst);
|
object Cyc_list2string(void *d, object cont, object lst);
|
||||||
object Cyc_list(void *data, int argc, object cont, ...);
|
object Cyc_list(void *data, int argc, object cont, ...);
|
||||||
|
|
10
runtime.c
10
runtime.c
|
@ -2002,6 +2002,16 @@ object Cyc_length(void *data, object l)
|
||||||
return obj_int2obj(len);
|
return obj_int2obj(len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
object Cyc_length_unsafe(void *data, object l)
|
||||||
|
{
|
||||||
|
int len = 0;
|
||||||
|
while (l != NULL) {
|
||||||
|
l = cdr(l);
|
||||||
|
len++;
|
||||||
|
}
|
||||||
|
return obj_int2obj(len);
|
||||||
|
}
|
||||||
|
|
||||||
char *int_to_binary(char *b, int x)
|
char *int_to_binary(char *b, int x)
|
||||||
{
|
{
|
||||||
unsigned int i = 0x80000000, leading_zeros = 1;
|
unsigned int i = 0x80000000, leading_zeros = 1;
|
||||||
|
|
|
@ -646,7 +646,10 @@
|
||||||
((eq? p 'Cyc-compilation-environment) "Cyc_compilation_environment")
|
((eq? p 'Cyc-compilation-environment) "Cyc_compilation_environment")
|
||||||
((eq? p 'command-line-arguments) "Cyc_command_line_arguments")
|
((eq? p 'command-line-arguments) "Cyc_command_line_arguments")
|
||||||
((eq? p 'system) "Cyc_system")
|
((eq? p 'system) "Cyc_system")
|
||||||
((eq? p 'length) "Cyc_length")
|
((eq? p 'length)
|
||||||
|
(if emit-unsafe
|
||||||
|
"Cyc_length_unsafe"
|
||||||
|
"Cyc_length"))
|
||||||
((eq? p 'set-car!) "Cyc_set_car")
|
((eq? p 'set-car!) "Cyc_set_car")
|
||||||
((eq? p 'set-cdr!) "Cyc_set_cdr")
|
((eq? p 'set-cdr!) "Cyc_set_cdr")
|
||||||
((eq? p 'eq?) "Cyc_eq")
|
((eq? p 'eq?) "Cyc_eq")
|
||||||
|
|
Loading…
Add table
Reference in a new issue