mirror of
https://forge.katzen.cafe/katzen-cafe/iowo.git
synced 2025-09-25 07:51:30 +02:00
implement basics of generics and generic checking
This commit is contained in:
parent
1acb5ef3cf
commit
ab7ff35d6c
6 changed files with 146 additions and 43 deletions
|
@ -26,11 +26,12 @@ pub fn initialise_globals() -> GlobalNamespace {
|
|||
// def math add [ Numeric Numeric ] -> Numeric
|
||||
ns.register_command(
|
||||
CMD_ADD,
|
||||
Some(TypeDef::List(vec![
|
||||
TypeDef::Trait(numeric),
|
||||
TypeDef::Trait(numeric),
|
||||
vec![("T", vec![&numeric])],
|
||||
Some(&TypeDef::List(vec![
|
||||
TypeDef::Generic("T".to_owned()),
|
||||
TypeDef::Generic("T".to_owned()),
|
||||
])),
|
||||
Some(TypeDef::Trait(numeric)),
|
||||
Some(&TypeDef::Generic("T".to_owned())),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue