Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: Re: $a++ allowed by $a-- is not ! why?

by demerphq (Chancellor)
on Sep 01, 2003 at 09:48 UTC ( [id://288104]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: $a++ allowed by $a-- is not ! why?
in thread $a++ allowed by $a-- is not ! why?

but if we only allow either lower case or upper case (not both mixed), the problem nearly disappears:

As long as you can mix numbers with letters the problem remains.

or can you find a value for $z so that ++ $z is "0"? no, you can't.

What about -1?

But thanks, some good links there. :-)


---
demerphq

<Elian> And I do take a kind of perverse pleasure in having an OO assembly language...

Replies are listed 'Best First'.
Re^4: $a++ allowed by $a-- is not ! why?
by kabel (Chaplain) on Sep 01, 2003 at 10:12 UTC
    As long as you can mix numbers with letters the problem remains.
    no, the signature does not allow to mix letters with numbers. if we allowed this, that means:
    ++: /\A[a-z0-9]*\z/ -> /\A[a-z0-9]*\z/
    , what is the difference between this addition and the addition in a 36-ary number system? (have fun with this link)
    the only problem here is that the first character must not be a number, thus the awkward domains:
    kabel@linux:~> perl my $num = "1hiho"; print ++ $num, $/; 2 kabel@linux:~>
    What about "-1"?
    "-1" is an illegal input. harhar. ;-)

      the signature does not allow to mix letters with numbers.

      I think we are at cross purposes here. It does allow them to be mixed, you may have any set of letters followed by any set of numbers and ++ will "work". This means that you still have the problem we have been discussing as there is no mapping from 9 to 'a0' but there is a mapping from 'a0' to 9.


      ---
      demerphq

      <Elian> And I do take a kind of perverse pleasure in having an OO assembly language...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://288104]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-16 23:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found