From 103b6cf803271fd43fcfe70bcc93bc029fa796a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Mon, 2 Sep 2013 17:47:11 +0200 Subject: [PATCH] Changed the syntax so that the difference between calling a member or a method is more explicit. If a is a dynDate object: a.format or a.format() are allowed because format is a method. a.freq is allowed but a.freq() returns an error message because freq (same for time) is a member. --- matlab/@dynDate/subsref.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/matlab/@dynDate/subsref.m b/matlab/@dynDate/subsref.m index c70bf12c0..76d445741 100644 --- a/matlab/@dynDate/subsref.m +++ b/matlab/@dynDate/subsref.m @@ -56,6 +56,9 @@ switch S(1).type case 'format' B = format(A); case {'time', 'freq'} + if length(S)>1 && isequal(S(2).type,'()') && isempty(S(2).subs) + error(['dynDate::subsref: ' S(1).subs ' is not a method but a member!']) + end B = builtin('subsref', A, S(1)); otherwise error('dynDate::subsref: Unknown public member of method!')