Re: Output/print without linefeed?
Stephen Wilson <[email protected]>
| Newsgroups | gmane.comp.mathematics.axiom.user |
|---|---|
| Message-ID | <[email protected]> |
*, "Alasdair McAndrew" <[email protected]> writes: > I was running a long program recently, and every now and again I wanted a > little output to indicate how far the program had got. The "output" command > includes a line feed, which I don't want. I've tried: > > )set expose add constructor IPRNTPK > > but then, for example: > > for i in 1..10 repeat iprint(i::String) > > produces the output: > > 1 > >> System error: > FLUSH is invalid as a function. > > Any ideas? I entered this as bug #371 on Issue Tracker. Attached is a patch containing a trivial fix. The issue is in newdata.spad.pamphlet, where FORCE-OUTPUT is being referenced as a symbol, not as a function call. The patch contains a new file: src/input/iprntpk.input.pamphlet which tests for this bug in the regression suite. Take care, Steve _______________________________________________ Axiom-mail mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/axiom-mail
changelog.patch
(text/x-patch, 370 B)
--- changelog 2007-07-09 22:09:36.000000000 -0400 +++ changelog.sxw 2007-07-09 22:10:17.000000000 -0400 @@ -1,3 +1,4 @@ +20070709 sxw fix issue #371, include regress test. 20070705 wxh src/algebra/draw.spad clip myTrap1, myTrap2 range to SF (545) 20070705 gdr remove execute bit from files (svn 651) 20070704 tpd zips/tla-1.1.tar.gz svn propset mime-type binary/data
newdata.spad.pamphlet.patch
(text/x-patch, 360 B)
--- newdata.spad.pamphlet 2007-07-08 14:52:49.000000000 -0400
+++ newdata.spad.pamphlet.sxw 2007-07-09 22:11:10.000000000 -0400
@@ -49,7 +49,7 @@
Implementation == add
iprint(s:String) ==
PRINC(coerce(s)@Symbol)$Lisp
- FORCE_-OUTPUT$Lisp
+ FORCE_-OUTPUT()$Lisp
@
\section{package TBCMPPK TabulatedComputationPackage}
iprntpk.input.pamphlet.patch
(text/x-patch, 1.3 KB)
--- /dev/null 1994-07-17 19:46:18.000000000 -0400
+++ iprntpk.input.pamphlet 2007-07-09 21:45:13.000000000 -0400
@@ -0,0 +1,54 @@
+\documentclass{article}
+\usepackage{axiom}
+\begin{document}
+\title{\$SPAD/src/input iprntpk.input}
+\author{The Axiom Team}
+\maketitle
+\begin{abstract}
+\end{abstract}
+\eject
+\tableofcontents
+\eject
+\section{License}
+<<license>>=
+--Copyright The Numerical Algorithms Group Limited 1991.
+@
+<<*>>=
+)spool iprntpk.output
+)set message test on
+)set message auto off
+)clear all
+
+@
+This package exports but one function. Nonetheless, we had a bug in
+this code, so a few tests are warranted. The function is iprint, which
+simply prints a string standard-output without a new line, and flushes
+the stream.
+
+<<*>>=
+--S 1 of 3
+)set expose add constructor IPRNTPK
+--R InternalPrintPackage is now explicitly exposed in frame initial
+--E 1
+
+--S 2 of 3
+iprint("Release the hounds!")
+--RRelease the hounds! Type: Void
+--E 2
+
+--S 3 of 3
+for i in 1..10 repeat iprint(i::String)
+--R12345678910 Type: Void
+--E 3
+
+)spool
+)lisp (bye)
+
+@
+\eject
+\begin{thebibliography}{99}
+\bibitem{1} nothing
+\end{thebibliography}
+\end{document}
+
+