Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

RFC: Entity names for square brackets.

by demerphq (Chancellor)
on Jul 19, 2002 at 20:14 UTC ( [id://183434]=monkdiscuss: print w/replies, xml ) Need Help??

Like many monks who dont do a lot of HTML I can rarely remember entity names, and its even rarer that I can remember numeric entities. So while bitching about not being able to remember what the entities are for [ and ] I mentioned that its too bad there wasnt an easier way to do it: Something like [ and ] would be easier to remember for an addled mind than the numbers. Unfortunately tye was watching the CB at the time, and of course he knows im a member of PmDev so his response was "quit bitching and make a patch" or something to that effect anyway.

So after pestering tye and ar0n a bit I finally figured out what to patch and wrote a patch for it. (not so hard really)

But then the debate arises. There is no recognized name for [ and ]. Most likely because the symbols arent used that much in HTML (outside of our funky taging system here in the Monastery (and other Everything sites)). So the question then becomes what to use? I initially though "sql" and "sqr" but those both have other meanings. Then I reversed it and added a "b" to get "lsqb" and "rsqb". In the meanwhile tye did some research and decided that the name that made the most sense from the Unicode specs would be "lsb" and "rsb" but of course "lsb" suggests "least signifigant bit(s)".

So the question is my fellow monks, which one to use?
Left [Right ]
&sql;&sqr;
&lsq;&rsq;
[]
&lsb;&rsb;
&ob;&cb;

11:53: DamnDirtyApe: Whats the escape sequence for [ and ]? 11:55: ar0n: [ and ] 11:56: demerphq: its too bad the parser doesnt convert &sqbl; and &sqb +r; to those. (or whatnot) 11:56: jeffa: perl -le "print ord for qw([ ])" ;) 11:56: DamnDirtyApe: Thanks. :-) 11:57: tye: another patch oportunity, [demerphq] 11:57: demerphq decides _not_ to suggest anything else ever again. :-) 14:11: ar0n: [Foo Bar] 14:12: aufrank: didn't work in IE 6 [ar0n] 14:13: tye: there are no HTML non-numeric entities for those 14:17: ar0n: I know. I just wonder if you'd applied the patch (too la +zy to log in and check) 14:18: tye: no. I don't want to establish a new "standard" name for t +hose w/o proper reflection. (:
So reflect monks, reflect...

BTWm apologies for quoting the CB w/o permission. If it bothers anyone I'll remove it...

Yves / DeMerphq
---
Writing a good benchmark isnt as easy as it might look.

Edit by tye to change PRE tags to CODE tags

Replies are listed 'Best First'.
Re: RFC: Entity names for square brackets.
by mirod (Canon) on Jul 19, 2002 at 21:41 UTC

    These characters are defined as entities in SGML. ISO 8879-1986 - ISOnum has them as ] and [.

    --
    The Error Message is GOD - MJD

Re: RFC: Entity names for square brackets.
by myocom (Deacon) on Jul 19, 2002 at 20:31 UTC

    I vote for &lsb; and &rsb;. I agree that &sql; calls to mind SQL, but I doubt that most Perl programmers deal much with "lsb" meaning "least significant bit(s)".

    Besides which, I call 'em "left square bracket" / "right square bracket", so &lsb; and &rsb; make nice mnemonics. :-)

    "One word of warning: if you meet a bunch of Perl programmers on the bus or something, don't look them in the eye. They've been known to try to convert the young into Perl monks." - Frank Willison
Re: RFC: Entity names for square brackets.
by brianarn (Chaplain) on Jul 19, 2002 at 20:45 UTC
    I vote for lsb/rsb, for a couple of reasons.
    • It's the shortest version that makes any sense. In some ways, ob and cb make sense, except that cb tends to be chatterbox around here, and more people think of them as left square bracket and right square bracket
    • lsb is shorter than lsqb, and the shorter the better ;)
    • I know that lsb is least significant bit(s), but I've seen that more in the world of electrical/computer engineering than in the world of programming, and I doubt many people will really think that about lsb in the least significant bit context
    • I trust tye enough to believe the research, so that works for me
    This'll be a nice thing to see come through - thanks for working on it! =)

    ~Brian

    Afterthought: What about backslash escaping? hehe
