-
Notifications
You must be signed in to change notification settings - Fork 0
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
5 changed files
with
571 additions
and
559 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,25 @@ | ||
!include { | ||
!with colors: | ||
print(bb.ansi.green+"test"); | ||
// main.bb | ||
!namespace dims { | ||
var x; | ||
var y; | ||
} | ||
!namespace main { | ||
var x; | ||
var y; | ||
} | ||
|
||
|
||
!include { // keep namespace activations in here only | ||
!with dims: // subsequent x and y are now dims::x and dims::y | ||
Point = { | ||
norm() => (this.x^2+this.y^2)^0.5; | ||
str() => "(!{this.x}, !{this.y})"; | ||
} | ||
p = new {Point: x=3;y=4} | ||
} | ||
|
||
// the scope is the same so we still access p | ||
!with main: | ||
p.x = 0; | ||
print(p); | ||
print(p.dims::x); |
Oops, something went wrong.