summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-03-03 21:16:43 -0800
committerKaz Kylheku <kaz@kylheku.com>2012-03-04 08:49:20 -0800
commitf75994545cb88c6625e4122afa61fbbe1adeb081 (patch)
treec7206a6c009493b62313f34ae5f2deff58cc08cd
parent66bcec2c491445a76b3ef63c53ed982b896cef00 (diff)
downloadtxr-f75994545cb88c6625e4122afa61fbbe1adeb081.tar.gz
txr-f75994545cb88c6625e4122afa61fbbe1adeb081.tar.bz2
txr-f75994545cb88c6625e4122afa61fbbe1adeb081.zip
Version 60
* txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated. * txr.vim: Handle : symbol properly. * eval.c (op_defun): Bugfix: documentation says that defun supports the same parameter list as lambda, and that is the intent. But this was broken, since op_defun was expecting the parameter list to be a proper list containing only bindable symbols, ruling out the use of the consing dot for rest parameter as well as the colon keyword symbol for optional parmeters.
-rw-r--r--ChangeLog23
-rw-r--r--RELNOTES31
-rwxr-xr-xconfigure2
-rw-r--r--eval.c18
-rw-r--r--txr.14
-rw-r--r--txr.c2
-rw-r--r--txr.vim1
7 files changed, 75 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 7d0141fa..91b45196 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2012-03-04 Kaz Kylheku <kaz@kylheku.com>
+
+ Version 60
+
+ * txr.c (version): Bumped.
+
+ * txr.1: Bumped version and set date.
+
+ * configure (txr_ver): Bumped.
+
+ * RELNOTES: Updated.
+
+ * txr.vim: Handle : symbol properly.
+
+2012-03-04 Kaz Kylheku <kaz@kylheku.com>
+
+ * eval.c (op_defun): Bugfix: documentation says that defun supports
+ the same parameter list as lambda, and that is the intent. But
+ this was broken, since op_defun was expecting the parameter list
+ to be a proper list containing only bindable symbols, ruling out
+ the use of the consing dot for rest parameter as well as the colon
+ keyword symbol for optional parmeters.
+
2012-03-03 Kaz Kylheku <kaz@kylheku.com>
* eval.c (eval_init): Expose remq, remql and remqual.
diff --git a/RELNOTES b/RELNOTES
index 8d1858ac..ed738cf9 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -1,3 +1,34 @@
+ TXR 60
+ 2011-03-04
+
+
+ Features
+
+ - List element removing functions: remq, remql, remqual.
+
+ - Memory use optimizations in @(freeform) horizontal scanning.
+
+ Bugs
+
+ - Fixed incorrect processing within long lines, caused by
+ earlier optimizations in 57.
+
+ - Missing 'd' command for deleting a breakpoint implemented
+ in the debugger.
+
+ - numberp function no longer blows up on nil.
+
+ - Fixed broken @(load) directive: was not allowing directives
+ which follow it to be processed.
+
+ - Fixed incorrectly formatted line number information in
+ some exceptions.
+
+ - Fixed missing support for optional and trailing parameters
+ in defun.
+
+
+
TXR 59
2011-02-29
diff --git a/configure b/configure
index 6ed4b41b..331f7ab1 100755
--- a/configure
+++ b/configure
@@ -357,7 +357,7 @@ fi
#
-txr_ver=59
+txr_ver=60
#
# The all important banner.
diff --git a/eval.c b/eval.c
index fb4ca4ce..76985a67 100644
--- a/eval.c
+++ b/eval.c
@@ -714,13 +714,27 @@ static val op_defun(val form, val env)
val body = rest(rest(args));
val block = cons(block_s, cons(name, body));
val fun = cons(name, cons(params, cons(block, nil)));
+ val iter;
+ val colon = nil;
if (!bindable(name))
eval_error(form, lit("defun: ~s is not a bindable sybol"), name, nao);
- if (!all_satisfy(params, func_n1(bindable), nil))
- eval_error(form, lit("defun: arguments must be bindable symbols"), nao);
+ for (iter = params; consp(iter); iter = cdr(iter)) {
+ val param = car(iter);
+ if (param == colon_k) {
+ if (colon)
+ eval_error(form, lit("defun: multiple colons in parameter list"), nao);
+ else
+ colon = t;
+ continue;
+ }
+ if (!bindable(param))
+ eval_error(form, lit("defun: parameter ~s is not a bindable symbol"), param, nao);
+ }
+ if (iter && !bindable(iter))
+ eval_error(form, lit("defun: dot parameter ~s is not a bindable symbol"), iter, nao);
/* defun captures lexical environment, so env is passed */
sethash(top_fb, name, cons(name, func_interp(env, fun)));
diff --git a/txr.1 b/txr.1
index ef0fd91d..f5f9fbbe 100644
--- a/txr.1
+++ b/txr.1
@@ -21,9 +21,9 @@
.\"IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
.\"WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-.TH "TXR" 1 2012-02-29 "Utility Commands" "Txr Text Processing Language" "Kaz Kylheku"
+.TH "TXR" 1 2012-03-03 "Utility Commands" "Txr Text Processing Language" "Kaz Kylheku"
.SH NAME
-txr \- text processing language (version 59)
+txr \- text processing language (version 60)
.SH SYNOPSIS
.B txr [ options ] query-file { data-file }*
.sp
diff --git a/txr.c b/txr.c
index 08e5acc8..89023268 100644
--- a/txr.c
+++ b/txr.c
@@ -43,7 +43,7 @@
#include "debug.h"
#include "txr.h"
-const wchli_t *version = wli("59");
+const wchli_t *version = wli("60");
const wchar_t *progname = L"txr";
const wchar_t *spec_file = L"stdin";
diff --git a/txr.vim b/txr.vim
index 6bc75a9c..c0c9eb3d 100644
--- a/txr.vim
+++ b/txr.vim
@@ -107,6 +107,7 @@ syn match txr_ncomment ";.*" contained
syn match txr_ident "[:@]\?[A-Za-z0-9!$%&*+\-<=>?\\^_~]\+" contained
syn match txl_ident "[:@]\?[A-Za-z0-9!$%&*+\-<=>?\\^_~/]\+" contained
+syn match txl_ident ":" contained
syn match txr_num "[+-]\?[0-9]\+" contained
syn match txr_unquote "," contained