Sand: Objects

From AJS.COM

Jump to: navigation, search

The Object System in the Sand language. Much more to be done here in the future. For right now, this is a scratch area.

class Object {

  # $object.str() is a shortcut for str.new($object)
  method str($obj;) -> str {...}
  method int($obj;) -> int {...}
  method num($obj;) -> num {...}
  method bool($obj;) -> bool {...}

  method _invoke($obj; $parameters) -> * {...} # $o(...)
  method _index($obj; $index) {...} # $o[...]
  method _dot($obj; $rhs_expr) -> * {...} # $o1.$o2
  method _pre_increment($obj;) {...} # ++$o
  method _post_increment($obj;) {...} # $o++
  method _pre_decrement($obj;) {...} # --$o
  method _post_decrement($obj;) {...} # $o--
  method _pow($obj; $exponenet) {...} # $o1 ** $o2
  method _not($obj;) -> bool {...} # !$o
  method _type($obj;) -> type {...} # ::$o
  method _subref($obj;) -> code {...} # &$o
  method _explode($obj;) -> * {...} # *$o
  method _numify($obj;) {...} # +$o
  method _negative($obj;) {...} # -$o
  method _match($obj; $target) -> * {...} # $o1 ~~ $o2
  method _not_match($obj; $target) -> * {...} # $o1 !~ $o2
  method _mult($obj; $target) 
  8. *, /, @
  9. +, -
 10. <<, >>
 11. <, >, <=, >=, lt, gt, le, ge
 12. ==, !=, <=>, eq, ne, cmp
 13. &
 14. | ^
 15. &&
 16. ||
 17. .., ^.., ..^, ^..^
 18. ??!! trinary
 19. =, +=, -=, etc.
 20. =>
 21. ,
 22. not prefix
 23. and
 24. or, xor
Personal tools