[OT: MATLAB] Any way to globally make Matlab struct attributes Python-property-like
I.e., I'd, at minimum, like to globally replace get(Handel, 'Property') with object.Property and set(Handel, 'Property', value) with object.Property = value to an arbitrary level of composition. (It's really getting cumbersome having to compound gets and sets all over the place while debugging.) (Sorry for the OT post; I thought I'd get a more sympathetic response here than on the MATLAB lists.) ;) Thanks! DG -- In science it often happens that scientists say, 'You know that's a really good argument; my position is mistaken,' and then they would actually change their minds and you never hear that old view from them again. They really do it. It doesn't happen as often as it should, because scientists are human and change is sometimes painful. But it happens every day. I cannot recall the last time something like that happened in politics or religion. - Carl Sagan, 1987 CSICOP address
On Mon, Sep 13, 2010 at 21:24, David Goldsmith <d.l.goldsmith@gmail.com> wrote:
(Sorry for the OT post; I thought I'd get a more sympathetic response here than on the MATLAB lists.) ;)
I'm sorry, but that's *really* off-topic. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
you have my sympathy, but no hints. :( The only thing I can think of is something like a preprocessor. --Josh On Mon, Sep 13, 2010 at 7:13 PM, Robert Kern <robert.kern@gmail.com> wrote:
On Mon, Sep 13, 2010 at 21:24, David Goldsmith <d.l.goldsmith@gmail.com> wrote:
(Sorry for the OT post; I thought I'd get a more sympathetic response here than on the MATLAB lists.) ;)
I'm sorry, but that's *really* off-topic.
-- Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Mon, Sep 13, 2010 at 11:18 PM, Joshua Holbrook <josh.holbrook@gmail.com> wrote:
you have my sympathy, but no hints. :( The only thing I can think of is something like a preprocessor.
--Josh
On Mon, Sep 13, 2010 at 7:13 PM, Robert Kern <robert.kern@gmail.com> wrote:
On Mon, Sep 13, 2010 at 21:24, David Goldsmith <d.l.goldsmith@gmail.com> wrote:
(Sorry for the OT post; I thought I'd get a more sympathetic response here than on the MATLAB lists.) ;)
I'm sorry, but that's *really* off-topic.
I think it's a question for the python list about what to do after import re It shouldn't take more than a few hours to come up with the right regular expression and sub arguments. Josef
-- Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Mon, Sep 13, 2010 at 7:33 PM, <josef.pktd@gmail.com> wrote:
On Mon, Sep 13, 2010 at 11:18 PM, Joshua Holbrook <josh.holbrook@gmail.com> wrote:
you have my sympathy, but no hints. :( The only thing I can think of is something like a preprocessor.
--Josh
On Mon, Sep 13, 2010 at 7:13 PM, Robert Kern <robert.kern@gmail.com> wrote:
On Mon, Sep 13, 2010 at 21:24, David Goldsmith <d.l.goldsmith@gmail.com> wrote:
(Sorry for the OT post; I thought I'd get a more sympathetic response here than on the MATLAB lists.) ;)
I'm sorry, but that's *really* off-topic.
I think it's a question for the python list about what to do after import re
It shouldn't take more than a few hours to come up with the right regular expression and sub arguments.
Josef
I'd love to see any solution(s) to fixing matlab's awkward OO syntax open-sourced. :D --Josh
-- Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Mon, Sep 13, 2010 at 10:24 PM, David Goldsmith <d.l.goldsmith@gmail.com> wrote:
I.e., I'd, at minimum, like to globally replace
get(Handel, 'Property')
with
object.Property
and
set(Handel, 'Property', value)
with
object.Property = value
to an arbitrary level of composition.
Both structures and objects of both handle and value types work exactly like you're asking for. You're probably talking about "handle graphics" objects (which are just opaque numeric values representing things related to the UI), which do still require the get/set functions. They're just doubles, after all. It should be feasible to write a class that wraps them for ease of use, but that wouldn't be a topic for here. If that intrigues you, try asking about it on StackOverflow.
participants (5)
-
David Goldsmith -
josef.pktd@gmail.com -
Joshua Holbrook -
Ken Watford -
Robert Kern