| kind | = | "Message" |
A Message is the basic code unit in Ioke.
- ->(nextMessage)
- <<(...)
- ==(other)
- ===(other)
- >>(newArgument)
- appendArgument(newArgument)
- arguments()
- arguments=(newArguments)
- asStackTraceText()
- code()
- deepCopy()
- doText(code)
- each([indexOrArgOrCode] nil, [argOrCode] nil, [code] nil)
- evalArgAt(argumentIndex, context)
- evaluateOn(ground, receiver ground, +arguments)
- filename()
- formattedCode()
- from(...)
- fromText(code)
- keyword?()
- last()
- line()
- name()
- name=(newName)
- next()
- next=(newNext)
- position()
- prev()
- prev=(newPrev)
- rewrite(+patterns)
- rewrite:recursively(+patterns)
- sendTo(newReceiver, context nil)
- seq()
- symbol?()
- terminator?()
- walk([argOrCode] nil, [code] nil)
- wrap(value)
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
[ show source ]
method(other,
cell(:other) kind ==("Message") &&(
@ name ==(other name)) &&(
@ arguments ==(other arguments)) &&(
@ next ==(other next)))
nil
[ show source ]
method(other,
if(self same?(
()),
Reflector other:mimics?(cell(:other),
()),
bind(rescue(Condition Error, fn(c, false)),
self ==(
other))))
evaluates the argument and adds it to the beginning of the argument list of this message. it then returns the receiving message.
evaluates the argument and adds it to the argument list of this message. it then returns the receiving message.
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.
Takes one evaluated argument and executes the contents of that text in the current context and returns the result of that.
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.
takes one index, and a context and returns the evaluated argument at that index.
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
returns the message chain for the argument given
[ show source ]
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))
)
Takes one evaluated argument and returns the message resulting from parsing and operator shuffling the resulting message.
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.
[ show source ]
method(+patterns,
patterns inject(self,
current,
pattern,
Rewriter rewrite(current, pattern))
)
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.
[ show source ]
method(+patterns,
patterns inject(self,
current,
pattern,
Rewriter rewrite(current, pattern, true))
)
Takes one evaluated argument and sends this message to that argument
nil
[ show source ]
method(
s = Sequence mimic do(
next = method(
obj = @ currentMessage
@ currentMessage = @ currentMessage next
obj
)
next? = method(!(@ currentMessage nil?))
)
s currentMessage = @
s
)
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.