4 ms·
> no <>s and such Funny. The first thing that came to mind was: import ( bar "github.com/name/bar" baz "github.com/name/baz" foo "
by stewbrew 9y ago
> no <>s and such
Funny. The first thing that came to mind was:
import (
bar "github.com/name/bar"
baz "github.com/name/baz"
foo "github.com/name/foo"
foo_bar "foo<A=bar, B=baz>"
)
- jhgb 9y agoYou could, but the strings are not the language proper. There's, e.g., no relational expressions in your import strings (yet!), so there's no ambiguity in parsing it. I'd actually use parentheses anyway, since type parameters are still parameters (this could give the parameter list a "Pythonic" syntax which has been shown to work well already).
- stewbrew 9y agoI don't fully understand your comment ("no relational expressions in your import strings") but parentheses are valid characters in filenames (thus URLs). I don't think Python is the best reference here.