octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #30419] set/get vs setappdata/getappdata for c


From: Ben Abbott
Subject: [Octave-bug-tracker] [bug #30419] set/get vs setappdata/getappdata for custom properties
Date: Tue, 13 Jul 2010 00:07:58 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4

Follow-up Comment #2, bug #30419 (project octave):

The only conflict I see with having setappdata/getappdata work with the same
properties as set/get is with property name conflicts.

Might an "appdata" property, be added to each object, with that property
acting like a structure whose fieldnames correspond to the appdata properties?
(forgive me if my understanding of  the c++ side sounds garbled, the only
c/c++ programming I've done is mimicry)

Another possibility would be to do as you suggest, but have set/getappdata
pre/postpend "__" to each property name.

function setappdata (h, name, val)
  addproperty (strcat ("__", name, "__"), h, "any", val);
endfunction

function getappdata (h, name, val)
  get (h, strcat ("__", name, "__"));
endfunction

Regarding relying on the undocumented mechanism Matlab uses, I don't see any
reason to copy it. I only mentioned it since is a recent example I found when
poking around while on vacation ... I later discovered you'd submitted a
changeset.









    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?30419>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]