-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a44423a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay so If I understand correctly, if we don't want to use the macro for whatever reason (cross language bindings, etc...), just manually using
Clay_OpenElement();
Clay_ElementPostConfiguration();
andClay_CloseElement();
ought to do the same thing. This makes much more sense nowa44423a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, exactly.
a44423a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep exactly - you can take a look at the odin bindings implementation of the clay macro here for an example:
https://github.com/nicbarker/clay/blob/main/bindings/odin/clay-odin/clay.odin#L333
Odin supports something called "deferred attributes" which allows us to tag the function and say "whenever the scope this function was called in exits, call the
CloseElement
function", which means we don't need a macro in Odin, can get away with just functions 🙂