Re: union member already defined?
[Thread Prev] | [Thread Next]
[Date Prev] | [Date Next]
- Subject: Re: union member already defined?
- From: Ori Bernstein <ori@xxxxxxxxxxxxxx>
- Reply-to: myrddin-dev@xxxxxxxxxxxxxx
- Date: Mon, 30 Jul 2018 22:23:34 -0700
- To: myrddin-dev@xxxxxxxxxxxxxx
- Cc: iriri <iri@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
On Mon, 30 Jul 2018 21:48:07 -0700, iriri <iri@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote: > 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. For a while, I also had a patch in that used D's resolution rules: If a name was unambiguous, it could be grabbed from any scope. If it was ambiguous, it would need to be fully qualified. So, for example, if you had the following packages: pkg foo = const Count = 123 ;; pkg bar = const Count = 246 ;; This code would be fine: use foo const main = {; frob(Count)} But this code would not: use foo use bar const main = {; frob(Count)} You'd need to amend to: use foo use bar const main = {; frob(foo.Count)} It sounds nice, but the feedback ended up being that the explicitness was only mildly annoying for the writer, and useful for the reader. I'm ok with the state of things as it is. -- Ori Bernstein
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> |
Re: union member already defined? | iriri <iri@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> |
- Prev by Date: Re: union member already defined?
- Previous by thread: Re: union member already defined?
- Next by thread: [PATCH 1/2] Make timespec/timeval struct members signed to simplify arithmatic.
- Index(es):