Skip to content

Commit

Permalink
#data macro usage updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Suraci committed May 23, 2011
1 parent 6c4bdc1 commit 2f3bd0e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/language/pattern-matching.ddl
Expand Up @@ -191,7 +191,7 @@ With precision sorting, things "just work." You can define your methods in whate

\example{
Integer with(odd?, true) = 1
data(Object): MyPoint(@x, @y)
data(MyPoint(@x, @y))
with(@x, 1) = MyPoint new(1, 2)
}
}
Expand Down
24 changes: 11 additions & 13 deletions kernel/condition.ay
Expand Up @@ -22,8 +22,7 @@ for-macro:
Atomy::AST::Send ->
"restart:" + x method-name

data(Object):
Restart(@name, @action)
data(Restart(@name, @action))

Restart invoke(*args) :=
throw(("restart:" + @name to-s) to-sym, @action [*args])
Expand All @@ -35,17 +34,16 @@ section("Conditions"):
Condition system hierarchy. You should subclass one of these to create \
your own conditions.
" for:
data(Object):
Condition:
Error(@backtrace):
SimpleError(@value)
ExceptionError(@exception)
NoRestartError(@name)
PortError(@port):
EndOfFile

Warning(@backtrace):
SimpleWarning(@value)
data(Condition):
Error(@backtrace):
SimpleError(@value)
ExceptionError(@exception)
NoRestartError(@name)
PortError(@port):
EndOfFile

Warning(@backtrace):
SimpleWarning(@value)

doc"
Get the name of a condition. By default, this will be the class name, \
Expand Down
3 changes: 3 additions & 0 deletions kernel/documentation.ay
Expand Up @@ -21,6 +21,9 @@ for-macro:
indent(escape(x pattern show))
to-thumb(`(~meth := ~_)) :=
indent(escape(meth show))
to-thumb(d: `(data())) :=
let(atomy/pretty/multiline? = true):
indent(escape(d block body show))
to-thumb(d: `(data(Object))) :=
let(atomy/pretty/multiline? = true):
indent(escape(d block body show))
Expand Down

0 comments on commit 2f3bd0e

Please sign in to comment.