APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1284640563 -3600
# Node ID 0d436a78c514cca5bc27c840366a2fa9b927fc00
# Parent 75bcb5bef4595fcc37f01e3e173d96b59fa8a821
Add an implementation for #'the, cl-macs.el
lisp/ChangeLog addition:
2010-09-16 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (the): Add a docstring and an implementation for this
macro.
* bytecomp.el (byte-compile-initial-macro-environment): Add #'the
to this, checking byte-compile-delete-errors to decide whether to
make the type assertion. Change the initvalue to use backquote and
preceding commas for the lambda expressions, to allow the latter
to be compiled.
diff -r 75bcb5bef459 -r 0d436a78c514 lisp/ChangeLog
--- a/lisp/ChangeLog Tue Sep 07 17:03:46 2010 +0100
+++ b/lisp/ChangeLog Thu Sep 16 13:36:03 2010 +0100
@@ -1,3 +1,13 @@
+2010-09-16 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl-macs.el (the): Add a docstring and an implementation for this
+ macro.
+ * bytecomp.el (byte-compile-initial-macro-environment): Add #'the
+ to this, checking byte-compile-delete-errors to decide whether to
+ make the type assertion. Change the initvalue to use backquote and
+ preceding commas for the lambda expressions, to allow the latter
+ to be compiled.
+
2010-09-06 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-seq.el (replace):
diff -r 75bcb5bef459 -r 0d436a78c514 lisp/bytecomp.el
--- a/lisp/bytecomp.el Tue Sep 07 17:03:46 2010 +0100
+++ b/lisp/bytecomp.el Thu Sep 16 13:36:03 2010 +0100
@@ -493,13 +493,21 @@
(fset (car elt) (cdr elt)))))))
(defconst byte-compile-initial-macro-environment
- '((byte-compiler-options . (lambda (&rest forms)
- (apply 'byte-compiler-options-handler forms)))
- (eval-when-compile . (lambda (&rest body)
- (list 'quote (byte-compile-eval (cons 'progn body)))))
- (eval-and-compile . (lambda (&rest body)
- (byte-compile-eval (cons 'progn body))
- (cons 'progn body))))
+ `((byte-compiler-options
+ . ,#'(lambda (&rest forms)
+ (apply 'byte-compiler-options-handler forms)))
+ (eval-when-compile
+ . ,#'(lambda (&rest body)
+ (list 'quote (byte-compile-eval (cons 'progn body)))))
+ (eval-and-compile
+ . ,#'(lambda (&rest body)
+ (byte-compile-eval (cons 'progn body))
+ (cons 'progn body)))
+ (the .
+ ,#'(lambda (&rest body)
+ (if byte-compile-delete-errors
+ (second body)
+ (apply (cdr (symbol-function 'the)) body)))))
"The default macro-environment passed to macroexpand by the compiler.
Placing a macro here will cause a macro to have different semantics when
expanded by the compiler as when expanded by the interpreter.")
diff -r 75bcb5bef459 -r 0d436a78c514 lisp/cl-macs.el
--- a/lisp/cl-macs.el Tue Sep 07 17:03:46 2010 +0100
+++ b/lisp/cl-macs.el Thu Sep 16 13:36:03 2010 +0100
@@ -1962,7 +1962,19 @@
;;;###autoload
(defmacro locally (&rest body) (cons 'progn body))
;;;###autoload
-(defmacro the (type form) form)
+(defmacro the (type form)
+ "Assert that FORM gives a result of type TYPE, and return FORM.
+
+TYPE is a Common Lisp type specifier.
+
+If macro expansion of a `the' form happens during byte compilation, and the
+byte compiler customization variable `byte-compile-delete-errors' is
+non-nil, `the' just returns FORM, without making any type checks."
+ (if (cl-safe-expr-p form)
+ `(prog1 ,form (assert ,(cl-make-type-test form type) t))
+ (let ((saved (gensym)))
+ `(let ((,saved ,form))
+ (prog1 ,saved (assert ,(cl-make-type-test saved type) t))))))
(defvar cl-proclaim-history t) ; for future compilers
(defvar cl-declare-stack t) ; for future compilers
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-patches
Ar an séiú lá de mí Méan Fómhair, scríobh Vin Shelton:
> I think this patch broke the VS6 compile of fns.c:
>
> C:\cygwin\usr\local\src\xemacs-21.5-proc-2010-09-06\src\fns.c(1198) :
> warning C4244: '=' : conversion from 'double ' to 'long ', possible
> loss of data
> C:\cygwin\usr\local\src\xemacs-21.5-proc-2010-09-06\src\fns.c(5866) :
> error C2143: syntax error : missing ';' before 'type'
> C:\cygwin\usr\local\src\xemacs-21.5-proc-2010-09-06\src\fns.c(5879) :
> error C2065: 'obj' : undeclared identifier
> NMAKE : fatal error U1077: 'cl' : return code '0x2'
> Stop.
>
> Thanks for looking into this.
What an odd error. Anyway, it’s clear enough what’s wrong once you look at
the relevant lines, and I’ve committed the below. Please confirm whether the
change fixes the build for you, as I mention in the ChangeLog entry I didn’t
see the problem with Visual Studio 2005, and thanks for reporting the
problem.
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1283875426 -3600
# Node ID 75bcb5bef4595fcc37f01e3e173d96b59fa8a821
# Parent 69f687b3ba9d833c9f7b2872e679b511df1c578b
Replace a doubled semi-colon with a single semi-colon, fns.c, for VS6's sake.
src/ChangeLog addition:
2010-09-07 Aidan Kehoe <kehoea(a)parhasard.net>
* fns.c (Freplace):
Replace an accidental double semi-colon with a single semi-colon,
hopefully fixing Vin's Visual Studio 6 build. (Visual Studio 2005
had no problem with it, oddly.)
diff -r 69f687b3ba9d -r 75bcb5bef459 src/ChangeLog
--- a/src/ChangeLog Mon Sep 06 17:29:51 2010 +0100
+++ b/src/ChangeLog Tue Sep 07 17:03:46 2010 +0100
@@ -1,3 +1,10 @@
+2010-09-07 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * fns.c (Freplace):
+ Replace an accidental double semi-colon with a single semi-colon,
+ hopefully fixing Vin's Visual Studio 6 build. (Visual Studio 2005
+ had no problem with it, oddly.)
+
2010-09-06 Aidan Kehoe <kehoea(a)parhasard.net>
Move #'replace to C; add bounds checking to it and to #'fill.
diff -r 69f687b3ba9d -r 75bcb5bef459 src/fns.c
--- a/src/fns.c Mon Sep 06 17:29:51 2010 +0100
+++ b/src/fns.c Tue Sep 07 17:03:46 2010 +0100
@@ -5862,7 +5862,7 @@
{
Ibyte *staging, *cursor;
Elemcount count, len1 = string_char_length (sequence1);
- Elemcount len2 = XINT (Flength (sequence2)), ii = 0;;
+ Elemcount len2 = XINT (Flength (sequence2)), ii = 0;
Lisp_Object obj;
check_sequence_range (sequence1, start1, end1, make_int (len1));
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-patches
>>>>> Mats Lidell <matsl(a)xemacs.org> writes:
Mats> I don't have the Karma to commit this patch. Can someone who has
Mats> please do.
I have also reverted this patch from the Package Smoketest so that the
smoketest now is based on what is in the repository.
Yours
--
%% Mats
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-patches