2022-06-03 21:04:40 +02:00
|
|
|
let
|
|
|
|
var a := exit(0)
|
|
|
|
/* ^ function.builtin */
|
|
|
|
|
|
|
|
primitive exit(ret: int) /* Shadowing the prelude-included built-in */
|
2022-06-03 22:04:28 +02:00
|
|
|
/* ^ type.builtin */
|
2022-06-03 21:04:40 +02:00
|
|
|
|
|
|
|
var b := exit(0)
|
|
|
|
/* ^ function */
|
|
|
|
|
2022-06-03 22:04:28 +02:00
|
|
|
type int = string /* Shadowing the built-in type */
|
|
|
|
/* ^ type.builtin */
|
|
|
|
|
|
|
|
var c : int := "This is an \"int\""
|
|
|
|
/* ^ type.builtin (not sure why it isn't 'type')*/
|
2022-06-04 21:31:43 +02:00
|
|
|
|
|
|
|
var d : Object := nil
|
|
|
|
/* ^ type.builtin */
|
|
|
|
|
|
|
|
type Object = int
|
2022-06-04 21:38:21 +02:00
|
|
|
|
|
|
|
var self := "self"
|
2022-06-03 21:04:40 +02:00
|
|
|
in
|
2022-06-03 22:04:28 +02:00
|
|
|
let
|
|
|
|
var c : int := "This is an int"
|
|
|
|
/* ^ type.builtin (not sure why it isn't 'type')*/
|
2022-06-04 21:31:43 +02:00
|
|
|
var d : Object := "This is an object"
|
|
|
|
/* ^ type.builtin (not sure why it isn't 'type')*/
|
2022-06-03 22:04:28 +02:00
|
|
|
in
|
|
|
|
end;
|
|
|
|
|
2022-06-03 21:04:40 +02:00
|
|
|
exit(1);
|
|
|
|
/* <- function */
|
|
|
|
|
|
|
|
print("shadowing is fun");
|
|
|
|
/* <- function.builtin */
|
|
|
|
|
2022-06-04 21:38:21 +02:00
|
|
|
self;
|
|
|
|
/* <- variable */
|
|
|
|
|
2022-06-03 21:04:40 +02:00
|
|
|
b := print
|
|
|
|
/* ^ variable */
|
|
|
|
end
|