Sha256: c0cfd282663bab990126e5320245928a34646be0f113a6c82ee4a7dd87f8d21f
Contents?: true
Size: 950 Bytes
Versions: 3
Compression:
Stored size: 950 Bytes
Contents
module Mulang::Ruby module Sexp def sequence(*contents) if contents.empty? ms(:MuNull) elsif contents.size == 1 contents[0] else ms(:Sequence, *contents) end end def ms(tag, *contents) if contents.empty? {tag: tag} elsif contents.size == 1 {tag: tag, contents: contents.first} else {tag: tag, contents: contents} end end def simple_method(name, args, body) { tag: :Method, contents: [ name, [ [ args, {tag: :UnguardedBody, contents: body }] ] ] } end def mu_method(tag, args, body) { tag: tag, contents: [ [ args, {tag: :UnguardedBody, contents: body }] ] } end def simple_send(sender, message, args) ms(:Send, sender, {tag: :Reference, contents: message}, args) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
mulang-ruby-1.3.2 | lib/mulang/ruby/sexp.rb |
mulang-ruby-1.3.1 | lib/mulang/ruby/sexp.rb |
mulang-ruby-1.3.0 | lib/mulang/ruby/sexp.rb |