proposal about src/plot.lisp/$sprint



Robert,

I feared, that you would argue this way. To me this quick hack was very helpful in the last 
years. You know that I teach Maxima to beginners and I believe for them sprint is a simple 
way to print sequences of numbers in a line. Fibonaccis, primes, random numbers, ascii 
characters, etc ... I also use sprint in simple games and other programs I have written for my 
classes. So I would be happy, if we keep it. 
I regard it as a simple wrapper for printf(true,"~@{~a ~}",x,y,z) where I don't have to explain 
the destination true and this cryptic string.

About the naming: does sprint mean sequential print?

Different to print or printf is the return value: the first arg resp. false in case of no args. I 
don't know what the original author intended here. 

(defun $sprint (&rest args)
  (sloop for v in args do
    ($printf t "~a " v))
  (car args))

Volker


Am 9 Apr 2008 um 8:39 hat Robert Dodier geschrieben:

> On 4/9/08, van Nek <van.nek at arcor.de> wrote:
> 
> >  So I propose to cut $sprint out of plot.lisp and put it
> > into the stringproc package. Then it can easily be fixed
> > by using stringproc/$printf. ($sprint and $printf can be
> > autoloaded at the  same time.)
> 
> I don't know if it's really worth the trouble to fix up sprint.
> It looks like sprint was a quick hack to generate some
> plotting output. The only place in share or src that it is
> called is share/numeric/riemsum.mac (to generate plot
> output).
> 
> The differences between print and sprint appear to be that
> sprint always outputs 1-d format while print observes the
> display2d flag, and print always ends the line with a newline
> and sprint does not. I don't know if these differences really
> warrant a separate function, given that there is print for
> simple output and printf for more precise formatting.
> 
> Also the name sprint is confusing because it calls to mind
> a C function by a similar name which is really something
> different.
> 
> Considering this, I think I would rather just get rid of sprint.
> 
> FWIW
> 
> Robert Dodier
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima