If I have the following code: 
    
    
    import jsffi
    
    type
      A = ref object of JsObject
    
    var a = A()
    a["name"] = cstring"Joe"
    
    
    Run

I get the following:

On the other hand, the following code: 
    
    
    import jsffi
    
    type
      B = ref object of JsRoot
        name:cstring
        surname:cstring
        male:bool
    
    proc newB(name:string = ""):B =
      new result
      result.name = name.cstring
    
    var b = B(name:"Joe")
    
    
    Run

produce the following:

I was wondering if we could instruct Nim only to export the symbols for which 
there is an explicit assignment.

The preferred style is the second case. It gives you a clear view of the 
properties available for that type. But the presence of `surname = null` and 
`male = false` might create problems in some cases.

Reply via email to