Re: Usage of \[oxdb] (was Re: String Literals, take 2)

2002-12-06 Thread James Mastros
On 12/05/2002 12:18 PM, Michael Lazzaro wrote: On Thursday, December 5, 2002, at 02:11 AM, James Mastros wrote: On 12/04/2002 3:21 PM, Larry Wall wrote: \x and \o are then just shortcuts. Can we please also have \0 as a shortcut for \0x0? \0 in addition to \x, meaning the same thing? I

Re: Usage of \[oxdb] (was Re: String Literals, take 2)

2002-12-05 Thread James Mastros
On 12/04/2002 3:21 PM, Larry Wall wrote: On Wed, Dec 04, 2002 at 11:38:35AM -0800, Michael Lazzaro wrote: : We still need to verify whether we can have, in qq strings: : :\033 - octal (p5; deprecated but allowed in p6?) I think it's disallowed. Thank the many gods ... or One True

Re: String Literals, take 2

2002-12-05 Thread Brad Hughes
Larry Wall wrote: On Mon, Dec 02, 2002 at 04:42:52PM -0500, Joseph F. Ryan wrote: [...] : As far as I know, *nothing* is special in a single quoted heredoc. Here docs is where you *most* want the \qq[] ability. It is assumed that the sequence \qq[ will not occur by accident very often in the

Re: Usage of \[oxdb] (was Re: String Literals, take 2)

2002-12-05 Thread Michael Lazzaro
On Thursday, December 5, 2002, at 02:11 AM, James Mastros wrote: On 12/04/2002 3:21 PM, Larry Wall wrote: \x and \o are then just shortcuts. Can we please also have \0 as a shortcut for \0x0? \0 in addition to \x, meaning the same thing? I think that would get us back to where we were

Re: Usage of \[oxdb] (was Re: String Literals, take 2)

2002-12-05 Thread Larry Wall
On Thu, Dec 05, 2002 at 09:18:21AM -0800, Michael Lazzaro wrote: : : On Thursday, December 5, 2002, at 02:11 AM, James Mastros wrote: : : On 12/04/2002 3:21 PM, Larry Wall wrote: : \x and \o are then just shortcuts. : Can we please also have \0 as a shortcut for \0x0? : : \0 in addition to \x,

Re: String Literals, take 2

2002-12-04 Thread James Mastros
On 12/03/2002 2:27 PM, Michael Lazzaro wrote: I think we've been gravitating to a language reference, geared primarily towards intermediate/advanced users. Something much more rigorous than beginners would be comfortable with (since it defines things in much greater detail than beginners

Re: String Literals, take 2

2002-12-04 Thread Luke Palmer
Date: Tue, 03 Dec 2002 18:39:27 -0500 From: James Mastros [EMAIL PROTECTED] Huh? In that case, somebody should tell Angel Faus; Numeric literals, take 3 says 0c777, and nobody disented. IIRC, in fact, nobody's descented to 0c777 since it was first suggested. Well, except Larry. I

Re: String Literals, take 2

2002-12-04 Thread Larry Wall
It's o, not c. Larry

Usage of \[oxdb] (was Re: String Literals, take 2)

2002-12-04 Thread Michael Lazzaro
We still need to verify whether we can have, in qq strings: \033 - octal (p5; deprecated but allowed in p6?) \o33 - octal (p5) \x1b - hex (p5) \d123 - decimal (?) \b1001- binary (?) and if so, if these are allowed too:

Re: Usage of \[oxdb] (was Re: String Literals, take 2)

2002-12-04 Thread Dave Whipp
Michael Lazzaro [EMAIL PROTECTED] wrote Note that \b conflicts with backspace. I'd rather keep backspace than binary, personally; I have yet to feel the need to call out a char in binary. :-) Or we can make it dependent on the trailing digits, or require the brackets, or require backspace

Re: Usage of \[oxdb] (was Re: String Literals, take 2)

2002-12-04 Thread Larry Wall
On Wed, Dec 04, 2002 at 11:38:35AM -0800, Michael Lazzaro wrote: : We still need to verify whether we can have, in qq strings: : :\033 - octal (p5; deprecated but allowed in p6?) I think it's disallowed. :\o33 - octal (p5) :\x1b - hex (p5) :

Re: Usage of \[oxdb] (was Re: String Literals, take 2)

2002-12-04 Thread Damian Conway
Larry wrote: : But I think we'd definitely like to introduce \d. Can't, unless we change \d to digit in regexen. Which we ought to be very wary of, given how very frequently it's used in regexes. Damian

Re: String Literals, take 2

2002-12-04 Thread Larry Wall
On Mon, Dec 02, 2002 at 04:42:52PM -0500, Joseph F. Ryan wrote: : Has this been vetted? $(...)/etc seem to cover this case, and being : a qq() metachar makes using qq() strings to print HTML/XML difficult. : : : Well, it was in Apoc 2: : http://www.perl.com/pub/a/2001/05/03/wall.html#rfc

Re: String Literals, take 2

2002-12-03 Thread Michael Lazzaro
On Monday, December 2, 2002, at 01:42 PM, Joseph F. Ryan wrote: James Mastros wrote: We need to decide if this is a user doc or a developer doc/language specification. If it's the later, we need a regirous defintion of what a pair is. I'm more inclined towards a user doc; a rigorous

Re: String Literals, take 2

2002-12-03 Thread Andrew Wilson
On Mon, Dec 02, 2002 at 02:36:52PM -0700, Luke Palmer wrote: There are a few special cases for delimeters; specifically : and #. : is not allowed because it might be used by custom-defined quoting s/is/are/; s/it/they/ operators to apply a property; # is allowed, but there cannot be a

Re: String Literals, take 2

2002-12-03 Thread Andrew Wilson
On Mon, Dec 02, 2002 at 06:58:12AM -0500, Joseph F. Ryan wrote: A string is formed when text is enclosed by a quoting operator. There are two types of quoting operators: interpolating and non-interpolating. In interpolating constructs, the value of a variable is substituted for the variable

Re: String Literals, take 2

2002-12-03 Thread Joseph F. Ryan
Andrew Wilson wrote: Do these nest arbitrarily? q{my string \qq{interpolate $this \q{but not $this} or am $I} Just asking for trouble?} As far as I know, yes. The current behavior already allows this, unless the design team vetos it for some reason. Thanks for all of the great

String Literals, take 2

2002-12-02 Thread Joseph F. Ryan
I've integrated most of the proposed suggestions, as well as a section on vstrings and a winged section on hash interpolation. So that leaves these known issues: - Reference stringification - Default Object Strinigifcation (.AS_STRING needs to be added to the doc as well, but I figure it is

Re: String Literals, take 2

2002-12-02 Thread James Mastros
Just a few more nits to pick... On 12/02/2002 6:58 AM, Joseph F. Ryan wrote: The q() operator allows strings to be made with any non-space, non-letter, non-digit character as the delimeter instead of '. In addition, if the starting delimeter is a part of a paired set, such as (, [, , or {, then

Re: String Literals, take 2

2002-12-02 Thread Luke Palmer
Date: Mon, 02 Dec 2002 06:58:12 -0500 From: Joseph F. Ryan [EMAIL PROTECTED] =pod =head1 Strings 'The quick brown $animal' The quick brown $animal This will not format correctly in POD. Either indent or put it in a list. =head2 Non-Interpolating Constructs Non-Interpolating

Re: String Literals, take 2

2002-12-02 Thread Joseph F. Ryan
James Mastros wrote: Just a few more nits to pick... On 12/02/2002 6:58 AM, Joseph F. Ryan wrote: The q() operator allows strings to be made with any non-space, non-letter, non-digit character as the delimeter instead of '. In addition, if the starting delimeter is a part of a paired set,

Re: String Literals, take 2

2002-12-02 Thread Joseph F. Ryan
Luke Palmer wrote: =head3 Embedding Interpolated Strings It is also possible to embed an interpolating string within a non- interpolating string by the use of the \qq{} construct. A string inside a \qq{} constructs acts exactly as if it were an interpolated string. Note that any end-brackets,

Re: Literals, take 2

2002-11-19 Thread Larry Wall
On Mon, Nov 18, 2002 at 07:39:43PM +, Graham Barr wrote: : On Mon, Nov 18, 2002 at 10:59:07AM -0800, Larry Wall wrote: : I'm thinking at the moment that I'd like to go back to the Ada notation : and use # for the radix, and rather that using dots, use colons. So : an IP address would

Re: Literals, take 2

2002-11-18 Thread Bryan C. Warnock
On Wed, 2002-11-13 at 13:26, Angel Faus wrote: There are many ways to specify literal numeric values in perl, but they default to base 10 for input and output. Once the number has Surely, Perl 6 will allow changing the radix on a more global scale. use radix(16); # or something of the ilk

Re: Literals, take 2

2002-11-18 Thread Erik Steven Harrison
-- On 17 Nov 2002 11:09:53 -050 Bryan C. Warnock wrote: On Wed, 2002-11-13 at 13:26, Angel Faus wrote: There are many ways to specify literal numeric values in perl, but they default to base 10 for input and output. Once the number has Surely, Perl 6 will allow changing the radix on a

Re: Literals, take 2

2002-11-18 Thread Larry Wall
On Thu, Nov 14, 2002 at 07:40:38PM +0100, Angel Faus wrote: : I would preferer to limit the usage of letter notation to just base : 11-36, and have n:F = n:f for every n. : : It is simpler, and we can always use de dot notation for bigger : bases. I'm thinking at the moment that I'd like to

Re: Literals, take 2

2002-11-18 Thread Bryan C. Warnock
On Mon, 2002-11-18 at 10:08, Erik Steven Harrison wrote: -- On 17 Nov 2002 11:09:53 -050 Bryan C. Warnock wrote: On Wed, 2002-11-13 at 13:26, Angel Faus wrote: There are many ways to specify literal numeric values in perl, but they default to base 10 for input and output. Once

Re: Literals, take 2

2002-11-17 Thread Bryan C. Warnock
On Wed, 2002-11-13 at 14:53, Andrew Wilson wrote: So, can we specify floats in other bases? Why would you want to? Personally I wouldn't. That doesn't mean it's not useful to someone. FWIW, I occasionally work with floating point in base-2 and base-16. Not that that should, by any

Re: Literals, take 2

2002-11-17 Thread Bryan C. Warnock
On Wed, 2002-11-13 at 14:08, Jonathan Scott Duff wrote: On Wed, Nov 13, 2002 at 07:26:06PM +0100, Angel Faus wrote: For example: my $x = 18; my $y = -18; my $z = -256:234.254; # negative number my $e = 256:-234.254; # error Why? -- Bryan C.

Re: Literals, take 2

2002-11-16 Thread Dave Storrs
On Fri, Nov 15, 2002 at 12:03:32PM -0800, Larry Wall wrote: On Thu, Nov 14, 2002 at 12:24:50AM -0800, Dave Storrs wrote: : Also, on this subject...what happens if I want to use letter notation : in a base higher than 36? What happens then is that people will think you're silly. :-)

Re: Literals, take 2

2002-11-15 Thread Larry Wall
On Thu, Nov 14, 2002 at 12:24:50AM -0800, Dave Storrs wrote: : On Wed, Nov 13, 2002 at 12:33:09PM -0800, Larry Wall wrote: : : 1_2_3_4__5___6 (absurd, but doable) : : Nope, _ is allowed only between digits (counting a-f as digits in hex). : : Larry : : Does this mean that you

Re: Literals, take 2

2002-11-14 Thread Dave Storrs
On Wed, Nov 13, 2002 at 12:33:09PM -0800, Larry Wall wrote: : 1_2_3_4__5___6 (absurd, but doable) Nope, _ is allowed only between digits (counting a-f as digits in hex). Larry Does this mean that you can't use _ in numbers if the radix is higher than 16? (For example, in base

Re: Literals, take 2

2002-11-14 Thread Michael Lazzaro
On Thu, Nov 14, 2002 at 07:40:38PM +0100, Angel Faus wrote: I would preferer to limit the usage of letter notation to just base 11-36, and have n:F = n:f for every n. OK, sounds good: being consistent wins. Only bases up to 36 may be expressed with letters. MikeL

Re: Literals, take 2

2002-11-14 Thread Angel Faus
Michael Lazzaro escribió: We should talk about this. My original proposal was to do this: (Case 1) base 2-10: use 0..9 (Case 2) base 11-36: use (0..9, a..z), but allow A..Z such that 0x00ff == 0x00FF which seems necessary, IMHO. (Case 3) base 37-62: use (0..9,a..z,A..Z),

Re: Literals, take 2

2002-11-14 Thread John J. Trammell
On Thu, Nov 14, 2002 at 11:02:02AM -0600, Jonathan Scott Duff wrote: Now, it would be nice to have a subroutine that, given a number, could output in any arbitrary base. Perhaps Perl6 could have a radix() subroutine that returns a string representation thusly: $base = 2; $number

Re: Literals, take 2

2002-11-14 Thread Angel Faus
Larry Wall escribió: : 1_2_3_4__5___6 (absurd, but doable) Nope, _ is allowed only between digits (counting a-f as digits in hex). Larry Mmm.. I thought that the whole purpose of creating a new mailing list was to prevent you from reading it. Not that I am against your presence

Re: Literals, take 2

2002-11-14 Thread Michael Lazzaro
On Thursday, November 14, 2002, at 11:07 AM, Angel Faus wrote: Larry Mmm.. I thought that the whole purpose of creating a new mailing list was to prevent you from reading it. (Dunno, I suspect that once we get our initial act together (i.e. posts drop from 70 a day to more like 20), this

Re: Literals, take 2

2002-11-14 Thread Jonathan Scott Duff
On Thu, Nov 14, 2002 at 07:40:38PM +0100, Angel Faus wrote: Michael Lazzaro escribió: We should talk about this. My original proposal was to do this: (Case 1) base 2-10: use 0..9 (Case 2) base 11-36: use (0..9, a..z), but allow A..Z such that 0x00ff == 0x00FF which

Literals, take 2

2002-11-13 Thread Angel Faus
Hi, Many thanks for all the feedback about the literals document. This new version integrates most of the changes. I've also added a subsection about Inf and NaN, directly coming from Michael's perlval. I've also changed the pod syntax to =section, as suggested. I've used the: =section **

Re: Literals, take 2

2002-11-13 Thread Andrew Wilson
On Wed, Nov 13, 2002 at 07:26:06PM +0100, Angel Faus wrote: For example, the integer 30 can be written in hexadecimal base in two equivalent ways: my $x = 16:1D my $x = 16:1.14 These two representations are incompatible, so writing something like C16:D.13 will generate a

Re: Literals, take 2

2002-11-13 Thread Jonathan Scott Duff
On Wed, Nov 13, 2002 at 07:26:06PM +0100, Angel Faus wrote: For example: my $x = 18; my $y = -18; my $z = -256:234.254; # negative number my $e = 256:-234.254; # error Perl allows the underline character, C_, to be placed as a separator between the

Re: Literals, take 2

2002-11-13 Thread Jonathan Scott Duff
On Wed, Nov 13, 2002 at 06:38:08PM +, Andrew Wilson wrote: On Wed, Nov 13, 2002 at 07:26:06PM +0100, Angel Faus wrote: For example, the integer 30 can be written in hexadecimal base in two equivalent ways: my $x = 16:1D my $x = 16:1.14 These two representations are

Re: Literals, take 2

2002-11-13 Thread Andrew Wilson
On Wed, Nov 13, 2002 at 01:10:05PM -0600, Jonathan Scott Duff wrote: On Wed, Nov 13, 2002 at 06:38:08PM +, Andrew Wilson wrote: On Wed, Nov 13, 2002 at 07:26:06PM +0100, Angel Faus wrote: For example, the integer 30 can be written in hexadecimal base in two equivalent ways: my $x =

Re: Literals, take 2

2002-11-13 Thread Jonathan Scott Duff
On Wed, Nov 13, 2002 at 07:53:05PM +, Andrew Wilson wrote: On Wed, Nov 13, 2002 at 01:10:05PM -0600, Jonathan Scott Duff wrote: On Wed, Nov 13, 2002 at 06:38:08PM +, Andrew Wilson wrote: On Wed, Nov 13, 2002 at 07:26:06PM +0100, Angel Faus wrote: For example, the integer 30 can be

Re: Literals, take 2

2002-11-13 Thread Dave Whipp
except for obfuscatory purposes. Besides, if we allow dots for floating point numbers how do we represent this integer: 256:234.254 Using this notation is cute: a generalization that lets us specify a strange thing. That are the reasons for using such a thing? 1) an alternative to Cpack 2)

