* 
[https://en.wikipedia.org/wiki/Frame_(artificial_intelligence](https://en.wikipedia.org/wiki/Frame_\(artificial_intelligence))
  * 
[https://web.media.mit.edu/~minsky/papers/Frames/frames.html](https://web.media.mit.edu/~minsky/papers/Frames/frames.html)



What is the right code for implementing the class hierarchy of frames?

I look at the base Frame class as a universal data (and code) type, can hold 
both single scalar values, and nested elements, all of them can be attributed 
by arbitrary slots. Making oriented graphs of such nodes with types inherited 
from the base Frame, we can model any type of data. Some subset of frames can 
be treated as executable so we can implement a homoiconic computing system.
    
    
    type
        Frame = ref object of RootObj
            typ: string
            val: string
            slot: Table[string,ptr Frame]
            nest: seq[ptr Frame]
    
    let nst = Frame(val:"nested")
    let hello = Frame(typ:"hello",val:"world",nest:@[nst])
    
    echo hello[]
    
    
    Run

Reply via email to