Category:S-lang: Difference between revisions
Content added Content deleted
Underscore (talk | contribs) (Cut-and-paste move from S-lang.) |
No edit summary |
||
Line 9: | Line 9: | ||
The S-Lang interpreter has very strong support for array-based operations making it ideal for numerical applications. (from [http://www.jedsoft.org/slang/ the official web site]]) |
The S-Lang interpreter has very strong support for array-based operations making it ideal for numerical applications. (from [http://www.jedsoft.org/slang/ the official web site]]) |
||
<hr> |
|||
Task Output Notes: |
|||
For simplicity, many of the S-Lang tasks use the print() |
|||
function. This is not part of S-Lang per se, but is normally |
|||
included in the "slsh" S-Lang shell. If it is missing, or you're |
|||
using some other S-Lang environment, options include a C-like |
|||
sprintf() and printf(). Their format and parameters work about |
|||
like you'd expect in a C-inspired interpreted language. |
|||
sprintf(f, d..) [f=string format, d..=zero or more data items] |
|||
returns a string. printf(f, d..) prints to "stdout" and returns |
|||
the number of items formatted: remember S-Lang is a "stack |
|||
language", so even if you don't care about that number, your code |
|||
should "eat" it: |
|||
() = printf("S-Lang: %d tasks and counting!\n", 14); |
|||
S-Lang is the extension language for the Emacs-like programmer's |
|||
editor [http://www.jedsoft.org/jed/ Jed]. There, the output functions |
|||
include: |
|||
insert(s) write string s into current buffer |
|||
vinsert(f,d..) insert(sprintf(f, d..)) ["variable"] equivalent |
|||
message(s) write string s into "mini-buffer" |
|||
vmessage(f,d..) message(sprintf(f, d..)) equivalent |
|||
error(s) like message(), but in error-color, then cancel cmd |
|||
verror(f, d..) error(sprintf(f, d..)) equivalent |
|||
== See Also == |
== See Also == |