From f4a4487ae85e972c27529ba7d13d40b08298883d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Inf=C3=BChr?= Date: Sat, 9 Nov 2024 21:02:50 +0100 Subject: [PATCH] frontend: Prepare IndexGet and IndexSet traits --- dora-frontend/src/sema/known.rs | 4 ++++ pkgs/std/traits.dora | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/dora-frontend/src/sema/known.rs b/dora-frontend/src/sema/known.rs index 4c52a54cb..a08de4eab 100644 --- a/dora-frontend/src/sema/known.rs +++ b/dora-frontend/src/sema/known.rs @@ -186,6 +186,8 @@ pub struct KnownTraits { pub stringable: Option, pub sub: Option, pub zero: Option, + pub index_get: Option, + pub index_set: Option, } impl KnownTraits { @@ -210,6 +212,8 @@ impl KnownTraits { stringable: None, sub: None, zero: None, + index_get: None, + index_set: None, } } diff --git a/pkgs/std/traits.dora b/pkgs/std/traits.dora index 79331783b..40604dca0 100644 --- a/pkgs/std/traits.dora +++ b/pkgs/std/traits.dora @@ -150,3 +150,13 @@ pub trait IntoIterator { type IteratorType: Iterator; fn iter(): Self::IteratorType; } + +// pub trait IndexGet[T] { +// type Item; +// fn get(index: T): Self::Item; +// } + +// pub trait IndexSet[T] { +// type Item; +// fn set(index: T, value: Self::Item); +// }