Re: Literals, take 2

2002-11-13 Thread Larry Wall
: 1_2_3_4__5___6 (absurd, but doable) Nope, _ is allowed only between digits (counting a-f as digits in hex). Larry

Re: Literals, take 2

2002-11-13 Thread Jonathan Scott Duff
On Wed, Nov 13, 2002 at 12:33:09PM -0800, Larry Wall wrote: : 1_2_3_4__5___6 (absurd, but doable) Nope, _ is allowed only between digits (counting a-f as digits in hex). Ah, good. It has always mildly annoyed me in prior perls that 1__2 was a literal 12. -Scott -- Jonathan Scott

Re: Literals, take 2

2002-11-13 Thread Joseph F. Ryan
Jonathan Scott Duff wrote: On Wed, Nov 13, 2002 at 06:38:08PM +, Andrew Wilson wrote: On Wed, Nov 13, 2002 at 07:26:06PM +0100, Angel Faus wrote: For example, the integer 30 can be written in hexadecimal base in two equivalent ways: my $x = 16:1D my $x = 16:1.14 These two

Re: Literals, take 2

2002-11-13 Thread Paul Johnson
On Wed, Nov 13, 2002 at 03:00:07PM -0600, Jonathan Scott Duff wrote: On Wed, Nov 13, 2002 at 12:33:09PM -0800, Larry Wall wrote: : 1_2_3_4__5___6 (absurd, but doable) Nope, _ is allowed only between digits (counting a-f as digits in hex). Ah, good. It has always mildly annoyed