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
36
37
38
39
40
41
42
43
44
|
# File 'lib/rpl/words/mode.rb', line 8
def populate_dictionary
super
category = 'Mode'
@dictionary.add_word( ['prec'],
category,
'( a -- ) set precision to a',
proc do
args = ( [[RplNumeric]] )
RplNumeric.precision = args[0].value
end )
@dictionary.add_word( ['default'],
category,
'( -- ) set default precision',
proc do
RplNumeric.default_precision
end )
@dictionary.add_word( ['type'],
category,
'( a -- s ) type of a as a string',
proc do
args = ( [:any] )
@stack << Types.new_object( RplString, "\"#{args[0].class.to_s[10..]}\"" )
end )
end
|