Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
a773ea60 by Raymond Toy at 2016-09-26T19:50:47-07:00
Add documentation for run-program
* Document :input and :output behavior when they are string streams.
* Document :element-type and :external-format
- - - - -
48c1dd59 by Raymond Toy at 2016-09-26T19:51:12-07:00
Update the date
Prepare for release 21b.
- - - - -
1b8f72ed by Raymond Toy at 2016-09-26T20:03:24-07:00
Update from logs
Fix some typos too.
- - - - -
3 changed files:
- src/docs/cmu-user/cmu-user.tex
- src/docs/cmu-user/extensions.tex
- src/general-info/release-21b.txt
Changes:
=====================================
src/docs/cmu-user/cmu-user.tex
=====================================
--- a/src/docs/cmu-user/cmu-user.tex
+++ b/src/docs/cmu-user/cmu-user.tex
@@ -48,7 +48,7 @@
\newcommand{\keywords}{lisp, Common Lisp, manual, compiler, programming
language implementation, programming environment}
-\date{October 2014 \\ 20f}
+\date{October 2016 \\ 21b}
\begin{document}
=====================================
src/docs/cmu-user/extensions.tex
=====================================
--- a/src/docs/cmu-user/extensions.tex
+++ b/src/docs/cmu-user/extensions.tex
@@ -1099,7 +1099,8 @@ It is possible to run programs from Lisp by using the following function.
\morekeys{\kwd{if-input-does-not-exist}}
\yetmorekeys{\kwd{output} \kwd{if-output-exists}}
\yetmorekeys{\kwd{error} \kwd{if-error-exists}}
- \yetmorekeys{\kwd{status-hook}}}}
+ \yetmorekeys{\kwd{status-hook} \kwd{external-format}}
+ \yetmorekeys{\kwd{element-type}}}}
\code{run-program} runs \var{program} in a child process.
\var{Program} should be a pathname or string naming the program.
@@ -1154,6 +1155,11 @@ It is possible to run programs from Lisp by using the following function.
already contains all the input for the process. In this case
\code{run-program} reads all the input from this stream before
returning, so this cannot be used to interact with the process.
+ If \kwd{input} is a string stream, it is up to the caller to call
+ \code{string-encode} or other function to convert the string to
+ the appropriate encoding. In either case, the least significant 8
+ bits of the \code{char-code} of each \code{character} is
+ sent to the program.
\item[\kwd{if-input-does-not-exist}] This specifies what to do if
the input file does not exist. The following values are valid:
@@ -1172,7 +1178,10 @@ It is possible to run programs from Lisp by using the following function.
\code{process-output} slot contains an input stream from which you
can read the program's output. \kwd{output} can also be a stream
in which case all output from the process is written to this
- stream.
+ stream. If \kwd{output} is a string-stream, each octet read from
+ the program is converted to a character using \code{code-char}.
+ It is up to the caller to convert this using the appropriate
+ external format to create the desired encoded string.
\item[\kwd{if-output-exists}] This specifies what to do if the
output file already exists. The following values are valid:
@@ -1197,6 +1206,15 @@ It is possible to run programs from Lisp by using the following function.
the process changes status. This is especially useful when
specifying \kwd{wait} as \nil. The function takes the process as
a required argument.
+
+ \item[\kwd{external-format}] This specifies the external format to
+ use for streams created for \code{run-program}. This does not
+ apply to string streams passed in as \kwd{input} or \kwd{output}
+ parameters.
+
+ \item[\kwd{element-type}] If streams are created \code{run-program},
+ use this as the \kwd{element-type} for the stream. Defaults to
+ \code{BASE-CHAR}.
% \item[\kwd{before-execve}] This specifies a function to run in the
% child process before it becomes the program to run. This is
=====================================
src/general-info/release-21b.txt
=====================================
--- a/src/general-info/release-21b.txt
+++ b/src/general-info/release-21b.txt
@@ -48,7 +48,7 @@ New in this release:
WITH-FLOAT-TRAPS-MASKED.
* (EXPT 0 power) doesn't throw INTEXP-LIMIT-ERROR anymore for any
integer value of power.
- * Starting cmucl with "-dyanmic-space-size 0" means using the
+ * Starting cmucl with "-dynamic-space-size 0" means using the
maximum possible heap size for the platform.
* More descriptive docstring for
* *environment-list*
@@ -56,16 +56,21 @@ New in this release:
* Maximum dynamic-space-size on Linux reduced to 1530 MB because
that's the largest available space on 32-bit Ubuntu 11.10.
* For linux, darwin, and solaris/sparc, the binding stack and
- control stack are now mapped into memory whereever the OS wishes
+ control stack are now mapped into memory wherever the OS wishes
to place them instead of being mapped into a fixed location.
This is indicated by new feature :relocatable-stacks.
* ANSI compliance fixes:
* PATHNAME-MATCH-P did not accept search-lists.
+ * (compile 'foo) returns the compiled function if foo is already
+ compiled. (See Ticket #24). This is a change in behavior for
+ developers where foo would be recompiled if the source was
+ available. Developers might want to investigate uncompile
+ combined with compile to get the old behavior back.
- * Bugfixes:
+ * Bug fixes:
* Linux was missing unix-setitimer which prevented saving cores.
- * Generate inxact exceptions more carefully.
+ * Generate inexact exceptions more carefully.
* Fix FP issue when building with Xcode 7.2 (and newer versions of
clang). (See ticket #12.)
* Cleanups in handling floating-point exceptions. See Tickets #15
@@ -94,8 +99,13 @@ New in this release:
* Ticket #27 fixed: Regression: ASDF test failures
* Ticket #28 fixed: Recursive function definition during
cross-compile
+ * Ticket #30 fixed: Compilation of (describe 'foo)
+ * Ticket #31 fixed: (compile #'foo) fails
+ * Ticket #24 fixed: Compilation of (compile 'foo)
+ * Ticket #32 fixed: doc fix: ext:run-program has no before-execve option
* Other changes:
+ * Update user manual.
* Improvements to the PCL implementation of CLOS:
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/9fe2a7d9699b1a60d874868c…
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
47b1e69b by Raymond Toy at 2016-09-25T19:10:25-07:00
Remove :before-execve option
The documentation for this keyward option to run-program was
commented, but the actual option was not removed from the list of
options for run-program.
Remove it.
- - - - -
21ae1a78 by Raymond Toy at 2016-09-25T19:26:54-07:00
Merge branch 'master' into rtoy-32-no-before-execve-option
- - - - -
2cc0df30 by Raymond Toy at 2016-09-25T19:28:17-07:00
Add test for issue #32.
- - - - -
9fe2a7d9 by Raymond Toy at 2016-09-26T02:29:33+00:00
Merge branch 'rtoy-32-no-before-execve-option' into 'master'
Fix #32: Remove :before-execve option
The documentation for this keyward option to run-program was
commented, but the actual option was not removed from the list of
options for run-program.
Remove it.
See merge request !14
- - - - -
2 changed files:
- src/docs/cmu-user/extensions.tex
- tests/issues.lisp
Changes:
=====================================
src/docs/cmu-user/extensions.tex
=====================================
--- a/src/docs/cmu-user/extensions.tex
+++ b/src/docs/cmu-user/extensions.tex
@@ -1099,7 +1099,7 @@ It is possible to run programs from Lisp by using the following function.
\morekeys{\kwd{if-input-does-not-exist}}
\yetmorekeys{\kwd{output} \kwd{if-output-exists}}
\yetmorekeys{\kwd{error} \kwd{if-error-exists}}
- \yetmorekeys{\kwd{status-hook} \kwd{before-execve}}}}
+ \yetmorekeys{\kwd{status-hook}}}}
\code{run-program} runs \var{program} in a child process.
\var{Program} should be a pathname or string naming the program.
=====================================
tests/issues.lisp
=====================================
--- a/tests/issues.lisp
+++ b/tests/issues.lisp
@@ -315,3 +315,9 @@
(:tag :issues)
(let* ((test-file #.(merge-pathnames #p"resources/issue-24.lisp" cl:*load-pathname*)))
(assert-true (compile-file test-file :load t))))
+
+(define-test issue.32
+ (:tag :issues)
+ (assert-error 'kernel:simple-program-error
+ (ext:run-program "cat" nil
+ :before-execve t)))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/d6ae3337990d21c6e9fb236f…
Raymond Toy pushed to branch rtoy-32-no-before-execve-option at cmucl / cmucl
Commits:
48d1f01f by Raymond Toy at 2016-09-10T12:40:03-07:00
Fix #24: compile already compiled function
If the function is already compiled and we don't have the source for
it any more, just return without recompiling anything.
- - - - -
ae93b43b by Raymond Toy at 2016-09-10T12:40:34-07:00
Add test for issue #24.
- - - - -
94259938 by Raymond Toy at 2016-09-25T18:59:48-07:00
Don't try to get the lambda-expression for a function
Since we're just going to return the original compiled function,
there's no point in trying to get the function-lambda-expression of
the function. So, if we're given a function, just return the
(default) definition.
- - - - -
d6ae3337 by Raymond Toy at 2016-09-26T02:01:07+00:00
Merge branch 'rtoy-fix-24-compile-foo' into 'master'
Fix #24: compilation of (compile 'foo)
If the function is already compiled and we don't have the source for it, we don't need to do anything, per CLHS.
Test case added as well.
See merge request !12
- - - - -
21ae1a78 by Raymond Toy at 2016-09-25T19:26:54-07:00
Merge branch 'master' into rtoy-32-no-before-execve-option
- - - - -
2cc0df30 by Raymond Toy at 2016-09-25T19:28:17-07:00
Add test for issue #32.
- - - - -
2 changed files:
- src/compiler/main.lisp
- tests/issues.lisp
Changes:
=====================================
src/compiler/main.lisp
=====================================
--- a/src/compiler/main.lisp
+++ b/src/compiler/main.lisp
@@ -2041,11 +2041,7 @@
((or cons eval:interpreted-function)
`#',(get-lambda-to-compile definition))
(function
- (multiple-value-bind (exp lexenv)
- (function-lambda-expression definition)
- (if (and exp (not lexenv))
- `#',exp
- `',definition)))))
+ definition)))
(*source-info* (make-lisp-source-info form))
(*top-level-lambdas* ())
(*converting-for-interpreter* nil)
@@ -2069,6 +2065,14 @@
(*gensym-counter* 0)
(*current-function-names* (list name))
(intl::*default-domain* intl::*default-domain*))
+ ;; As mentioned above, we can return the same function if the
+ ;; function was already compiled. We do this when FORM is EQ
+ ;; to DEFINITION (which happens above if we have a compiled
+ ;; function that we don't have the source for or was defined
+ ;; in a non-null environment.
+ (when (and name (eq form definition))
+ (return-from compile
+ (values name nil nil)))
(with-debug-counters
(clear-stuff)
(find-source-paths form 0)
=====================================
tests/issues.lisp
=====================================
--- a/tests/issues.lisp
+++ b/tests/issues.lisp
@@ -310,3 +310,14 @@
(assert-true (pathnamep fasl-file))
(assert-equalp (list fasl-file nil nil)
(multiple-value-list (compile-file test-file :load t)))))
+
+(define-test issue.24
+ (:tag :issues)
+ (let* ((test-file #.(merge-pathnames #p"resources/issue-24.lisp" cl:*load-pathname*)))
+ (assert-true (compile-file test-file :load t))))
+
+(define-test issue.32
+ (:tag :issues)
+ (assert-error 'kernel:simple-program-error
+ (ext:run-program "cat" nil
+ :before-execve t)))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/47b1e69b80394e6bc8fb56cf…
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
48d1f01f by Raymond Toy at 2016-09-10T12:40:03-07:00
Fix #24: compile already compiled function
If the function is already compiled and we don't have the source for
it any more, just return without recompiling anything.
- - - - -
ae93b43b by Raymond Toy at 2016-09-10T12:40:34-07:00
Add test for issue #24.
- - - - -
94259938 by Raymond Toy at 2016-09-25T18:59:48-07:00
Don't try to get the lambda-expression for a function
Since we're just going to return the original compiled function,
there's no point in trying to get the function-lambda-expression of
the function. So, if we're given a function, just return the
(default) definition.
- - - - -
d6ae3337 by Raymond Toy at 2016-09-26T02:01:07+00:00
Merge branch 'rtoy-fix-24-compile-foo' into 'master'
Fix #24: compilation of (compile 'foo)
If the function is already compiled and we don't have the source for it, we don't need to do anything, per CLHS.
Test case added as well.
See merge request !12
- - - - -
2 changed files:
- src/compiler/main.lisp
- tests/issues.lisp
Changes:
=====================================
src/compiler/main.lisp
=====================================
--- a/src/compiler/main.lisp
+++ b/src/compiler/main.lisp
@@ -2041,11 +2041,7 @@
((or cons eval:interpreted-function)
`#',(get-lambda-to-compile definition))
(function
- (multiple-value-bind (exp lexenv)
- (function-lambda-expression definition)
- (if (and exp (not lexenv))
- `#',exp
- `',definition)))))
+ definition)))
(*source-info* (make-lisp-source-info form))
(*top-level-lambdas* ())
(*converting-for-interpreter* nil)
@@ -2069,6 +2065,14 @@
(*gensym-counter* 0)
(*current-function-names* (list name))
(intl::*default-domain* intl::*default-domain*))
+ ;; As mentioned above, we can return the same function if the
+ ;; function was already compiled. We do this when FORM is EQ
+ ;; to DEFINITION (which happens above if we have a compiled
+ ;; function that we don't have the source for or was defined
+ ;; in a non-null environment.
+ (when (and name (eq form definition))
+ (return-from compile
+ (values name nil nil)))
(with-debug-counters
(clear-stuff)
(find-source-paths form 0)
=====================================
tests/issues.lisp
=====================================
--- a/tests/issues.lisp
+++ b/tests/issues.lisp
@@ -310,3 +310,8 @@
(assert-true (pathnamep fasl-file))
(assert-equalp (list fasl-file nil nil)
(multiple-value-list (compile-file test-file :load t)))))
+
+(define-test issue.24
+ (:tag :issues)
+ (let* ((test-file #.(merge-pathnames #p"resources/issue-24.lisp" cl:*load-pathname*)))
+ (assert-true (compile-file test-file :load t))))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/f810fc97740f2bd1405247fc…
Raymond Toy pushed to branch rtoy-fix-24-compile-foo at cmucl / cmucl
Commits:
94259938 by Raymond Toy at 2016-09-25T18:59:48-07:00
Don't try to get the lambda-expression for a function
Since we're just going to return the original compiled function,
there's no point in trying to get the function-lambda-expression of
the function. So, if we're given a function, just return the
(default) definition.
- - - - -
1 changed file:
- src/compiler/main.lisp
Changes:
=====================================
src/compiler/main.lisp
=====================================
--- a/src/compiler/main.lisp
+++ b/src/compiler/main.lisp
@@ -2041,11 +2041,7 @@
((or cons eval:interpreted-function)
`#',(get-lambda-to-compile definition))
(function
- (multiple-value-bind (exp lexenv)
- (function-lambda-expression definition)
- (if (and exp (not lexenv))
- `#',exp
- definition)))))
+ definition)))
(*source-info* (make-lisp-source-info form))
(*top-level-lambdas* ())
(*converting-for-interpreter* nil)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/94259938ccba4c40ae4ab9445…
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
53fe0a4f by Raymond Toy at 2016-09-07T20:28:36-07:00
Fix #30: compilation of (describe 'foo)
The debug-info-source isn't available until later in the fasl, so
don't try to print where the source was compiled from. This seems
like a small oversight since the next bit of code does nothing if the
debug-info-source isn't available.
- - - - -
5524c034 by Raymond Toy at 2016-09-07T20:29:38-07:00
Add test for issue #30.
- - - - -
6714a3a1 by Raymond Toy at 2016-09-07T20:52:29-07:00
Fix mistake in test.
- - - - -
f810fc97 by Raymond Toy at 2016-09-08T03:55:32+00:00
Merge branch 'rtoy-fix-30-describe-foo' into 'master'
Fix #30: compilation of describe foo
The debug-info-source isn't available until later in the fasl, so
don't try to print where the source was compiled from. This seems
like a small oversight since the next bit of code does nothing if the
debug-info-source isn't available.
See merge request !11
- - - - -
3 changed files:
- src/code/describe.lisp
- tests/issues.lisp
- + tests/resources/issue-30.lisp
Changes:
=====================================
src/code/describe.lisp
=====================================
--- a/src/code/describe.lisp
+++ b/src/code/describe.lisp
@@ -313,11 +313,12 @@
(let ((info (kernel:%code-debug-info code-obj)))
(when info
(let ((sources (c::debug-info-source info)))
- (format t (intl:gettext "~&On ~A it was compiled from:")
- (format-universal-time nil
- (c::debug-source-compiled
- (first sources))
- :style :iso8601))
+ (when sources
+ (format t (intl:gettext "~&On ~A it was compiled from:")
+ (format-universal-time nil
+ (c::debug-source-compiled
+ (first sources))
+ :style :iso8601)))
(dolist (source sources)
(let ((name (c::debug-source-name source)))
(ecase (c::debug-source-from source)
=====================================
tests/issues.lisp
=====================================
--- a/tests/issues.lisp
+++ b/tests/issues.lisp
@@ -298,3 +298,15 @@
(assert-eql (length in-string) (length out-string))
(assert-equal in-string out-string)))))
+
+
+(define-test issue.30
+ (:tag :issues)
+ (let* ((test-file #.(merge-pathnames #p"resources/issue-30.lisp" cl:*load-pathname*))
+ (fasl-file (compile-file-pathname test-file)))
+ ;; Compiling and loading the test file should succeed without
+ ;; errors.
+ (assert-true (pathnamep test-file))
+ (assert-true (pathnamep fasl-file))
+ (assert-equalp (list fasl-file nil nil)
+ (multiple-value-list (compile-file test-file :load t)))))
=====================================
tests/resources/issue-30.lisp
=====================================
--- /dev/null
+++ b/tests/resources/issue-30.lisp
@@ -0,0 +1,4 @@
+(defun foo ()
+ (print "Hello world"))
+
+(describe 'foo)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/a5175917df91f875c88e7206…