Cicada scripting constructs
Cicada stakes it reputation on its ability to mix and match programming constructs that are ordinarily completely different things. For example, it doesn't know the difference between a function, a set and a class, because those are all the same object in Cicada.
But -- if one single object can describe x, y and z, then chances are that it can do some strange things in between as well. What follows is a sampling of unusual raw ingredients that went into the language along with some of their surprising (and unintended) consequences.
- named elements in function arguments
  f :: { code, todo = args.op, ... }
  f(3, 5, op := "add")
- commands in a function's arguments
  f(a, print("If you see this, 'a' was passed\n"))
- optional parameters in function calls
  sort(a)
  sort(b; direction = decreasing)
- inheritance (concatenation) of sets
  primes :: { 2, 3, 5, 7 }
  odds :: primes : { 1, 9, remove this[1] }
- inheritance of functions
  loop :: {
     c1 :: int
     code
     for c1 in <1, args[1]> &
         f(c1)     }
  count :: loop : {
     f :: { code, print(c1, " ") }
     code
     print("done!\n")           }
- code substitution
  (gizmo.part[56] << { code, color = "blue", size = { 2, 3, 1 } })()
Last update: November 12, 2017