Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: union member already defined?


I don't really mind typing "std." but the way Rust deals with this is by
implicitly putting "use std::option::Option::{Some,None};" along with some
other conveniences into every module. If we supported bringing things into
scope that way, we could also include similarly fundamental things (mk? slice
operations?) in our prelude.

Names tend to be shorter in Myrddin though, so the need might not be there.
 
---- On Mon, 30 Jul 2018 08:00:08 -0700 Ryan Gonzalez <rymg19@xxxxxxxxx> wrote ---- 
 > *snip*
 >  
 > FWIW maybe a Swift-like syntax could be adopted here? Something like: 
 >  
 > match fn() 
 > | `.Ok result: ... 
 > | `.Err error: ... 
 >

I'm not at all familiar with Swift, but the leading "." looks really off to me.

 ---- On Mon, 30 Jul 2018 08:00:08 -0700 Ryan Gonzalez <rymg19@xxxxxxxxx> wrote ---- 
 > On July 29, 2018 4:23:38 PM Ori Bernstein <ori@xxxxxxxxxxxxxx> wrote: 
 > > *snip* 
 > > 
 > > And, honestly, the 'std.' in union lookups is annoying enough: 
 > > 
 > >     match fn() 
 > >     | `std.Ok result:    use(result) 
 > >     | `std.Err error:    fail(error) 
 > >     ;; 
 > > 
 >  
 > FWIW maybe a Swift-like syntax could be adopted here? Something like: 
 >  
 > match fn() 
 > | `.Ok result: ... 
 > | `.Err error: ... 
 >  
 > > 
 > > 
 > > -- 
 > >     Ori Bernstein 
 > > 
 >  
 >  
 >  
 >  
 > 


Follow-Ups:
Re: union member already defined?Ori Bernstein <ori@xxxxxxxxxxxxxx>
References:
union member already defined?theos <theosjp@xxxxxxxxx>
Re: union member already defined?iriri <iri@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Re: union member already defined?theos <theosjp@xxxxxxxxx>
Re: union member already defined?Ori Bernstein <ori@xxxxxxxxxxxxxx>
Re: union member already defined?Ryan Gonzalez <rymg19@xxxxxxxxx>