Lisp has used directives in comments in the past. Only on the first line of a file but they were parsed.
That had to be very distant past or some non-standard lisp. Common Lisp has no such feature.
Go Lang: Comments Are Not Directives
81–90 of 222 posts
Re: Go Lang: Comments Are Not Directives
#82Earlier quoted context omitted.
Fully agree. I love Go and use it for anything related to servers or the web, but doing anything with comments besides just letting them be comments, is just braindead.
They aren't used by the compiler at all.
//#cgo
//go:nosplit
//go:noescpae
are all used by the compiler in one way or anotherRe: Go Lang: Comments Are Not Directives
#83I also do not agree with that. This is bad for so many reasons. First, to the compiler code, comments should be discarded as soon as possible (often in the lexer). To the programmers, comments should never execute anything (this is just intuitively expected). To any go source code reader (human or machine), comments are supposed to contain only human readable text, probably a context sensitive explanation of that par…
Re: Go Lang: Comments Are Not Directives
#84Comments are just comments, we should not keep adding keywords and syntax to them. Go's backward compatible promise is hurting itself. By sticking with strict compatibility mode, ad hoc solutions for fundamental issues are added from time to time. Sooner or later, those patch works will back-fire. For a language so young (version 1.0 in 2012), they should keep compatibility for stable release (1.x), but start adding…
One of the best features of go is "go fix" Yea! A migration tool for the language it self? Before they need to worry about compatibility they can break a lot of stuff.
However, we can not easily fix the way people writing the code, or the so-called idiomatic Go norms.
Actually, it is compatibility in the ecosystem of Go packages that matters. We have lots of good Go packages on Github that are no longer compatible with Go 1.0/1.1/1.2 etc.
Re: Go Lang: Comments Are Not Directives
#85#--utf8--
indicated the encoding of a source file. In most cases, this won't induce ambiguity, though it's potentially dangerous.
Re: Go Lang: Comments Are Not Directives
#86(You left out "// +build", which predates Go 1.4.) We made the decision that "//go:" is the syntax for comment directives. The old ones stay around for compatibility reasons. Previous discussion: https://groups.google.com/forum/#!searchin/golang-dev/commen...
And there's //line path/to/file:linenumber and //go:noescape
///
Re: Go Lang: Comments Are Not Directives
#87At last! I'm not insane! I raised this on the golang dev forums and got nowhere: https://groups.google.com/d/msg/golang-dev/r4rdPdsH1Fg/yjOOz... The response was basically "we disagree" and I wandered away feeling confused that so many bright people couldn't see the problem here.
That's a rather disingenuous summary given that literally the very first response is Brad Fitzpatrick from the Go team agreeing with you, acknowledging that it's unfortunate, and admitting that it can't feasibly be changed yet due to the compatibility guarantees. And then shortly afterwards, he encourages you to bring this point up when Go 2 comes around.
Re: Go Lang: Comments Are Not Directives
#88Re: Go Lang: Comments Are Not Directives
#89seems more appropriate.
Re: Go Lang: Comments Are Not Directives
#90I think this is a semantic argument.