(defn make-greeter [greeting-prefix]
(fn [username] (str greeting-prefix ", " username)))
(def hello-greeting (make-greeter "Hello"))
(hello-greeting "world")
((make-greeter "Howdy") "pardner")
def make_greeter(greeting_prefix):
return lambda user: greeting_prefix + ", " + user
hello_greting = make_greeter("Hello")
print hello_greting("world")
print make_greeter("Howdy")("pardner")
def make_greeter(greeting_prefix)
lambda {|usernmae| greeting_prefix + ", " + usernmae}
end
hello_greeting = make_greeter("Hello")
puts hello_greeting.call("world")
puts make_greeter("Howdy").call("pardner")