Wiki

Ticket #111 (closed enhancement: fixed)

Opened 15 years ago

Last modified 15 years ago

Move Utils.cobra methods to Cobra.Lang extensions

Reported by: Chuck Owned by: chuck
Priority: medium Milestone: Cobra 0.9
Component: Cobra Compiler Version: 0.8.0
Keywords: library, extensions Cc:

Description

There are several useful methods in the compiler's Utils.cobra. Move these as extension methods to Cobra.Lang\Extensions. Note that not all methods in Utils.cobra will be migrated. Only the highly general purpose ones.

Attachments

utilsToExtns.patch Download (34.6 KB) - added by hopscc 15 years ago.

Change History

Changed 15 years ago by hopscc

  • status changed from new to assigned
  • owner set to hopscc

Heres the candidates identified as 'useful' from Utils

String.{capped,md5hashInHex}
  Move to String

Utils methods -> String extension methods
    countChars
    isCapped
    startsWithLowerLetter (-> startsIsLower)
    startsNonLower        (-> startsIsNonLower)

Utils.join(sep as String, parts*) -> join(parts*)
       join(sep,lastSep, parts*)    -> join(lastSep as String, parts*)
       join( sep as String, parts as vari String) - unused remove

The path adjusting methods should go to (static methods extending) Path class but cannot do that - leave in Utils, docstring and rename to path<*>...
    combinePaths -> pathCombine
    normalizePath-> pathNormalizeLeading
    forceExtension(fileName, extn) -> pathForceExtension(filename, extn)

 getS{B,I,S,O} - make generic version (getKeyValueOrDefault)

Changed 15 years ago by hopscc

the getS{B,I,S,O} family changes to
Utils.dictGetVOD<of T> - ( dictGetValueOrDefault)

Changed 15 years ago by hopscc

Changed 15 years ago by hopscc

  • owner changed from hopscc to chuck

Heres a patch file for the above - relnote, tests inline with the methods.
You'll probably need to regen the Snapshot version to get this building correctly
but I expect you know all about that by now.

Changed 15 years ago by Chuck

  • status changed from assigned to closed
  • resolution set to fixed

Applied.

Note: See TracTickets for help on using tickets.