Mimics
Inactive cells
Active cells
Specs
Inactive cells (details)
invertedOperators = {:":::" => 12, ?: 12, ?: 12, :"::" => 12}
kind = "Message OperatorTable"
operators = {?: 5, :"&&>>" => 12, :"<->" => 12, <: 5, :"|>>" => 12, :"**=" => 13, :"===" => 6, :"->>" => 12, :"&>" => 12, ?: 12, ^>: 12, :"&&>" => 12, :"<=>" => 5, ?>>: 12, />>: 12, :"%=" => 13, @>>: 12, %>: 12, #>>: 12, :"&>>" => 12, :"|>" => 12, ^: 8, :"=~" => 6, **>: 12, :"&" => 7, :"?|" => 11, **>>: 12, and: 13, or: 13, $: 0, :"&&=" => 13, ?: 5, >>: 4, ?: 0, ?>: 12, *>>: 12, ~: 0, :".." => 12, :"->" => 12, >: 5, :">>=" => 13, ^>>: 12, $>: 12, :"<<=" => 13, ?: 5, return: 14, :"==" => 6, /: 2, :"+=" => 13, <>: 5, **: 1, xor: 13, :"!~" => 6, <>>: 5, :"/=" => 13, :"||>" => 12, :"?&" => 10, />: 12, :"..." => 12, :"^=" => 13, :"*=" => 13, :"|" => 9, nor: 13, :"+" => 3, :"-" => 3, :"!>" => 12, :"<=" => 5, :"||=" => 13, nand: 13, :"|=" => 13, :"=>>" => 12, :"&=" => 13, :"!=" => 6, $>>: 12, :"&&" => 10, :"!" => 0, ?: 3, %: 2, ³: 5, ?: 5, :"=>" => 12, #: 0, :"<-" => 14, #>: 12, :"!>>" => 12, import: 14, <<: 4, *>: 12, :"+>" => 12, ~>>: 12, :"||" => 11, ~>: 12, *: 2, :"-=" => 13, ?: 3, :"||>>" => 12, ²: 5, ­: 6, @>: 12, :"+>>" => 12, :">=" => 5, %>>: 12}
precedenceLevelCount = 32
trinaryOperators = {:"^=" => 2, :"=" => 2, :"*=" => 2, :">>=" => 2, :"%=" => 2, :"-=" => 2, :"/=" => 2, :"**=" => 2, :"--" => 1, :"++" => 1, :"<<=" => 2, :"||=" => 2, :"|=" => 2, :"&=" => 2, :"+=" => 2, :"&&=" => 2}
Active cells (details)
withInvertedOperator(...)

temporarily adds a new inverted operator with the specified associativity, and then removes it again. if the operator is already in there, changes the associativity temporarily

macro(
  argCount = call arguments length 
  cond(
    argCount ==(
      3), 
    
    name = call argAt(
        0) 
    assoc = call argAt(
        1) 
    code = call arguments [](
        2) 
    
    if(name mimics?(Text), 
      name = :(name)) 
    let(Message OperatorTable invertedOperators, Message OperatorTable invertedOperators merge(name =>(assoc)), 
      code evaluateOn(call ground, call ground)), 
    error!(Condition Error Invocation NoMatch, message: call message, context: call currentContext)) 
  )
Message OperatorTable withInvertedOperator
  • - should temporarily add a new inverted operator to the table, but then remove it [ show source ]
    Message OperatorTable withInvertedOperator(":-:", 42, 
      Message OperatorTable invertedOperators [](:(":-:")) should ==(42) 
      ) 
    Message OperatorTable invertedOperators [](:(":-:")) should be nil 
    
    
  • - should reassign the associativity of an existing operator [ show source ]
    Message OperatorTable withInvertedOperator("::", 42, 
      Message OperatorTable invertedOperators [](:("::")) should ==(42) 
      ) 
    Message OperatorTable invertedOperators [](:("::")) should ==(12) 
    
    
withOperator(...)

temporarily adds a new operator with the specified associativity, and then removes it again. if the operator is already in there, changes the associativity temporarily

macro(
  argCount = call arguments length 
  cond(
    argCount ==(
      3), 
    
    name = call argAt(
        0) 
    assoc = call argAt(
        1) 
    code = call arguments [](
        2) 
    
    if(name mimics?(Text), 
      name = :(name)) 
    let(Message OperatorTable operators, Message OperatorTable operators merge(name =>(assoc)), 
      code evaluateOn(call ground, call ground)), 
    error!(Condition Error Invocation NoMatch, message: call message, context: call currentContext)) 
  )
Message OperatorTable withOperator
  • - should temporarily add a new operator to the table, but then remove it [ show source ]
    Message OperatorTable withOperator("+++++", 42, 
      Message OperatorTable operators [](:("+++++")) should ==(42) 
      ) 
    Message OperatorTable operators [](:("+++++")) should be nil 
    
    
  • - should reassign the associativity of an existing operator [ show source ]
    Message OperatorTable withOperator("+", 42, 
      Message OperatorTable operators [](:("+")) should ==(42) 
      ) 
    Message OperatorTable operators [](:("+")) should ==(3) 
    
    
withTrinaryOperator(...)

temporarily adds a new trinary operator with the specified associativity, and then removes it again. if the operator is already in there, changes the associativity temporarily

macro(
  argCount = call arguments length 
  cond(
    argCount ==(
      3), 
    
    name = call argAt(
        0) 
    assoc = call argAt(
        1) 
    code = call arguments [](
        2) 
    
    if(name mimics?(Text), 
      name = :(name)) 
    let(Message OperatorTable trinaryOperators, Message OperatorTable trinaryOperators merge(name =>(assoc)), 
      code evaluateOn(call ground, call ground)), 
    error!(Condition Error Invocation NoMatch, message: call message, context: call currentContext)) 
  )
Message OperatorTable withTrinaryOperator
  • - should temporarily add a new trinary operator to the table, but then remove it [ show source ]
    Message OperatorTable withTrinaryOperator("+++++", 42, 
      Message OperatorTable trinaryOperators [](:("+++++")) should ==(42) 
      ) 
    Message OperatorTable trinaryOperators [](:("+++++")) should be nil 
    
    
  • - should reassign the associativity of an existing operator [ show source ]
    Message OperatorTable withTrinaryOperator("+=", 42, 
      Message OperatorTable trinaryOperators [](:("+=")) should ==(42) 
      ) 
    Message OperatorTable trinaryOperators [](:("+=")) should ==(2)