Eigenstate: myrddin-dev mailing list

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

Re: Another change.


What python did was have explicit syntax for importing into the global
namespace as well as renames.

The unprincipled but practical approach is to make the arguably two most
common cases - std.result and std.option compiler builtin's. This is
essentially what Go did with the 'error' type. (Not advocating we do it)

On Fri, Jul 28, 2017 at 3:23 PM, Michael Forney <mforney@xxxxxxxxxxx> wrote:

> On 7/27/17, Ori Bernstein <ori@xxxxxxxxxxxxxx> wrote:
> > Yesterday, another language change landed. Now, if a namespaced
> > name is unambiguous (ie, only appears in one namespace), it can
> > be referred to directly. For example:
> >
> >       use std
> >
> >       const main = {args : byte[:][:]
> >               match open(args[1]) /* std.open */
> >               | `Ok fd:       put("opened fd\n")
> >               | `Err e:       put("error opening fd: {}\n", e)
> >               ;;
> >       }
> >
> > I'm not sure how much I like this change, since it's now less clear
> where a
> > function comes from, and makes looking up documentation harder. But it
> also
> > reduces visual noise in code, and makes longer library names more
> > tolerable.
>
> I think I don't like this, mainly because of the looking up documentation
> thing.
>
> What are you thoughts on instead adding the ability to rename an
> import like in go?
>
>

References:
Another change.Ori Bernstein <ori@xxxxxxxxxxxxxx>
Re: Another change.Michael Forney <mforney@xxxxxxxxxxx>