** Snobol Example-11: 11/19/2003 ** Indirect Referencing Operator (Unary $) BEAUTY = "GRACE" GRACE = "CHARM" Charm = 'NICE' Nice = 'GOOD' Good = 'NotBad' output = "VALUE OF 'BEAUTY' IS::" Beauty X = Beauty * YY = $"SMART" Again X = $X Output = differ(X,null) "NEXT VALUE REFERENCED:::" X :S(Again) Output = "End of a cycle" Output = "*********************" define("Swap(One,Two)Third",'Entry') define('Show(X,Y)') X = 10; Y = 20 output = "ORIGINAL VALUES" Show(X,Y) output = "AFTER SWAPPING BY WAY OF 'NAME' OPERATOR" Swap(.X,.Y) ;* Name Operator (Unary dot) ;* Basically, same as String Delimiters ;* (More flexible) like: Swap("X","Y") Show(X,Y) output = "AFTER SWAPPING AGAIN BY WAY OF STRINGS" SWAP("X","Y") Show(X,Y) output = "AFTER SWAPPING AGAIN BY WAY OF VALUES: NO SWAPPING EFFECT" SWAP(X,Y) show(X,Y) :(Done) *** ******************************* Entry point of function Swap entry Third = $One $One = $Two $Two = Third :(Return) *** ******************************* Entry point of function Show Show Output = "X:::" X Output = "Y:::" Y output = "***************************" :(Return) Done Output = End