Re: RFC: Entity names for square brackets.
by mattr (Curate) on Jul 20, 2002 at 09:25 UTC
    Q1. Is there a problem with providing a few aliases?

    Q2. Are lb/rb taken? bracketl/bracketr? bra(c)kl/bra(c)kr?

    Q3. if lsb/rsb then lcb/rcb for curlies? Oh yeah and how about &spc; for a space not the nbspc entity?

    Q4. if we're making aliases, how 'bout using "caret" instead of "greater than" for those symbols. I'm not meaning to type a "greater than" symbol, that's just how someone made this keyboard, and I know fonts which show a tall thin caret instead of a big open wide one. so caretl,lcaret and caretr,rcaret would be nice, maybe it would even create a gif (and a little table) that is tall enough for a few lines to fit in between them.

    Q5. Also I may be mistaken but I think the standard way of delimiting a phonetic pronunciation (i.e. showing an upside "e" for a schwa mark) uses tall thin square brackets. Which is not as important as maybe tall lines for drawing matrices. Maybe some of these questions are a little frivolous but I would not mind at all an end to ascii art and the ability for people to draw proper looking matrices and other mathematical symbols properly supported by gifs. You need the functionality if you want to talk about algorithms and HTML entities or not, is not enough (and MathML is too much probably).

    Anyway it would be nice not to have to remember a mnemonic. I vote full words so you can easily remember the entity when you need it.

    Okay, here is the question I really want to ask:

    How many people cringe at the ascii art in the DBI.pm man page? Do you ever wish a module author provided a gif in the docs that could be seen on its CPAN page? Do you remember how monks used to create fabulous illustrated texts yet wake up from your revery to a pile of old ascii?
      I think it would be neat to provide a way for people to be able to draw diagrams in posts. Perhaps a graph with graphviz, or maybe just a way to upload a gif under a certain size if you are above a certain level. Or link to one on another server. Or like some wikis, a way to actually draw a vector diagram would be nice. I think it would be really great for PM, for Perl, for serious discussions, and for general enlightenment. And we could ask Damian to draw some Feynman diagrams to go along with the Quantum modules.

      Cough*MathXML*Cough. Requires browser support, but is a much cleaner way to go.

      Also, there's no need for HTML-escapes for {}; they aren't metachars in Everything. [ and ] are only needed because they're metachars in Everything-text and not HTML. HTML should provide HTML-escapes for everything else that can't be typed directly on a standard US 101-key QUERTY -- if not, it's not considered common enough.

      In other words, it isn't Everything's job to make up for (percived) problems in HTML that it didn't cause.


      Confession: It does an Immortal Body good.

        Natch, you're right. Though I don't carry an entity table in my head (for a current project I am wondering how for example to display, and better yet input, an Old English "OE" character used in a wine product name). So I still would like a curly entity so I don't have to carry that extra info in my head.. oops too late.

        To follow up, HTML can do images, how come PM (/ Everything?) can't I wonder. The phrase a picture is worth a thousand words may be true if we use compressed formats.

Re: RFC: Entity names for square brackets.
by Aristotle (Chancellor) on Jul 19, 2002 at 21:39 UTC
    I like &lsb; &rsb; or maybe, if we really determine the LSB reference is bad, &lsbr; &rsbr; (which should be a last resort though; I'd much prefer typing 5 over 6 characters, not to mention 6 chars is more than the [ we already have.)

    Makeshifts last the longest.

Re: RFC: Entity names for square brackets.
by erikharrison (Deacon) on Jul 22, 2002 at 01:00 UTC

    The Engine introduces us to some additional metachars, the square brackets. I think that this is too specific a patch. What I'd *really* like to see is something tilly mentioned once. I'd like PM to support a backslash escape. This would allow me to backslash those pesky square brackets and also backwhack angle brackets, while creating a potential extendable metachar system if the Monastery ever needs one, all in manner consistent with the way we all think of escapes in Perl.

    That aside, my vote is for &lsqb and &rsqb :-). Also, if the patch is in, one way or another, then maybe this should be a poll?

    Cheers,
    Erik

    Light a man a fire, he's warm for a day. Catch a man on fire, and he's warm for the rest of his life. - Terry Pratchet

Re: RFC: Entity names for square brackets.
by hsmyers (Canon) on Jul 23, 2002 at 20:38 UTC

    Use the existing wheel! [ and ] Hmmm-- that would be left squab and right squab, what about quail?

    --hsm

    "Never try to teach a pig to sing...it wastes your time and it annoys the pig."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://183434]
Approved by brianarn
Front-paged by brianarn
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-19 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found