diff options
Diffstat (limited to 'src/lisp')
| -rw-r--r-- | src/lisp/ao_lisp_builtin.c | 4 | ||||
| -rw-r--r-- | src/lisp/ao_lisp_builtin.txt | 2 | ||||
| -rw-r--r-- | src/lisp/ao_lisp_const.lisp | 16 | ||||
| -rw-r--r-- | src/lisp/ao_lisp_string.c | 5 | 
4 files changed, 19 insertions, 8 deletions
| diff --git a/src/lisp/ao_lisp_builtin.c b/src/lisp/ao_lisp_builtin.c index ccd13d07..e5370f90 100644 --- a/src/lisp/ao_lisp_builtin.c +++ b/src/lisp/ao_lisp_builtin.c @@ -533,9 +533,9 @@ ao_lisp_do_string_to_list(struct ao_lisp_cons *cons)  }  ao_poly -ao_lisp_do_flush(struct ao_lisp_cons *cons) +ao_lisp_do_flush_output(struct ao_lisp_cons *cons)  { -	if (!ao_lisp_check_argc(_ao_lisp_atom_flush, cons, 0, 0)) +	if (!ao_lisp_check_argc(_ao_lisp_atom_flush2doutput, cons, 0, 0))  		return AO_LISP_NIL;  	ao_lisp_os_flush();  	return _ao_lisp_bool_true; diff --git a/src/lisp/ao_lisp_builtin.txt b/src/lisp/ao_lisp_builtin.txt index 4c484337..c324ca67 100644 --- a/src/lisp/ao_lisp_builtin.txt +++ b/src/lisp/ao_lisp_builtin.txt @@ -31,7 +31,7 @@ f_lexpr		less_equal	<=  f_lexpr		greater_equal	>=  f_lambda	list_to_string		list->string  f_lambda	string_to_list		string->list -f_lambda	flush +f_lambda	flush_output		flush-output  f_lambda	delay  f_lexpr		led  f_lambda	save diff --git a/src/lisp/ao_lisp_const.lisp b/src/lisp/ao_lisp_const.lisp index 191ef005..861a4fc8 100644 --- a/src/lisp/ao_lisp_const.lisp +++ b/src/lisp/ao_lisp_const.lisp @@ -60,10 +60,17 @@  (defun caddr (l) (car (cdr (cdr l)))) -(defun nth (list n) -  (cond ((= n 0) (car list)) -	((nth (cdr list) (1- n))) -	) +(define list-tail (lambda (x k) +		    (if (zero? k) +			x +		      (list-tail (cdr x (- k 1))) +		      ) +		    ) +  ) + +(define list-ref (lambda (x k) +		   (car (list-tail x k)) +		   )    )  					; simple math operators @@ -264,6 +271,7 @@  (let ((x 1)) x) +(define let* let)  					; boolean operators  (define or (lexpr (l) diff --git a/src/lisp/ao_lisp_string.c b/src/lisp/ao_lisp_string.c index fff218df..1daa50ea 100644 --- a/src/lisp/ao_lisp_string.c +++ b/src/lisp/ao_lisp_string.c @@ -140,7 +140,10 @@ ao_lisp_string_write(ao_poly p)  			printf ("\\t");  			break;  		default: -			putchar(c); +			if (c < ' ') +				printf("\\%03o", c); +			else +				putchar(c);  			break;  		}  	} | 
