public import and bugs it causes

Alex Makhotin alex at bitprox.com
Sat May 15 07:20:15 PDT 2010


In previous post I was unsatisfied about the much typing in the D 
language to solve the globals problem.
And what came next is I realized the alternative: Go Programming Language.
Among the other significant advantages(goroutines etc.) it claims *less 
typing*. Reading the newsgroups, finally I go strait to the specification:

Excerpt from http://golang.org/doc/go_spec.html
> Assume we have compiled a package containing the package clause package math, which exports function Sin, and installed the compiled package in the file identified by "lib/math". This table illustrates how Sin may be accessed in files that import the package after the various types of import declaration.
> 
> Import declaration          Local name of Sin
> 
> import   "lib/math"         math.Sin
> import M "lib/math"         M.Sin
> import . "lib/math"         Sin
> 

I think that's better than in D.
By default it requires me to access fully qualified name of the global.
Renamed import doesn't require '= '.
Explicit period required to use exported name without prefix.
I like less typing, I like the Go!



-- 
Alex Makhotin,
the founder of BITPROX,
http://bitprox.com


More information about the Digitalmars-d mailing list