new print function in interim release 660

"Mark Hahn" <[email protected]>
Newsgroups gmane.comp.lang.prothon.user
Message-ID <[email protected]>
Interim release 660 at http://prothon.org has a bunch of bug fixes and one
major enhancement.

The print keyword has been removed and replaced by a print function.  The
function requires parentheses for now until I implement the
"function-as-command" feature.  The function returns the same text string
that is printed, except inside the console, where the function just returns
the None object so you don't see double.  (This limits your testing of the
print function inside the console).  When the function-as-command is
implemented, it will only return None only when used as a command in the
console.

The print funtion prints the positional arguments just the same way the old
print keyword printed the command arguments.  You can now add two optional
keyword arguments, "sep = ' '" and "eol = '\n'".  These string arguments
specify the seperator printed between arguments and the end-of-line
characters respectively.

I didn't implement the "to = stdOut" argument that Paul recommended.  I took
Serge's advice and left that for the stream methods.  So you will use
stdOut.print() when that is implemented.

The general form is:  print(*args, sep = ' ', eol = '\n') to print to
stdOut.

O>> print(1,2,3,4)
1 2 3 4
O>> print(Object, Modules, sep='\n', eol='\n\n')
<Object:943020:Object: prototype base for all objects>
<Object:9432e0:Modules: container of all modules>

O>>

Inside a script....

    x = print(Object, Modules, sep='\n', eol='\n\n')
    print (x)

Output is ...

    <Object:943020:Object: prototype base for all objects>
    <Object:9432e0:Modules: container of all modules>

    <Object:943020:Object: prototype base for all objects>
    <Object:9432e0:Modules: container of all modules>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.