Discussion:
[xquery-talk] Smiley comments
Joe Wicentowski
2015-06-13 13:12:52 UTC
Permalink
Hi all,

On a lighter note, the @xquery twitter account got this question:

@xquery Were the smiley faces intentional? :)
https://twitter.com/EChan42/status/609465297523838976

Can anyone enlighten EChan42 and the seemingly endless stream, in many different languages, of tweets about this lovable aspect of XQuery?

Joe

Sent from my iPhone
Ihe Onwuka
2015-06-13 13:17:05 UTC
Permalink
I heard it was Jeni Tennison's idea.
Post by Joe Wicentowski
Hi all,
@xquery Were the smiley faces intentional? :)
https://twitter.com/EChan42/status/609465297523838976
Can anyone enlighten EChan42 and the seemingly endless stream, in many
different languages, of tweets about this lovable aspect of XQuery?
Joe
Sent from my iPhone
_______________________________________________
http://x-query.com/mailman/listinfo/talk
Joe Wicentowski
2015-06-13 13:53:31 UTC
Permalink
Thanks, Ihe. That led me to
https://www.progress.com/xquery/resources/tutorials/learning-xquery/xquery---a-guided-tour
(a site I'd never seen before), which cites _ XQuery from the Experts: A
Guide to the W3C XML Query Language_ (2004) as having said:

XQuery uses "smiley faces" to begin and end comments. This cheerful
notation was originally suggested by Jeni Tennison.
I heard it was Jeni Tennison's idea.
Post by Joe Wicentowski
Hi all,
@xquery Were the smiley faces intentional? :)
https://twitter.com/EChan42/status/609465297523838976
Can anyone enlighten EChan42 and the seemingly endless stream, in many
different languages, of tweets about this lovable aspect of XQuery?
Joe
Sent from my iPhone
_______________________________________________
http://x-query.com/mailman/listinfo/talk
Adam Retter
2015-06-13 14:08:09 UTC
Permalink
Likewise that was my understanding too.
Post by Joe Wicentowski
Thanks, Ihe. That led me to
https://www.progress.com/xquery/resources/tutorials/learning-xquery/xquery---a-guided-tour
(a site I'd never seen before), which cites _ XQuery from the Experts: A
Post by Joe Wicentowski
XQuery uses "smiley faces" to begin and end comments. This cheerful
notation was originally suggested by Jeni Tennison.
I heard it was Jeni Tennison's idea.
Post by Joe Wicentowski
Hi all,
@xquery Were the smiley faces intentional? :)
https://twitter.com/EChan42/status/609465297523838976
Can anyone enlighten EChan42 and the seemingly endless stream, in many
different languages, of tweets about this lovable aspect of XQuery?
Joe
Sent from my iPhone
_______________________________________________
http://x-query.com/mailman/listinfo/talk
_______________________________________________
http://x-query.com/mailman/listinfo/talk
--
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk
_______________________________________________
***@x-query.com
http://x-query.com/mailman/listinfo/talk
Ihe Onwuka
2015-06-13 14:40:03 UTC
Permalink
It will probably be the best $4.48 you ever spent.

http://www.amazon.com/XQuery-Experts-Guide-Query-Language/dp/0321180607/ref=sr_1_2?ie=UTF8&qid=1434206347&sr=8-2&keywords=xquery+for+the+experts
Post by Joe Wicentowski
Thanks, Ihe. That led me to
https://www.progress.com/xquery/resources/tutorials/learning-xquery/xquery---a-guided-tour
(a site I'd never seen before), which cites _ XQuery from the Experts: A
XQuery uses "smiley faces" to begin and end comments. This cheerful
notation was originally suggested by Jeni Tennison.
I heard it was Jeni Tennison's idea.
Post by Joe Wicentowski
Hi all,
@xquery Were the smiley faces intentional? :)
https://twitter.com/EChan42/status/609465297523838976
Can anyone enlighten EChan42 and the seemingly endless stream, in many
different languages, of tweets about this lovable aspect of XQuery?
Joe
Sent from my iPhone
_______________________________________________
http://x-query.com/mailman/listinfo/talk
Michael Kay
2015-06-13 15:20:23 UTC
Permalink
Post by Joe Wicentowski
Can anyone enlighten EChan42 and the seemingly endless stream, in many different languages, of tweets about this lovable aspect of XQuery?
For the record, here are edited highlights of the discussion which took place between 2nd and 6th December 2002:

