Special variables: Difference between revisions
Content deleted Content added
Walterpachl (talk | contribs) →{{header|REXX}}: added my view after some discussions about Version 1 |
Added Bracmat |
||
Line 407: | Line 407: | ||
{{Works with|GNU bc}} |
{{Works with|GNU bc}} |
||
The GNU implementation adds another special variable, <code>last</code>, that contains the value of the last printed number. |
The GNU implementation adds another special variable, <code>last</code>, that contains the value of the last printed number. |
||
=={{header|Bracmat}}== |
|||
Every function has a local variable <code>arg</code>. It is the function's actual argument. Pattern matching is used to dissect the argument, if needed. Functions in a pattern have an additional argument, <code>sjt</code>, which is bound to (part of) the subject of the pattern match operation. It is the part of the subject that the function, in the role of a pattern, attempts to match. These variables can be reassigned. |
|||
The names of the built-in functions <code>alc, arg, asc, chr, chu, clk, d2x, dbg, den, div, fil, flg, glf, fre, get, low, lst, mem, mod, new, pee, pok, put, ren, rev, rmv, sim, str, swi, sys, tbl, upp, utf, whl, x2d</code> can be used as variable names or names of user defined object member functions, but not as names of user defined functions. Conversely, the name <code>hash</code> can be used for user defined functions, but not for variables. Currentlty, <code>hash</code> is the only predefined object type. |
|||
If Bracmat starts in interactive mode, a few more variables are predefined: <code>!v</code> evaluates to a string telling which version of Bracmat you are running. <code>!w</code> and <code>!c</code> evaluate to sections 11 and 12 of the GPL. More vital is the variable <code>main</code>, which is the interpreter's main loop. Setting it to another value changes the behaviour of the interpreter. When running in interactive mode, <code>!</code> or <code>!""</code> evaluates to the last answer, so the empty string is the name of yet another special variable. These variables can be reassigned. |
|||
=={{header|C}}== |
=={{header|C}}== |