#How does @ work?

1 messages · Page 1 of 1 (latest)

normal pagoda
#

When I do something like @max(a, b, c) what is happening internally? Is it doing a function call? Or is @ a macro? Documentation suggests that @max should only work with two inputs, but it works with 3 for me :/

frigid vortex
#

All @name are compiler builtins that can accept arguments in ways that a normal function cannot. For @max this means any number of arguments >=2 is valid.

dark garden
#

A stranger one is @cImport. Because of compiler magic, it takes either a single @cInclude expression as a an argument, or a scope of multiple includes and defines: @cImport({ @cInclude("foo.h"); @cInclude("bar.h"); })

#

Builtins are literally voodoo