--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/60cf1568-31d3-426e-bfdc-0b4b98b53acdn%40googlegroups.com.
A linked list, for example, consists of pointers to pointers to pointers...Why should any limit exist to the length of the list except resources available?
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAA40n-WZwmcC6aVyvO3H42c9WeuL%2BPEimApdOPgR20cS_nPU%2Bw%40mail.gmail.com.
Um
Really?
Which of these things are you specifically trying to prevent happening
- Curiousity
- Creativity
- Asking questions
- Some combination of the aboveI mean, I appreciate that you think that people should *know* whatever it is you think you know, but that's a really *really* poor response
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/974ff13d-59ff-41f5-90a2-9a3ccd08f10dn%40googlegroups.com.
Does anyone know what the upper bound on this could be?
TypeDef = identifier Type .
Type = TypeName | TypeLit | "(" Type ")" .
TypeName = identifier | QualifiedIdent .
TypeLit = … | PointerType | … .
PointerType = "*" BaseType .
BaseType = Type .
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAA40n-VotEGgVupaJ6S1zRF%3D3hDHDKAz0V5_enaD9EfYfL7t-Q%40mail.gmail.com.
On Thu, Mar 10, 2022 at 1:40 PM 'wagner riffel' via golang-nuts <golan...@googlegroups.com> wrote:
> I don't think it's mentioned in the specification, my bet is that
> unless your type requires inifnity amout of memory (eg: `type t struct
> {t}`) or the type is an interface and break its rules, (eg: `type
> iface interface{ iface }`) you can use self-reference.The validity of `type T *T` in Go is based on two things: 1) The visibility of the identifier in `type T ...` is specified to start right after the identifier, 2) It's possible, in this case, to compute the size of type T. So no problem here.
The scope of an identifier denoting a constant, type, variable, or function (but not method) declared at top level (outside any function) is the package block.
> [...]ThanksManlio
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/aba04b1a-29a3-4950-8ba8-c4d6a4d9aa3en%40googlegroups.com.
On Thu, Mar 10, 2022 at 2:38 PM Manlio Perillo <manlio....@gmail.com> wrote:On Thursday, March 10, 2022 at 2:04:44 PM UTC+1 Jan Mercl wrote:On Thu, Mar 10, 2022 at 1:40 PM 'wagner riffel' via golang-nuts <golan...@googlegroups.com> wrote:
> I don't think it's mentioned in the specification, my bet is that
> unless your type requires inifnity amout of memory (eg: `type t struct
> {t}`) or the type is an interface and break its rules, (eg: `type
> iface interface{ iface }`) you can use self-reference.The validity of `type T *T` in Go is based on two things: 1) The visibility of the identifier in `type T ...` is specified to start right after the identifier, 2) It's possible, in this case, to compute the size of type T. So no problem here.The only reference I found in the spec (after a quick search) is:8. The scope of a type identifier declared inside a function begins at the identifier in the TypeSpec and ends at the end of the innermost containing block.Also:The scope of an identifier denoting a constant, type, variable, or function (but not method) declared at top level (outside any function) is the package block.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/43992fed-8c73-444d-aedc-19d549726896n%40googlegroups.com.
TypeDecl = "type" ( TypeSpec | "(" { TypeSpec ";" } ")" ) .
TypeSpec = AliasDecl | TypeDef .
AliasDecl = identifier "=" Type .
TypeDef = identifier Type .
Type = TypeName | TypeLit | "(" Type ")" .
TypeName = identifier | QualifiedIdent .
TypeLit = … | PointerType | … .
PointerType = "*" BaseType .
BaseType = Type .
A linked list, for example, consists of pointers to pointers to pointers...
a struct with a single field is another interesting case that can be
abstracted out.