gravity
gravity copied to clipboard
[Feature] #include guards
Including a file multiple times should automatically guard against re-loading the same file multiple times. This is especially important with diamond dependencies.
Main.gravity
#include "A.gravity"
#include "B.gravity"
func main() {
return A.value() + B.value()
}
A.gravity
#include "C.gravity"
class A {
static func value() {
return C.value() + 1
}
}
B.gravity
#include "C.gravity"
class B {
static func value() {
return C.value() + 2
}
}
C.gravity
class C {
static func value() {
return 39
}
}
@mwasplund you are right, it should not be too hard to implement, let me take a look at it.