You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add an AS Equivalent to Option in Rust to the AS Standard Library #1410
One thing about AS is that basic types cannot be nullable. However, I've been designing some APIs that need some nullable Basic types, and I've been working around them. But I think it'd be cool just to write up a quick equivalent to C#'s Nullable or Rust's Option.
I could super easily add this myself. I personally like C#'s interface more, but I think it should be named Optional. That way, it doesn't conflict with our already exisiting idea of nullability in the docs.
Activity
jtenner commentedon Jul 24, 2020
I believe that this feature requires multi-value returns, if I am not mistaken.
MaxGraey commentedon Jul 24, 2020
It's just temporary limitation. And as @jtenner mentioned it's depending on multi-value proposal
willemneal commentedon Jul 24, 2020
Here was what I made a year ago when I was working with WASI and wanted to get the result and the error:
https://github.com/WebAssemblyOS/wasmos/blob/a454ec8bd5b39253557745747c5d9120e18b9049/packages/assemblyscript/assembly/wasa/index.ts
As @jtenner points out multi-value means that we don't have to deal with an allocation each time, but that might be okay for now.
torch2424 commentedon Jul 25, 2020
Ahhhh that makes sense. I'll wait for that than, thanks everyone! 😄 👍