Gidsss / UwUIDE

A compiler made to be cute uwu >~<
6 stars 0 forks source link

All types should have array methods, and an `isArray()` method #269

Closed am-cid closed 4 months ago

am-cid commented 4 months ago
  1. isArray() returns true for all array types, false for everything else

  2. len-chan()

    • always returns 0 for Int, Float, and Bool
      a-chan = 100~ a.len()~ >.< 0
      a-kun = 10.0~ a.len()~ >.< 0
      a-sama = fax~ a.len()~ >.< 0
  3. reverse-san()

    • Int, Float: converts to string, reverses the string, then converts back to Int/Float
    • Bool: turns fax to cap, and vice versa
    • String: reverses the underlying string
      a-chan = 100~ a.reverse()~ >.< 1
      a-kun = 10.0~ a.reverse()~ >.< 0.01
      a-sama = fax~ a.reverse()~ >.< cap
  4. append-san()

    • does nothing for Int, Float, Bool
    • String: takes in String; concats the given item to the underlying string
  5. has-sama()

    • takes in any number type val for Int, Float, and Bool
    • converts to string then checks if passed string is in the converted string
      a-chan = 100~ a.has(10)~ >.< fax
      a-kun = 10.0~ a.has(10)~ >.< fax
      a-sama = fax~ a.has(10)~ >.< cap
  6. clear-san()

    • Int, Float: turns val to 0
    • Bool: turns val to cap
    • String: turns underlying string to an empty string
  7. count-chan()

    • takes in any number type val for Int, Float, and Bool
    • converts to string then counts passed string in the converted string
      a-chan = 100~ a.count(0)~ >.< 2
      a-kun = 10.0~ a.has(1)~ >.< 1
      a-sama = fax~ a.has(2)~ >.< 0
  8. extend-san()

    • does nothing for Int, Float, Bool
    • String: takes in String; concats the given item to the underlying string
  9. index-chan()

    • takes in any number type val for Int, Float, and Bool
    • converts to string then counts passed string in the converted string
      a-chan = 100~ a.count(0)~ >.< 2
      a-kun = 10.0~ a.has(1)~ >.< 1
      a-sama = fax~ a.has(2)~ >.< 0
  10. pop-san()

    • does nothing for Int, Float, Bool
    • String: takes in String; removes the last character from the underlying string
  11. prepend-san()

    • does nothing for Int, Float, Bool
    • String: takes in String; prepends the given item to the underlying string
  12. prextend-san()

    • does nothing for Int, Float, Bool
    • String: takes in String; prepends the given item to the underlying string
am-cid commented 4 months ago

going to do another solution, closing this