|
From: Rui N. C. <rn...@rn...> - 2004-06-21 12:47:31
|
Hi Simon, > >>[...] What about that all-upper-case restriction for command keywords? >> And the parameter key names _must_ be capitalized or sort of. >> > My suggestion was that "key names _must_ not match keywords" be the only > rule - its sufficient - and that key names be mixed case by convention, > rather than by law. > That would allow for the occasional upper-case name where it made sense, > eg for acronyms (still use ALSA rather than Alsa). > Agreed. > The keywords are all upper case because... thats just the way they are. > Its not a rule exactly (or IMHO shouldn't be) its simply the convention > that was chosen/adopted. > > (FWIW I don't particularly like the upper case keywords because > 1) its less readable, > 2) its less typeable, > 3) there's no need to shout, and > 4) it isn't 1976 any more. > But its not my place to rework the protocol according to my personal > tastes/prejudices, especially when I lurked my way through the first > eight drafts and am not involved in the software at either end of the > link. So I'm just offering what help I can to make the parser work at > all). > >>Isn't it too restrictive? I'd rather have LSCP case insensitive al >> together. >> > There's not much advantage in making the protocol case insensitive. Its > not like the software at either end is going to forget to press the > shift key. > More likely it would fail to match an oddly cased key name because > someone forgot ToUpper(). > OK, some people might need to type LSCP by hand, but with a consistent > set of conventions it shouldn't be too hard for them to get it right. > > The disadvantages of case insensitivity are > 1) extra work in the lexical analyser and > 2) extra opportunity for name/keyword clashes: It would no longer be > possible to use the key name "Channel" because it would now clash with > the keyword "CHANNEL". > I surely understand about increased complexity for the lexical analyzer, but my complaints, or so to speak, were exactly about this clashing issue. Beware, ignorant's questions follows :) How can it be that a parser/syntax design is such that it can't resolve around distinguishing a keyword from a parameter key name? In my humble POV the position within the phrase would suffice to that. Is it a lex/yacc limitation or what, that a keyword is always taken literally, prioritary and unconditianally independant from where it occurs whithin a parsed sentence? Anyway, I can live with it. I only wish to know better. Finally, please forgive my not-so-good english, eheh, I hope you're not using a lex/yacc combination to read this :) Cheers. -- rncbc aka Rui Nuno Capela rn...@rn... |