aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-11-09 18:42:16 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-11-09 18:42:16 -0500
commit1d461611bac782c272d0e082d5da74b4fe353ae6 (patch)
tree0b1687a3edb507835f9aa3b7666fd590975b73ff /examples
parent78fd9141bb7dfcf817158a7a4d098e0e4b3d515b (diff)
Rename Num -> Float64, Num32 -> Float32
Diffstat (limited to 'examples')
-rw-r--r--examples/learnxiny.tm10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/learnxiny.tm b/examples/learnxiny.tm
index a03db6c9..746e11a1 100644
--- a/examples/learnxiny.tm
+++ b/examples/learnxiny.tm
@@ -200,7 +200,7 @@ func demo_keyword_args()
func takes_many_types(
boolean:Bool,
integer:Int,
- floating_point_number:Num,
+ floating_point_number:Float64,
text_aka_string:Text,
list_of_ints:[Int],
table_of_text_to_bools:{Text=Bool},
@@ -258,18 +258,18 @@ func demo_structs()
# indicates which type it is, and any data you want to associate with it.
enum Shape(
Point,
- Circle(radius:Num),
- Rectangle(width:Num, height:Num),
+ Circle(radius:Float64),
+ Rectangle(width:Float64, height:Float64),
)
# Just like with structs, you define methods and constants inside a level
# of indentation:
- func get_area(self:Shape->Num)
+ func get_area(self:Shape->Float64)
# In order to work with an enum, it's most often handy to use a 'when'
# statement to get the internal values:
when self is Point
return 0
is Circle(r)
- return Num.PI * r^2
+ return Float64.PI * r^2
is Rectangle(w, h)
return w * h
# 'when' statements are checked for exhaustiveness, so the compiler