s |
focus search bar ( enter to select, ▲ / ▼ to change selection) |
g e |
go to examples |
g m |
go to modules |
g o |
go to overview |
g r |
go to reference |
h |
toggle this help ( esc also exits) |
Jai supports declaration notes that the compiler retains and makes available at compile-time and run-time. 1 2 3
my_const :: 3; @note
my_procedure :: () @note {}
my_struct :: struct @note {}
See the note operator reference page for more details.
/** from: https://youtu.be/JoNkttD_MUs?t=3418 */
has_note :: (member : Type_Info_Struct_Member, note_name : string) -> bool {
for member.notes if strings_match(it, cast(note_name, ^u8)) return true;
return false;
}
Notes are purely for you as the user. The compiler has no idea what they mean. It’s just an opaque string that you make for your own code to interpret.
“Demo: Run-Time (and Compile-Time) Type Information” YouTube, uploaded by Jonathan Blow, Feb 11, 2015, https://youtu.be/JoNkttD_MUs?t=3384 ⮌
Notes are a completely user-defined thing that you can use to interface your program with other stuff.
“Demo: Run-Time (and Compile-Time) Type Information” YouTube, uploaded by Jonathan Blow, Feb 11, 2015, https://youtu.be/JoNkttD_MUs?t=3503 ⮌
Notes aren’t just for struct members. They can go on any declarations.
“Demo: Run-Time (and Compile-Time) Type Information” YouTube, uploaded by Jonathan Blow, Feb 11, 2015, https://youtu.be/JoNkttD_MUs?t=3538 ⮌
jailang
2019 pixeldroid
https://github.com/pixeldroid/jailang |
programming pages theme v0.5.21 (https://github.com/pixeldroid/programming-pages) |
s |
focus search bar ( enter to select, ▲ / ▼ to change selection) |
g e |
go to examples |
g m |
go to modules |
g o |
go to overview |
g r |
go to reference |
h |
toggle this help ( esc also exits) |