Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Stack-oriented programming
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Procedures === A procedure in a stack-based programming language is treated as a data object in its own right. In PostScript, procedures are denoted between <code>{</code> and <code>}</code>. For example, in PostScript syntax, <code>{ dup mul }</code> represents an anonymous procedure to duplicate what is on the top of the stack and then multiply the result β a squaring procedure. Since procedures are treated as simple data objects, names with procedures can be defined. When they are retrieved, they are executed directly. Dictionaries provide a means of controlling scoping, as well as storing definitions. Since data objects are stored in the top-most dictionary, an unexpected ability arises naturally: when looking up a definition from a dictionary, the topmost dictionary is checked, then the next, and so on. If a procedure is defined that has the same name as another already defined in a different dictionary, the local one will be called.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)