Talk:Abbreviations, easy

From Rosetta Code
Revision as of 21:55, 18 September 2017 by Thundergnat (talk | contribs) (→‎Need some clarifications: new section)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Need some clarifications

Ok, I'm not going to waste my time coding a new Perl 6 example until the specs are clarified.

   * a command is followed by an optional number, which indicates the minimum abbreviation

So... we need to account for optional numbers? It is part of the spec. Why aren't there any tests for it? What if we had the following command table?

  Add ALTer  BAckup Bottom  CAppend Change SCHANGE  CInsert CLAst COMPress COpy
  COUnt COVerlay CURsor DELete CDelete Down DUPlicate Xedit EXPand EXTract Find
  NFind NFINDUp NFUp CFind FINdup FUp FOrward GET Help HEXType Input POWerinput
  Join SPlit SPLTJOIN  LOAD  Locate CLocate  LOWercase UPPercase  LPrefix MACRO
  MErge MODify MOve MSG Next Overlay PARSE PREServe PURge PUT PUTD  Query  QUIT
  READ  RECover REFRESH RENum REPeat  Replace CReplace  RESet  RESTore  RGTLEFT
  RIght 4 LEft SAVE  SET SHift SI  SORT SOS STAck STATus TOP TRAnsfer 6 Type Up

(Note: the optional 4 and 6 after RIght and TRAnsfer.) Should the string "riG rePEAT copies put mo rest types fup. 6 poweRin" return "*error* REPEAT *error* PUT MOVE RESTORE *error* *error* *error* POWERINPUT"?

It doesn't now when testing the reference REXX implementation. Is that wrong or is the spec? If we aren't supposed to account for 'optional' numbers, why are they in the spec?


   * A blank input   (or a null input)   should return a null string.

What is meant by a null string? It has different meanings in different languages and could have several meanings depending on interpretation.

Consider this contrived example; all are possible valid interpretations of "return a null string" in Perl 6:

   What pet name did your uncle Harold use for his car when he was a teenager?
   
   'a null string' # The string 'a null string'; Uncle Harold was a computer programmer and did weird things for illustrative purposes.
   ''              # An empty string; Uncle Harold was boring and unimaginative and didn't have pet names for anything.
   Nil             # The absence of a value (It could have one, but doesn't); Uncle Harold lived in the city, never got his licence and didn't even own a car let alone name it.
   Mu              # The Most undefined object. There is no there there; I don't even have an Uncle Harold.

Maybe it should be a null byte? \z, ^@, \0 or \x00? C programmers will be familiar with those.

Or should it just be an empty string? And if it should, why not just state that?