octave-maintainers
[Top][All Lists]
Advanced

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

Re: whitespace and structure access operator


From: John W. Eaton
Subject: Re: whitespace and structure access operator
Date: Fri, 27 Nov 2015 10:30:36 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0

On 11/26/2015 01:41 AM, Sebastian wrote:
Am 25.11.2015 um 23:50 schrieb John W. Eaton <address@hidden>:

What does Matlab do for things like

  b . x = 1

Does the behavior differ if there is a function called 'b' in the path (I hope 
not, but I have to ask)?

jwe

I have created the following function "b" in my path

function b(varargin)
   varargin
end

The function is called if I do not assign any value
b . x
varargin =
     '.'    'x'

and similarly

b .x
varargin =
     '.x'

However, If I do assign a value a struct is created
b . x = 1
b =
     x: 1

Tested on Matlab 2015b (Mac).

Hmm. OK, I'm not sure how to handle this without looking (arbitrarily far) ahead for the assignment operator. Having the lexer and parser look arbitrarily far ahead to decide how the lexer should convert the input into tokens causes a lot of trouble. Can anyone else see a way to decide what to do here that does not require arbitrary look ahead?

jwe




reply via email to

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