Re: D equivalent to Rust or Scala's Optional and Result and best practice ?

2021-10-18 Thread dangbinghoo via Digitalmars-d-learn
On Tuesday, 19 October 2021 at 00:01:47 UTC, James Blachly wrote: On 10/18/21 12:03 PM, dangbinghoo wrote: [...] Not quite the same as tagged algebraic union ("sum type" == Rust enum) are not (yet?) a language feature. That being said, I recently integrated mir's Algebraic and Nullable

Re: D equivalent to Rust or Scala's Optional and Result and best practice ?

2021-10-18 Thread Soulsbane via Digitalmars-d-learn
On Monday, 18 October 2021 at 16:03:53 UTC, dangbinghoo wrote: hi, It seems that now we have `Optional` and `Result` packages in Dub, are these enough or fully equal to Rust or Scala's error-handling and pattern-matching? if these are enough for real-code, any best practice advice? thanks!

Re: D equivalent to Rust or Scala's Optional and Result and best practice ?

2021-10-18 Thread James Blachly via Digitalmars-d-learn
On 10/18/21 12:03 PM, dangbinghoo wrote: hi, It seems that now we have `Optional` and `Result` packages in Dub, are these enough or fully equal to Rust or Scala's error-handling and pattern-matching? if these are enough for real-code, any best practice advice? thanks! Not quite the same

D equivalent to Rust or Scala's Optional and Result and best practice ?

2021-10-18 Thread dangbinghoo via Digitalmars-d-learn
hi, It seems that now we have `Optional` and `Result` packages in Dub, are these enough or fully equal to Rust or Scala's error-handling and pattern-matching? if these are enough for real-code, any best practice advice? thanks!