You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However in starlark-go it is impossible to implement a Label object that would behave like this, instead the value of repr is forced to be '"//:hi"' per the straightforward implementation:
Are there any plans to allow overriding repr of a particular type to be able to achieve this distinction?
No, there are no plans. If this feature is really important it could be supported by defining a Reprable interface that the repr function would probe for, but our experience building a Bazel-like tool using starlark-go was that this wasn't necessary, even though it was technically a point of difference between the Go API and the java.starlark.net API.
In Bazel's Starlark, the following holds:
str(Label('//:hi')) == '//:hi'
repr(Label('//:hi')) == 'Label("//:hi")'
However in starlark-go it is impossible to implement a
Label
object that would behave like this, instead the value ofrepr
is forced to be'"//:hi"'
per the straightforward implementation:starlark-go/starlark/library.go
Line 958 in e6e8e7c
Are there any plans to allow overriding
repr
of a particular type to be able to achieve this distinction?The text was updated successfully, but these errors were encountered: