You can subscribe to this list here.
| 2000 |
Jan
(81) |
Feb
(55) |
Mar
(459) |
Apr
(159) |
May
(126) |
Jun
(69) |
Jul
(48) |
Aug
(29) |
Sep
(106) |
Oct
(76) |
Nov
(155) |
Dec
(161) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(122) |
Feb
(150) |
Mar
(294) |
Apr
(124) |
May
(197) |
Jun
(266) |
Jul
(111) |
Aug
(259) |
Sep
(163) |
Oct
(142) |
Nov
(101) |
Dec
(86) |
| 2002 |
Jan
(187) |
Feb
(108) |
Mar
(274) |
Apr
(157) |
May
(346) |
Jun
(242) |
Jul
(345) |
Aug
(187) |
Sep
(263) |
Oct
(69) |
Nov
(30) |
Dec
(76) |
| 2003 |
Jan
(125) |
Feb
(191) |
Mar
(87) |
Apr
(69) |
May
(107) |
Jun
(66) |
Jul
(112) |
Aug
(161) |
Sep
(184) |
Oct
(137) |
Nov
(28) |
Dec
(61) |
| 2004 |
Jan
(148) |
Feb
(99) |
Mar
(365) |
Apr
(225) |
May
(311) |
Jun
(204) |
Jul
(95) |
Aug
(214) |
Sep
(256) |
Oct
(290) |
Nov
(239) |
Dec
(152) |
| 2005 |
Jan
(253) |
Feb
(183) |
Mar
(178) |
Apr
(88) |
May
(175) |
Jun
(195) |
Jul
(122) |
Aug
(81) |
Sep
(119) |
Oct
(200) |
Nov
(110) |
Dec
(179) |
| 2006 |
Jan
(154) |
Feb
(64) |
Mar
(55) |
Apr
(69) |
May
(66) |
Jun
(64) |
Jul
(80) |
Aug
(59) |
Sep
(62) |
Oct
(90) |
Nov
(132) |
Dec
(106) |
| 2007 |
Jan
(58) |
Feb
(51) |
Mar
(59) |
Apr
(19) |
May
(33) |
Jun
(52) |
Jul
(15) |
Aug
(50) |
Sep
(41) |
Oct
(259) |
Nov
(323) |
Dec
(136) |
| 2008 |
Jan
(205) |
Feb
(128) |
Mar
(203) |
Apr
(126) |
May
(307) |
Jun
(166) |
Jul
(259) |
Aug
(181) |
Sep
(217) |
Oct
(265) |
Nov
(256) |
Dec
(132) |
| 2009 |
Jan
(104) |
Feb
(81) |
Mar
(27) |
Apr
(21) |
May
(85) |
Jun
(237) |
Jul
(243) |
Aug
(199) |
Sep
(178) |
Oct
(151) |
Nov
(64) |
Dec
(39) |
| 2010 |
Jan
(33) |
Feb
(146) |
Mar
(125) |
Apr
(109) |
May
(52) |
Jun
(135) |
Jul
(103) |
Aug
(68) |
Sep
(99) |
Oct
(88) |
Nov
(45) |
Dec
(56) |
| 2011 |
Jan
(19) |
Feb
(32) |
Mar
(50) |
Apr
(105) |
May
(46) |
Jun
(22) |
Jul
(101) |
Aug
(80) |
Sep
(52) |
Oct
(16) |
Nov
(10) |
Dec
(29) |
| 2012 |
Jan
(8) |
Feb
(22) |
Mar
(17) |
Apr
(68) |
May
(19) |
Jun
(19) |
Jul
(12) |
Aug
(6) |
Sep
(13) |
Oct
(5) |
Nov
(5) |
Dec
(5) |
| 2013 |
Jan
(6) |
Feb
(4) |
Mar
(3) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(6) |
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
(16) |
Apr
(1) |
May
(8) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
|
Feb
(8) |
Mar
(23) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
(7) |
Sep
(1) |
Oct
|
Nov
|
Dec
(5) |
| 2016 |
Jan
|
Feb
|
Mar
(16) |
Apr
(6) |
May
(53) |
Jun
(19) |
Jul
(3) |
Aug
(39) |
Sep
(24) |
Oct
(2) |
Nov
(19) |
Dec
|
| 2017 |
Jan
(13) |
Feb
(44) |
Mar
(208) |
Apr
(12) |
May
(94) |
Jun
(54) |
Jul
(18) |
Aug
(52) |
Sep
(12) |
Oct
(22) |
Nov
(27) |
Dec
(93) |
| 2018 |
Jan
(85) |
Feb
(28) |
Mar
(16) |
Apr
(47) |
May
(16) |
Jun
(15) |
Jul
(10) |
Aug
(3) |
Sep
(5) |
Oct
|
Nov
(6) |
Dec
|
| 2019 |
Jan
(4) |
Feb
(6) |
Mar
(12) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
| 2020 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(6) |
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
| 2022 |
Jan
(2) |
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(10) |
Oct
(5) |
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2024 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(8) |
Nov
(28) |
Dec
(3) |
| 2025 |
Jan
(8) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <cli...@li...> - 2010-12-14 19:06:16
|
Send clisp-cvs mailing list submissions to cli...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/clisp-cvs or, via email, send a message with subject or body 'help' to cli...@li... You can reach the person managing the list at cli...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of clisp-cvs digest..." CLISP CVS commits for today Today's Topics: 1. clisp/src ChangeLog,1.7556,1.7557 pathname.d,1.520,1.521 (Sam Steingold) 2. clisp/tests ChangeLog,1.668,1.669 path.tst,1.92,1.93 (Sam Steingold) 3. clisp/tests path.tst,1.93,1.94 (Sam Steingold) 4. clisp/tests path.tst,1.92,1.93 (Sam Steingold) 5. clisp/tests path.tst,1.92,1.93 (Sam Steingold) ---------------------------------------------------------------------- Message: 1 Date: Fri, 15 Oct 2010 18:32:27 +0000 From: Sam Steingold <sd...@us...> Subject: clisp/src ChangeLog,1.7556,1.7557 pathname.d,1.520,1.521 To: cli...@li... Message-ID: <E1P...@sf...> Update of /cvsroot/clisp/clisp/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15263/src Modified Files: ChangeLog pathname.d Log Message: * src/pathname.d (PROBE-PATHNAME): fix open stream handling Index: pathname.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/pathname.d,v retrieving revision 1.520 retrieving revision 1.521 diff -u -d -r1.520 -r1.521 --- pathname.d 27 Sep 2010 21:39:10 -0000 1.520 +++ pathname.d 15 Oct 2010 18:32:25 -0000 1.521 @@ -6027,13 +6027,13 @@ "none", "none/" ==> NIL the first value is the truename, the second is the "correct" absolute pathname */ - if (builtin_stream_p(STACK_0)) { /* stream -> treat extra: */ - if (probe_path_from_stream(&STACK_0)) - { VALUES1(popSTACK()); return; } - } else /* turn into a pathname */ + if (builtin_stream_p(STACK_0)) { /* stream -> path */ + probe_path_from_stream(&STACK_0); /* STACK_0 is now an absolute truename */ + } else { /* turn into a pathname */ STACK_0 = merge_defaults(coerce_pathname(STACK_0)); - check_no_wildcards(STACK_0); - STACK_0 = use_default_dir(STACK_0); /* absolute pathname */ + check_no_wildcards(STACK_0); + STACK_0 = use_default_dir(STACK_0); /* absolute pathname */ + } /* STACK_0 is a non-wild non-logical absolute pathname */ var namestring_kind_t classification; var char resolved[MAXPATHLEN]; @@ -6080,7 +6080,7 @@ } break; case NAMESTRING_FILE: /* file */ if (namenullp(STACK_0)) { /* make STACK_0 a regular file pathname */ - STACK_0 = copy_pathname(STACK_0); + STACK_0 = copy_pathname(STACK_0); var object tmp = ThePathname(STACK_0)->pathname_directory; while (!nullp(Cdr(Cdr(tmp)))) tmp = Cdr(tmp); pushSTACK(Car(Cdr(tmp))); Cdr(tmp) = NIL; /* chop off last dir comp */ Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.7556 retrieving revision 1.7557 diff -u -d -r1.7556 -r1.7557 --- ChangeLog 12 Oct 2010 19:46:04 -0000 1.7556 +++ ChangeLog 15 Oct 2010 18:32:25 -0000 1.7557 @@ -1,3 +1,7 @@ +2010-10-15 Sam Steingold <sd...@gn...> + + * pathname.d (PROBE-PATHNAME): fix open stream handling + 2010-10-12 Sam Steingold <sd...@gn...> * modules/editor: resurrect editor.lisp from 1998; update and fix ------------------------------ Message: 2 Date: Fri, 15 Oct 2010 18:33:35 +0000 From: Sam Steingold <sd...@us...> Subject: clisp/tests ChangeLog,1.668,1.669 path.tst,1.92,1.93 To: cli...@li... Message-ID: <E1P...@sf...> Update of /cvsroot/clisp/clisp/tests In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15498/tests Modified Files: ChangeLog path.tst Log Message: * tests/path.tst: more PROBE-PATHNAME tests Index: path.tst =================================================================== RCS file: /cvsroot/clisp/clisp/tests/path.tst,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- path.tst 14 Sep 2010 21:44:22 -0000 1.92 +++ path.tst 15 Oct 2010 18:33:33 -0000 1.93 @@ -1255,6 +1255,42 @@ (rmrf d))) #+clisp ((2 T) (7 T) (2 T) (7 T)) +#+clisp (consp (show (multiple-value-list (ext:probe-pathname "/")))) #+clisp T + +#+(and clisp unix) +(equalp (show (multiple-value-list (ext:probe-pathname "/etc"))) + (show (multiple-value-list (ext:probe-pathname "/etc/")))) +#+(and clisp unix) T + +#+clisp +(equalp + (show (multiple-value-list (ext:probe-pathname (ext:default-directory)))) + (show (multiple-value-list (ext:probe-pathname "")))) +#+clisp T + +#+clisp +(let* ((path "test-pathname") + (s1 (open path :direction :probe :if-does-not-exist :create)) + (s2 (open path :direction :input))) + (unwind-protect + (let ((p-p (show (multiple-value-list (ext:probe-pathname path)))) + (p-c (show (multiple-value-list (ext:probe-pathname s1)))) + (p-o (show (multiple-value-list (ext:probe-pathname s2))))) + (list (equalp p-p p-c) (equalp p-p p-o) (equalp p-c p-o))) + (close s2) + (delete-file s1))) +#+clisp (T T T) + +;; top-level directory on disk C +#+(and clisp win32) (pathname-directory (ext:probe-pathname "c:/")) +#+(and clisp win32) (:ABSOLUTE) + +;; default directory on disk C +#+(and clisp win32) +(let ((p (ext:probe-pathname "c:"))) + (list (pathname-namee p) (paathname-type))) +#+(and clisp win32) (NIL NIL) + #+(and clisp unicode) (block test-weird-pathnames (handler-bind ((parse-error Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/tests/ChangeLog,v retrieving revision 1.668 retrieving revision 1.669 diff -u -d -r1.668 -r1.669 --- ChangeLog 21 Sep 2010 19:53:35 -0000 1.668 +++ ChangeLog 15 Oct 2010 18:33:33 -0000 1.669 @@ -1,3 +1,7 @@ +2010-10-15 Sam Steingold <sd...@gn...> + + * path.tst: more PROBE-PATHNAME tests + 2010-09-21 Sam Steingold <sd...@gn...> * screen.tst: add demo for the SCREEN package ------------------------------ Message: 3 Date: Fri, 15 Oct 2010 18:44:32 +0000 From: Sam Steingold <sd...@us...> Subject: clisp/tests path.tst,1.93,1.94 To: cli...@li... Message-ID: <E1P...@sf...> Update of /cvsroot/clisp/clisp/tests In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv17558 Modified Files: path.tst Log Message: * tests/path.tst: more PROBE-PATHNAME tests oops Index: path.tst =================================================================== RCS file: /cvsroot/clisp/clisp/tests/path.tst,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- path.tst 15 Oct 2010 18:33:33 -0000 1.93 +++ path.tst 15 Oct 2010 18:44:30 -0000 1.94 @@ -1288,7 +1288,7 @@ ;; default directory on disk C #+(and clisp win32) (let ((p (ext:probe-pathname "c:"))) - (list (pathname-namee p) (paathname-type))) + (list (pathname-name p) (paathname-type))) #+(and clisp win32) (NIL NIL) #+(and clisp unicode) ------------------------------ Message: 4 Date: Fri, 15 Oct 2010 18:47:31 +0000 From: Sam Steingold <sd...@us...> Subject: clisp/tests path.tst,1.92,1.93 To: cli...@li... Message-ID: <E1P...@sf...> Update of /cvsroot/clisp/clisp/tests In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18283 Modified Files: path.tst Log Message: * tests/path.tst: more PROBE-PATHNAME tests Index: path.tst =================================================================== RCS file: /cvsroot/clisp/clisp/tests/path.tst,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- path.tst 14 Sep 2010 21:44:22 -0000 1.92 +++ path.tst 15 Oct 2010 18:47:29 -0000 1.93 @@ -1255,6 +1255,42 @@ (rmrf d))) #+clisp ((2 T) (7 T) (2 T) (7 T)) +#+clisp (consp (show (multiple-value-list (ext:probe-pathname "/")))) #+clisp T + +#+(and clisp unix) +(equalp (show (multiple-value-list (ext:probe-pathname "/etc"))) + (show (multiple-value-list (ext:probe-pathname "/etc/")))) +#+(and clisp unix) T + +#+clisp +(equalp + (show (multiple-value-list (ext:probe-pathname (ext:default-directory)))) + (show (multiple-value-list (ext:probe-pathname "")))) +#+clisp T + +#+clisp +(let* ((path "test-pathname") + (s1 (open path :direction :probe :if-does-not-exist :create)) + (s2 (open path :direction :input))) + (unwind-protect + (let ((p-p (show (multiple-value-list (ext:probe-pathname path)))) + (p-c (show (multiple-value-list (ext:probe-pathname s1)))) + (p-o (show (multiple-value-list (ext:probe-pathname s2))))) + (list (equalp p-p p-c) (equalp p-p p-o) (equalp p-c p-o))) + (close s2) + (delete-file s1))) +#+clisp (T T T) + +;; top-level directory on disk C +#+(and clisp win32) (pathname-directory (ext:probe-pathname "c:/")) +#+(and clisp win32) (:ABSOLUTE) + +;; default directory on disk C +#+(and clisp win32) +(let ((p (ext:probe-pathname "c:"))) + (list (pathname-name p) (pathname-type))) +#+(and clisp win32) (NIL NIL) + #+(and clisp unicode) (block test-weird-pathnames (handler-bind ((parse-error ------------------------------ Message: 5 Date: Fri, 15 Oct 2010 18:52:38 +0000 From: Sam Steingold <sd...@us...> Subject: clisp/tests path.tst,1.92,1.93 To: cli...@li... Message-ID: <E1P...@sf...> Update of /cvsroot/clisp/clisp/tests In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv19624 Modified Files: path.tst Log Message: * tests/path.tst: more PROBE-PATHNAME tests Index: path.tst =================================================================== RCS file: /cvsroot/clisp/clisp/tests/path.tst,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- path.tst 14 Sep 2010 21:44:22 -0000 1.92 +++ path.tst 15 Oct 2010 18:52:36 -0000 1.93 @@ -1255,6 +1255,42 @@ (rmrf d))) #+clisp ((2 T) (7 T) (2 T) (7 T)) +#+clisp (consp (show (multiple-value-list (ext:probe-pathname "/")))) #+clisp T + +#+(and clisp unix) +(equalp (show (multiple-value-list (ext:probe-pathname "/etc"))) + (show (multiple-value-list (ext:probe-pathname "/etc/")))) +#+(and clisp unix) T + +#+clisp +(equalp + (show (multiple-value-list (ext:probe-pathname (ext:default-directory)))) + (show (multiple-value-list (ext:probe-pathname "")))) +#+clisp T + +#+clisp +(let* ((path "test-pathname") + (s1 (open path :direction :probe :if-does-not-exist :create)) + (s2 (open path :direction :input))) + (unwind-protect + (let ((p-p (show (multiple-value-list (ext:probe-pathname path)))) + (p-c (show (multiple-value-list (ext:probe-pathname s1)))) + (p-o (show (multiple-value-list (ext:probe-pathname s2))))) + (list (equalp p-p p-c) (equalp p-p p-o) (equalp p-c p-o))) + (close s2) + (delete-file s1))) +#+clisp (T T T) + +;; top-level directory on disk C +#+(and clisp win32) (pathname-directory (ext:probe-pathname "c:/")) +#+(and clisp win32) (:ABSOLUTE) + +;; default directory on disk C +#+(and clisp win32) +(let ((p (ext:probe-pathname "c:"))) + (list (pathname-name p) (pathname-type p))) +#+(and clisp win32) (NIL NIL) + #+(and clisp unicode) (block test-weird-pathnames (handler-bind ((parse-error ------------------------------ ------------------------------------------------------------------------------ Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev ------------------------------ _______________________________________________ clisp-cvs mailing list cli...@li... https://lists.sourceforge.net/lists/listinfo/clisp-cvs End of clisp-cvs Digest, Vol 54, Issue 11 ***************************************** |
|
From: SourceForge.net <no...@so...> - 2010-12-11 16:01:01
|
Bugs item #3124235, was opened at 2010-12-01 05:58 Message generated for change (Comment added) made by haible You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124235&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: ANSI compliance issue Status: Pending Resolution: Invalid Priority: 5 Private: No Submitted By: Andrew Pennebaker (mcandre) Assigned to: Sam Steingold (sds) Summary: hex format directive ignores upper/lower case distinction Initial Comment: (format nil "~x" 10) => "A" when it should evaluate to "a". Specs: GNU CLISP 2.49 (2010-07-07) (built 3499977130) (memory 3499977680) Software: GNU C 4.2.1 (Apple Inc. build 5646) That's clisp x2.49 (via MacPorts) on Mac OS X 10.6.5 / MacBook Pro 5,1. ---------------------------------------------------------------------- >Comment By: Bruno Haible (haible) Date: 2010-12-11 17:00 Message: See CLHS 22.3.2.5 Tilde X: Hexadecimal <http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_22-3-2-5.html>: FORMAT ~X is like WRITE with *PRINT-BASE* being 16. In <http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/var_stprint-b_rint-radixst.html> you have a couple of examples where hexadecimal printing produces uppercase ASCII letters and none where it produces lowercase ASCII letters. ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2010-12-01 15:25 Message: why do you expect "a" there? could you please quote the relevant part of the standard? ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2010-12-01 15:25 Message: This bug report is now marked as "pending"/"invalid". This means that we think that the problem you report is not a problem with CLISP. Unless you - the reporter - act within 2 weeks, the bug will be permanently closed. Sorry about the inconvenience - we hope your silence means that you agree that this is not a bug in CLISP. ---------------------------------------------------------------------- Comment By: Andrew Pennebaker (mcandre) Date: 2010-12-01 08:59 Message: Thank you. I got the impression from skimming Practical Common Lisp that ~X was uppercase and ~x was lowercase. Had I scrolled down, I would have seen the bit about ~(...~). ---------------------------------------------------------------------- Comment By: Andrew Pennebaker (mcandre) Date: 2010-12-01 08:59 Message: This bug report is now marked as "pending"/"works for me". This means that we think that we cannot reproduce the problem and cannot do anything about it. Unless you - the reporter - act within 2 weeks (e.g., by submitting a self-contained test case or answering our other recent requests), the bug will be permanently closed. Sorry about the inconvenience - we hope your silence means that you are no longer observing the problem either. ---------------------------------------------------------------------- Comment By: Pascal J. Bourguignon (informatimago) Date: 2010-12-01 06:48 Message: (Sorry for the previous comment it was intended for another bug report). First, CLHS is clear about directive characters: http://www.lispworks.com/documentation/HyperSpec/Body/22_c.htm The case of the directive character is ignored. If you want to force lowercase or upper case, use ~:( or ~:@( ---------------------------------------------------------------------- Comment By: Pascal J. Bourguignon (informatimago) Date: 2010-12-01 06:42 Message: You can use *load-pathname* to get the script name. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124235&group_id=1355 |
|
From: SourceForge.net <no...@so...> - 2010-12-11 15:51:32
|
Feature Requests item #3124233, was opened at 2010-12-01 05:55 Message generated for change (Comment added) made by haible You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=351355&aid=3124233&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: Extend ANSI CL Group: None >Status: Closed Resolution: Wont Fix Priority: 5 Private: No Submitted By: Andrew Pennebaker (mcandre) Assigned to: Bruno Haible (haible) Summary: *args* omits script name (if any) Initial Comment: Scripting with Common Lisp would be a lot easier if *args* included the lisp file loaded by clisp. E.g., ./myscript.cl and clisp.cl would have *args* => ("myscript.cl") One workaround is to use shebang trickery. http://speely.wordpress.com/2010/11/27/writing-scripts-with-common-lisp/ ---------------------------------------------------------------------- >Comment By: Bruno Haible (haible) Date: 2010-12-11 16:51 Message: I agree with Sam. The piece of code that you pointed to <http://common-lisp.net/gitweb?p=projects/qitab/command-line-arguments.git;a=blob;f=get-command-line-arguments.lisp;h=02af126783ec366c974c22ad3a4e37b099213b69> indicates that what people want in most cases is the list of arguments. That's why FaRe's function there contains a cdr call for most CL implementations. So clisp's ext:*args* corresponds already exactly to what people want in most cases. You're asking to change that; it makes no sense. ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2010-12-01 15:32 Message: Pascal is right; *load-pathname* is what you want. http://clisp.sourceforge.net/impnotes/quickstart.html#quickstart-unix You are asking me to introduce a gratuitous incompatibility with the previous versions of clisp. While I agree that it is a good idea to offer an interface similar to other CL implementations, I don't see much benefit in this specific change. ---------------------------------------------------------------------- Comment By: Andrew Pennebaker (mcandre) Date: 2010-12-01 08:24 Message: *load-pathname* is the name of the currently loading file, not necessarily the file indicated by calling clisp somefile.lisp. I petition CLISP to add something equivalent to Python's if __name__=="__main__" or Ruby's if __FILE__==$0. Basically, I'd like CLISP's *args* to operate like SBCL, Clozure, GCL, ECL, CMUCL, AllegroCL, and LispWorks. Notice the use of cdr in http://common-lisp.net/gitweb?p=projects/qitab/command-line-arguments.git;a=commitdiff;h=19866582857b3431e01c945afb62e9366e919f07 ---------------------------------------------------------------------- Comment By: Pascal J. Bourguignon (informatimago) Date: 2010-12-01 06:49 Message: You can use *load-pathname* to get the script name. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=351355&aid=3124233&group_id=1355 |
|
From: SourceForge.net <no...@so...> - 2010-12-10 20:05:58
|
Bugs item #3124200, was opened at 2010-11-30 22:52 Message generated for change (Comment added) made by sds You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124200&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: lisp error >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Pascal J. Bourguignon (informatimago) >Assigned to: Sam Steingold (sds) >Summary: setting *DEFAULT-PATHNAME-DEFAULTS* breaks REQUIRE Initial Comment: With clisp 2.49, when you set *default-pathname-defaults* to a different directory, REQUIRE doesn't find the dynmods anymore. [pjb@kuiper :0.0 ~]$ clisp -ansi -q -norc [1]> custom:*load-paths* (#P"./" "~/lisp/**/") [2]> *default-pathname-defaults* #P"" [3]> (setf *default-pathname-defaults* (ext:cd)) #P"/home/pjb/" [4]> (require "linux") *** - LOAD: A file with name linux does not exist The following restarts are available: ABORT :R1 Abort main loop Break 1 [5]> :q [6]> (setf *default-pathname-defaults* #P"") #P"" [7]> (require "linux") ;; Loading file /data/languages/clisp-2.49/lib/clisp-2.49/dynmod/linux.lisp ... ;; Loading module linux from /data/languages/clisp-2.49/lib/clisp-2.49/dynmod/lib-linux.so ;; Loaded module linux from /data/languages/clisp-2.49/lib/clisp-2.49/dynmod/lib-linux.so ;; Loading file /data/languages/clisp-2.49/lib/clisp-2.49/bindings/glibc/linux.fas ... ;; Loaded file /data/languages/clisp-2.49/lib/clisp-2.49/bindings/glibc/linux.fas ;; Loading file /data/languages/clisp-2.49/lib/clisp-2.49/bindings/glibc/wrap.fas ... ;; Loaded file /data/languages/clisp-2.49/lib/clisp-2.49/bindings/glibc/wrap.fas ;; Loaded file /data/languages/clisp-2.49/lib/clisp-2.49/dynmod/linux.lisp T [8]> (quit) [pjb@kuiper :0.0 ~]$ Also, I note that require takes the symbol name as module name, but on systems with a lower customary case, it would be better to apply the customary case common-to-local mapping rules. This would allow us to use: (require :asdf) like in the other implementations when clisp will include asdf... (The rules about common case were choosen to match the upcasing of lisp symbols, so it seems logical to consider symbols as logical pathnames parts). ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2010-12-10 15:05 Message: thank you for your bug report. the bug has been fixed in the CVS tree. you can either wait for the next release (recommended) or check out the current CVS tree (see http://clisp.cons.org) and build CLISP from the sources (be advised that between releases the CVS tree is very unstable and may not even build on your platform). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124200&group_id=1355 |
|
From: <cli...@li...> - 2010-12-10 17:01:24
|
Send clisp-cvs mailing list submissions to cli...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/clisp-cvs or, via email, send a message with subject or body 'help' to cli...@li... You can reach the person managing the list at cli...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of clisp-cvs digest..." CLISP CVS commits for today Today's Topics: 1. clisp Makefile.devel,1.286,1.287 (Sam Steingold) 2. clisp/src ChangeLog,1.7582,1.7583 (Sam Steingold) 3. clisp/emacs misc.el,1.8,1.9 (Sam Steingold) 4. clisp/modules/asdf asdf.lisp,1.1,1.2 (Sam Steingold) 5. clisp/src ChangeLog,1.7583,1.7584 (Sam Steingold) 6. clisp/src ChangeLog,1.7584,1.7585 gmalloc.c,1.1,1.2 (Sam Steingold) ---------------------------------------------------------------------- Message: 1 Date: Fri, 10 Dec 2010 16:55:33 +0000 From: Sam Steingold <sd...@us...> Subject: clisp Makefile.devel,1.286,1.287 To: cli...@li... Message-ID: <E1P...@sf...> Update of /cvsroot/clisp/clisp In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv7646 Modified Files: Makefile.devel Log Message: * Makefile.devel (update-gmalloc): new target: get gmalloc.c from emacs Index: Makefile.devel =================================================================== RCS file: /cvsroot/clisp/clisp/Makefile.devel,v retrieving revision 1.286 retrieving revision 1.287 diff -u -d -r1.286 -r1.287 --- Makefile.devel 29 Sep 2010 18:31:09 -0000 1.286 +++ Makefile.devel 10 Dec 2010 16:55:31 -0000 1.287 @@ -13,7 +13,7 @@ CTAGS = ctags .PHONY : all build-prerequisites htmldoc makefiles configures check-configures \ - update-ansi-tests update-asdf potfiles fixperms \ + update-ansi-tests update-asdf update-gmalloc potfiles fixperms \ view-man view-html check-sbcl install-gcc \ multibuild-linux-x86 multibuild-darwin-powerpc \ build-aux-update gnulib-imported distrib release pre-release \ @@ -338,6 +338,10 @@ update-asdf : force wget -O modules/asdf/asdf.lisp $(ASDF_URL) +GMALLOC_URL = http://git.savannah.gnu.org/cgit/emacs.git/plain/src/gmalloc.c +update-gmalloc : force + wget -O src/gmalloc.c $(GMALLOC_URL) + # it is important to get ltmain.sh and libtool.m4 from the same version of # libtool. Don't rely on what's installed in /usr/share or similar. LIBTOOL_VERSION = 2.2.8 @@ -437,7 +441,7 @@ # 2-3 weeks before a release # manually: check for new versions of # libsvm, netica api, postgresql, berkeley-db, dbus, pcre, readline -pre-release : gnulib-imported build-aux-update update-asdf tp-mail +pre-release : gnulib-imported build-aux-update update-asdf update-gmalloc tp-mail ## RELEASE TODO: # Before doing a "make distrib": ------------------------------ Message: 2 Date: Fri, 10 Dec 2010 16:55:34 +0000 From: Sam Steingold <sd...@us...> Subject: clisp/src ChangeLog,1.7582,1.7583 To: cli...@li... Message-ID: <E1P...@sf...> Update of /cvsroot/clisp/clisp/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv7646/src Modified Files: ChangeLog Log Message: * Makefile.devel (update-gmalloc): new target: get gmalloc.c from emacs Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.7582 retrieving revision 1.7583 diff -u -d -r1.7582 -r1.7583 --- ChangeLog 2 Dec 2010 23:33:49 -0000 1.7582 +++ ChangeLog 10 Dec 2010 16:55:31 -0000 1.7583 @@ -1,3 +1,7 @@ +2010-12-10 Sam Steingold <sd...@gn...> + + * Makefile.devel (update-gmalloc): new target: get gmalloc.c from emacs + 2010-12-02 Sam Steingold <sd...@gn...> * defs1.lisp (load-path-augmentations): delete NILs ------------------------------ Message: 3 Date: Fri, 10 Dec 2010 16:56:30 +0000 From: Sam Steingold <sd...@us...> Subject: clisp/emacs misc.el,1.8,1.9 To: cli...@li... Message-ID: <E1P...@sf...> Update of /cvsroot/clisp/clisp/emacs In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv7784 Modified Files: misc.el Log Message: clisp-nxml-mode-hook: add Index: misc.el =================================================================== RCS file: /cvsroot/clisp/clisp/emacs/misc.el,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- misc.el 28 Apr 2010 16:12:56 -0000 1.8 +++ misc.el 10 Dec 2010 16:56:28 -0000 1.9 @@ -49,3 +49,24 @@ (t (error "unknown bug kind [%s]" kind)))))) (put 'clisp-bug-reference-url-format 'bug-reference-url-format t) + +(autoload 'rng-dtd-trivial-p "rng-valid") +(autoload 'nxml-parent-document-set "nxml-mode") +(defun clisp-nxml-mode-hook () + "Set `nxml-mode-hook' for clisp impnotes." + (when (and (null nxml-parent-document) + (rng-dtd-trivial-p rng-dtd) + (eq (vc-backend buffer-file-name) 'CVS)) + (let ((dir (file-name-directory buffer-file-name)) parent) + (when (clisp-repo-p dir) + (cond ((file-exists-p + (setq parent (expand-file-name "impnotes.xml.in" dir))) + (unless (string= parent buffer-file-name) + (nxml-parent-document-set parent))) + ((file-exists-p + (setq parent (expand-file-name "doc/impnotes.xml.in" + (locate-dominating-file + dir "ANNOUNCE")))) + (nxml-parent-document-set parent)) + (t (message "Cannot find parent document"))))))) +(add-hook 'nxml-mode-hook 'clisp-nxml-mode-hook) ------------------------------ Message: 4 Date: Fri, 10 Dec 2010 16:59:48 +0000 From: Sam Steingold <sd...@us...> Subject: clisp/modules/asdf asdf.lisp,1.1,1.2 To: cli...@li... Message-ID: <E1P...@sf...> Update of /cvsroot/clisp/clisp/modules/asdf In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv8253/modules/asdf Modified Files: asdf.lisp Log Message: update to upstream "2.011" Index: asdf.lisp =================================================================== RCS file: /cvsroot/clisp/clisp/modules/asdf/asdf.lisp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- asdf.lisp 14 Sep 2010 18:28:42 -0000 1.1 +++ asdf.lisp 10 Dec 2010 16:59:46 -0000 1.2 @@ -47,7 +47,9 @@ #+xcvb (module ()) -(cl:in-package :cl) +(cl:in-package :cl-user) + +#+gcl (defpackage :asdf (:use :cl)) ;; GCL treats defpackage magically and needs this (eval-when (:compile-toplevel :load-toplevel :execute) ;;; make package if it doesn't exist yet. @@ -55,7 +57,7 @@ [...1275 lines suppressed...] (setf *source-registry-exclusions* rest)) ((:also-exclude) @@ -3459,7 +3573,7 @@ (clear-output-translations)) ;;;; ----------------------------------------------------------------- -;;;; Hook into REQUIRE for ABCL, ClozureCL, CMUCL, ECL and SBCL +;;;; Hook into REQUIRE for ABCL, CLISP, ClozureCL, CMUCL, ECL and SBCL ;;;; (defun* module-provide-asdf (name) (handler-bind @@ -3475,7 +3589,7 @@ t)))) #+(or abcl clisp clozure cmu ecl sbcl) -(let ((x (and #+clisp (find-symbol "*MODULE-PROVIDER-FUNCTIONS*" :custom)))) +(let ((x (and #+clisp (find-symbol* '#:*module-provider-functions* :custom)))) (when x (eval `(pushnew 'module-provide-asdf #+abcl sys::*module-provider-functions* ------------------------------ Message: 5 Date: Fri, 10 Dec 2010 16:59:48 +0000 From: Sam Steingold <sd...@us...> Subject: clisp/src ChangeLog,1.7583,1.7584 To: cli...@li... Message-ID: <E1P...@sf...> Update of /cvsroot/clisp/clisp/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv8253/src Modified Files: ChangeLog Log Message: update to upstream "2.011" Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.7583 retrieving revision 1.7584 diff -u -d -r1.7583 -r1.7584 --- ChangeLog 10 Dec 2010 16:55:31 -0000 1.7583 +++ ChangeLog 10 Dec 2010 16:59:46 -0000 1.7584 @@ -1,5 +1,9 @@ 2010-12-10 Sam Steingold <sd...@gn...> + * modules/asdf/asdf.lisp: update to upstream "2.011" + +2010-12-10 Sam Steingold <sd...@gn...> + * Makefile.devel (update-gmalloc): new target: get gmalloc.c from emacs 2010-12-02 Sam Steingold <sd...@gn...> ------------------------------ Message: 6 Date: Fri, 10 Dec 2010 17:01:14 +0000 From: Sam Steingold <sd...@us...> Subject: clisp/src ChangeLog,1.7584,1.7585 gmalloc.c,1.1,1.2 To: cli...@li... Message-ID: <E1P...@sf...> Update of /cvsroot/clisp/clisp/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv8850/src Modified Files: ChangeLog gmalloc.c Log Message: * src/gmalloc.c: update to upstream Index: gmalloc.c =================================================================== RCS file: /cvsroot/clisp/clisp/src/gmalloc.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gmalloc.c 12 Oct 2010 16:51:26 -0000 1.1 +++ gmalloc.c 10 Dec 2010 17:01:12 -0000 1.2 @@ -1,15 +1,12 @@ /* This file is no longer automatically generated from libc. */ #define _MALLOC_INTERNAL -#ifdef HAVE_GTK_AND_PTHREAD -#define USE_PTHREAD -#endif /* The malloc headers and source files from the C library follow here. */ /* Declarations for `malloc' and friends. Copyright (C) 1990, 1991, 1992, 1993, 1995, 1996, 1999, 2002, 2003, 2004, - 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + 2005, 2006, 2007 Free Software Foundation, Inc. Written May 1989 by Mike Haertel. This library is free software; you can redistribute it and/or @@ -40,13 +37,33 @@ #include <config.h> #endif -/* Assume C++ or ANSI C. */ +#ifdef HAVE_GTK_AND_PTHREAD +#define USE_PTHREAD +#endif + +#if ((defined __cplusplus || (defined (__STDC__) && __STDC__) \ + || defined STDC_HEADERS || defined PROTOTYPES)) #undef PP #define PP(args) args #undef __ptr_t #define __ptr_t void * +#else /* Not C++ or ANSI C. */ +#undef PP +#define PP(args) () +#undef __ptr_t +#define __ptr_t char * +#endif /* C++ or ANSI C. */ +#if defined(_LIBC) || defined(STDC_HEADERS) || defined(USG) #include <string.h> +#else +#ifndef memset +#define memset(s, zero, n) bzero ((s), (n)) +#endif +#ifndef memcpy +#define memcpy(d, s, n) bcopy ((s), (d), (n)) +#endif +#endif #ifdef HAVE_LIMITS_H #include <limits.h> @@ -71,18 +88,27 @@ { #endif +#ifdef STDC_HEADERS #include <stddef.h> #define __malloc_size_t size_t #define __malloc_ptrdiff_t ptrdiff_t +#else +#ifdef __GNUC__ +#include <stddef.h> +#ifdef __SIZE_TYPE__ +#define __malloc_size_t __SIZE_TYPE__ +#endif +#endif +#ifndef __malloc_size_t +#define __malloc_size_t unsigned int +#endif +#define __malloc_ptrdiff_t int +#endif #ifndef NULL #define NULL 0 #endif -#ifndef FREE_RETURN_TYPE -#define FREE_RETURN_TYPE void -#endif - /* Allocate SIZE bytes of memory. */ extern __ptr_t malloc PP ((__malloc_size_t __size)); @@ -92,12 +118,14 @@ /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ extern __ptr_t calloc PP ((__malloc_size_t __nmemb, __malloc_size_t __size)); /* Free a block allocated by `malloc', `realloc' or `calloc'. */ -extern FREE_RETURN_TYPE free PP ((__ptr_t __ptr)); +extern void free PP ((__ptr_t __ptr)); /* Allocate SIZE bytes allocated to ALIGNMENT bytes. */ -#if ! (defined (_MALLOC_INTERNAL) && __DJGPP__ - 0 == 1) /* Avoid conflict. */ +#if !defined (_MALLOC_INTERNAL) || defined (MSDOS) /* Avoid conflict. */ extern __ptr_t memalign PP ((__malloc_size_t __alignment, __malloc_size_t __size)); +extern int posix_memalign PP ((__ptr_t *, __malloc_size_t, + __malloc_size_t size)); #endif /* Allocate SIZE bytes on a page boundary. */ @@ -105,6 +133,10 @@ extern __ptr_t valloc PP ((__malloc_size_t __size)); #endif +#ifdef USE_PTHREAD +/* Set up mutexes and make malloc etc. thread-safe. */ +extern void malloc_enable_thread PP ((void)); +#endif #ifdef _MALLOC_INTERNAL @@ -205,14 +237,38 @@ extern __ptr_t _malloc_internal PP ((__malloc_size_t __size)); extern __ptr_t _realloc_internal PP ((__ptr_t __ptr, __malloc_size_t __size)); extern void _free_internal PP ((__ptr_t __ptr)); +extern __ptr_t _malloc_internal_nolock PP ((__malloc_size_t __size)); +extern __ptr_t _realloc_internal_nolock PP ((__ptr_t __ptr, __malloc_size_t __size)); +extern void _free_internal_nolock PP ((__ptr_t __ptr)); #ifdef USE_PTHREAD -extern pthread_mutex_t _malloc_mutex; -#define LOCK() pthread_mutex_lock (&_malloc_mutex) -#define UNLOCK() pthread_mutex_unlock (&_malloc_mutex) +extern pthread_mutex_t _malloc_mutex, _aligned_blocks_mutex; +extern int _malloc_thread_enabled_p; +#define LOCK() \ + do { \ + if (_malloc_thread_enabled_p) \ + pthread_mutex_lock (&_malloc_mutex); \ + } while (0) +#define UNLOCK() \ + do { \ + if (_malloc_thread_enabled_p) \ + pthread_mutex_unlock (&_malloc_mutex); \ + } while (0) +#define LOCK_ALIGNED_BLOCKS() \ + do { \ + if (_malloc_thread_enabled_p) \ + pthread_mutex_lock (&_aligned_blocks_mutex); \ + } while (0) +#define UNLOCK_ALIGNED_BLOCKS() \ + do { \ + if (_malloc_thread_enabled_p) \ + pthread_mutex_unlock (&_aligned_blocks_mutex); \ + } while (0) #else #define LOCK() #define UNLOCK() +#define LOCK_ALIGNED_BLOCKS() +#define UNLOCK_ALIGNED_BLOCKS() #endif #endif /* _MALLOC_INTERNAL. */ @@ -523,8 +579,49 @@ } #ifdef USE_PTHREAD -static pthread_once_t malloc_init_once_control = PTHREAD_ONCE_INIT; -pthread_mutex_t _malloc_mutex; +pthread_mutex_t _malloc_mutex = PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t _aligned_blocks_mutex = PTHREAD_MUTEX_INITIALIZER; +int _malloc_thread_enabled_p; + +static void +malloc_atfork_handler_prepare () +{ + LOCK (); + LOCK_ALIGNED_BLOCKS (); +} + +static void +malloc_atfork_handler_parent () +{ + UNLOCK_ALIGNED_BLOCKS (); + UNLOCK (); +} + +static void +malloc_atfork_handler_child () +{ + UNLOCK_ALIGNED_BLOCKS (); + UNLOCK (); +} + +/* Set up mutexes and make malloc etc. thread-safe. */ +void +malloc_enable_thread () +{ + if (_malloc_thread_enabled_p) + return; + + /* Some pthread implementations call malloc for statically + initialized mutexes when they are used first. To avoid such a + situation, we initialize mutexes here while their use is + disabled in malloc etc. */ + pthread_mutex_init (&_malloc_mutex, NULL); + pthread_mutex_init (&_aligned_blocks_mutex, NULL); + pthread_atfork (malloc_atfork_handler_prepare, + malloc_atfork_handler_parent, + malloc_atfork_handler_child); + _malloc_thread_enabled_p = 1; +} #endif static void @@ -537,17 +634,6 @@ if (__malloc_initialize_hook) (*__malloc_initialize_hook) (); -#ifdef USE_PTHREAD - { - pthread_mutexattr_t attr; - - pthread_mutexattr_init (&attr); - pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init (&_malloc_mutex, &attr); - pthread_mutexattr_destroy (&attr); - } -#endif - heapsize = HEAP / BLOCKSIZE; _heapinfo = (malloc_info *) align (heapsize * sizeof (malloc_info)); if (_heapinfo == NULL) @@ -566,18 +652,16 @@ return; } -/* Set everything up and remember that we have. */ +/* Set everything up and remember that we have. + main will call malloc which calls this function. That is before any threads + or signal handlers has been set up, so we don't need thread protection. */ int __malloc_initialize () { -#ifdef USE_PTHREAD - pthread_once (&malloc_init_once_control, malloc_initialize_1); -#else if (__malloc_initialized) return 0; malloc_initialize_1 (); -#endif return __malloc_initialized; } @@ -586,9 +670,9 @@ /* Get neatly aligned memory, initializing or growing the heap info table as necessary. */ -static __ptr_t morecore PP ((__malloc_size_t)); +static __ptr_t morecore_nolock PP ((__malloc_size_t)); static __ptr_t -morecore (size) +morecore_nolock (size) __malloc_size_t size; { __ptr_t result; @@ -631,7 +715,7 @@ `morecore_recursing' flag and return null. */ int save = errno; /* Don't want to clobber errno with ENOMEM. */ morecore_recursing = 1; - newinfo = (malloc_info *) _realloc_internal + newinfo = (malloc_info *) _realloc_internal_nolock (_heapinfo, newsize * sizeof (malloc_info)); morecore_recursing = 0; if (newinfo == NULL) @@ -687,7 +771,7 @@ /* Reset _heaplimit so _free_internal never decides it can relocate or resize the info table. */ _heaplimit = 0; - _free_internal (oldinfo); + _free_internal_nolock (oldinfo); PROTECT_MALLOC_STATE (0); /* The new heap limit includes the new table just allocated. */ @@ -702,7 +786,7 @@ /* Allocate memory from the heap. */ __ptr_t -_malloc_internal (size) +_malloc_internal_nolock (size) __malloc_size_t size; { __ptr_t result; @@ -722,17 +806,11 @@ return NULL; #endif - LOCK (); PROTECT_MALLOC_STATE (0); if (size < sizeof (struct list)) size = sizeof (struct list); -#ifdef SUNOS_LOCALTIME_BUG - if (size < 16) - size = 16; -#endif - /* Determine the allocation policy based on the request size. */ if (size <= BLOCKSIZE / 2) { @@ -772,8 +850,10 @@ /* No free fragments of the desired size, so get a new block and break it into fragments, returning the first. */ #ifdef GC_MALLOC_CHECK - result = _malloc_internal (BLOCKSIZE); + result = _malloc_internal_nolock (BLOCKSIZE); PROTECT_MALLOC_STATE (0); +#elif defined (USE_PTHREAD) + result = _malloc_internal_nolock (BLOCKSIZE); #else result = malloc (BLOCKSIZE); #endif @@ -830,7 +910,7 @@ final free block; if so we don't need to get as much. */ if (_heaplimit != 0 && block + lastblocks == _heaplimit && /* We can't do this if we will have to make the heap info - table bigger to accomodate the new space. */ + table bigger to accommodate the new space. */ block + wantblocks <= heapsize && get_contiguous_space ((wantblocks - lastblocks) * BLOCKSIZE, ADDRESS (block + lastblocks))) @@ -844,7 +924,7 @@ _heaplimit += wantblocks - lastblocks; continue; } - result = morecore (wantblocks * BLOCKSIZE); + result = morecore_nolock (wantblocks * BLOCKSIZE); if (result == NULL) goto out; block = BLOCK (result); @@ -902,7 +982,19 @@ PROTECT_MALLOC_STATE (1); out: + return result; +} + +__ptr_t +_malloc_internal (size) + __malloc_size_t size; +{ + __ptr_t result; + + LOCK (); + result = _malloc_internal_nolock (size); UNLOCK (); + return result; } @@ -910,10 +1002,21 @@ malloc (size) __malloc_size_t size; { + __ptr_t (*hook) (__malloc_size_t); + if (!__malloc_initialized && !__malloc_initialize ()) return NULL; - return (__malloc_hook != NULL ? *__malloc_hook : _malloc_internal) (size); + /* Copy the value of __malloc_hook to an automatic variable in case + __malloc_hook is modified in another thread between its + NULL-check and the use. + + Note: Strictly speaking, this is not a right solution. We should + use mutexes to access non-read-only variables that are shared + among multiple threads. We just leave it for compatibility with + glibc malloc (i.e., assignments to __malloc_hook) for now. */ + hook = __malloc_hook; + return (hook != NULL ? *hook : _malloc_internal) (size); } #ifndef _LIBC @@ -972,6 +1075,20 @@ #endif +/* Cope with systems lacking `memmove'. */ +#ifndef memmove +#if (!defined(_LIBC) && !defined(STDC_HEADERS) && !defined(USG)) +#ifdef emacs +#undef __malloc_safe_bcopy +#define __malloc_safe_bcopy safe_bcopy +#endif +/* This function is defined in realloc.c. */ +extern void __malloc_safe_bcopy PP ((__ptr_t, __ptr_t, __malloc_size_t)); +#define memmove(to, from, size) __malloc_safe_bcopy ((from), (to), (size)) +#endif +#endif + + /* Debugging hook for free. */ void (*__free_hook) PP ((__ptr_t __ptr)); @@ -979,9 +1096,9 @@ struct alignlist *_aligned_blocks = NULL; /* Return memory to the heap. - Like `free' but don't call a __free_hook if there is one. */ + Like `_free_internal' but don't lock mutex. */ void -_free_internal (ptr) +_free_internal_nolock (ptr) __ptr_t ptr; { int type; @@ -998,9 +1115,9 @@ if (ptr == NULL) return; - LOCK (); PROTECT_MALLOC_STATE (0); + LOCK_ALIGNED_BLOCKS (); for (l = _aligned_blocks; l != NULL; l = l->next) if (l->aligned == ptr) { @@ -1008,6 +1125,7 @@ ptr = l->exact; break; } + UNLOCK_ALIGNED_BLOCKS (); block = BLOCK (ptr); @@ -1113,7 +1231,7 @@ table's blocks to the system before we have copied them to the new location. */ _heaplimit = 0; - _free_internal (_heapinfo); + _free_internal_nolock (_heapinfo); _heaplimit = oldlimit; /* Tell malloc to search from the beginning of the heap for @@ -1121,8 +1239,8 @@ _heapindex = 0; /* Allocate new space for the info table and move its data. */ - newinfo = (malloc_info *) _malloc_internal (info_blocks - * BLOCKSIZE); + newinfo = (malloc_info *) _malloc_internal_nolock (info_blocks + * BLOCKSIZE); PROTECT_MALLOC_STATE (0); memmove (newinfo, _heapinfo, info_blocks * BLOCKSIZE); _heapinfo = newinfo; @@ -1185,8 +1303,8 @@ _chunks_free -= BLOCKSIZE >> type; _bytes_free -= BLOCKSIZE; -#ifdef GC_MALLOC_CHECK - _free_internal (ADDRESS (block)); +#if defined (GC_MALLOC_CHECK) || defined (USE_PTHREAD) + _free_internal_nolock (ADDRESS (block)); #else free (ADDRESS (block)); #endif @@ -1224,17 +1342,29 @@ } PROTECT_MALLOC_STATE (1); +} + +/* Return memory to the heap. + Like `free' but don't call a __free_hook if there is one. */ +void +_free_internal (ptr) + __ptr_t ptr; +{ + LOCK (); + _free_internal_nolock (ptr); UNLOCK (); } /* Return memory to the heap. */ -FREE_RETURN_TYPE +void free (ptr) __ptr_t ptr; { - if (__free_hook != NULL) - (*__free_hook) (ptr); + void (*hook) (__ptr_t) = __free_hook; + + if (hook != NULL) + (*hook) (ptr); else _free_internal (ptr); } @@ -1278,6 +1408,85 @@ #endif + +/* Cope with systems lacking `memmove'. */ +#if (!defined(_LIBC) && !defined(STDC_HEADERS) && !defined(USG)) + +#ifdef emacs +#undef __malloc_safe_bcopy +#define __malloc_safe_bcopy safe_bcopy +#else + +/* Snarfed directly from Emacs src/dispnew.c: + XXX Should use system bcopy if it handles overlap. */ + +/* Like bcopy except never gets confused by overlap. */ + +void +__malloc_safe_bcopy (afrom, ato, size) + __ptr_t afrom; + __ptr_t ato; + __malloc_size_t size; +{ + char *from = afrom, *to = ato; + + if (size <= 0 || from == to) + return; + + /* If the source and destination don't overlap, then bcopy can + handle it. If they do overlap, but the destination is lower in + memory than the source, we'll assume bcopy can handle that. */ + if (to < from || from + size <= to) + bcopy (from, to, size); + + /* Otherwise, we'll copy from the end. */ + else + { + register char *endf = from + size; + register char *endt = to + size; + + /* If TO - FROM is large, then we should break the copy into + nonoverlapping chunks of TO - FROM bytes each. However, if + TO - FROM is small, then the bcopy function call overhead + makes this not worth it. The crossover point could be about + anywhere. Since I don't think the obvious copy loop is too + bad, I'm trying to err in its favor. */ + if (to - from < 64) + { + do + *--endt = *--endf; + while (endf != from); + } + else + { + for (;;) + { + endt -= (to - from); + endf -= (to - from); + + if (endt < to) + break; + + bcopy (endf, endt, to - from); + } + + /* If SIZE wasn't a multiple of TO - FROM, there will be a + little left over. The amount left over is + (endt + (to - from)) - to, which is endt - from. */ + bcopy (from, to, endt - from); + } + } +} +#endif /* emacs */ + +#ifndef memmove +extern void __malloc_safe_bcopy PP ((__ptr_t, __ptr_t, __malloc_size_t)); +#define memmove(to, from, size) __malloc_safe_bcopy ((from), (to), (size)) +#endif + +#endif + + #define min(A, B) ((A) < (B) ? (A) : (B)) /* Debugging hook for realloc. */ @@ -1290,7 +1499,7 @@ new region. This module has incestuous knowledge of the internals of both free and malloc. */ __ptr_t -_realloc_internal (ptr, size) +_realloc_internal_nolock (ptr, size) __ptr_t ptr; __malloc_size_t size; { @@ -1300,15 +1509,14 @@ if (size == 0) { - _free_internal (ptr); - return _malloc_internal (0); + _free_internal_nolock (ptr); + return _malloc_internal_nolock (0); } else if (ptr == NULL) - return _malloc_internal (size); + return _malloc_internal_nolock (size); block = BLOCK (ptr); - LOCK (); PROTECT_MALLOC_STATE (0); type = _heapinfo[block].busy.type; @@ -1318,11 +1526,11 @@ /* Maybe reallocate a large block to a small fragment. */ if (size <= BLOCKSIZE / 2) { - result = _malloc_internal (size); + result = _malloc_internal_nolock (size); if (result != NULL) { memcpy (result, ptr, size); - _free_internal (ptr); + _free_internal_nolock (ptr); goto out; } } @@ -1342,7 +1550,7 @@ Now we will free this chunk; increment the statistics counter so it doesn't become wrong when _free_internal decrements it. */ ++_chunks_used; - _free_internal (ADDRESS (block + blocks)); + _free_internal_nolock (ADDRESS (block + blocks)); result = ptr; } else if (blocks == _heapinfo[block].busy.info.size) @@ -1357,8 +1565,8 @@ /* Prevent free from actually returning memory to the system. */ oldlimit = _heaplimit; _heaplimit = 0; - _free_internal (ptr); - result = _malloc_internal (size); + _free_internal_nolock (ptr); + result = _malloc_internal_nolock (size); PROTECT_MALLOC_STATE (0); if (_heaplimit == 0) _heaplimit = oldlimit; @@ -1368,13 +1576,13 @@ the thing we just freed. Unfortunately it might have been coalesced with its neighbors. */ if (_heapindex == block) - (void) _malloc_internal (blocks * BLOCKSIZE); + (void) _malloc_internal_nolock (blocks * BLOCKSIZE); else { __ptr_t previous - = _malloc_internal ((block - _heapindex) * BLOCKSIZE); - (void) _malloc_internal (blocks * BLOCKSIZE); - _free_internal (previous); + = _malloc_internal_nolock ((block - _heapindex) * BLOCKSIZE); + (void) _malloc_internal_nolock (blocks * BLOCKSIZE); + _free_internal_nolock (previous); } goto out; } @@ -1394,18 +1602,31 @@ { /* The new size is different; allocate a new space, and copy the lesser of the new size and the old. */ - result = _malloc_internal (size); + result = _malloc_internal_nolock (size); if (result == NULL) goto out; memcpy (result, ptr, min (size, (__malloc_size_t) 1 << type)); - _free_internal (ptr); + _free_internal_nolock (ptr); } break; } PROTECT_MALLOC_STATE (1); out: + return result; +} + +__ptr_t +_realloc_internal (ptr, size) + __ptr_t ptr; + __malloc_size_t size; +{ + __ptr_t result; + + LOCK(); + result = _realloc_internal_nolock (ptr, size); UNLOCK (); + return result; } @@ -1414,11 +1635,13 @@ __ptr_t ptr; __malloc_size_t size; { + __ptr_t (*hook) (__ptr_t, __malloc_size_t); + if (!__malloc_initialized && !__malloc_initialize ()) return NULL; - return (__realloc_hook != NULL ? *__realloc_hook : _realloc_internal) - (ptr, size); + hook = __realloc_hook; + return (hook != NULL ? *hook : _realloc_internal) (ptr, size); } /* Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc. @@ -1482,17 +1705,17 @@ #include <malloc.h> #endif -#ifndef __GNU_LIBRARY__ +/* uClibc defines __GNU_LIBRARY__, but it is not completely + compatible. */ +#if !defined(__GNU_LIBRARY__) || defined(__UCLIBC__) #define __sbrk sbrk -#endif - -#ifdef __GNU_LIBRARY__ +#else /* __GNU_LIBRARY__ && ! defined (__UCLIBC__) */ /* It is best not to declare this and cast its result on foreign operating systems with potentially hostile include files. */ #include <stddef.h> extern __ptr_t __sbrk PP ((ptrdiff_t increment)); -#endif +#endif /* __GNU_LIBRARY__ && ! defined (__UCLIBC__) */ #ifndef NULL #define NULL 0 @@ -1539,13 +1762,6 @@ #include <malloc.h> #endif -#if __DJGPP__ - 0 == 1 - -/* There is some problem with memalign in DJGPP v1 and we are supposed - to omit it. Noone told me why, they just told me to do it. */ - -#else - __ptr_t (*__memalign_hook) PP ((__malloc_size_t __size, __malloc_size_t __alignment)); @@ -1556,9 +1772,10 @@ { __ptr_t result; unsigned long int adj, lastadj; + __ptr_t (*hook) (__malloc_size_t, __malloc_size_t) = __memalign_hook; - if (__memalign_hook) - return (*__memalign_hook) (alignment, size); + if (hook) + return (*hook) (alignment, size); /* Allocate a block with enough extra space to pad the block with up to (ALIGNMENT - 1) bytes if necessary. */ @@ -1593,6 +1810,7 @@ of an allocated block. */ struct alignlist *l; + LOCK_ALIGNED_BLOCKS (); for (l = _aligned_blocks; l != NULL; l = l->next) if (l->aligned == NULL) /* This slot is free. Use it. */ @@ -1600,22 +1818,58 @@ if (l == NULL) { l = (struct alignlist *) malloc (sizeof (struct alignlist)); - if (l == NULL) + if (l != NULL) { - free (result); - return NULL; + l->next = _aligned_blocks; + _aligned_blocks = l; } - l->next = _aligned_blocks; - _aligned_blocks = l; } - l->exact = result; - result = l->aligned = (char *) result + alignment - adj; + if (l != NULL) + { + l->exact = result; + result = l->aligned = (char *) result + alignment - adj; + } + UNLOCK_ALIGNED_BLOCKS (); + if (l == NULL) + { + free (result); + result = NULL; + } } return result; } -#endif /* Not DJGPP v1 */ +#ifndef ENOMEM +#define ENOMEM 12 +#endif + +#ifndef EINVAL +#define EINVAL 22 +#endif + +int +posix_memalign (memptr, alignment, size) + __ptr_t *memptr; + __malloc_size_t alignment; + __malloc_size_t size; +{ + __ptr_t mem; + + if (alignment == 0 + || alignment % sizeof (__ptr_t) != 0 + || (alignment & (alignment - 1)) != 0) + return EINVAL; + + mem = memalign (alignment, size); + if (mem == NULL) + return ENOMEM; + + *memptr = mem; + + return 0; +} + /* Allocate memory on a page boundary. Copyright (C) 1991, 92, 93, 94, 96 Free Software Foundation, Inc. @@ -1715,12 +1969,12 @@ #endif /* Old hook values. */ -static void (*old_free_hook) __P ((__ptr_t ptr)); -static __ptr_t (*old_malloc_hook) __P ((__malloc_size_t size)); -static __ptr_t (*old_realloc_hook) __P ((__ptr_t ptr, __malloc_size_t size)); +static void (*old_free_hook) (__ptr_t ptr); +static __ptr_t (*old_malloc_hook) (__malloc_size_t size); +static __ptr_t (*old_realloc_hook) (__ptr_t ptr, __malloc_size_t size); /* Function to call when something awful happens. */ -static void (*abortfunc) __P ((enum mcheck_status)); +static void (*abortfunc) (enum mcheck_status); /* Arbitrary magical numbers. */ #define MAGICWORD 0xfedabeeb @@ -1735,7 +1989,23 @@ unsigned long int magic; /* Magic number to check header integrity. */ }; -static enum mcheck_status checkhdr __P ((const struct hdr *)); +#if defined(_LIBC) || defined(STDC_HEADERS) || defined(USG) +#define flood memset +#else +static void flood (__ptr_t, int, __malloc_size_t); +static void +flood (ptr, val, size) + __ptr_t ptr; + int val; + __malloc_size_t size; +{ + char *cp = ptr; + while (size--) + *cp++ = val; +} +#endif + +static enum mcheck_status checkhdr (const struct hdr *); static enum mcheck_status checkhdr (hdr) const struct hdr *hdr; @@ -1761,7 +2031,7 @@ return status; } -static void freehook __P ((__ptr_t)); +static void freehook (__ptr_t); static void freehook (ptr) __ptr_t ptr; @@ -1773,7 +2043,7 @@ hdr = ((struct hdr *) ptr) - 1; checkhdr (hdr); hdr->magic = MAGICFREE; - memset (ptr, FREEFLOOD, hdr->size); + flood (ptr, FREEFLOOD, hdr->size); } else hdr = NULL; @@ -1783,7 +2053,7 @@ __free_hook = freehook; } -static __ptr_t mallochook __P ((__malloc_size_t)); +static __ptr_t mallochook (__malloc_size_t); static __ptr_t mallochook (size) __malloc_size_t size; @@ -1799,11 +2069,11 @@ hdr->size = size; hdr->magic = MAGICWORD; ((char *) &hdr[1])[size] = MAGICBYTE; - memset ((__ptr_t) (hdr + 1), MALLOCFLOOD, size); + flood ((__ptr_t) (hdr + 1), MALLOCFLOOD, size); return (__ptr_t) (hdr + 1); } -static __ptr_t reallochook __P ((__ptr_t, __malloc_size_t)); +static __ptr_t reallochook (__ptr_t, __malloc_size_t); static __ptr_t reallochook (ptr, size) __ptr_t ptr; @@ -1819,7 +2089,7 @@ checkhdr (hdr); if (size < osize) - memset ((char *) ptr + size, FREEFLOOD, osize - size); + flood ((char *) ptr + size, FREEFLOOD, osize - size); } __free_hook = old_free_hook; @@ -1836,7 +2106,7 @@ hdr->magic = MAGICWORD; ((char *) &hdr[1])[size] = MAGICBYTE; if (size > osize) - memset ((char *) (hdr + 1) + osize, MALLOCFLOOD, size - osize); + flood ((char *) (hdr + 1) + osize, MALLOCFLOOD, size - osize); return (__ptr_t) (hdr + 1); } @@ -1876,7 +2146,7 @@ int mcheck (func) - void (*func) __P ((enum mcheck_status)); + void (*func) (enum mcheck_status); { abortfunc = (func != NULL) ? func : &mabort; Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.7584 retrieving revision 1.7585 diff -u -d -r1.7584 -r1.7585 --- ChangeLog 10 Dec 2010 16:59:46 -0000 1.7584 +++ ChangeLog 10 Dec 2010 17:01:12 -0000 1.7585 @@ -1,6 +1,7 @@ 2010-12-10 Sam Steingold <sd...@gn...> * modules/asdf/asdf.lisp: update to upstream "2.011" + * src/gmalloc.c: update to upstream 2010-12-10 Sam Steingold <sd...@gn...> ------------------------------ ------------------------------------------------------------------------------ Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL, new data types, scalar functions, improved concurrency, built-in packages, OCI, SQL*Plus, data movement tools, best practices and more. http://p.sf.net/sfu/oracle-sfdev2dev ------------------------------ _______________________________________________ clisp-cvs mailing list cli...@li... https://lists.sourceforge.net/lists/listinfo/clisp-cvs End of clisp-cvs Digest, Vol 56, Issue 4 **************************************** |
|
From: Sam S. <sd...@gn...> - 2010-12-10 16:41:51
|
> * Aleksej Saushev <nf...@va...> [2010-11-22 15:39:46 +0300]: > > This fixes build on NetBSD (perhaps something similar applies to other BSD systems): > > > NetBSD has getpagesize(3) in unistd.h > > --- src/gmalloc.c.orig 2010-10-12 20:51:26.000000000 +0400 > +++ src/gmalloc.c 2010-11-19 02:51:35.000000000 +0300 > @@ -1657,7 +1657,11 @@ > extern size_t __getpagesize PP ((void)); > #endif > #else > +#if defined (__NetBSD__) > +extern int getpagesize (void); /* from getpagesize(3) */ > +#else > #include "getpagesize.h" > +#endif > #define __getpagesize() getpagesize() > #endif gmalloc is not "our file". we get it from emacs. please submit your patch to emacs-devel. thanks! PS. sorry about the slow response. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 10.04 (lucid) http://dhimmi.com http://camera.org http://palestinefacts.org http://jihadwatch.org http://www.memritv.org http://honestreporting.com Booze is the answer. I can't remember the question. |
|
From: Pascal J. B. <pj...@in...> - 2010-12-05 21:09:18
|
Samium Gromoff <_de...@fe...> writes:
> On Sun, 05 Dec 2010 03:25:46 +0100, "Pascal J. Bourguignon" <pj...@in...> wrote:
>> Samium Gromoff <_de...@fe...> writes:
>>
>> > Good day,
>> >
>> > it appears as if CLisp's implementation of *READ-SUPPRESS* behavior
>> > is suboptimal:
>> >
>> > deepfire@auriga:~$ LC_ALL=C clisp -x '(read-from-string "#+foo(#+foo:foo t) t")'
>
> [snip banner stuff]
>
>> > *** - COMMON-LISP:READ from #<INPUT STRING-INPUT-STREAM>: there is no package with name "FOO"
>
> [more snippage]
>
>> I'm afraid clisp behavior is correct here.
>
> I am under impression, that my not being clear enough resulted in
> us talking about different sides of the same phenomena.
>
>> clhs *read-supress* says:
>>
>> Dispatching macro characters (including sharpsign)
>>
>> Dispatching macro characters continue to parse an infix numerical
>> argument, and invoke the dispatch function. The standardized
>> sharpsign reader macros do not enforce any constraints on either the
>> presence of or the value of the numerical argument.
>
> What I was referring to, was the following passage from clhs
> *read-supress*:
>
>> Except as noted below, any standardized reader macro[2] that is defined
>> to read[2] a following object or token will do so, but not signal an
>> error if the object read is not of an appropriate type or syntax.
>
> I.e. it's the /condition/ which I'm riled up against.
#+ and #- do read two things, the feature test, and the conditionalized
object. IMO, in the paragraph you cite, "following object or token"
means the conditionalized object, what appears after the feature test.
2.4.8.17 Sharpsign Plus
#+ provides a read-time conditionalization facility; the syntax is
#+test expression. If the feature expression test succeeds, then
this textual notation represents an object whose printed
representation is expression. If the feature expression test fails,
then this textual notation is treated as whitespace[2]; that is, it
is as if the ``#+ test expression'' did not appear and only a space
appeared in its place.
For a detailed description of success and failure in feature
expressions, see Section 24.1.2.1 (Feature Expressions).
#+ operates by first reading the feature expression and then
skipping over the form if the feature expression fails. While
reading the test, the current package is the KEYWORD
package. Skipping over the form is accomplished by binding
*read-suppress* to true and then calling read.
IMO, #+ and #- need to bind *read-suppress* to NIL when reading the
feature test, otherwise it could be read as NIL.
>> Consider what if the foo package existed, and exported a foo symbol
>> pushed onto *features*.
>>
>> $ clall -r '(defpackage :foo (:use) (:export :foo))' \
>> '(progn (push (quote foo:foo) *features*)\
>> (read-from-string "(#+foo #+foo:foo a b c)"))'
>
> Hmm, composed reader conditionalisation. What value does it add over
> #+(and foo foo:foo) ?
None. My advice is to write #+(and a b) x. However, you will find a lot
of occurences of #+a #+b x, and other combinations of #+ and #-.
> Is it, in fact, even legal?
It's a little underspecified, and indeed, #- #+ and #- #- have quite
varying behaviors:
[pjb@kuiper :0.0 ~]$ clall -r '(read-from-string "(#-(and) #+(and) a b c)")'
Armed Bear Common Lisp --> (B C), 23
International Allegro CL Free Express Edition --> (C), 23
Clozure Common Lisp --> (C), 23
CLISP --> (B C), 23
CMU Common Lisp --> (B C), 23
ECL --> (C), 23
SBCL --> (B C), 23
========================================================================
[pjb@kuiper :0.0 ~]$ clall -r '(read-from-string "(#-(and) #-(and) a b c)")'
Armed Bear Common Lisp --> (C), 23
International Allegro CL Free Express Edition --> (B C), 23
Clozure Common Lisp --> (B C), 23
CLISP --> (C), 23
CMU Common Lisp --> (C), 23
ECL --> (C), 23
SBCL --> (C), 23
========================================================================
On the other hand, #+ #+ and #+ #- behave properly in all the
implementations I have:
[pjb@kuiper :0.0 ~]$ clall -r '(read-from-string "(#+(and) #+(and) a b c)")'
Armed Bear Common Lisp --> (A B C), 23
International Allegro CL Free Express Edition --> (A B C), 23
Clozure Common Lisp --> (A B C), 23
CLISP --> (A B C), 23
CMU Common Lisp --> (A B C), 23
ECL --> (A B C), 23
SBCL --> (A B C), 23
========================================================================
[pjb@kuiper :0.0 ~]$ clall -r '(read-from-string "(#+(and) #-(and) a b c)")'
Armed Bear Common Lisp --> (B C), 23
International Allegro CL Free Express Edition --> (B C), 23
Clozure Common Lisp --> (B C), 23
CLISP --> (B C), 23
CMU Common Lisp --> (B C), 23
ECL --> (B C), 23
SBCL --> (B C), 23
========================================================================
>> 2.4.8.17 Sharpsign Plus
>>
>> #+ provides a read-time conditionalization facility; the syntax is
>> #+test expression. If the feature expression test succeeds, then this
>> textual notation represents an object whose printed representation is
>> expression.
>
> ...but are there objects, whose textual representation is #+foo:foo?
>
> I suspect that the answer is a decisive negative.
Indeed, "#+foo:foo" is not a textual representation of any lisp object.
>> $ clall -r '(defpackage :foo (:use) (:export :foo))' \
>> '(progn (push (quote foo:foo) *features*)\
>> (read-from-string "(#+foo #+foo:foo a b c)"))'
>>
>> Armed Bear Common Lisp --> #<PACKAGE "FOO">
>> Armed Bear Common Lisp --> (B C), 23
>> Clozure Common Lisp --> #<Package "FOO">
>> Clozure Common Lisp --> (C), 23
>> CLISP --> #<PACKAGE FOO>
>> CLISP --> (B C), 23
>> CMU Common Lisp --> #<The FOO package, 0/8 internal, 1/2 external>
>> CMU Common Lisp --> (B C), 23
>> ECL --> #<"FOO" package>
>> ECL --> (C), 23
>> SBCL --> #<PACKAGE "FOO">
>> SBCL --> (B C), 23
>>
>> ========================================================================
>>
>> If *read-suppress* was in effect when reading foo:foo after #+, we'd get
>> nil, and since nil is not *feature*, we'd have to read (C). But clearly
>> we, want to read (B C). ccl is in error here.
>
> I'm not even sure what your expression is trying to accomplish here.
>
> Can you do the same using "boring", non-composed reader
> conditionalisation?
Yes.
(defpackage :foo (:use) (:export :foo))
(progn (push (quote foo:foo) *features*)
(read-from-string "(#+(and foo foo:foo) a b c)"))
and that's my point.
Using #+(and foo foo:foo) instead of #+foo #+foo:foo
removes any ambiguity due to the underspecification of #+ and #-, and
let us get the same results in all implementations. It also means that
(and foo foo:foo) is not read under a true *read-suppress*, and
therefore if there is no package foo, or exported symbol foo:foo, then
an error will be signaled, and you should not expect not to get this
error.
[pjb@kuiper :0.0 ~]$ clall -r '(defpackage :foo (:use) (:export :foo))' \
'(progn (push (quote foo:foo) *features*)
(read-from-string "(#+foo #+foo:foo a b c)"))'
> >
Armed Bear Common Lisp --> #<PACKAGE "FOO">
Armed Bear Common Lisp --> (B C), 23
Clozure Common Lisp --> #<Package "FOO">
Clozure Common Lisp --> (C), 23
CLISP --> #<PACKAGE FOO>
CLISP --> (B C), 23
CMU Common Lisp --> #<The FOO package, 0/8 internal, 1/2 external>
CMU Common Lisp --> (B C), 23
ECL --> #<"FOO" package>
ECL --> (C), 23
SBCL --> #<PACKAGE "FOO">
SBCL --> (B C), 23
========================================================================
[pjb@kuiper :0.0 ~]$ clall -r '(defpackage :foo (:use) (:export :foo))' \
'(progn (push (quote foo:foo) *features*)
(read-from-string "(#+(and foo foo:foo) a b c)"))'
> >
Armed Bear Common Lisp --> #<PACKAGE "FOO">
Armed Bear Common Lisp --> (B C), 27
Clozure Common Lisp --> #<Package "FOO">
Clozure Common Lisp --> (B C), 27
CLISP --> #<PACKAGE FOO>
CLISP --> (B C), 27
CMU Common Lisp --> #<The FOO package, 0/8 internal, 1/2 external>
CMU Common Lisp --> (B C), 27
ECL --> #<"FOO" package>
ECL --> (B C), 27
SBCL --> #<PACKAGE "FOO">
SBCL --> (B C), 27
========================================================================
>> In any case, you might want to avoid chains of #+/#-, since there is a
>> lot of diverging interpretation about their meaning.
>> Better use a single #+ or #- with a (and ...) or (or ...) form, and if
>> you depend on more complex tests such as the existance of a package or
>> symbol, use #. as above.
>
> I don't chain them in my example! To wit:
>
>> '(read-from-string "#+foo(#+foo:foo t) t")'
>From the point of view of your question about *read-suppress*,
(#+a #+b x y z) and (#+a (#+b x y) z) are equivalent.
> What I actually _want_ is to be able to:
>
> (let ((*read-suppress* t))
> (read-from-string
> "#<any-valid-sexp-with-any-combination-of-reader-conditionals-from-any-martian-packages>"))
>
> ..and not _ever_ have it signal an error.
*read-suppress* doesn't suppress errors. You will still get errors.
For another example, notice how #. isn't affected by *read-suppress*:
2.4.8.6 Sharpsign Dot
#.foo is read as the object resulting from the evaluation of the
object represented by foo. The evaluation is done during the read
process, when the #. notation is encountered. The #. syntax
therefore performs a read-time evaluation of foo.
The normal effect of #. is inhibited when the value of *read-eval*
is false. In that situation, an error of type reader-error is
signaled.
For an object that does not have a convenient printed
representation, a form that computes the object can be given using
the #. notation.
(it has it's own *read-eval* variable).
So: #-(and) #.(print 'foo:hello)
will either print FOO:HELLO, or signal an error if no symbol foo:hello
is exported from the package foo, that MUST EXIST when this is READ!
If you want to ignore the errors, you can still do it:
(ignore-errors
(let ((*read-suppress* t)
(*read-eval* t)) ; might be prudent: #.(intern "FOO" "FOO") !
(read-from-string alien-string)))
> What the current CLisp' and SBCL's collective behavior amounts to, is
> that it's impossible to READ a sequence of arbitrary forms, without
> resorting to manual SEXP parsing -- you are bound to have unrecoverable
> reader errors for SEXP subtrees referring to symbols within inexistent
> packages, and without any means to "seek" past them.
There are lisp readers that would allow you to 'read' alien forms.
But for the most alien forms, you will also need to have a definition of
the reader macros, at least able to skip over the correct amount of
text.
Imagine you want to read:
"(eval '#>pascal
function f(x:integer):integer;
begin
if (x<1) then begin
f:=1;
end else begin
f:=x*f(x-1);
end;
end;
#>/pascal)"
This is another reason why it may not be possible to read martian
sources with a standard reader: you would have to load the martial
sources to run their reader macros!
In any case, the lisp reader at:
http://git.informatimago.com/viewgit/index.php?a=tree&p=public/lisp&h=fc21bf13409c2cf35044828604ebcd8d1ac91693&hb=70763ed2f4ea63b2e4c742236aeddac83c911ff7&f=common-lisp/lisp-reader
and also:
http://git.informatimago.com/viewgit/index.php?a=viewblob&p=public/lisp&h=232abd6e3a943129146f1a9535181b21d940fcdf&hb=70763ed2f4ea63b2e4c742236aeddac83c911ff7&f=common-lisp/lisp-text/source-text.lisp
Download instructions at:
http://www.informatimago.com/develop/lisp/index.html
could be of help.
> Unless, that is, *READ-SUPPRESS* cooperates.
IMO, #+ and #- have to bind *read-suppress* to NIL when reading the
feature test.
Notice that it should be most unusual to have a non-keyword put in
*features*. It might have been suggested to use non-keyword symbols in
*features* for specific (library or program) uses, but your questions
clearly shows that it's not a good idea.
--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.
|
|
From: Samium G. <_de...@fe...> - 2010-12-05 20:06:42
|
On Sun, 05 Dec 2010 03:25:46 +0100, "Pascal J. Bourguignon" <pj...@in...> wrote: > Samium Gromoff <_de...@fe...> writes: > > > Good day, > > > > it appears as if CLisp's implementation of *READ-SUPPRESS* behavior > > is suboptimal: > > > > deepfire@auriga:~$ LC_ALL=C clisp -x '(read-from-string "#+foo(#+foo:foo t) t")' [snip banner stuff] > > *** - COMMON-LISP:READ from #<INPUT STRING-INPUT-STREAM>: there is no package with name "FOO" [more snippage] > I'm afraid clisp behavior is correct here. I am under impression, that my not being clear enough resulted in us talking about different sides of the same phenomena. What I was referring to, was the following passage from clhs *read-supress*: > Except as noted below, any standardized reader macro[2] that is defined > to read[2] a following object or token will do so, but not signal an > error if the object read is not of an appropriate type or syntax. I.e. it's the /condition/ which I'm riled up against. > clhs *read-supress* says: > > Dispatching macro characters (including sharpsign) > > Dispatching macro characters continue to parse an infix numerical > argument, and invoke the dispatch function. The standardized > sharpsign reader macros do not enforce any constraints on either the > presence of or the value of the numerical argument. > > Consider what if the foo package existed, and exported a foo symbol > pushed onto *features*. > > $ clall -r '(defpackage :foo (:use) (:export :foo))' \ > '(progn (push (quote foo:foo) *features*)\ > (read-from-string "(#+foo #+foo:foo a b c)"))' Hmm, composed reader conditionalisation. What value does it add over #+(and foo foo:foo) ? Is it, in fact, even legal? > 2.4.8.17 Sharpsign Plus > > #+ provides a read-time conditionalization facility; the syntax is > #+test expression. If the feature expression test succeeds, then this > textual notation represents an object whose printed representation is > expression. ...but are there objects, whose textual representation is #+foo:foo? I suspect that the answer is a decisive negative. > Armed Bear Common Lisp --> #<PACKAGE "FOO"> > Armed Bear Common Lisp --> (B C), 23 > Clozure Common Lisp --> #<Package "FOO"> > Clozure Common Lisp --> (C), 23 > CLISP --> #<PACKAGE FOO> > CLISP --> (B C), 23 > CMU Common Lisp --> #<The FOO package, 0/8 internal, 1/2 external> > CMU Common Lisp --> (B C), 23 > ECL --> #<"FOO" package> > ECL --> (C), 23 > SBCL --> #<PACKAGE "FOO"> > SBCL --> (B C), 23 > > ======================================================================== > > If *read-suppress* was in effect when reading foo:foo after #+, we'd get > nil, and since nil is not *feature*, we'd have to read (C). But clearly > we, want to read (B C). ccl is in error here. I'm not even sure what your expression is trying to accomplish here. Can you do the same using "boring", non-composed reader conditionalisation? > Perhaps you want: > > (read-from-string "#+foo ( #+#.(cl:if (cl:and (cl:find-package \"FOO\") > (cl:find-symbol \"FOO\" \"FOO\") > (cl:member (cl:find-symbol \"FOO\" \"FOO\") cl:*features*)) > '(:and) > '(:or)) t) t") No, I don't directly control what text I pass to READ. > In any case, you might want to avoid chains of #+/#-, since there is a > lot of diverging interpretation about their meaning. > Better use a single #+ or #- with a (and ...) or (or ...) form, and if > you depend on more complex tests such as the existance of a package or > symbol, use #. as above. I don't chain them in my example! To wit: > '(read-from-string "#+foo(#+foo:foo t) t")' What I actually _want_ is to be able to: (let ((*read-suppress* t)) (read-from-string "#<any-valid-sexp-with-any-combination-of-reader-conditionals-from-any-martian-packages>")) ..and not _ever_ have it signal an error. What the current CLisp' and SBCL's collective behavior amounts to, is that it's impossible to READ a sequence of arbitrary forms, without resorting to manual SEXP parsing -- you are bound to have unrecoverable reader errors for SEXP subtrees referring to symbols within inexistent packages, and without any means to "seek" past them. Unless, that is, *READ-SUPPRESS* cooperates. -- regards, Samium Gromoff -- "Actually I made up the term 'object-oriented', and I can tell you I did not have C++ in mind." - Alan Kay (OOPSLA 1997 Keynote) |
|
From: Pascal J. B. <pj...@in...> - 2010-12-05 02:24:22
|
Samium Gromoff <_de...@fe...> writes: > Good day, > > it appears as if CLisp's implementation of *READ-SUPPRESS* behavior > is suboptimal: > > deepfire@auriga:~$ LC_ALL=C clisp -x '(read-from-string "#+foo(#+foo:foo t) t")' > i > . . . . I i i i i ooooo o ooooooo ooooo ooooo > I I I I I I I I I 8 8 8 8 8 o 8 8 > I I \ `+' / I I 8 8 8 8 8 8 > I \ `-+-' / I 8 8 8 ooooo 8oooo > \ `-__|__-' / 8 8 8 8 8 > `--___|___--' 8 o 8 8 o 8 8 > | ooooo 8oooooo ooo8ooo ooooo 8 > --------+-------- > > Welcome to GNU CLISP 2.48 (2009-07-28) <http://clisp.cons.org/> > > Copyright (c) Bruno Haible, Michael Stoll 1992, 1993 > Copyright (c) Bruno Haible, Marcus Daniels 1994-1997 > Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998 > Copyright (c) Bruno Haible, Sam Steingold 1999-2000 > Copyright (c) Sam Steingold, Bruno Haible 2001-2009 > > Type :h and hit Enter for context help. > > *** - COMMON-LISP:READ from #<INPUT STRING-INPUT-STREAM>: there is no package with name "FOO" > > Bye. > > ... > > Admittedly, it's whatever I've got in debian sid, and still it's pretty > old, so I apologise in advance if this is already fixed.. > > For the record, SBCL 1.0.44 suffers the same (bug reported), but > ECL 10.7.1 and CCL 1.4-r13119 handle it just fine. I'm afraid clisp behavior is correct here. clhs *read-supress* says: Dispatching macro characters (including sharpsign) Dispatching macro characters continue to parse an infix numerical argument, and invoke the dispatch function. The standardized sharpsign reader macros do not enforce any constraints on either the presence of or the value of the numerical argument. Consider what if the foo package existed, and exported a foo symbol pushed onto *features*. $ clall -r '(defpackage :foo (:use) (:export :foo))' \ '(progn (push (quote foo:foo) *features*)\ (read-from-string "(#+foo #+foo:foo a b c)"))' Armed Bear Common Lisp --> #<PACKAGE "FOO"> Armed Bear Common Lisp --> (B C), 23 Clozure Common Lisp --> #<Package "FOO"> Clozure Common Lisp --> (C), 23 CLISP --> #<PACKAGE FOO> CLISP --> (B C), 23 CMU Common Lisp --> #<The FOO package, 0/8 internal, 1/2 external> CMU Common Lisp --> (B C), 23 ECL --> #<"FOO" package> ECL --> (C), 23 SBCL --> #<PACKAGE "FOO"> SBCL --> (B C), 23 ======================================================================== If *read-suppress* was in effect when reading foo:foo after #+, we'd get nil, and since nil is not *feature*, we'd have to read (C). But clearly we, want to read (B C). ccl is in error here. Perhaps you want: (read-from-string "#+foo ( #+#.(cl:if (cl:and (cl:find-package \"FOO\") (cl:find-symbol \"FOO\" \"FOO\") (cl:member (cl:find-symbol \"FOO\" \"FOO\") cl:*features*)) '(:and) '(:or)) t) t") In any case, you might want to avoid chains of #+/#-, since there is a lot of diverging interpretation about their meaning. Better use a single #+ or #- with a (and ...) or (or ...) form, and if you depend on more complex tests such as the existance of a package or symbol, use #. as above. -- __Pascal Bourguignon__ http://www.informatimago.com/ A bad day in () is better than a good day in {}. |
|
From: Samium G. <_de...@fe...> - 2010-12-05 01:20:23
|
Good day,
it appears as if CLisp's implementation of *READ-SUPPRESS* behavior
is suboptimal:
deepfire@auriga:~$ LC_ALL=C clisp -x '(read-from-string "#+foo(#+foo:foo t) t")'
i
. . . . I i i i i ooooo o ooooooo ooooo ooooo
I I I I I I I I I 8 8 8 8 8 o 8 8
I I \ `+' / I I 8 8 8 8 8 8
I \ `-+-' / I 8 8 8 ooooo 8oooo
\ `-__|__-' / 8 8 8 8 8
`--___|___--' 8 o 8 8 o 8 8
| ooooo 8oooooo ooo8ooo ooooo 8
--------+--------
Welcome to GNU CLISP 2.48 (2009-07-28) <http://clisp.cons.org/>
Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2009
Type :h and hit Enter for context help.
*** - COMMON-LISP:READ from #<INPUT STRING-INPUT-STREAM>: there is no package with name "FOO"
Bye.
...
Admittedly, it's whatever I've got in debian sid, and still it's pretty
old, so I apologise in advance if this is already fixed..
For the record, SBCL 1.0.44 suffers the same (bug reported), but
ECL 10.7.1 and CCL 1.4-r13119 handle it just fine.
--
regards,
Samium Gromoff
--
"Actually I made up the term 'object-oriented', and I can tell you I
did not have C++ in mind." - Alan Kay (OOPSLA 1997 Keynote)
|
|
From: Sam S. <sd...@gn...> - 2010-12-03 15:18:50
|
Hi Bruno, On Fri, Dec 3, 2010 at 4:41 AM, Bruno Haible <br...@cl...> wrote: > http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_load.html > http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_compile-file.html oops. I stand corrected. > No. But when the user has set a directory in *default-pathname-defaults* > he has to be prepared to seeing this directory being merged into all > non-absolute pathnames he enters. > >> re: bug#3124200 > > Haven't had time to look at that, sorry. (setq *default-pathname-defaults* (cd)) breaks (require "rawsock") because search-file now looks for "/home/...../rawsock" and not for "rawsock". since "rawsock" in require is a module designator, not a pathname designator, I think that my first original patch replacing merge-pathnames with pathname in search-file is actually correct. -- Sam Steingold <http://sds.podval.org> |
|
From: Bruno H. <br...@cl...> - 2010-12-03 10:07:04
|
Hi Sam, > this is caused by (merge-pathname filename) in search-file. > why is it necessary? CLHS specifies that for LOAD, COMPILE-FILE, etc., the *default-pathname-defaults* are merged into the pathnames provided as strings or as PATHNAME objects by the user. See http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_load.html http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_compile-file.html So, the processing steps are: 1. The user enters a string or pathname. This happens outside LOAD and COMPILE-FILE. 2. It is converted to a PATHNAME. This happens inside or outside LOAD and COMPILE-FILE, doesn't matter. 3. It is merged with *default-pathname-defaults*. This happens inside LOAD and COMPILE-FILE. Removing the MERGE-PATHNAME invocations would therefore be wrong. > you seem to think that *default-pathname-defaults* is not supposed to > contain anything "defining" (directory, et al), just the useless > version. No. But when the user has set a directory in *default-pathname-defaults* he has to be prepared to seeing this directory being merged into all non-absolute pathnames he enters. Maybe the merging of the pathnames provided to LOAD and COMPILE-FILE with *default-pathname-defaults* has to be done in a different way than by calling MERGE-PATHNAMES? I don't know. > re: bug#3124200 Haven't had time to look at that, sorry. Bruno |
|
From: SourceForge.net <no...@so...> - 2010-12-01 14:32:54
|
Feature Requests item #3124233, was opened at 2010-11-30 23:55 Message generated for change (Comment added) made by sds You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=351355&aid=3124233&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: None Group: None >Status: Pending >Resolution: Wont Fix Priority: 5 Private: No Submitted By: Andrew Pennebaker (mcandre) Assigned to: Bruno Haible (haible) Summary: *args* omits script name (if any) Initial Comment: Scripting with Common Lisp would be a lot easier if *args* included the lisp file loaded by clisp. E.g., ./myscript.cl and clisp.cl would have *args* => ("myscript.cl") One workaround is to use shebang trickery. http://speely.wordpress.com/2010/11/27/writing-scripts-with-common-lisp/ ---------------------------------------------------------------------- >Comment By: Sam Steingold (sds) Date: 2010-12-01 09:32 Message: Pascal is right; *load-pathname* is what you want. http://clisp.sourceforge.net/impnotes/quickstart.html#quickstart-unix You are asking me to introduce a gratuitous incompatibility with the previous versions of clisp. While I agree that it is a good idea to offer an interface similar to other CL implementations, I don't see much benefit in this specific change. ---------------------------------------------------------------------- Comment By: Andrew Pennebaker (mcandre) Date: 2010-12-01 02:24 Message: *load-pathname* is the name of the currently loading file, not necessarily the file indicated by calling clisp somefile.lisp. I petition CLISP to add something equivalent to Python's if __name__=="__main__" or Ruby's if __FILE__==$0. Basically, I'd like CLISP's *args* to operate like SBCL, Clozure, GCL, ECL, CMUCL, AllegroCL, and LispWorks. Notice the use of cdr in http://common-lisp.net/gitweb?p=projects/qitab/command-line-arguments.git;a=commitdiff;h=19866582857b3431e01c945afb62e9366e919f07 ---------------------------------------------------------------------- Comment By: Pascal J. Bourguignon (informatimago) Date: 2010-12-01 00:49 Message: You can use *load-pathname* to get the script name. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=351355&aid=3124233&group_id=1355 |
|
From: SourceForge.net <no...@so...> - 2010-12-01 14:25:04
|
Bugs item #3124235, was opened at 2010-11-30 23:58 Message generated for change (Settings changed) made by sds You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124235&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: ANSI compliance issue >Status: Pending >Resolution: Invalid Priority: 5 Private: No Submitted By: Andrew Pennebaker (mcandre) >Assigned to: Sam Steingold (sds) Summary: hex format directive ignores upper/lower case distinction Initial Comment: (format nil "~x" 10) => "A" when it should evaluate to "a". Specs: GNU CLISP 2.49 (2010-07-07) (built 3499977130) (memory 3499977680) Software: GNU C 4.2.1 (Apple Inc. build 5646) That's clisp x2.49 (via MacPorts) on Mac OS X 10.6.5 / MacBook Pro 5,1. ---------------------------------------------------------------------- >Comment By: Sam Steingold (sds) Date: 2010-12-01 09:25 Message: why do you expect "a" there? could you please quote the relevant part of the standard? ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2010-12-01 09:25 Message: This bug report is now marked as "pending"/"invalid". This means that we think that the problem you report is not a problem with CLISP. Unless you - the reporter - act within 2 weeks, the bug will be permanently closed. Sorry about the inconvenience - we hope your silence means that you agree that this is not a bug in CLISP. ---------------------------------------------------------------------- Comment By: Andrew Pennebaker (mcandre) Date: 2010-12-01 02:59 Message: Thank you. I got the impression from skimming Practical Common Lisp that ~X was uppercase and ~x was lowercase. Had I scrolled down, I would have seen the bit about ~(...~). ---------------------------------------------------------------------- Comment By: Andrew Pennebaker (mcandre) Date: 2010-12-01 02:59 Message: This bug report is now marked as "pending"/"works for me". This means that we think that we cannot reproduce the problem and cannot do anything about it. Unless you - the reporter - act within 2 weeks (e.g., by submitting a self-contained test case or answering our other recent requests), the bug will be permanently closed. Sorry about the inconvenience - we hope your silence means that you are no longer observing the problem either. ---------------------------------------------------------------------- Comment By: Pascal J. Bourguignon (informatimago) Date: 2010-12-01 00:48 Message: (Sorry for the previous comment it was intended for another bug report). First, CLHS is clear about directive characters: http://www.lispworks.com/documentation/HyperSpec/Body/22_c.htm The case of the directive character is ignored. If you want to force lowercase or upper case, use ~:( or ~:@( ---------------------------------------------------------------------- Comment By: Pascal J. Bourguignon (informatimago) Date: 2010-12-01 00:42 Message: You can use *load-pathname* to get the script name. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124235&group_id=1355 |
|
From: SourceForge.net <no...@so...> - 2010-12-01 07:59:56
|
Bugs item #3124235, was opened at 2010-12-01 04:58 Message generated for change (Comment added) made by mcandre You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124235&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: ANSI compliance issue Status: Open Resolution: None Priority: 5 Private: No Submitted By: Andrew Pennebaker (mcandre) Assigned to: Bruno Haible (haible) Summary: hex format directive ignores upper/lower case distinction Initial Comment: (format nil "~x" 10) => "A" when it should evaluate to "a". Specs: GNU CLISP 2.49 (2010-07-07) (built 3499977130) (memory 3499977680) Software: GNU C 4.2.1 (Apple Inc. build 5646) That's clisp x2.49 (via MacPorts) on Mac OS X 10.6.5 / MacBook Pro 5,1. ---------------------------------------------------------------------- >Comment By: Andrew Pennebaker (mcandre) Date: 2010-12-01 07:59 Message: Thank you. I got the impression from skimming Practical Common Lisp that ~X was uppercase and ~x was lowercase. Had I scrolled down, I would have seen the bit about ~(...~). ---------------------------------------------------------------------- Comment By: Andrew Pennebaker (mcandre) Date: 2010-12-01 07:59 Message: This bug report is now marked as "pending"/"works for me". This means that we think that we cannot reproduce the problem and cannot do anything about it. Unless you - the reporter - act within 2 weeks (e.g., by submitting a self-contained test case or answering our other recent requests), the bug will be permanently closed. Sorry about the inconvenience - we hope your silence means that you are no longer observing the problem either. ---------------------------------------------------------------------- Comment By: Pascal J. Bourguignon (informatimago) Date: 2010-12-01 05:48 Message: (Sorry for the previous comment it was intended for another bug report). First, CLHS is clear about directive characters: http://www.lispworks.com/documentation/HyperSpec/Body/22_c.htm The case of the directive character is ignored. If you want to force lowercase or upper case, use ~:( or ~:@( ---------------------------------------------------------------------- Comment By: Pascal J. Bourguignon (informatimago) Date: 2010-12-01 05:42 Message: You can use *load-pathname* to get the script name. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124235&group_id=1355 |
|
From: SourceForge.net <no...@so...> - 2010-12-01 07:24:40
|
Bugs item #3124233, was opened at 2010-12-01 04:55 Message generated for change (Comment added) made by mcandre You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124233&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Andrew Pennebaker (mcandre) Assigned to: Bruno Haible (haible) Summary: *args* omits script name (if any) Initial Comment: Scripting with Common Lisp would be a lot easier if *args* included the lisp file loaded by clisp. E.g., ./myscript.cl and clisp.cl would have *args* => ("myscript.cl") One workaround is to use shebang trickery. http://speely.wordpress.com/2010/11/27/writing-scripts-with-common-lisp/ ---------------------------------------------------------------------- >Comment By: Andrew Pennebaker (mcandre) Date: 2010-12-01 07:24 Message: *load-pathname* is the name of the currently loading file, not necessarily the file indicated by calling clisp somefile.lisp. I petition CLISP to add something equivalent to Python's if __name__=="__main__" or Ruby's if __FILE__==$0. Basically, I'd like CLISP's *args* to operate like SBCL, Clozure, GCL, ECL, CMUCL, AllegroCL, and LispWorks. Notice the use of cdr in http://common-lisp.net/gitweb?p=projects/qitab/command-line-arguments.git;a=commitdiff;h=19866582857b3431e01c945afb62e9366e919f07 ---------------------------------------------------------------------- Comment By: Andrew Pennebaker (mcandre) Date: 2010-12-01 07:24 Message: this is the standard request for more information. 1. what is your platform? ("uname -a" on a Unix system) compiler version? libc (on Linux)? 2. where did you get the sources? when? (absolute dates are prefered over the relative ones) 3. how did you build CLISP? (what command, options &c) please do a clean build (remove your build directory and build CLISP with "./configure --build build" or at least do a "make distclean" before "make") 4. if you are using pre-built binaries, the problem is likely to be in the incompatibilities between the platform on which the binary was built and yours; please try compiling the sources. 5. what is the output of (lisp-implementation-version)? 6. what is the value of *features*? 7. please supply the full output (copy and paste) of all the error messages. If you cannot build CLISP, you can obviously skip 5 and 6, but then you should provide more information in 1. please see <http://clisp.cons.org/clisp.html#bugs> for more information. Thanks. PS. This bug report is now marked "pending" and will auto-close unless you respond (in which case it will auto-re-open). ---------------------------------------------------------------------- Comment By: Pascal J. Bourguignon (informatimago) Date: 2010-12-01 05:49 Message: You can use *load-pathname* to get the script name. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124233&group_id=1355 |
|
From: SourceForge.net <no...@so...> - 2010-12-01 05:49:14
|
Bugs item #3124233, was opened at 2010-12-01 05:55 Message generated for change (Comment added) made by informatimago You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124233&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Andrew Pennebaker (mcandre) Assigned to: Bruno Haible (haible) Summary: *args* omits script name (if any) Initial Comment: Scripting with Common Lisp would be a lot easier if *args* included the lisp file loaded by clisp. E.g., ./myscript.cl and clisp.cl would have *args* => ("myscript.cl") One workaround is to use shebang trickery. http://speely.wordpress.com/2010/11/27/writing-scripts-with-common-lisp/ ---------------------------------------------------------------------- Comment By: Pascal J. Bourguignon (informatimago) Date: 2010-12-01 06:49 Message: You can use *load-pathname* to get the script name. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124233&group_id=1355 |
|
From: SourceForge.net <no...@so...> - 2010-12-01 05:48:42
|
Bugs item #3124235, was opened at 2010-12-01 05:58 Message generated for change (Comment added) made by informatimago You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124235&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: ANSI compliance issue Status: Open Resolution: None Priority: 5 Private: No Submitted By: Andrew Pennebaker (mcandre) Assigned to: Bruno Haible (haible) Summary: hex format directive ignores upper/lower case distinction Initial Comment: (format nil "~x" 10) => "A" when it should evaluate to "a". Specs: GNU CLISP 2.49 (2010-07-07) (built 3499977130) (memory 3499977680) Software: GNU C 4.2.1 (Apple Inc. build 5646) That's clisp x2.49 (via MacPorts) on Mac OS X 10.6.5 / MacBook Pro 5,1. ---------------------------------------------------------------------- Comment By: Pascal J. Bourguignon (informatimago) Date: 2010-12-01 06:48 Message: (Sorry for the previous comment it was intended for another bug report). First, CLHS is clear about directive characters: http://www.lispworks.com/documentation/HyperSpec/Body/22_c.htm The case of the directive character is ignored. If you want to force lowercase or upper case, use ~:( or ~:@( ---------------------------------------------------------------------- Comment By: Pascal J. Bourguignon (informatimago) Date: 2010-12-01 06:42 Message: You can use *load-pathname* to get the script name. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124235&group_id=1355 |
|
From: SourceForge.net <no...@so...> - 2010-12-01 05:42:52
|
Bugs item #3124235, was opened at 2010-12-01 05:58 Message generated for change (Comment added) made by informatimago You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124235&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: ANSI compliance issue Status: Open Resolution: None Priority: 5 Private: No Submitted By: Andrew Pennebaker (mcandre) Assigned to: Bruno Haible (haible) Summary: hex format directive ignores upper/lower case distinction Initial Comment: (format nil "~x" 10) => "A" when it should evaluate to "a". Specs: GNU CLISP 2.49 (2010-07-07) (built 3499977130) (memory 3499977680) Software: GNU C 4.2.1 (Apple Inc. build 5646) That's clisp x2.49 (via MacPorts) on Mac OS X 10.6.5 / MacBook Pro 5,1. ---------------------------------------------------------------------- Comment By: Pascal J. Bourguignon (informatimago) Date: 2010-12-01 06:42 Message: You can use *load-pathname* to get the script name. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124235&group_id=1355 |
|
From: SourceForge.net <no...@so...> - 2010-12-01 04:58:18
|
Bugs item #3124235, was opened at 2010-12-01 04:58 Message generated for change (Tracker Item Submitted) made by mcandre You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124235&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: ANSI compliance issue Status: Open Resolution: None Priority: 5 Private: No Submitted By: Andrew Pennebaker (mcandre) Assigned to: Bruno Haible (haible) Summary: hex format directive ignores upper/lower case distinction Initial Comment: (format nil "~x" 10) => "A" when it should evaluate to "a". Specs: GNU CLISP 2.49 (2010-07-07) (built 3499977130) (memory 3499977680) Software: GNU C 4.2.1 (Apple Inc. build 5646) That's clisp x2.49 (via MacPorts) on Mac OS X 10.6.5 / MacBook Pro 5,1. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124235&group_id=1355 |
|
From: SourceForge.net <no...@so...> - 2010-12-01 04:55:39
|
Bugs item #3124233, was opened at 2010-12-01 04:55 Message generated for change (Tracker Item Submitted) made by mcandre You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124233&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Andrew Pennebaker (mcandre) Assigned to: Bruno Haible (haible) Summary: *args* omits script name (if any) Initial Comment: Scripting with Common Lisp would be a lot easier if *args* included the lisp file loaded by clisp. E.g., ./myscript.cl and clisp.cl would have *args* => ("myscript.cl") One workaround is to use shebang trickery. http://speely.wordpress.com/2010/11/27/writing-scripts-with-common-lisp/ ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124233&group_id=1355 |
|
From: SourceForge.net <no...@so...> - 2010-12-01 03:52:31
|
Bugs item #3124200, was opened at 2010-12-01 04:52 Message generated for change (Tracker Item Submitted) made by informatimago You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124200&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: lisp error Status: Open Resolution: None Priority: 5 Private: No Submitted By: Pascal J. Bourguignon (informatimago) Assigned to: Bruno Haible (haible) Summary: When you set *default-pathname-defaults* to a different dire Initial Comment: With clisp 2.49, when you set *default-pathname-defaults* to a different directory, REQUIRE doesn't find the dynmods anymore. [pjb@kuiper :0.0 ~]$ clisp -ansi -q -norc [1]> custom:*load-paths* (#P"./" "~/lisp/**/") [2]> *default-pathname-defaults* #P"" [3]> (setf *default-pathname-defaults* (ext:cd)) #P"/home/pjb/" [4]> (require "linux") *** - LOAD: A file with name linux does not exist The following restarts are available: ABORT :R1 Abort main loop Break 1 [5]> :q [6]> (setf *default-pathname-defaults* #P"") #P"" [7]> (require "linux") ;; Loading file /data/languages/clisp-2.49/lib/clisp-2.49/dynmod/linux.lisp ... ;; Loading module linux from /data/languages/clisp-2.49/lib/clisp-2.49/dynmod/lib-linux.so ;; Loaded module linux from /data/languages/clisp-2.49/lib/clisp-2.49/dynmod/lib-linux.so ;; Loading file /data/languages/clisp-2.49/lib/clisp-2.49/bindings/glibc/linux.fas ... ;; Loaded file /data/languages/clisp-2.49/lib/clisp-2.49/bindings/glibc/linux.fas ;; Loading file /data/languages/clisp-2.49/lib/clisp-2.49/bindings/glibc/wrap.fas ... ;; Loaded file /data/languages/clisp-2.49/lib/clisp-2.49/bindings/glibc/wrap.fas ;; Loaded file /data/languages/clisp-2.49/lib/clisp-2.49/dynmod/linux.lisp T [8]> (quit) [pjb@kuiper :0.0 ~]$ Also, I note that require takes the symbol name as module name, but on systems with a lower customary case, it would be better to apply the customary case common-to-local mapping rules. This would allow us to use: (require :asdf) like in the other implementations when clisp will include asdf... (The rules about common case were choosen to match the upcasing of lisp symbols, so it seems logical to consider symbols as logical pathnames parts). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3124200&group_id=1355 |
|
From: SourceForge.net <no...@so...> - 2010-11-29 21:43:22
|
Bugs item #3122505, was opened at 2010-11-29 12:04 Message generated for change (Comment added) made by sds You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3122505&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: lisp error >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: https://www.google.com/accounts () >Assigned to: Sam Steingold (sds) Summary: LOAD does not close input file on abort Initial Comment: If a LOAD is aborted for some reason, the input file is not close. That can cause later errors when trying to open the file with different options. Here is a simplified version of the example that caused me some trouble: $ echo 1 > foo.lisp $ echo -e '\0' > foo.fas $ clisp -norc i i i i i i i ooooo o ooooooo ooooo ooooo I I I I I I I 8 8 8 8 8 o 8 8 I \ `+' / I 8 8 8 8 8 8 \ `-+-' / 8 8 8 ooooo 8oooo `-__|__-' 8 8 8 8 8 | 8 o 8 8 o 8 8 ------+------ ooooo 8oooooo ooo8ooo ooooo 8 Welcome to GNU CLISP 2.49 (2010-07-07) <http://clisp.cons.org/> Copyright (c) Bruno Haible, Michael Stoll 1992, 1993 Copyright (c) Bruno Haible, Marcus Daniels 1994-1997 Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998 Copyright (c) Bruno Haible, Sam Steingold 1999-2000 Copyright (c) Sam Steingold, Bruno Haible 2001-2010 Type :h and hit Enter for context help. [1]> (load "foo.fas") *** - READ from #<INPUT BUFFERED FILE-STREAM CHARACTER #P"foo.fas" @1>: illegal character #\Null The following restarts are available: ABORT :R1 Abort main loop Break 1 [2]> :r1 [3]> (compile-file "foo.lisp") ** - Continuable Error OPEN: #<INPUT BUFFERED FILE-STREAM CHARACTER #P"foo.fas" @1> already points to file "/tmp/foo.fas", opening the file again for :OUTPUT may produce unexpected results If you continue (by typing 'continue'): Open the file anyway The following restarts are also available: ABORT :R1 Abort main loop Break 1 [4]> :r1 [5]> It was a surprise to me that the earlier failed LOAD interfered with the later attempt to use COMPILE-FILE. I expected the two operations to be fully independent. If LOAD closed its input file on abort, I think this problem would have been avoided. I'm using CLISP 2.49 built from source on 64-bit Linux. ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2010-11-29 16:43 Message: thank you for your bug report. the bug has been fixed in the CVS tree. you can either wait for the next release (recommended) or check out the current CVS tree (see http://clisp.cons.org) and build CLISP from the sources (be advised that between releases the CVS tree is very unstable and may not even build on your platform). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3122505&group_id=1355 |
|
From: SourceForge.net <no...@so...> - 2010-11-29 17:04:47
|
Bugs item #3122505, was opened at 2010-11-29 17:04 Message generated for change (Tracker Item Submitted) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3122505&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: lisp error Status: Open Resolution: None Priority: 5 Private: No Submitted By: https://www.google.com/accounts () Assigned to: Bruno Haible (haible) Summary: LOAD does not close input file on abort Initial Comment: If a LOAD is aborted for some reason, the input file is not close. That can cause later errors when trying to open the file with different options. Here is a simplified version of the example that caused me some trouble: $ echo 1 > foo.lisp $ echo -e '\0' > foo.fas $ clisp -norc i i i i i i i ooooo o ooooooo ooooo ooooo I I I I I I I 8 8 8 8 8 o 8 8 I \ `+' / I 8 8 8 8 8 8 \ `-+-' / 8 8 8 ooooo 8oooo `-__|__-' 8 8 8 8 8 | 8 o 8 8 o 8 8 ------+------ ooooo 8oooooo ooo8ooo ooooo 8 Welcome to GNU CLISP 2.49 (2010-07-07) <http://clisp.cons.org/> Copyright (c) Bruno Haible, Michael Stoll 1992, 1993 Copyright (c) Bruno Haible, Marcus Daniels 1994-1997 Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998 Copyright (c) Bruno Haible, Sam Steingold 1999-2000 Copyright (c) Sam Steingold, Bruno Haible 2001-2010 Type :h and hit Enter for context help. [1]> (load "foo.fas") *** - READ from #<INPUT BUFFERED FILE-STREAM CHARACTER #P"foo.fas" @1>: illegal character #\Null The following restarts are available: ABORT :R1 Abort main loop Break 1 [2]> :r1 [3]> (compile-file "foo.lisp") ** - Continuable Error OPEN: #<INPUT BUFFERED FILE-STREAM CHARACTER #P"foo.fas" @1> already points to file "/tmp/foo.fas", opening the file again for :OUTPUT may produce unexpected results If you continue (by typing 'continue'): Open the file anyway The following restarts are also available: ABORT :R1 Abort main loop Break 1 [4]> :r1 [5]> It was a surprise to me that the earlier failed LOAD interfered with the later attempt to use COMPILE-FILE. I expected the two operations to be fully independent. If LOAD closed its input file on abort, I think this problem would have been avoided. I'm using CLISP 2.49 built from source on 64-bit Linux. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3122505&group_id=1355 |
|
From: Aleksej S. <as...@in...> - 2010-11-22 12:40:19
|
Hello! This fixes build on NetBSD (perhaps something similar applies to other BSD systems): NetBSD has getpagesize(3) in unistd.h --- src/gmalloc.c.orig 2010-10-12 20:51:26.000000000 +0400 +++ src/gmalloc.c 2010-11-19 02:51:35.000000000 +0300 @@ -1657,7 +1657,11 @@ extern size_t __getpagesize PP ((void)); #endif #else +#if defined (__NetBSD__) +extern int getpagesize (void); /* from getpagesize(3) */ +#else #include "getpagesize.h" +#endif #define __getpagesize() getpagesize() #endif -- HE CE3OH... |