title: Objectifying Array based on Term
body: <p>I have this for array :</p>
  <pre><code>ary1d_new(Size,Sym,ArySym,Ary) :- 
      functor(Ary,ArySym,Size), 
      forall(arg(X,Ary,_), nb_setarg(X,Ary,Sym)).
  ary1d_get(Pos,Ary,Val) :- arg(Pos,Ary,Val).
  ary1d_set(Pos,Ary,Val) :- nb_setarg(Pos,Ary,Val).
  </code></pre>
  <p>trying to turn it to logtalk object,  but is not happening for me</p>
  <pre><code>:- object(array, instantiates(array)).
  
      :- initialization(init).
      :- private(init/0).
  
      :- public(ary/1).
      :- dynamic(ary/1).
      ary(_).
  
      :- public([new1d/2, set1d/2, get1d/2]).
  
      new1d(Size,Sym) :- 
          functor(Ary,ary,Size), 
          forall(arg(X,Ary,_), nb_setarg(X,Ary,Sym)),writeln(Ary).
      get1d(Pos,Val) :- arg(Pos,::ary,Val).
      set1d(Pos,Val) :- nb_setarg(Pos,::ary,Val).
  
      init :- true.
  
  :- end_object.
  
  :- object(g, instantiates(array)).
  :- end_object.
  
  
  ?- g::new1d(5,0).
  ary(0,0,0,0,0)
  true.
  
  ?- g::set1d(2,7).
  false.
  
  ?- g::get1d(2,D).
  false.
  </code></pre>
  <p>what is the correct way ? functor vs ::ary is confusing me</p>
  <hr />
  <p>came up with this for Obj attributes out of the array storage :</p>
  <pre><code>:- public(test/2).
  test(Size, Value) :- test(Size,Value,i(Size)).
  :- public(test/3).
  test(Size, Value, Info) :-
      functor(A, s, Size),
      forall(
          arg(Arg, A, _),
          nb_setarg(Arg, A, Value)
      ),
      _Array_ = a(Info,A).
  
  ?- ary(A)::test(5,0).
  A = a(i(5), s(0, 0, 0, 0, 0)).
  </code></pre>