A Message is the basic code unit in Ioke.

Mimics
Inactive cells
Active cells
Specs
Inactive cells (details)
kind = "Message"
Active cells (details)
->(nextMessage)

evaluates the argument and makes it the new next pointer of the receiver. it also modifies the argument so its prev pointer points back to this message. if the argument is nil, the next pointer will be erased. it then returns the receiving message.

<<(...)

nil

==(other)

nil

method(other, 
  cell(:other) kind ==("Message") &&(
    @ name ==(other name)) &&(
    @ arguments ==(other arguments)) &&(
    @ next ==(other next)))
===(other)

nil

method(other, 
  if(self same?(
      ()), 
    Reflector other:mimics?(cell(:other), 
      ()), 
    bind(rescue(Condition Error, fn(c, false)), 
      self ==(
        other))))
>>(newArgument)

evaluates the argument and adds it to the beginning of the argument list of this message. it then returns the receiving message.

appendArgument(newArgument)

evaluates the argument and adds it to the argument list of this message. it then returns the receiving message.

arguments()

Returns the unevaluated arguments for this message

arguments=(newArguments)

sets the arguments for this message. if given nil the arguments list will be creared, otherwise the list given as arguments will be used. it then returns the receiving message.

asStackTraceText()

returns a string that describes this message as a stack trace elemtn

code()

Returns a code representation of the object

deepCopy()

returns a deep clone of this message chain, starting at the current point.

doText(code)

Takes one evaluated argument and executes the contents of that text in the current context and returns the result of that.

each([indexOrArgOrCode] nil, [argOrCode] nil, [code] nil)

takes either one or two or three arguments. if one argument is given, it should be a message chain that will be sent to each message in the chain. the result will be thrown away. if two arguments are given, the first is an unevaluated name that will be set to each of the messages in the chain in succession, and then the second argument will be evaluated in a scope with that argument in it. if three arguments is given, the first one is an unevaluated name that will be set to the index of each message, and the other two arguments are the name of the argument for the value, and the actual code. the code will evaluate in a lexical context, and if the argument name is available outside the context, it will be shadowed. the method will return the original message.

evalArgAt(argumentIndex, context)

takes one index, and a context and returns the evaluated argument at that index.

evaluateOn(ground, receiver ground, +arguments)

Takes one or more evaluated arguments and sends this message chain to where the first argument is ground, and if there are more arguments, the second is the receiver, and the rest will be the arguments

filename()

returns the file name where this message is written

formattedCode()

Returns a formatted code representation of the object

from(...)

returns the message chain for the argument given

macro(
  argCount = call arguments length 
  cond(
    argCount ==(
      1), 
    
    code = call arguments [](
        0) 
    
    code deepCopy, 
    error!(Condition Error Invocation NoMatch, message: call message, context: call currentContext)) 
  )
fromText(code)

Takes one evaluated argument and returns the message resulting from parsing and operator shuffling the resulting message.

keyword?()

returns true if this message is a keyword parameter or not

last()

returns the last message in the chain

line()

returns the line where this message is written

name()

returns the name of this message

name=(newName)

sets the name of the message and then returns that name

next()

returns the next message in the chain, or nil

next=(newNext)

sets the next pointer of the message and then returns that pointer

position()

returns the position on the line where this message is written

prev()

returns the previous message in the chain, or nil

prev=(newPrev)

sets the prev pointer of the message and then returns that pointer

rewrite(+patterns)

Takes zero or more pairs of message chains, that describe how rewriting of the current message chain should happen. The message patterns can use symbols to match variable pieces of the pattern.

method(+patterns, 
  patterns inject(self, 
    current, 
    pattern, 
    Rewriter rewrite(current, pattern)) 
  )
rewrite:recursively(+patterns)

Takes zero or more pairs of message chains, that describe how rewriting of the current message chain should happen. The message patterns can use symbols to match variable pieces of the pattern.

method(+patterns, 
  patterns inject(self, 
    current, 
    pattern, 
    Rewriter rewrite(current, pattern, true)) 
  )
sendTo(newReceiver, context nil)

Takes one evaluated argument and sends this message to that argument

seq()

nil

method(
  s = Sequence mimic do(
      next = method(
          obj = @ currentMessage 
          @ currentMessage = @ currentMessage next 
          obj 
          ) 
      next? = method(!(@ currentMessage nil?)) 
      ) 
  s currentMessage = @ 
  s 
  )
symbol?()

returns true if this message is a symbol message or not

terminator?()

returns true when this message is a terminator, otherwise false

walk([argOrCode] nil, [code] nil)

takes either one or two arguments. if one argument is given, it should be a message chain that will be sent to each message in the chain, recursively. the result will be thrown away. if two arguments are given, the first is an unevaluated name that will be set to each of the messages in the chain in succession, and then the second argument will be evaluated in a scope with that argument in it. the code will evaluate in a lexical context, and if the argument name is available outside the context, it will be shadowed. the method will return the original message.

wrap(value)

Takes one evaluated argument and returns a message that wraps the value of that argument.