#!/usr/local/bin/rune -x -d # # Demonstrate constant types. Constants in Rune are effectively what # '#define BLAH 23' would be in C, except they are specifically typed. # # Demonstrate a resolve-time constant (the array size for fu[]). The # resolver drills the resolution by executing the interpreter and requires # a constant return value. Note that no global storage is available when # doing this, but the resolver will shortcut through any variable assignments # to avoid having to instantiate and fully initialize the global SemGroup. import "sys"; import ; const int charlie = fubar(); const int fu[charlie]; pure int fubar() { return 55; } public int main(int ac, char **av) { stdio.stdout->show("fubar 55:", charlie); fu[0] = 1; fu[54] = 1; }