eoc icon indicating copy to clipboard operation
eoc copied to clipboard

`inspect` command, new feature

Open yegor256 opened this issue 6 months ago • 11 comments
trafficstars

When I start eoc inspect it should load all .class files into the VM and then give me an interactive interface, for example:

$ eoc inspect
Loaded 56 objects
Ready to traverse the Universe
@ Φ ⟦org⟧
_

Current position in the tree is printed with the @ prefix.

Then, I type in:

@ Φ ⟦org⟧
.org

@ Φ.org ⟦bytes⟧
.eolang

@ Φ.org ⟦number bytes go malloc ... +15⟧
.bytes

@ Φ.org.bytes ⟦data and or xor div plus minus ... +7⟧
ls
.data ↦ ∅
.and ↦ ⟦ λ, b ⟧
.or ↦ ⟦ λ, b ⟧
...

@ Φ.org.bytes ⟦data and or xor div plus minus ... +7⟧
cp Φ.bar
Copied @ Φ.org.bytes to @ Φ.bar

@ Φ.bar ⟦data and or xor div plus minus ... +7⟧
ls
.data ↦ ∅
.and ↦ ⟦ λ b ⟧
.or ↦ ⟦ λ b ⟧

@ Φ.bar ⟦data and or xor div plus minus ... +7⟧
.data

@ Φ.bar.data ∅
form

@ Φ.bar.data ⟦⟧
put 04-05-96-92-2F-E3

@ Φ.bar.data ⟦Δ⟧
run
04-05-96-92-2F-E3

There are four possible commands:

  • .. - jump to the upper object in the tree
  • add foo (or +foo) - add new attribute foo to the current object
  • rm foo (or -foo) - delete foo attribute from the current object
  • go foo (or .foo) - jump to the object attached to the foo attribute
  • to Φ.bar - attach Φ.bar to the current object
  • form - create an empty formation and attach to the current object
  • put 75-E4-3F - attach data to the Δ asset of the current object
  • cp Φ.bar - make a copy of the current object and attach it to Φ.bar
  • dd foo Φ.bar - dispatch foo and attach the result to Φ.bar
  • ls - print all attributes of the current object
  • dataize (or run) - dataize current objects and print result

yegor256 avatar Apr 23 '25 07:04 yegor256