Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Raw pointers are prefixed by the raw keyword.
- // unique and shared act like std::unique_ptr and std::shared_ptr from C++.
- func main(argc: int, argv: raw char[]) -> int {
- {
- d := 42;
- o := 052;
- x := 0x2a;
- X := 0X2A;
- b := 0b101010;
- }
- {
- x : raw int = new int(3);
- y : unique float = new float(-1.86);
- z : shared float64 = new float64(863.832987);
- delete x; // y deleted at end of scope, z is deleted as-long as no references are held.
- }
- a := 32;
- b := 16;
- if ((a / 2) == b) {
- puts("if1!\n")
- }
- s := '"Hello World!"';
- return a + b;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement