Top Level Namespace
Defined in:
Macro Summary
-
class_record(name, *properties)
Creates class name in a single line, like one would do with the usual
#record
macro. -
event(e, *args)
Creates events in a single line.
Macro Detail
macro class_record(name, *properties)
#
Creates class name in a single line, like one would do with the usual #record
macro.
However, unlike #record
which creates structs, #class_record
creates classes.
The properties on the object are still exposed as getters and not getters+setters.
This may change in the future.
This macro code is a copy of Crystal's 0.31.1 macro #record
, adjusted for this purpose.
class_record MyRecord, a : Int32, b : String, c : Bool
macro event(e, *args)
#
Creates events in a single line. Each event is created as a class.
Since events are classes, they can be also created manually.
See EventHandler::Event
for more details.
event MouseClick, x : Int32, y : Int32