class Conflisp::DSL

A nice helper DSL for building up Conflisp languages

Attributes

registry[R]

Public Class Methods

define(&block) click to toggle source
# File lib/conflisp/dsl.rb, line 8
def self.define(&block)
  registry = {}
  dsl = new(registry: registry)
  dsl.instance_exec(&block)
  registry
end
new(registry:) click to toggle source
# File lib/conflisp/dsl.rb, line 15
def initialize(registry:)
  @registry = registry
end

Public Instance Methods

fn(name, implementation) click to toggle source
# File lib/conflisp/dsl.rb, line 19
def fn(name, implementation)
  registry[name.to_s] = implementation
end