Again, fine, but I think that having an API for (somehow) working with comments is a pre-requisite for an srfi on directives. With comments that are like #!fold-case, I don't even know how to do that. For example, if some Scheme implements one of those non-sexpy syntax srfis, and especially if a file switches the syntax in the middle of a file. ``` #!/usr/bin/env my-scheme #!r7rs (display "hello world1\n") #;(comment number one) #!my-funky-syntax display: "hello world 1\n" /* comment number 2*/ ``` How would you read that? >> I don't see a value in that. I see value in that, but I agree that adding "directives" as a disjoint entity means needlessly increasing complexity. I see an IDE reading a file with "read" and getting "something reasonable". >>The point of comments is to be ignored by the computer. Well, nothing on a computer is truly ignored. To me, it makes sense to help an IDE as much as possible, even though there is not that much that can be done. Still, you can keep things valid in the present Schemes, while helping and IDE (who is the primary user of those structured comments), a bit, without changing the existing syntax. On Wed, 10 Feb 2021 at 21:13, Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de> wrote: > > Am Mi., 10. Feb. 2021 um 14:05 Uhr schrieb Vladimir Nikishkin <xxxxxx@gmail.com>: >> >> > >> I would suggest a simpler thing: procedural comments. >> > >> Just keep the comments as they are (all valid code remains valid), but >> > >> propose a mechanism to process the comments instead of ignoring them. >> > >> >> > >> >> > >> This would be something like, for example, a recond value returned from (read). >> > >> The first value would be the sexp of the source, the second one would >> > >> be, say a list of strings, where each string, would be a pair >> > >> (line-of-file comment-text), or something like that. >> > >> Perhaps, "load" could do the same, iff it returns. >> > > >> > > >> > > This would lose any local relation between the comments and the scheme datums. I think the API has to be a bit more complicated. It should also cope with comments inside complex datum objects and relate them somehow. >> >> Comments are not scheme datums. That's the point of comments. If they >> could be written in scheme datums, they would have been Scheme datums. >> But they are not. >> Or, rather, they may be Scheme strings, as far as I understand. > > > Sometimes, a special comment syntax is used to associate documentation to particular Scheme datums, for example. See Scribble. > >> Aren't directives actually comments? > > > #!fold-case > > is of a different type and has a different meaning than > > #|blabla|# > > The former changes how the Scheme reader acts, the latter is a true comment that fits into the "return comments" idea. > > By the way, we also have datum comments > > #; foo > > For these, it makes sense to report a datum, and not a string. > Marc > -- Yours sincerely, Vladimir Nikishkin (Sent from GMail web interface.)