[#349422] Date.parse('17:26:33 Oct 31, 2009') returns invalid date — Jacob Gorban <jacob.gorban@...>

Hi,

13 messages 2009/11/01

[#349519] All Gems Down? — Joshua Ballanco <jballanc@...>

I think I must be the only one using allgems.ruby-forum.com. It seems

17 messages 2009/11/03

[#349527] Ruby Inline over two times slower under 1.9 than under 1.8? — "Shot (Piotr Szotkowski)" <shot@...>

I=E2=80=99m starting to dip my toes in non-Ruby coding (for performance rea=

13 messages 2009/11/03
[#349564] Re: Ruby Inline over two times slower under 1.9 than under 1.8? — Ryan Davis <ryand-ruby@...> 2009/11/03

[#350186] Re: Ruby Inline over two times slower under 1.9 than under 1.8? — "Shot (Piotr Szotkowski)" <shot@...> 2009/11/11

Ryan Davis:

[#350196] Re: Ruby Inline over two times slower under 1.9 than under 1.8? — Roger Pack <rogerpack2005@...> 2009/11/11

> — Shot, who’s off to play with RubyToC now. :)

[#350228] Re: Ruby Inline over two times slower under 1.9 than under 1.8? — "Shot (Piotr Szotkowski)" <shot@...> 2009/11/11

Roger Pack:

[#349640] Odd : a = Hash.new(Hash.new) — Aldric Giacomoni <aldric@...>

irb(main):086:0> a = Hash.new(Hash.new)

13 messages 2009/11/04
[#349641] Re: Odd : a = Hash.new(Hash.new) — Aldric Giacomoni <aldric@...> 2009/11/04

Aldric Giacomoni wrote:

[#349685] Create HTML files using RUBY — Krithika San <skrithikaa@...>

Hi,

23 messages 2009/11/04
[#349690] Re: Create HTML files using RUBY — Marnen Laibow-Koser <marnen@...> 2009/11/04

Krithika San wrote:

[#349691] Re: Create HTML files using RUBY — Krithika San <skrithikaa@...> 2009/11/04

Hi Marnen,

[#349692] Re: Create HTML files using RUBY — Marnen Laibow-Koser <marnen@...> 2009/11/04

Krithika San wrote:

[#349720] Executing one of several ruby objects — "dhf0820@..." <dhf0820@...>

I am trying to write a program that will load a series of DSLs (ruby

11 messages 2009/11/05

[#349849] RCR enumerable extra into core — Roger Pack <rogerpack2005@...>

I'm considering suggesting that the base functionality for the

25 messages 2009/11/08
[#349853] Re: RCR enumerable extra into core — "David A. Black" <dblack@...> 2009/11/08

Hi --

[#349996] Re: RCR enumerable extra into core — Roger Pack <rogerpack2005@...> 2009/11/09

[#349888] Using Nokogiri — jzakiya <jzakiya@...>

I'm trying to scrape some data off websites using nokogiri

18 messages 2009/11/08

[#349926] FileString - request for comments — apeiros@...

Hi there

15 messages 2009/11/09
[#349931] Re: FileString - request for comments — James Edward Gray II <james@...> 2009/11/09

On Nov 8, 2009, at 7:47 PM, apeiros@gmx.net wrote:

[#349987] Berkeley DB BDB Install on Windows — david <davidhooey@...>

I've been scripting in Ruby (and Rails) for about two years now, but

14 messages 2009/11/09

[#350007] Good or best way to allocate a large array — Ralph Shnelvar <ralphs@...32.com>

Newbie here:

45 messages 2009/11/09
[#350017] Re: Good or best way to allocate a large array — Marnen Laibow-Koser <marnen@...> 2009/11/09

Ralph Shnelvar wrote:

[#350019] Re: Good or best way to allocate a large array — Ralph Shnelvar <ralphs@...32.com> 2009/11/09

Marnen,

[#350023] Re: Good or best way to allocate a large array — Marnen Laibow-Koser <marnen@...> 2009/11/09

Ralph Shnelvar wrote:

[#350029] Re: Good or best way to allocate a large array — Ralph Shnelvar <ralphs@...32.com> 2009/11/09

Marnen,

[#350042] Re: Good or best way to allocate a large array — "Florian Frank" <flori@...> 2009/11/09

Ralph Shnelvar wrote:

[#350045] Re: Good or best way to allocate a large array — Ralph Shnelvar <ralphs@...32.com> 2009/11/09

Florian,

[#350047] Re: Good or best way to allocate a large array — Rick DeNatale <rick.denatale@...> 2009/11/09

On Mon, Nov 9, 2009 at 5:46 PM, Ralph Shnelvar <ralphs@dos32.com> wrote:

[#350048] Re: Good or best way to allocate a large array — Ralph Shnelvar <ralphs@...32.com> 2009/11/10

Rick,

[#350053] Re: Good or best way to allocate a large array — Florian Gilcher <flo@...> 2009/11/10

Hi,

[#350142] Calling a subprocess with specific arguments and capturing its output? — Dan Q <quinxex@...>

Hi. I haven't written Ruby in a while, and I was wondering if someone

9 messages 2009/11/10

[#350147] Roman Numerals (Arrgh!) — Rick Barrett <chngth3wrld@...>

I have a homework assignment where I have to convert an inputted integer

22 messages 2009/11/10
[#350150] Re: Roman Numerals (Arrgh!) — Rob Biedenharn <Rob@...> 2009/11/11

On Nov 10, 2009, at 6:56 PM, Rick Barrett wrote:

[#350152] Re: Roman Numerals (Arrgh!) — Gennady Bystritsky <Gennady.Bystritsky@...> 2009/11/11

On Nov 10, 2009, at 5:37 PM, Rob Biedenharn wrote:

[#350156] Re: Roman Numerals (Arrgh!) — Rob Biedenharn <Rob@...> 2009/11/11

On Nov 10, 2009, at 8:49 PM, Gennady Bystritsky wrote:

[#350159] Re: Roman Numerals (Arrgh!) — Gennady Bystritsky <Gennady.Bystritsky@...> 2009/11/11

[#350290] DRYing a Regex — RichardOnRails <RichardDummyMailbox58407@...>

I've got a routine that works fine at building an array of upper-case

42 messages 2009/11/12
[#350311] Re: DRYing a Regex — RichardOnRails <RichardDummyMailbox58407@...> 2009/11/13

On Nov 12, 6:50=A0pm, James Edward Gray II <ja...@graysoftinc.com>

[#350367] Naming conventions -- was: Re: DRYing a Regex — Marnen Laibow-Koser <marnen@...> 2009/11/14

RichardOnRails wrote:

[#350368] Re: Naming conventions -- was: Re: DRYing a Regex — James Edward Gray II <james@...> 2009/11/14

On Nov 13, 2009, at 10:11 PM, Marnen Laibow-Koser wrote:

[#350369] Re: Naming conventions -- was: Re: DRYing a Regex — Marnen Laibow-Koser <marnen@...> 2009/11/14

James Edward Gray II wrote:

[#350415] Re: Naming conventions -- was: Re: DRYing a Regex — "David A. Black" <dblack@...> 2009/11/14

Hi --

[#350426] Re: Naming conventions -- was: Re: DRYing a Regex — Marnen Laibow-Koser <marnen@...> 2009/11/14

David A. Black wrote:

[#350359] Trajectories — Thijs Leeflang <t_leeflang@...>

hello,

60 messages 2009/11/13
[#350444] Re: Trajectories — Marnen Laibow-Koser <marnen@...> 2009/11/14

Thijs Leeflang wrote:

[#350446] Re: Trajectories — Eleanor McHugh <eleanor@...> 2009/11/15

On 14 Nov 2009, at 23:40, Marnen Laibow-Koser wrote:

[#350447] Re: Trajectories — Marnen Laibow-Koser <marnen@...> 2009/11/15

Eleanor McHugh wrote:

[#350449] Re: Trajectories — Eleanor McHugh <eleanor@...> 2009/11/15

On 15 Nov 2009, at 00:42, Marnen Laibow-Koser wrote:

[#350451] Re: Trajectories — Marnen Laibow-Koser <marnen@...> 2009/11/15

Eleanor McHugh wrote:

[#350509] Re: Trajectories — Rick DeNatale <rick.denatale@...> 2009/11/15

On Sat, Nov 14, 2009 at 8:19 PM, Marnen Laibow-Koser <marnen@marnen.org> wr=

[#350523] Re: Trajectories — Marnen Laibow-Koser <marnen@...> 2009/11/15

Rick Denatale wrote:

[#350524] Re: Trajectories — Eleanor McHugh <eleanor@...> 2009/11/15

On 15 Nov 2009, at 23:02, Marnen Laibow-Koser wrote:

[#350529] Re: Trajectories — Todd Benson <caduceass@...> 2009/11/16

On Sun, Nov 15, 2009 at 5:32 PM, Eleanor McHugh

[#350532] Re: Trajectories — Eleanor McHugh <eleanor@...> 2009/11/16

On 16 Nov 2009, at 01:12, Todd Benson wrote:

[#350538] Re: Trajectories — Marnen Laibow-Koser <marnen@...> 2009/11/16

Eleanor McHugh wrote:

[#350577] Re: Trajectories — Paul Smith <paul@...> 2009/11/16

On Mon, Nov 16, 2009 at 2:57 AM, Marnen Laibow-Koser <marnen@marnen.org> wr=

[#350593] Re: Trajectories — Marnen Laibow-Koser <marnen@...> 2009/11/16

Paul Smith wrote:

[#350600] Re: Trajectories — Paul Smith <paul@...> 2009/11/16

On Mon, Nov 16, 2009 at 3:18 PM, Marnen Laibow-Koser <marnen@marnen.org> wrote:

[#350602] Re: Trajectories — Marnen Laibow-Koser <marnen@...> 2009/11/16

Paul Smith wrote:

[#350628] Re: Trajectories — Caleb Clausen <vikkous@...> 2009/11/17

On 11/16/09, Marnen Laibow-Koser <marnen@marnen.org> wrote:

[#350629] Re: Trajectories — Marnen Laibow-Koser <marnen@...> 2009/11/17

Caleb Clausen wrote:

[#350645] Re: Trajectories — Caleb Clausen <vikkous@...> 2009/11/17

On 11/16/09, Marnen Laibow-Koser <marnen@marnen.org> wrote:

[#350454] How do I get a random number between two random numbers? — Alex Untitled <somebodydc691n@...>

I want to create a program that asks you to guess a number between two

12 messages 2009/11/15

[#350476] Traversing the contents of a proc (for a DSL) — Siemen Baader <siemenbaader@...>

Hi List,

11 messages 2009/11/15

[#350485] Using activerecord with mysql — Rob Mauchel <rmauchel@...>

Hi All,

13 messages 2009/11/15

[#350526] Newbie question: Defining a numeric type — Seebs <usenet-nospam@...>

I have a type which has a bit of internal magic, but fundamentally, I want

32 messages 2009/11/16

[#350535] Any official name for Ruby's class which makes "class methods"? — Hunt Jon <jona.hunt777@...>

We all know Ruby really doesn't have class methods.

20 messages 2009/11/16
[#350539] Re: Any official name for Ruby's class which makes "class me — Marnen Laibow-Koser <marnen@...> 2009/11/16

Hunt Jon wrote:

[#350682] Re: Any official name for Ruby's class which makes "class me — "David A. Black" <dblack@...> 2009/11/17
[#350689] Re: Any official name for Ruby's class which makes "class me — Marnen Laibow-Koser <marnen@...> 2009/11/17

David A. Black wrote:

[#350698] Re: Any official name for Ruby's class which makes "class me — "David A. Black" <dblack@...> 2009/11/17

[#350590] Google Wave: A new type of "Ruby Quiz" ? — Aldric Giacomoni <aldric@...>

Google Wave is, according to Google, "the new email". It combines email,

21 messages 2009/11/16

[#350594] something went wrong — Dev Tri <divyanshutri@...>

16 messages 2009/11/16

[#350669] What is the difference between the two following pieces of c — Doney Kaka <doneysr@...>

Don't really know where to go with this one, but I gotta know...

10 messages 2009/11/17

[#350679] Class inside a Method Body — Mike Stephens <rubfor@...>

I have a class that works fine if I declare it outside of anything. If

15 messages 2009/11/17

[#350705] Special characters in csv header using fastercsv — John Mcleod <john.mcleod@...>

Hello all,

17 messages 2009/11/17
[#350709] Re: Special characters in csv header using fastercsv — James Edward Gray II <james@...> 2009/11/17

On Nov 17, 2009, at 10:24 AM, John Mcleod wrote:

[#350710] Re: Special characters in csv header using fastercsv — John Mcleod <john.mcleod@...> 2009/11/17

James,

[#350712] Re: Special characters in csv header using fastercsv — James Edward Gray II <james@...> 2009/11/17

On Nov 17, 2009, at 10:38 AM, John Mcleod wrote:

[#350719] Re: Special characters in csv header using fastercsv — John Mcleod <john.mcleod@...> 2009/11/17

I'm not sure if the placement is correct but I'm still getting "Error

[#350810] Exact (LISP-ish) calculations in Ruby? — Aldric Giacomoni <aldric@...>

Has anyone written a gem for exact calculations? The kind one would find

25 messages 2009/11/18

[#350829] Ruby/tk Help Please — Sean Ob <sob4ever33@...>

I am a complete beginner when it comes to programming and i need some

20 messages 2009/11/18
[#350830] Re: Ruby/tk Help Please — Marnen Laibow-Koser <marnen@...> 2009/11/18

Sean Ob wrote:

[#350924] How to strip ruby comments in a ruby line of code? — Alexandre Mutel <alexandre_mutel@...>

Short description : My question is : do you know any available method,

17 messages 2009/11/19

[#350969] Re-opening an existing module and changing a method — Aldric Giacomoni <aldric@...>

"I hear and I forget; I see and I remember; I do and I understand."

11 messages 2009/11/19

[#351010] RubyForge gem index is no more — Tom Copeland <tom@...>

Hello -

14 messages 2009/11/20

[#351084] Distinct Sets (#225) — Daniel Moore <yahivin@...>

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

21 messages 2009/11/21
[#351111] Re: [QUIZ] Distinct Sets (#225) — brabuhr@... 2009/11/21

On Fri, Nov 20, 2009 at 9:23 PM, Daniel Moore <yahivin@gmail.com> wrote:

[#351170] Re: [QUIZ] Distinct Sets (#225) — Rob Biedenharn <Rob@...> 2009/11/22

[#351171] Re: Distinct Sets (#225) — lith <minilith@...> 2009/11/22

> http://gist.github.com/240457

[#351279] Re: Distinct Sets (#225) — Rob Biedenharn <Rob@...> 2009/11/23

On Nov 22, 2009, at 1:51 AM, lith wrote:

[#351137] Order of evaluation and precedence — Seebs <usenet-nospam@...>

In _The Ruby Programming Language_, it is asserted that order of evaluation

11 messages 2009/11/21

[#351245] More on psuedo arrays; Better way? — Ralph Shnelvar <ralphs@...32.com>

Newbie here:

15 messages 2009/11/23
[#351266] Re: More on psuedo arrays; Better way? — Marnen Laibow-Koser <marnen@...> 2009/11/23

Ralph Shnelvar wrote:

[#351267] Re: More on psuedo arrays; Better way? — Brian Candler <b.candler@...> 2009/11/23

Marnen Laibow-Koser wrote:

[#351271] Re: More on psuedo arrays; Better way? — Ralph Shnelvar <ralphs@...32.com> 2009/11/23

BC> Marnen Laibow-Koser wrote:

[#351297] ideas for a "parameter sweep" program? — Diego Virasoro <diego.virasoro@...>

Hello,

11 messages 2009/11/23

[#351328] Warning: instance variable @foo not initialized — Seebs <usenet-nospam@...>

Running some simple tests with Prawn, I am getting thousands of lines

13 messages 2009/11/24

[#351367] Difference between << and += for Strings and Arrays. Bug? — Pieter Hugo <pieter@...>

Hi

14 messages 2009/11/24
[#351373] Re: Difference between << and += for Strings and Arrays. Bug? — Tom Stuart <tom@...> 2009/11/24

2009/11/24 Pieter Hugo <pieter@internext.co.za>:

[#351377] Re: Difference between << and += for Strings and Arrays. Bug? — Pieter Hugo <pieter@...> 2009/11/24

Hi Guys

[#351426] Ruby internals & other questions — Ralph Shnelvar <ralphs@...32.com>

Is there a document or website that describes how Ruby works?

17 messages 2009/11/25

[#351448] Ruby a good choice for CGI? — Nick Dr <nickhannum@...>

Ive been messing around with Ruby for a few weeks now, and I'm fairly

28 messages 2009/11/25
[#351452] Re: Ruby a good choice for CGI? — David Masover <ninja@...> 2009/11/25

On Wednesday 25 November 2009 01:12:19 pm Nick Dr wrote:

[#351453] Re: Ruby a good choice for CGI? — Marnen Laibow-Koser <marnen@...> 2009/11/25

David Masover wrote:

[#351455] Re: Ruby a good choice for CGI? — David Masover <ninja@...> 2009/11/25

On Wednesday 25 November 2009 02:38:32 pm Marnen Laibow-Koser wrote:

[#351456] Re: Ruby a good choice for CGI? — Judson Lester <nyarly@...> 2009/11/25

On Wed, Nov 25, 2009 at 12:52 PM, David Masover <ninja@slaphack.com> wrote:

[#351461] Re: Ruby a good choice for CGI? — David Masover <ninja@...> 2009/11/25

On Wednesday 25 November 2009 03:00:49 pm Judson Lester wrote:

[#351508] Ruby byte access to disk sectors like dd does — Gary Hasson <gary@...>

I have been unable to find any reference to Ruby methods that provide

16 messages 2009/11/26

[#351548] Class variables, instance variables, singleton; Ruby v. C++ — Ralph Shnelvar <ralphs@...32.com>

Newb here coming from C++

31 messages 2009/11/27
[#351570] Re: Class variables, instance variables, singleton; Ruby v. C++ — Steve Wilhelm <steve@...831.com> 2009/11/28

Ralph Shnelvar wrote:

[#351579] Re: Class variables, instance variables, singleton; Ruby v. C++ — "David A. Black" <dblack@...> 2009/11/28

Hi --

[#351586] Re: Class variables, instance variables, singleton; Ruby v. C++ — Ralph Shnelvar <ralphs@...32.com> 2009/11/28

DAB> And of course this is one of the (many) problems with class variables:

[#351572] Local variables can't be accessed from outside, right? — Michael Winterstein <parzival@...>

Hi, I've been trying to figure out metaprogramming and I've mostly got

9 messages 2009/11/28

[#351637] Best way to distribute an app — Omar Campos <hypermeister@...>

Hello everyone,

16 messages 2009/11/29
[#351682] Re: Best way to distribute an app — David Masover <ninja@...> 2009/11/29

On Saturday 28 November 2009 09:03:12 pm Omar Campos wrote:

[#351655] ruby language parser in ruby — Brian Candler <b.candler@...>

I'm looking for a ruby language parser written in ruby, that I can hack

27 messages 2009/11/29

[#351753] have a problem with the loops and variable — Sajjad Po <magicc0d3r@...>

Hi Friends.

20 messages 2009/11/30
[#351756] Re: have a problem with the loops and variable — Michael Linfield <globyy3000@...> 2009/11/30

[#351788] Re: have a problem with the loops and variable — Marnen Laibow-Koser <marnen@...> 2009/12/01

Michael Linfield wrote:

[#351796] Re: have a problem with the loops and variable — Sajjad Po <magicc0d3r@...> 2009/12/01

thank you friends.

[#351798] Re: have a problem with the loops and variable — Sajjad Iran <magicc0d3r@...> 2009/12/01

I want create a program like this.

[#351833] Re: have a problem with the loops and variable — Michael Linfield <globyy3000@...> 2009/12/01

Sajjad Po wrote:

[#351835] Re: have a problem with the loops and variable — Marnen Laibow-Koser <marnen@...> 2009/12/01

Michael Linfield wrote:

[#351840] Re: have a problem with the loops and variable — Michael Linfield <globyy3000@...> 2009/12/01

For something small such as testing lets say a million keys, the

[#351842] Re: have a problem with the loops and variable — Marnen Laibow-Koser <marnen@...> 2009/12/02

Michael Linfield wrote:

[#351755] Problem trying to get a constant with correct scope — Alexandre Mutel <alexandre_mutel@...>

I'm trying to get a constant inside a class (but i have to do it outside

11 messages 2009/11/30

Re: Ruby doesn't implement x++ for Fixnum's because ???

From: RichardOnRails <RichardDummyMailbox58407@...>
Date: 2009-11-04 03:25:12 UTC
List: ruby-talk #349598
On Oct 30, 11:05=A0am, Robert Klemme <shortcut...@googlemail.com> wrote:
> 2009/10/30 RichardOnRails <RichardDummyMailbox58...@uscomputergurus.com>:
>
> > I'll correct my errors and probably have a new theory subsequently.
>
> IMHO the story goes like this: absence of postfix ++ and -- is a
> consequence of the fact that numeric types are immutable in Ruby which
> makes an assignment necessary for these operators. =A0Although that
> would be doable, it would not immediately be obvious when looking at
> "foo++". =A0On the other side, "foo +=3D 1" makes the assignment obvious
> while still being pretty concise (you do not have to write "foo =3D foo
> + 1").
>
> Which brings us to the question: what is the advantage of immutable
> numbers? =A0First, it avoids errors that could be caused by aliasing
> (two objects refer the same object, one of them changes it, it changes
> for the other one as well without being expected). =A0Then, it is quite
> natural if you consider mathematical numbers: they cannot change.
>
> Additionally, the expression "1" can always refer to the same object
> (in reality it's a bit different but from a Ruby programmer's
> perspective the difference is not noticeable) which in fact makes
> using numeric constants very efficient (as opposed to the expression
> "'foo'" which constructs a new String instance on every invocation,
> albeit with a shared char array underneath which eases the pain a
> bit).
>
> This in turn makes integer math pretty efficient because if numbers
> were mutable Ruby would have to create a new object for every result
> of an operator evaluation. =A0I am not saying that Ruby is ideal for
> number crunching but it could be significantly slower if certain
> design decisions would have been made differently.
>
> Kind regards
>
> robert
>
> --
> remember.guy do |as, often| as.you_can - without endhttp://blog.rubybestp=
ractices.com/

Hi Robert,

Thank you for your thoughtful and extensive responses.  I apologized
earlier for my sloppy analysis.  I hope the following offers higher
quality.

(a) You say, in part:
=93... immutable numbers?  First, it avoids errors that could be caused
by aliasing (two objects refer the same object, one of them changes
it, it changes for the other one as well without being expected=94
(b) Dave Black, in his truly excellent =93The Well-Grounded Rubyist=94
says, in part:
=93Any object that=92s represented as an immediate value is always exactly
the same object=94 and
=93The reason [there=92s no x=3D1; x++] is that , due to the immediate
presence of 1 in x, means you=92d be changing 1 into 2,
and that makes no sense=94

1. I=92d rather discuss this matter in concrete terms rather than
abstractions.  Please look at the following method (to generate
results) and two statements:

def show(v)
  "Got #{v}, class =3D #{v.class}, object_id =3D #{v.object_id}
(v.object_id-1)/2 =3D #{(v.object_id-1)/2 }"
end

a =3D 1; show (a)  =3D>  Got 1;  class =3D Fixnum;   object_id =3D 3;  v >>=
 1
=3D 1
b =3D 1; show (b)  =3D>  Got 1;  class =3D Fixnum;   object_id =3D 3;  v >>=
 1
=3D 1
a =3D=3D b =3D> true

Both =93a=94 and =93b=94 have their respective values held as immediate val=
ues
(embedded in their object_id=92s), but they are NOT the same thing
because they=92re ultimately held in their respective entries in the
symbol table.  So, object_id=92s for Fixnum=92s are synthetic.  To think
that  those object_id=92s point to a location in a memory area that
stores the 32-bit 000...001 (in a 32-bit machine/OS) is to  contradict
the meaning of immediacy and defeat the very efficiency that immediate
values offer.

2. Now please consider the following supplement to the statements
above:

a +=3D 1; show (a)  =3D>  Got 2;  class =3D Fixnum;   object_id =3D 5;  v >=
> 1
=3D 2
show (a)  =3D>  Got 2;  class =3D Fixnum;   object_id =3D 5;  v >> 1 =3D 2
show (b)  =3D>  Got 1;  class =3D Fixnum;   object_id =3D 3;  v >> 1 =3D 1

The assignment of =93a +=3D 1=94 to =93a=94 changed a=92s object_id to embe=
d a new
value: 2.  Despite that change of 1 to 2 in a=92s object,  =93b=94 remains
set to 1.  =93b=94 did not suffer the calamity of a universal change of
all Fixnum 1=92s to 2=92s.

3. Conclusion:

a +=3D 1 is equivalent to a++=92s natural meaning.  In fact, we further
supplement the above statements with:

class Fixnum
  def pp # We can=92t define ++ because of a compiler restriction.
    self + 1
  end
end

a=3D1; show(a.pp)  =3D>  Got 2;  class =3D Fixnum;   object_id =3D 5;  v >>=
 1
=3D 2
show(b)  =3D>  Got 1;  class =3D Fixnum;   object_id =3D 3;  v >> 1 =3D 1

Furthermore, pp works fine on the boundary condition for Fixnum=92s on a
common 32-bit cpu/OS, i.e. 2**30-1:

a =3D 2**30-1; show (a) =3D> Got 1073741823;  class =3D Fixnum;   object_id
=3D 2147483647;  v >> 1 =3D 1073741823
a =3D 2**30; show (a) =3D> Got 1073741824;  class =3D Bignum;   object_id =
=3D
22737670;  v >> 1 =3D 11368835

So x++ works fine in the form of pp for positive Fixnum=92s.  I assume
it=92ll work fine for non-positives, also..  A compiler change to allow
=93def ++=94 is necessary to finally add ++ to Fixnum.

Again,  thanks for your responses to my question.

Best wishes,
Richard

In This Thread