help-octave
[Top][All Lists]
Advanced

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

Re: interesting results from char


From: Carlo De Falco
Subject: Re: interesting results from char
Date: Wed, 21 Jun 2017 15:34:12 +0000

> On 21 Jun 2017, at 17:22, Doug Stewart <address@hidden> wrote:
>> On Wed, Jun 21, 2017 at 11:14 AM, Carlo De Falco <address@hidden> wrote:
>> 
>> I think this is related to the "command form" of Octave functions.
>> The interpreter parses
>> 
>>  myfunction abcdef
>> 
>> as if you had typed
>> 
>>  myfunction ("abcdef")
>> 
>> therefore
>> 
>>  char x=[ 0xbb,0x36]
>> 
>> is treated as
>> 
>>  char ("x=[ 0xbb,0x36]")
>> 
>> c.
>> 
>> 
> 
> OK but why cant I do
> 
> q = char x = [ 0xbb,0x36]

IIUC that is because of the "=" sign which leads the interpreter to try and 
parse that line as an assignment rather than a command.
For example consider the following:

>> disp 0
0
>> disp "0"
0
>> disp 0=
0=
>> disp "0="
0=
>> disp =0
disp = 0
>> disp
disp = 0
>> 

c.






reply via email to

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