summaryrefslogtreecommitdiffhomepage
path: root/mrblib/kernel.rb
blob: f98284d2451f50a9dd75e90b28f468c0cf8f19f2 (plain)
1
2
3
4
5
6
7
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
##
# Kernel
#
# ISO 15.3.1
module Kernel

  ##
  # Takes the given block, create a lambda
  # out of it and +call+ it.
  #
  # ISO 15.3.1.2.6
  def self.lambda(&block)
    ### *** TODO *** ###
    block  # dummy
  end

  ##
  # Calls the given block repetitively.
  #
  # ISO 15.3.1.2.8
  def self.loop #(&block)
    while(true)
      yield
    end
  end

  ##
  # Alias for +send+.
  #
  # ISO 15.3.1.3.4
  def __send__(symbol, *args, &block)
    ### *** TODO *** ###
  end

  # 15.3.1.3.18
  def instance_eval(string=nil, &block)
    ### *** TODO *** ###
  end

  ##
  # Alias for +Kernel.lambda+.
  #
  # ISO 15.3.1.3.27
  def lambda(&block)
    ### *** TODO *** ###
    block # dummy
  end

  ##
  # Alias for +Kernel.loop+.
  #
  # ISO 15.3.1.3.29
  def loop #(&block)
    while(true)
      yield
    end
  end

  ##
  # Invoke the method with the name +symbol+ on
  # the receiver and pass +args+ and the given
  # block.
  #
  # ISO 15.3.1.3.44
  def send(symbol, *args, &block)
    ### *** TODO *** ###
  end
end