User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

harlowe:put [2017/06/20 02:28]
l created
harlowe:put [2017/10/09 20:39]
Line 1: Line 1:
-**(put: /// ...[[harlowe:​VariableToValue|VariableToValue]]//​) -> //​Instant//​** 
-A left-to-right version of [[harlowe:​set|(set:​)]] that requires the word ''​%%into%%''​ rather than ''​%%to%%''​. 
-=== Rationale: === 
-This macro has an identical purpose to [[harlowe:​set|(set:​)]] - it creates and changes variables. 
-For a basic explanation,​ see the rationale for [[harlowe:​set|(set:​)]]. 
-Almost every programming language has a [[harlowe:​set|(set:​)]] construct, and most of these place the 
-variable on the left-hand-side. However, a minority, such as HyperTalk, place the variable 
-on the right. Harlowe allows both to be used, depending on personal preference. [[harlowe:​set|(set:​)]] reads 
-as ''​%%(set:​%%''​ variable ''​%%to%%''​ value ''​%%)%%'',​ and (put:) reads as ''​%%(put:​%%''​ value ''​%%into%%''​ variable ''​%%)%%''​. 
-=== Details: === 
-Just as with [[harlowe:​set|(set:​)]],​ a variable is changed using ''​%%(put:​%%''​ value ''​%%into%%''​ variable ''​%%)%%''​. You can 
-also set multiple variables in a single (put:) by separating each VariableToValue 
-with commas: ''​%%(put:​ 2 into $batteries, 4 into $bottles)%%'',​ etc. 
-''​%%it%%''​ can also be used with (put:), but, interestingly,​ it's used on the right-hand side of 
-the expression: ''​%%(put:​ $eggs + 2 into it)%%''​. 
-=== See also: === 
-[[harlowe:​set|(set:​)]],​ [[harlowe:​move|(move:​)]] 
harlowe/put.txt ยท Last modified: 2017/10/09 20:39 (external edit)