Skip to main content

⍎ — Execute / Execute in

Function. Keys: Alt-o b. Hanzi: 行. Ranks: 1 monadic, ∞ ∞ dyadic

⍎Y evaluates the string Y in the current lexical scope.

⍎"2+3"             ⍝ 5
x←7 ◇ ⍎"x+1"       ⍝ 8

On a character matrix, ⍎ evaluates each row; on an array of strings, each string.

⍎["1+1"◇"2×3"]    ⍝ 2 6
⍎"1+1" "2×3"        ⍝ 2 6

Assignments and explicit output in ⍎Y take effect in the current scope.

T⍎Y evaluates Y with each key on the first axis of T as a name, as Dot’s T.(expr) does. Names that aren’t keys resolve in the current scope. Assignments stay inside the evaluation, and leave T unchanged.

T←["a":1 "b":2] ◇ T⍎"a+b"      ⍝ 3
T←["a":1] ◇ T⍎"a←5 ◇ a+1"      ⍝ 6

Inverse

⍎⁻Y writes Y as BPL source that ⍎ reads back, as •literal⁻ does.

⍎⁻1 2.5   ⍝ "[1 2.5]ₚ"

Errors

  • DOMAIN: T has no keys on its first axis