/TODO

http://github.com/baryluk/cords · #! · 82 lines · 74 code · 8 blank · 0 comment · 0 complexity · b1c1624240c6bdfe9f1c2947573456e6 MD5 · raw file

  1. Dodatkowe metody:
  2. Templates like this:
  3. cord title = ...;
  4. cord author = ...;
  5. cord article = ...;
  6. cord X = template(r"<html>
  7. <head><title>{title}</title></head>
  8. <body>
  9. <h1>{header}</h1>
  10. By {author}
  11. <p>{article}</p>
  12. </body>
  13. </html>");
  14. // - it will just merge constant nodes, and create call
  15. // to the concat of multiple cords
  16. // - we should use templates similar to other programing templates
  17. // - template should be static string or static file content (using mixin)
  18. // - both static and dynamic templates should be possible
  19. // - we can also support encoding of the fly (like changing characters into HTML entities)
  20. // - one can also support expression templates, which will simplify switching, but will not be template
  21. From Python:
  22. - cord c.py.swapcase()
  23. - cord[] c.py.splitlines(bool keepends = false)
  24. - cord[] c.py.split(uint maxsplit = -1) // split on whitespace
  25. - cord[] c.py.split(cord|string sep, uint maxsplit = -1)
  26. - cord[] c.py.rsplit(uint maxsplit = -1) // split on whitespace
  27. - cord[] c.py.rsplit(cord|string sep, uint maxsplit = -1)
  28. - [head,sep,tail] = cord[3] c.py.partition(cord|string sep)
  29. - [tail,sep,head] = cord[3] c.py.rpartition(cord|string sep)
  30. - cord c.py.center(uint width, char fillchar = ' ')
  31. - cord c.py.ljust(uint width, char fillchar = ' ')
  32. - cord c.py.rjust(uint width, char fillchar = ' ')
  33. - uint c.py.count(cord|string sub)
  34. - uint c.py.count(cord|string sub, uint start = 0, uint end = -1) // not really needed, as slicing is cheap
  35. - cord c.py.lower()
  36. - cord c.py.upper()
  37. - cord c.py.title()
  38. - cord c.py.islower()
  39. - cord c.py.isupper()
  40. - bool c.py.istitle()
  41. - bool c.py.isdigit()
  42. - bool c.py.isalpha()
  43. - bool c.py.isalnum()
  44. - bool c.py.isspace()
  45. - cord c.py.capitalize()
  46. - bool c.py.starswith(cord|string prefix, uint start = 0, uint end = -1)
  47. - bool c.py.endswith(cord|string prefix, uint start = 0, uint end = -1)
  48. - cord c.py.lstrip(string chars = " \t")
  49. - cord c.py.rstrip(string chars = " \t")
  50. - cord c.py.strip(string chars = " \t")
  51. - cord c.py.expandtabs(uint tabsize = 8)
  52. - cord c.py.zfill(uint width)
  53. - int c.py.find(cord|string sub, uint start = 0, uint end = -1) // in python, returns -1 on failure.
  54. - int c.py.rfind(cord|string sub, uint start = 0, uint end = -1)
  55. - int c.py.index(cord|string sub, uint start = 0, uint end = -1) // same as find but throws exception on failure
  56. - int c.py.rindex(cord|string sub, uint start = 0, uint end = -1)
  57. - cord c.py.decode(string encoding, bool errors)
  58. - cord c.py.encode(string encoding, bool errors)
  59. - cord c.py.join(cord[] sequenced) // uses c as string in the middle
  60. - cord c.py.replace(cord|string old, cord|string new, uint count = -1)
  61. - cord c.py.translate(char[256] table, bool[char] deletchards = null)
  62. From Ruby:
  63. % * + << <=> == =~ [] []= block_scanf capitalize capitalize!
  64. casecmp center chomp chomp! chop chop chop! chop! concat count
  65. crypt delete delete delete! delete! downcase downcase! dump each
  66. each_byte each_char each_line empty? end_regexp eql? gsub gsub!
  67. hash hex include? index initialize_copy insert inspect intern
  68. iseuc issjis isutf8 jcount jlength jsize kconv length ljust
  69. lstrip lstrip! match mbchar? new next next! oct quote
  70. replace reverse reverse! rindex rjust rstrip rstrip! scan
  71. scanf size slice slice! split squeeze squeeze squeeze! squeeze!
  72. strip strip! sub sub! succ succ succ! succ! sum swapcase swapcase!
  73. to_f to_i to_s to_str to_sym toeuc tojis tosjis toutf16 toutf8
  74. tr tr tr! tr! tr_s tr_s tr_s! tr_s! unpack upcase upcase! upto