capt_falamer
MModular
•Created by franchesoni on 10/23/2024 in #questions
dict containing sets?
I ended up modifying the stdlib for Set and added the modified file to my project. Like you mentioned, it only needs one method to be a viable CollectionElement. Then you don't have to write a wrapper and treat can use it as is
4 replies
MModular
•Created by jmky on 10/7/2024 in #questions
Is there a disdain for Rust from the Mojo team?
this kind of step by step introduction from simple to advanced features would be great to add to the mojo documentation. it would be especially helpful to the python crowd or even people new to programming
23 replies
MModular
•Created by taalhaataahir01022001 on 10/8/2024 in #questions
Reshape MAX API OP giving error
I'm not getting any errors when running this (same as above but with the import statements):
what version of mojo/max are you running?
4 replies
MModular
•Created by banananas on 9/28/2024 in #questions
Calling methods from list indexes
then what I first responded was what you were looking for. Here's a fleshed out example to clarify what I was trying to communicate
Unfortunately there is no shortcut currently to blanket apply a method by doing
list[x].common_method()
even if all the structs within the variant have the exact same method.18 replies
MModular
•Created by banananas on 9/28/2024 in #questions
Calling methods from list indexes
Think I may be missing what you are trying to do. On mobile right now and it will be a bit before I can write up working code. I think if you could explain the specific use case I might be able to better answer the root of your question
18 replies
MModular
•Created by banananas on 9/28/2024 in #questions
Calling methods from list indexes
It can be, depending on what you're trying to do you may not even need a variant
18 replies
MModular
•Created by banananas on 9/28/2024 in #questions
Calling methods from list indexes
you'll need to have the
Variant[types...]
as one of the list of types in the original variant
18 replies
MModular
•Created by banananas on 9/28/2024 in #questions
Calling methods from list indexes
Yeah, if I were to guess, the explicit call is for the strict typing and performance reasons
18 replies
MModular
•Created by banananas on 9/28/2024 in #questions
Calling methods from list indexes
Here's the example from the API docs for an example:
18 replies
MModular
•Created by banananas on 9/28/2024 in #questions
Calling methods from list indexes
Mojo requires you to tell it which of the variant types it is
18 replies
MModular
•Created by Hylke on 9/22/2024 in #questions
How to define nested dict function
Also if you are looking at parsing (or better more fleshed out code) I recommend checking out https://www.modular.com/modverse/modverse-42
specifically Pholmola's project
6 replies
MModular
•Created by Hylke on 9/22/2024 in #questions
How to define nested dict function
Probably not the best way to do what you're looking for but see the 2 examples below. From example you have though, makes me wonder if you want to use a nested dict or just store each type in its own array.
6 replies
MModular
•Created by banananas on 9/23/2024 in #questions
"Linking" structs together?
Does the list have to be ordered in relation to other types of objects? Thinking you might get away with struct with a list for each type
44 replies