class Print
  def method_missing(sym, *args, &block)
    print "#{sym} "
  end

  def self.const_missing(name)
    print "#{name} "
  end
end

def Print(&block)
  Print.new.instance_eval(&block)
end

Print() do
  Hello world!
end