Don't know if this indicates a bug

3 Messages Forum Options Options
Permalink
Chris Saunders-4
Don't know if this indicates a bug
Reply Threaded More
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

This is going to be a little difficult to get across.  I’m going to show some code and describe what happens.  First the code – but read the description below:

 

class

                APPLICATION

 

create

                make

 

feature -- Initialization

 

                make

                                                -- Run application.

                                do

                                                print ("Starting."); crr

                                                io.read_line

                                                print ("Initializing m."); cr

                                               

                                                -- 1.

--                                             create m.make_from_array (2, 2, <<create {REAL_NUMBER_64}.make_from_real_64 (1.0),

--                                                                               create {REAL_NUMBER_64}.make_from_real_64 (2.0),

--                                                                               create {REAL_NUMBER_64}.make_from_real_64 (3.0),

--                                                                               create {REAL_NUMBER_64}.make_from_real_64 (4.0)>>)

                                               

                                                -- 2.

--                                             create m.make_from_array (2, 2, <<1.0, 2.0, 3.0, 4.0>>)

                                               

                                                -- 3.

--                                             create m.make_from_array (2, 2, array)

                                               

                                                -- 4.

--                                             create m.make_from_array2 (array2)

 

                                                print ("m initialized."); cr

                                                print ("m = "); print (m); crr

                                                print ("Done."); crr

                                end

 

feature -- Access

 

                array: ARRAY [REAL_NUMBER_64] is

                                                --

                                once

                                                create Result.make (1, 4)

                                                Result.put (1.0, 1)

                                                Result.put (2.0, 2)

                                                Result.put (3.0, 3)

                                                Result.put (4.0, 4)

                                end

 

                array2: ARRAY2 [REAL_NUMBER_64] is

                                                --

                                once

                                                create Result.make (2, 2)

                                                Result.put (1.0, 1, 1)

                                                Result.put (2.0, 1, 2)

                                                Result.put (3.0, 2, 1)

                                                Result.put (4.0, 2, 2)

                                end

 

                m: MATRIX [REAL_NUMBER_64]

 

feature -- Implementation

 

                cr

                                                -- Print a carraige return.

                                do

                                                io.new_line

                                end

 

                crr

                                                -- Print a double carraige return.

                                do

                                                cr; cr

                                end

 

end -- class APPLICATION

 

Now if I uncomment 3. Or 4. The code runs as expected.  If instead I uncomment 1. Or 2. and run this code the application just stops running (after I press “Enter” for the `io.read_line’).  The console just closes and EiffelStudio just returns to normal mode with no error messages.  The class REAL_NUMBER_64 does have a conversion clause so that it can be initialized from a REAL_64.  I was expecting that I could use a <<>> array (can’t think of the term for this right now) to initialize `m’.

 

Does this indicate a bug in the compiler?

 

Regards

Chris Saunders


_______________________________________________
Es-devel mailing list
Es-devel@...
http://rock.inf.ethz.ch/cgi-bin/mailman/listinfo/es-devel
Emmanuel Stapf [ES]
RE: Don't know if this indicates a bug
Reply Threaded More
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
We would need to whole source code and the exception trace you are getting to better understand if there is a problem.
 
Manu


From: es-devel-bounces@... [mailto:es-devel-bounces@...] On Behalf Of Chris Saunders
Sent: Tuesday, August 21, 2007 6:29 PM
To: Eiffel Studio Development Mailing List
Subject: [Es-devel] Don't know if this indicates a bug

This is going to be a little difficult to get across.  I’m going to show some code and describe what happens.  First the code – but read the description below:

 

class

                APPLICATION

 

create

                make

 

feature -- Initialization

 

                make

                                                -- Run application.

                                do

                                                print ("Starting."); crr

                                                io.read_line

                                                print ("Initializing m."); cr

                                               

                                                -- 1.

--                                             create m.make_from_array (2, 2, <<create {REAL_NUMBER_64}.make_from_real_64 (1.0),

--                                                                               create {REAL_NUMBER_64}.make_from_real_64 (2.0),

--                                                                               create {REAL_NUMBER_64}.make_from_real_64 (3.0),

--                                                                               create {REAL_NUMBER_64}.make_from_real_64 (4.0)>>)

                                               

                                                -- 2.

--                                             create m.make_from_array (2, 2, <<1.0, 2.0, 3.0, 4.0>>)

                                               

                                                -- 3.

--                                             create m.make_from_array (2, 2, array)

                                               

                                                -- 4.

--                                             create m.make_from_array2 (array2)

 

                                                print ("m initialized."); cr

                                                print ("m = "); print (m); crr

                                                print ("Done."); crr

                                end

 

feature -- Access

 

                array: ARRAY [REAL_NUMBER_64] is

                                                --

                                once

                                                create Result.make (1, 4)

                                                Result.put (1.0, 1)

                                                Result.put (2.0, 2)

                                                Result.put (3.0, 3)

                                                Result.put (4.0, 4)

                                end

 

                array2: ARRAY2 [REAL_NUMBER_64] is

                                                --

                                once

                                                create Result.make (2, 2)

                                                Result.put (1.0, 1, 1)

                                                Result.put (2.0, 1, 2)

                                                Result.put (3.0, 2, 1)

                                                Result.put (4.0, 2, 2)

                                end

 

                m: MATRIX [REAL_NUMBER_64]

 

feature -- Implementation

 

                cr

                                                -- Print a carraige return.

                                do

                                                io.new_line

                                end

 

                crr

                                                -- Print a double carraige return.

                                do

                                                cr; cr

                                end

 

end -- class APPLICATION

 

Now if I uncomment 3. Or 4. The code runs as expected.  If instead I uncomment 1. Or 2. and run this code the application just stops running (after I press “Enter” for the `io.read_line’).  The console just closes and EiffelStudio just returns to normal mode with no error messages.  The class REAL_NUMBER_64 does have a conversion clause so that it can be initialized from a REAL_64.  I was expecting that I could use a <<>> array (can’t think of the term for this right now) to initialize `m’.

 

Does this indicate a bug in the compiler?

 

Regards

Chris Saunders


_______________________________________________
Es-devel mailing list
Es-devel@...
http://rock.inf.ethz.ch/cgi-bin/mailman/listinfo/es-devel
Chris Saunders-4
RE: Don't know if this indicates a bug
Reply Threaded More
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

I’ll send in a bug report.  There is no exception trace as there was no exception.

 

Regards

Chris Saunders

 

From: Emmanuel Stapf [ES] [mailto:manus@...]
Sent: August 21, 2007 9:34 PM
To: 'Chris Saunders'; 'Eiffel Studio Development Mailing List'
Subject: RE: [Es-devel] Don't know if this indicates a bug

 

We would need to whole source code and the exception trace you are getting to better understand if there is a problem.

 

Manu


_______________________________________________
Es-devel mailing list
Es-devel@...
http://rock.inf.ethz.ch/cgi-bin/mailman/listinfo/es-devel