From 26f6d0faddf53810ea1e3a1726bc77b5b4ee8ba8 Mon Sep 17 00:00:00 2001 From: Araozu Date: Fri, 14 Jun 2024 22:20:05 -0500 Subject: [PATCH] small changes --- src/pages/learn/index.mdx | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/src/pages/learn/index.mdx b/src/pages/learn/index.mdx index 2e6eb49..f5c2c44 100644 --- a/src/pages/learn/index.mdx +++ b/src/pages/learn/index.mdx @@ -239,15 +239,15 @@ For example: // This expression val greeting = match get_person() - | Some(person) if person.age > 18 + case Some(person) if person.age > 18 { "Welcome, {person.name}" } - | Some(person) + case Some(person) { "I'm sorry {person.name}, you need to be 18 or older" } - | None + case None { "Nobody is here" } @@ -274,26 +274,3 @@ However, more advanced datatypes & helper functions will require a sort of runtime (new classes/functions/etc) or abuse the language's syntax/semantics. -```thp -// TBD: Enum compilation -enum IpAddress { - V4(String), - V6(String), -} - -val ip_1 = IpAddress::V4("255.255.0.0") -``` - -```php -// Would possibly compile to: -enum IpAddress { - V4, - V6, -} - -$ip_1 = [IpAddress::V4, "255.255.0.0"] -``` - -Such changes will be documented - -