8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/rpl/words/program.rb', line 8
def populate_dictionary
super
category = 'Program'
@dictionary.add_word!( ['eval'],
category,
'( a -- … ) interpret',
proc do
args = ( [:any] )
if [RplList, RplNumeric, RplBoolean].include?( args[0].class )
@stack << args[0] else
run!( args[0].value.to_s )
end
end )
@dictionary.add_word!( ['↴', 'lsto'],
category,
'( content name -- ) store to local variable',
proc do
args = ( [[RplName], :any] )
@dictionary.add_local_var!( args[0].value,
args[1] )
end )
end
|