Basic Examples (7)
Basic Examples
(7)
An in which keys and values are stored without evaluation:
In[1]:=
Out[1]=
1+1Echo[2],2+2Echo[4]
Extract the value associated with key :
1+1
In[2]:=
%[Unevaluated[1+1]]
»
2
Out[2]=
2
———
Convert a of rules to an :
In[1]:=
Out[1]=
1+1Echo[2],2+2Echo[4]
———
Create an unevaluated from an uninitialized :
In[1]:=
Out[1]=
NowDateObject[],Red
———
Specify that a key should be evaluated:
In[1]:=
»
a
Out[1]=
aEcho[1],Echo[b]Echo[2]
———
Specify that a value should be evaluated:
In[1]:=
»
1
Out[1]=
Echo[a]1,Echo[b]Echo[2]
———
Many operations can be done while preserving the original expressions:
In[1]:=
assoc=[1+12*1,2+22*2]
Out[1]=
1+121,2+222
In[2]:=
Map[Hold,assoc]
Out[2]=
1+1Hold[21],2+2Hold[22]
In[3]:=
Select[assoc,#>3&]
Out[3]=
2+222
In[4]:=
Reverse[assoc]
Out[4]=
2+222,1+121
In[5]:=
Join[assoc,<|ab|>]
Out[5]=
1+121,2+222,ab
———
Append an element without evaluation:
In[1]:=
Append[1+1Echo[2],2+2Echo[4]],Unevaluated[3+3Echo[6]]
Out[1]=
1+1Echo[2],2+2Echo[4],3+3Echo[6]
Scope (6)
Scope
(6)
Options (3)
Options
(3)
Properties and Relations (5)
Properties and Relations
(5)
Possible Issues (3)
Possible Issues
(3)