help-octave
[Top][All Lists]
Advanced

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

Re: equivalent for C-style init: structname varname[] = {...} ?


From: Dimitri Maziuk
Subject: Re: equivalent for C-style init: structname varname[] = {...} ?
Date: Mon, 19 Nov 2012 20:31:13 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.10) Gecko/20121030 Thunderbird/10.0.10

On 11/19/2012 07:26 PM, Sergei Steshenko wrote:

> octave:3> foo."foo bar" = 1
> parse error:
> 
>   syntax error
> 
>>>> foo."foo bar" = 1
>                 ^
> 
> octave:3>   
> ",
> 
> 2)
> "
> octave:3> foo = struct
> foo =
> 
>   scalar structure containing the fields:
> 
> 
> octave:4> foo.("foo bar") = 1
> error: invalid structure field name `foo bar'
> octave:4>   
> "
> 
> should work exactly because "foo bar" is a valid hash key.
> 
> 
> And, as shown before, the key is accepted through 'setfield':

I suspect it's because nobody does it. There may be some reason why
lexer won't easily tokenize foo."foo bar" into foo, dot, and "foo bar",
but I can't think of one right now.

-- 
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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