[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Semantics of single datum with all-empty-children in datum comments of sweet-expressions
There's an edge case in "datum comments of sweet-expressions" I'd like to note.
If anyone has comments, please post!
Here's the edge case: If there is a single datum on a line, followed by children that
produce an empty value (now possible with datum comments), what should that mean?
Does it even matter? For example, given this input:
! #; hello
My current starting implementation produces this:
... and *NOT* the symbol "foo5-body-only-comments".
That's because the "monify" routine is *only* invoked if there is *NO* body at all.
At first I thought, "ah, a bug. That should return the symbol foo5-body-only-comments".
After all, normally comments don't change interpretation of text.
But... maybe this is better. If you comment out all the children by prepending "#;",
it's likely it was originally a call to a procedure with some parameters that are being commented out.
In which case, making it return a list is the "least surprising" result. The current semantics
given here do fall out quite straightforwardly from the grammar.
It's certainly *possible* to make it return the single datum if the body is empty...
but SHOULD it? Or, is this an edge case where no one cares?
My goal is to make the semantics "obvious".. the trick is sometimes figuring out
what that means :-).
If no one speaks up, I'll probably just keep these semantics, but if there's a good argument
either way I'd like to know.
--- David A. Wheeler