#588 "Here document" data blocks


This patch adds support for the definition and use of in-line data blocks using here document syntax:
$Mydata << EOD
11 22 33 data line 1
44 55 66 data line 2
# comments, etc, as with a normal data file
77 88 99

stats $Mydata using 3
plot $Mydata with filledcurves

- A datablock name must begin with $. This allows us to use the existing code for tracking and manipulating user defined variables while insuring that datablocks can not be mixed in normal variables in expressions, functions, etc.
- No attempt is made to parse the contents of the data block at the time it is defined. The lines are simply stored for later use.
- All the usual options for 'using' 'every' etc apply to data blocks just as they do for input from a file.


  • Ethan Merritt

    Ethan Merritt - 2012-06-13

    Updated patch works for "fit", plugs a memory leak if datablocks are cleared using "undefine $*", and safely traps attempts to define a datablock inside an "eval" statement or curly-brace clause.

  • Ethan Merritt

    Ethan Merritt - 2012-06-26
    • status: open --> closed-accepted

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks