GolfScript: Difference between revisions

Content deleted Content added
it's unreviewed
Language: +section; sentence
Line 8:
== Language ==
 
Programs in GolfScript consist of lists of items, each of which is pushed onto the [[Stack (abstract data type)|stack]] as it is encountered with the exception of variables which have code blocks as their value, in which case the code is executed. When a variable assignment (carried out through the placement of a colon before the name of the variable) is encountered, the top item on the stack is popped and assigned to the variable.<ref name="esolang">{{cite web|title=GolfScript - Esolang|url=http://esolangs.org/w/index.php?title=GolfScript&oldid=35741|accessdate=20 June 2014}}</ref>
 
GolfScript attempts to reach its goal of solving problems in as few keystrokes as possible through the use of single symbols to represent high-level operations.<ref name="official website" /> A single symbol can stand for multiple operations depending on the type of the arguments passed to it.<ref name="esolang" />
 
=== Input and output ===
If input is supplied to a GolfScript program, it is pushed onto the stack as a string before the program is executed. Output is provided via the stack's contents being printed when execution of the program finishes.<ref name="esolang" />
 
== Examples ==