The URI RFC is pretty sparse when it comes to query parameters, but doesn't
mandate that queries must have values, meaning that this is a valid URI:
"https://example.com/?query1=value1&query2";
But the net/url package does not provide an easy way to see that "query2"
is present in the URL throu
dencies should be managed by the application using the libraries in
its own vendor directory.
Ian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-
Define a logging interface in your main package, then pass an
implementation of the interface in your test that forwards writes to
t.Logf
On Tue, 30 Jan 2018, at 2:11 PM, Jérôme LAFORGE wrote:
> No, it is not possible to use t.Log within the code you want to test.> The
> function IsBuggyEven is n
If it compiled (there are syntax errors) then I'd expect it to print
each of the numbers 0..99 doubled, followed by a repeat of the last
printed value.
Each iteration of the second loop you set y = x[i]+i
What are you trying to achieve?
On Thu, 1 Feb 2018, at 9:43 AM, Ganesh kumar wrote:
> packa
stants) is hard coded at least X times in the code
> base, could be a candidate for being a constant.>
> Having all these hard coded and repeated values as constants would
> reduce the risk of typos when typing out the values every time.>
> Any suggestions?
github.com/jgauther
the naming of your functions is misleading you. In the
following code,CopyImplicitDeref is called on the pointer called a
since the method set of the pointer type includes all the methods of
the value type.
a := &T{0}
b := a.CopyImplicitDeref()
There is no copying in this case.
Ian
--
You received th
s code only map the origin field not the firstname, and
> lastname part.
Please show an example of the JSON you are receiving.
You have some errors in your struct. Remove the spaces between json: and
the quote, like this: `json:"firstname"`
Also your origin tag is missing the json prefix.
On Tue, 14 Aug 2018, at 12:44 PM, nicolas_boiteux via golang-nuts wrote:> the
raw of response.body is this
>
>
> { "args": {}, "data":
> "{\"firstname\":\"Nic\",\"lastname\":\"Raboy\"}", "files": {},
> "form": {}, "headers": {"Accept-Encoding": "gzip",
> "Connection": "close","Cont
On Fri, 17 Aug 2018, at 5:08 PM, Tad Vizbaras wrote:
> I have a package. Let say a/b/c. How to find what are other packages
> in my GOPATH using it?>
> I am basically trying to clean up GOPATH from all unused packages
> installed and downloaded over the years.> Finding "dead" packages in GOPATH.
>
On Thu, 30 Aug 2018, at 3:37 PM, Denis Cheremisov wrote:
> Hi!
> With Go 1.10 and earlier one can install binaries via regular `go
> get`, `go get golang.org/x/tools/cmd/goimports` for instance.> It doesn't
> work with Go modules enabled:
>
> $ go get golang.org/x/tools/cmd/goimports
> go: canno
On Tue, 11 Sep 2018, at 3:01 PM, viktor.oge...@gmail.com wrote:
> Hi,
>
> I am struggling to load and use custom fonts from ttf files in draw2d
> (used since I need rotated text).>
> To illustrate: https://play.golang.org/p/6-rswetZOr8 give the output:>
> 2018/09/11 15:52:43 open ../resource/fon
On Tue, 11 Sep 2018, at 3:23 PM, Jeff wrote:
> TLDR; So why contracts and not templates or something else? Is there
> a benefit to contracts that I don't appreciate (very likely, cause I
> don't understand them)? Are there issues with a template approach?
> If this has been addressed elsewhere, p
On Fri, 14 Sep 2018, at 6:02 PM, Andrew Williams wrote:
>
> It's now well into development and ready for people to get involved.
> There is a long way to go but it feels like a solid base.> Instructions for
> getting started, if you need them, are at
> https://github.com/fyne-io/bootstrap/blob/m
On Fri, 21 Sep 2018, at 3:36 AM, ascarra...@gmail.com wrote:
> He has a valid point. Most of the enterprise applications uses Oracle
> DB. I for one is looking for an oracle driver similar to what JDBC
> does (a simple to use, no separate installation needed). All of Go
> oracle drivers available
Quoting Lucio (2018-09-21 16:15:19)
>The other thought I had, but is very poorly baked, is that the
>"essence" of polymorphism in Go operators is analogous to the informal
>definition of interfaces: it can be determined by the compiler, even
>though it is not expressed in a formal
> >It's good that you brought that up, because another issue I
remember
>from C++ V1.0 days, is that operator overloading did not allow for
>changes in operator precedence, an arbitrary sop to some weird
>decisions taken in earlier centuries. What I see as pertinent
Quoting Robert Engels (2018-09-23 13:38:04)
> I wasn’t suggesting that Go should resemble Java. I was just trying to point
> out that many of the current issues under debate for Go2 have been resolved
> quite well in other languages, and looking to them for direction should not
> be out of bound
Quoting robert engels (2018-09-23 22:50:54)
>I'm often confounded when people discuss Java (at least in comparison
>to Go) as being "heavy". If you read early interviews with Gosling it
>is clear that his design was more about what to leave out, not what to
>include (macros, pre-pr
On Thu, 27 Sep 2018, at 2:04 PM, Peter Mogensen wrote:
>
> Of course... it requires that you handle any collisions in hashing the
> string key to an int yourself, but wrt. the value I curious if anyone
> can see issued with just storing a uintptr instead of the pointer for
> sync.Pool managed o
On Thu, 27 Sep 2018, at 3:06 PM, Peter Mogensen wrote:
>
>
> On 09/27/2018 03:58 PM, Robert Engels wrote:
> > It wasn’t necessarily a warning to you :)
> >
> > It comes from the days of GC bashing in Java and so everyone tried to
> > manually write garbage free programs using pools and it had a
I am working on setting up NTPsec's build system to properly handle Go
code, and can only find limited information of the preferred way of
structuring the directory tree.
Forcing the entire project into GOPATH would be sloppy and a giant kluge
all around.
Placing the go code in a folder with
ssible in a future release of
Go this could break.
Hope this helps,
-Ian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
cost of really only being effective for the one
codebase. Critically, it still punted on trying to be perfect, which
made it tractable at all.
-Ian
Quoting Eric Raymond (2018-10-02 09:21:08)
>Is promised in the thread on pytogo, I have blogged on the general
>topic of rule-swarm att
Quoting Lucio (2018-10-04 23:19:48)
>On Tuesday, 2 October 2018 15:21:08 UTC+2, Eric Raymond wrote:
>
>Is promised in the thread on pytogo, I have blogged on the general
>topic of rule-swarm attacks in the domain of language transformation.
>[1]http://esr.ibiblio.org/?p=8153
>
>
On Sat, 6 Oct 2018, at 3:07 PM, 'kalekold' via golang-nuts wrote:
> `go mod download -json` does not product valid json? Is this a known
> issue or am I missing something?
Do you have an example that shows the invalid json?
--
You received this message because you are subscribed to the Google Gro
Yeah, there's no way to do this as such. One thing you could possibly do
instead is define a wrapper around the type and use methods:
type MyWrapper struct {
theSlice []Elem
}
type Index int
func(w MyWrapper) At(i Index) Elem {
return w.theSlice[int(i)]
}
func(w MyWrapper) SetAt(i Index
Note that this would still accept numeric literals:
w.At(4)
If you want to avoid this, you can wrap the index type in a struct:
type Index struct {
I int
}
Quoting Ian Denhardt (2018-10-07 13:20:48)
> Yeah, there's no way to do this as such. One thing you could possibly do
>
proposal
focusing on the latter:
https://gist.github.com/zenhack/ad508d08c72fce6df945a49945ad826d
(It is also linked from the feedback wiki page).
It punts on operator overloading, though discusses some related
subtleties.
Thoughts?
-Ian
--
You received this message because you are subscr
Hmm, I suppose I imagined having read a deeper reason than syntax :/.
That does seem like an incredibly shallow reason to introduce a whole
new non-orthogonal concept (I see others have attempted to tackle the
syntax issue, including yourself).
There are actually deeper difficulties than syntax wi
Quoting Dean B (2018-10-11 14:58:01)
> Yeah that's why I was about how operators were the primary reason
> interfaces couldn't work out. Your proposal doesn't include operators,
> which was the reason interfaces aren't used. Syntax in Go is pretty
> important, which I imagine is the reason that op
Quoting gary.willoug...@victoriaplumb.com (2018-10-11 10:38:38)
>Add it to this: https://github.com/golang/go/wiki/Go2GenericsFeedback
Already did (before posting to the list); it's at the top.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
Quoting alanfo (2018-10-13 13:26:18)
>Suppose we turn this strategy on its head and instead allow types which
>wouldn't otherwise do so support the ordering operators provided they
>satisfy a simple interface. This interface would have a single method
>which returned a string repr
Quoting alan.f...@gmail.com (2018-10-13 15:39:46)
>Unfortunately, no approach is immune to silly mistakes by yours truly
>but, as it's an area where "Effective Go" could offer some pointers, it
>need not be unduly error prone in practice.
Still, some approaches are more error prone th
e options, but I still
haven't been able to come up with a solution that has a credible upgrade
path.
I've mentioned this when it's come up in a couple of other threads, but
not everybody reads every rabbit-hole conversation about generics...
-Ian
--
You received this message because you
clever
> to the point of crazy. I am more than willing to chop that off to preserve
> the simplicity and transparency of the cases where "implements" is legal.
Agree, my only concern is as mentioned above.
It's also worth noting that you can always wrap the pointer in a new
Cute. I think we're better off without it though; the use cases I can
think of for "generic booleans" are all way too clever.
FWIW, the uses of "generic booleans" I've seen in the wild don't
actually work with your proposal, because they really do need to
overload `and` and `or`, not just `not`. B
Quoting Ian Lance Taylor (2018-10-16 09:44:00)
> It's not clear to me what other aspects of various generic proposals
> you are picking up here. How are you imagining that we would write
> the function that merges two channels? With the current design draft
> that looks so
I write this kind of code a lot when working in Elm (whose generics are
in a similar spot to the place you suggest). It's not the worst, and
there various approaches in related languages use to make the "adaptors"
more ergonomic.
I still like the idea of using interfaces to express constraints bet
t they require
careful consideration. Importantly, we have to figure out where and how
we're going to document these rules so that people actually see and
understand them. It's not enough for us to have a thing buried in the
spec that `*` should be commutative; the author of that matrix libr
Quoting Eric Raymond (2018-10-16 15:57:49)
>I don't undetstand rte q
rte q? I assume this is a typo, but I'm not sure what it was supposed to
be...
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop recei
Quoting Ian Lance Taylor (2018-10-16 16:02:57)
> On Tue, Oct 16, 2018 at 8:39 AM, Eric Raymond wrote:
> >
> > New rule: A function on variables of undefined formal-argument types
> > compiles to a template (not a textual template - we don't want identifier
> > ca
Quoting Eric Raymond (2018-10-16 16:14:46)
>It's up to the programmer to implement things like commutativity.� I
>don't think the language should pre-specify whether < is a partial or
>total ordering.� Any choice of this kind the language makes will
>inevitably turn out wrong a s
Quoting Dave MacFarlane (2018-10-16 16:40:59)
> (Also, does this mean the compiler wouldn't be able to make any
> optimization assumptions regarding whether an operation is
> commutative/associative/distributive?)
This is true regardless, because we aren't actually *enforcing* these
properties; t
Quoting Eric Raymond (2018-10-16 16:37:01)
> you either compile "a < b" using the "implements <" method of the
> concrete type or throw an error.
> This means that a change in the generic function, which happens to
> introduce a new use of the parameter, can cause a failure at the
>
com/zenhack/ad508d08c72fce6df945a49945ad826d
As written it punts on operator overloading, but I think given the
solution you've described re: ==, it can be updated to support it.
-Ian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group
Quoting Patrick Smith (2018-10-16 18:04:05)
>One way to avoid this is to supply the adaptor when the Set is created,
>store it in the Set, and thereafter used the stored adaptor instead of
>requiring an adaptor parameter.
This works for insert/member, but what about union, which takes
Quoting Patrick Smith (2018-10-16 18:32:48)
>The union function could verify that the two adaptors are the same,
>using the == operator, and panic if not. However, this breaks down if
>the adaptors, instead of being defined as struct{}, are defined as
>types which don't support ==.
Quoting Patrick Smith (2018-10-16 19:21:35)
>If overloading [] were disallowed, how would one write a generic
>function taking a single argument of type either []int or a
>user-defined type with similar behavior, and returning the sum of the
>elements? Sort of the marriage of these
the issue with == that I
mentioned earlier, though ESR has offered a possible solution.
-Ian
Quoting roger peppe (2018-10-17 12:43:44)
>While thinking about the draft generics proposal and the complexity of
>contracts, it occured to me that if you relax some of the restrictions
>on
nd know for certain that it's
not calling a method? You can't have both.
-Ian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubs
rs; both approaches work.
Burak, apologies if I've misinterpreted your own line of thinking.
-Ian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golan
Quoting Burak Serdar (2018-10-19 12:34:44)
> Re: Ian Denhardt's proposal:
>
> I agree that it handles all the cases in the official proposal,
> but I think the syntax is too verbose and reminds me of
> Java. For instance, the "sorting" example can be written
Quoting Burak Serdar (2018-10-19 12:46:19)
> Where can I read about this "implements"? Link?
This is the thread:
https://groups.google.com/forum/#!search/go-nuts/golang-nuts/pR5pmql5olM/RPDuL2BsCAAJ
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" grou
Quoting Burak Serdar (2018-10-19 14:09:46)
> It is useful in a linked list. You can instantiate a linked list
> template in a package, and use that concrete type in another package
> without access to the internals of the linked list.
Can you provide an example of what some code using this would
that most of us have been raising specific
critiques of the design. While our criticisms are based on
substance, you dismiss them entirely without providing a
justification other than "Ian and Robert know what they're
doing."
Second, I agree with Tristan that Eric
Quoting Eric Raymond (2018-10-19 14:43:51)
>Therefore, as the author of the "implements" proposal, I am declaring
>neutrality on whether an "implements" clause should declare an overload
>at all!
>That is, there is a possible future in which "implements <" on type T�
>does not�
Quoting Burak Serdar (2018-10-19 15:13:20)
> Without operator overloading:
>
> type X interface {
>implements <
> }
>
> means that you want a primitive numeric type or a string. So:
This is not quite quite correct; in Eric's proposal, it is possible to
define (for example):
```
// A Version
Quoting Ian Denhardt (2018-10-19 16:29:07)
>
> Quoting Burak Serdar (2018-10-19 15:13:20)
> > Without operator overloading:
> >
Realized I missed this right after hitting send. Yes, without operator
overloading you're restricted to built-in types that already support the
Quoting Eric S. Raymond (2018-10-19 16:15:25)
> Ian Denhardt :
> > What would code making use of a `Sortable` type look like? If you can't
> > actually use "implements <" to overload `<`, it's not clear to me what
> > it would actually do?
>
Quoting alan.f...@gmail.com (2018-10-19 16:19:36)
> Ian D,
>The introduction is certainly not intended to be insulting to those who
>have put serious thought into the problem. If it were, then I'd be
>insulting myself as I've put serious thought i
Quoting Burak Serdar (2018-10-19 17:01:42)
> On Fri, Oct 19, 2018 at 1:09 PM Ian Denhardt wrote:
> >
> > Quoting Burak Serdar (2018-10-19 14:09:46)
> >
> > > It is useful in a linked list. You can instantiate a linked list
> > > template in a package, and us
it and it solves the problem. It's been pointed out
elsewhere that this would also be solved by allowing interfaces to
specify fields:
type HasNode interface {
Node *Node
}
Ian T points out that there is an issue about this, which was rejected:
https://github.com/golan
Quoting Andy Balholm (2018-10-20 13:30:58)
> There are some contracts in the draft design that can’t be expressed with the
> “implements” syntax as it stands. Some would be fairly simple syntax
> extensions, but others describe the relationship between two types rather
> than just the operations
tent. Even so, as I mentioned above, the interfaces +
operator overloading route covers basically everything I've seen. And
it's still simpler.
-Ian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and
cise is worth adding conceptual complexity.
>3. Interfaces don't deal with fields at all and so would need to be
>extended to cope with a struct constraint. To be fair, some people have
>questioned whether such constraints are important enough to be catered
> for
On Sun, 21 Oct 2018, at 10:52 PM, Justin Israel wrote:
> I was getting an error trying to pass a []string to this elasticsearch
> API ctor:>
> https://github.com/olivere/elastic/blob/v6.2.11/search_queries_terms_set.go#L26>
>
> func NewTermsSetQuery(name string, values ...interface{})
> *TermsSe
On Mon, 22 Oct 2018, at 4:36 PM, Sathish VJ wrote:
> So, I also tried with
> *go test -v -bench=. -test.benchtime=0.1s *
> and that does complete.
>
> But is the implication that StopTimer/StartTimer is too costly to use
> even for this simple benchmark?
See https://github.com/golang/go/iss
Observation: this discussion is very close to the debate around operator
overloading. In fact, if we add generics to the language, we could
define interfaces (I will use Alan Fox's square bracket syntax, as I
think it improves readability):
type Iterator[type Elem] interface {
Next() bool
Quoting robert engels (2018-10-22 16:01:18)
> I am sure it has been discussed, but why the aversion to using < > in
> type declarations? I guess I just don’t understand using bracketing
> notations that are already used for something else.
This was mentioned in the draft design, but using `<` at
. Updating to the new version is easy and
can be done incrementally: just rename any variables that collide with
the keyword.
Thoughts?
-Ian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop
Quoting Pat Farrell (2018-10-26 21:30:47)
>This leads to my second issue with the OP's ideas. I strongly believe
>that Java has been damaged by its attempt to deliver backward
>compatability. While others have brought up the potential issues with
>keywords, a much more telling disa
Quoting robert engels (2018-10-26 23:31:46)
>OK, you got me, I'm sucked in - it was a nice balance of yes, BUT no.
>
>First, there is simply no debate, Java += Android, and you have the
>most successful language/platform ever. NO debate.
>Arguing against Java's write-once, run anyw
It's a little unclear to me what exactly you're trying to check; giving
an example might make it easier to advise.
But in any case, Go doesn't have anything quite like static_assert in
C/C++. Depending on what you're trying to do, you could put a call to
panic in an init() function, which would at
Quoting Mandolyte (2018-11-01 06:30:30)
> - it uses square brackets instead of (type .. ) for the type parameters
What does it do with `type Foo [T] int`? The draft design cites this
ambiguity (is it a generic type with an unused parameter, or an array of
length T?) as the reason for not using sq
T cannot be a variable, it must be a
>constant... so perhaps it can be figured out -
>see� https://play.golang.org/
>On Thursday, November 1, 2018 at 11:54:31 AM UTC-4, Ian Denhardt wrote:
>
> Quoting Mandolyte (2018-11-01 06:30:30)
> > - it uses square brac
>Ah, I see. the albrow/fo package is the equivalent of just pasting the
>entire function into the contract.
It's not actually -- the rules seem to be those of the draft design,
with the contracts mechanism simply omitted. So e.g. there's no way to
write a max function; see:
https://
d potentially do more compelling things with methods that return
`self`, since then you can actually get more than one value of the
`self` type. But my own inclination is to keep things simple.
-Ian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts&qu
What is the functionality that you're not seeing re: how to do file
downloads over net/rpc?
The thing that pops to my mind as likely important is the ability to
stream data, which you indeed cannot do with net/rpc.
If you need that I might suggest using a different rpc system that has
the express
a frozen package? Interesting ... I didn't know
>they had streams
>
>On Sun, Nov 4, 2018 at 12:20 PM Ian Denhardt <[1]i...@zenhack.net>
>wrote:
>
> What is the functionality that you're not seeing re: how to do file
> downloads over net/rpc?
&
Quoting Steven Wiley (2018-11-05 22:12:40)
>And let's face it. Templates, operator overloading, and talk of
>generics has swirled around golang since its inception. Separating the
>template/generic/operational overload step from the core language via a
>pre-compile step� is one wa
owing: which might be a clue to someone.
Ian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
For more optio
On Fri, 16 Nov 2018, at 6:05 PM, Wagner Riffel wrote:
> I'm either on 60.3 under linux and it's working fine.
OK thanks, it must be something on my system
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop r
>From an implementation standpoint they are passed by reference (The
representation is actually a pair (pointer to vtable, pointer to
object), but from a semantic standpoint the difference still matters,
because e.g. if the original value was a struct, it still can't be
mutated. There are use cases
Quoting Robert Engels (2018-11-19 15:13:53)
> But isn’t that just for safety. Meaning the unmarshall could use it as a
> pointer via reflection and mutate it (but that is probably not what the
> caller expects in Go) ?
No, see:
https://play.golang.org/p/MyF0Dx87-1j
If you pass in &foo inst
x27;d probably
just do:
myfun := mydecorator(func() {
...
})
-Ian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
stand it without having to think about more than a few things at
a time.
-Ian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
that the call site is clearer. Sometimes a simple comment will help.
Sometimes that means just putting the type annotation there even though you
don't have to. This is common in ML family languages, where type annotations
are never actually required *anywhere*. All language features are abu
Quoting robert engels (2018-11-25 00:15:21)
> Contrast that with this actual code from the leading Go application (picked
> at random):
>
> func (p *pruner) prune(namespace string, mapping *meta.RESTMapping,
> includeUninitialized bool) error {
> objList, err := p.dynamicClient.Resource(
Quoting robert engels (2018-11-25 01:39:30)
> You kind of made my point, when you state “it’s either a slice or a
> map”… Well, what if the resource needed to be ordered, which is why the
> previous method has List in its name, but the method was actually
> returning a map.
If the authors of meta.
Quoting roger peppe (2018-11-25 12:01:08)
>On Sun, 25 Nov 2018 at 16:54, 'Axel Wagner' via golang-nuts
><[1]golang-nuts@googlegroups.com> wrote:
>
>I'd suggest simply
>func (b *Binlog) writeArgumentToOutput(writer writer, arg uint64) error
>{ /* do the writing */ }
>and doin
omewhat limited,
clumsy way. But most of the trickery I've seen relies on one feature or
another that Go doesn't have, and the result is always somewhat
cumbersome.
-Ian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To uns
Quoting Marko Ristin-Kaufmann (2018-11-27 10:29:15)
> if you could call template hacks really dependent types...
You really couldn't, they're entirely different beasts.
>I expect most applications to need wider family of behavioral contracts
>-- and I doubt that Go would ever support the
I believe Jan is talking about bits in the information-theoretic sense.
I.e, asking "how much do I know?", not "how much space does this take
up?"
Quoting robert engels (2018-11-29 17:10:51)
>Would you elaborate? I've read the discussion multiple times, and can't
>see what other bits you t
ometimes hear them referred to as "phantom types".
type USD struct{}
type EUR struct{}
type GBP struct{}
// ...
var m1 Money(USD) = 5
var m2 Money(USD) = 10
var m3 Money(EUR) = 2
m1 + m2 // ok
m2 + m3 // type error: Money(USD) vs. Money(EUR)
-Ian
--
You received this message because you a
Quoting Robert Engels (2018-12-01 22:25:06)
> The way to fix it though it just to use dot imports, and encourage it!
> The only time dot imports don't work is when there isn't package
> stutter. Seems like a no brainer and you get the best of both worlds.
My experience in every language I've work
Quoting Robert Engels (2018-12-02 00:19:40)
> I know everyone hates it when I reference java but it has had dot
> importsat the package level since day one. I won’t repeat why that
> matters. It’s never been a problem.
>
> I don’t think I ever heard someone complain it was a problem in
> working in
Quoting robert engels (2018-12-02 00:59:31)
>Granted, their package structure seems poor in my opinion, but you
>can't talk bad about k8s.
Of course you don't lose anything by getting rid of the package names if
the package structure doesn't make any sense in the first place.
>And pr
Based on your explanation, my original understanding of the semantics
were correct. This:
> import java.util.Collections;
..is not a dot import -- a dot import makes visible every (exported)
identifier in the package. This just exposes the one identifier --
Collections. I don't have a problem wi
Quoting robert engels (2018-12-02 01:43:45)
> import * + type inference + dynamic language = hell
Can't have type inference without types, so it's just the dynamic bit,
but I basically agree -- combined with the fact that you can do nonsense
black magic with the import machinery at runtime in Py
Quoting robert engels (2018-12-02 01:55:17)
> added to Go, but I am not sure if the package has a few related types
> (which it should IMO) it is any better than
>
> import . “package”
This also exposes stand-alone functions, constants etc. which doesn't
come up in Java.
I think the stutter real
1 - 100 of 2570 matches
Mail list logo