Jeni Tennison, 2 Dec 2002:

The use of "--" in comment syntax in XPath 2.0 means that XSLT users
will find it harder to comment-out sections of their code for
debugging purposes (since XML comments cannot contain '--').

Michael Kay:

Ouch… Just when Scott had persuaded everyone that we needed to support nested
comments!

Unfortunately, the choice of comment delimiters is one of those things that
is both completely arbitrary and highly emotional at the same time. It's not
going to be easy to come up with an alternative that a majority prefer.

I've always felt that the way one ought to handle this is to make a list of
the options (one of which is the status quo) and ask people to put them in
order of preference.

Here's a candidate:

{| .... |}

Jim Melton:

I'm a huge fan of nested comments, which is highly useful when one needs to
comment out a chunk of code that might already contain comments...

I am not rabid about the specific syntax of the comments though. Mike's
suggestion of {|...|} is acceptable, although I find myself sighing at the
"new language, new comment syntax" syndrome ;^} It'd be nice if we could
find a comment syntax from some other popular language that would
work.

Michael Kay:

I chose on the following criteria:

* don't use any new characters
* choose opening and closing sequences that are different
* choose opening and closing sequences that "complement" each other
* chose an opening sequence that can't appear at the start of an expression

{* ... *} fails the last test: a valid query today is:

<a> {*:b/b:*} </a>

The fact is, it's very hard for us to use the comment syntax of existing
language because we use common punctuation characters such as "/" and "*" in
rather unusual ways.

Jeni Tennison:

The survey at:


http://merd.net/pixel/language-study/syntax-across-languages/Vrs.html


Shows the following syntax for multi-line comments:

1. (* ... *) Beta, Modula-3, OCaml, Pascal, SML
2. /* ... */ Dylan, Oz, B, C, C#, C++, Java, JavaScript, Mercury, PHP, PL/I
3. " ... " Smalltalk
4. { ... } Pascal
5. ( ... ) Forth
6. {- ... -} Haskell
7. #| ... |# Common Lisp
Post by Joe Wicentowski
* don't use any new characters
* choose opening and closing sequences that are different
* choose opening and closing sequences that "complement" each other
* chose an opening sequence that can't appear at the start of an expression
1, 2, 3, 4, 5 and 6 are out because they all fail on at least the
last of these. Common Lisp's #|...|# fails on the first of the
criteria -- it introduces #.

I think that we should avoid any syntax that starts/ends with {
because of the problems with that syntax being used at the start/end
of an attribute value template.

What about using colons in some way? They're existing characters that
can't appear at the start or end of an expression (any more, as far as
I can tell). For example:

(: comment :)
/: comment :/
|: comment :|
:- comment -:

Jonathan Robie:

I like either of the following:

(: comment :)
{: comment :}

I think I prefer the first. It looks cheerful with those happy faces on
both sides.

Jim Melton:

I find that I like the first and the last better than the middle two, the
|: ... :| alternative next, and the /: ... :/ alternative the least.
Post by Joe Wicentowski
(: comment :)
I like this best, I guess. The characters are a bit closer together on the
keyboard than the alternatives.

Michael Rys:

Note that we decided to use {} for XQuery specific delimiters:

{ EXPR }
{!-- Comment --}

So unless the new comment delimiter starts with { I am not interested.

Jeni Tennison:

I'd be very happy if it were the case that {}s were, indeed,
XQuery-specific delimiters, but currently they're used in both
comments and the validate expression in XPath as well as XQuery.

I'd prefer XPath not to include any {}s because I think that XSLT
users will find {}s in XPaths confusing given that they're used in
attribute value templates with a different meaning.

NOTE:

I haven’t been able to find the minutes of the meeting where the final decision was taken; they may contain further discussion. (The search facility for W3C mailing lists is notoriously poor.)

Michael Kay
Saxonica



_______________________________________________
***@x-query.com
http://x-query.com/mailman/listinfo

Loading...