A lexical block allows you to delay a computation in a specific lexical context. See DefaultMethod#fn for detailed documentation.

Mimics
Inactive cells
Active cells
Specs
Inactive cells (details)
kind = "LexicalBlock"
Active cells (details)
&(other)

nil

method(other, 
  outsideSelf = self 
  if(cell?(:activatable) &&(activatable), 
    fnx(arg, 
      res1 = cell(:outsideSelf) call(arg) 
      res2 = cell(:other) call(arg) 
      res1 &&(res2)), 
    fn(arg, 
      res1 = cell(:outsideSelf) call(arg) 
      res2 = cell(:other) call(arg) 
      res1 &&(res2))))
->(other)

nil

method(other, 
  outsideSelf = self 
  if(cell?(:activatable) &&(activatable), 
    fnx(arg, cell(:other) call(cell(:outsideSelf) call(arg))), 
    fn(arg, cell(:other) call(cell(:outsideSelf) call(arg)))))
<-(other)

nil

method(other, 
  outsideSelf = self 
  if(cell?(:activatable) &&(activatable), 
    fnx(arg, cell(:outsideSelf) call(cell(:other) call(arg))), 
    fn(arg, cell(:outsideSelf) call(cell(:other) call(arg)))))
===(other)

nil

method(other, 
  if(self same?(
      #<LexicalBlock:5D15126E>), 
    Reflector other:mimics?(cell(:other), 
      #<LexicalBlock:5D15126E>), 
    bind(rescue(Condition Error, fn(c, false)), 
      self call(
        other))))
argumentNames()

returns a list of the argument names the positional arguments this block takes

argumentsCode()

returns the code for the argument definition

arity()

nil

method(
  Arity fromArgumentsCode(argumentsCode))
call(+[arguments])

invokes the block with the arguments provided, returning the result of the last expression in the block

code()

returns the full code of this lexical block, as a Text

complement()

nil

method(
  outsideSelf = self 
  if(cell?(:activatable) &&(activatable), 
    fnx(arg, !(cell(:outsideSelf) call(arg))), 
    fn(arg, !(cell(:outsideSelf) call(arg)))))
createFrom(messageList, lexicalContext)

takes two evaluated arguments, where this first one is a list of messages which will be used as the arguments and the code, and the second is the context where this lexical scope should be created in

formattedCode()

returns idiomatically formatted code for this lexical block

inspect()

Returns a text inspection of the object

iterate(+args)

Returns an infinite sequence that will in turn yield args, self(args), self(self(args)), etc

method(+args, 
  Sequence Iterate with(currentValue: args, code: self) 
  )
java:coerceCode(javaType, abstractNames)

nil

method(javaType, abstractNames, 
  proxy = integrate(javaType) mimic 
  outerSelf = self 
  abstractNames each(name, 
    proxy cell(name) = fnx(+(rest), +:(krest), cell(:outerSelf) call(*(rest), *(krest))) 
    ) 
  proxy new 
  )
keywords()

returns a list of the keywords this block takes

message()

returns the message chain for this block

notice()

Returns a brief text inspection of the object

|(other)

nil

method(other, 
  outsideSelf = self 
  if(cell?(:activatable) &&(activatable), 
    fnx(arg, 
      res1 = cell(:outsideSelf) call(arg) 
      res2 = cell(:other) call(arg) 
      res1 ||(res2)), 
    fn(arg, 
      res1 = cell(:outsideSelf) call(arg) 
      res2 = cell(:other) call(arg) 
      res1 ||(res2))))
(other)

nil

method(other, 
  outsideSelf = self 
  if(cell?(:activatable) &&(activatable), 
    fnx(arg, cell(:outsideSelf) call(cell(:other) call(arg))), 
    fn(arg, cell(:outsideSelf) call(cell(:other) call(arg)))))