Opened 9 years ago

Closed 9 years ago

#645 closed proposed feature (not a bug)

newstruct: names for the compontents only allow characters (typos)

Reported by: gorzel Owned by: somebody
Priority: minor Milestone: 4-1-0 and higher
Component: doc Version: 4-0-0
Keywords: newstruct Cc:

Description

For the names of variables are allowed the characters a..z, A..Z, followed by 0,1,...,9 as well as ' and _

intvec w1,w2;
int C_1;
string S';

For newstructs, the choice of names is more (too) restrictive:

> newstruct("nt","intvec w1, intvec w2");
   ? unknown character in newstruct:>>1, intvec w2<<
   ? error occurred in or before STDIN line 7: `newstruct("nt","intvec w1, intvec w2");`
   ? wrong type declaration. type 'help intvec;'

Change History (4)

comment:1 Changed 9 years ago by gorzel

Summary: newstruct: no names for the compontents only allow characters (nnewstruct: names for the compontents only allow characters

comment:2 Changed 9 years ago by hannes

Resolution: not a bug
Status: newclosed

Member names are not variable names. Member names are restricted to alphanumeric characters, starting with a letter.

comment:3 in reply to:  2 Changed 9 years ago by gorzel

Component: singular-kerneldoc
Resolution: not a bug
Status: closedreopened
Summary: newstruct: names for the compontents only allow charactersnewstruct: names for the compontents only allow characters (typos)
Type: bugproposed feature

Replying to hannes:

Member names are not variable names. Member names are restricted to alphanumeric characters, starting with a letter.

I don't understand. Are the names of newstructs now "member names"? Then w1 and w2 will fit.

If this should not be allowed, then state it in the manual.

4.22.1 Definition of a user defined type 
defines a new type with elemnts given by the last argmuent (string_expression).

At least two typos may be corrected here: elements, arguments

comment:4 Changed 9 years ago by hannes

Resolution: not a bug
Status: reopenedclosed

typo fixed. And the example works (with w1, w2) -> not a bug. With w@ it would not work, but this is also documented.

Note: See TracTickets for help on using tickets.