IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Corrected version
I don't know Perl 6, but I asked the expert (aka Damian Conway), and he identified some errors. Here is a corrected version:\r\n
\r\nclass Shape {\r\n    has $.x;\r\n    has $.y;\r\n    method moveTo($newx, $newy) {\r\n        $.x = $newx;\r\n        $.y = $newy;\r\n    }\r\n    method rMoveTo($newx, $newy) {\r\n        .moveTo($.x + $newx, $.y + $newy);\r\n    }\r\n}\r\n\r\nclass Rectangle is Shape {\r\n    has $.width is rw;\r\n    has $.height is rw;\r\n    method draw() {\r\n        print "Drawing a Rectange at:($.x,$.y), width $.width, height $.height\\n";\r\n    }\r\n}\r\n\r\nclass Circle is Shape {\r\n    has $.radius;\r\n    method draw() {\r\n        print "Draw a Circle at:($.x,$.y), radius $.radius\\n";\r\n    }\r\n}\r\n\r\n\r\n@scribble = (Rectangle.new(x=>10, y=>20, width=>5, height->6), Circle.new(x=>15, y=>25, radius=>8));\r\n\r\nfor @scribble -> $ashape {\r\n    $ashape.draw;\r\n    $ashape.rMoveTo(100, 100);\r\n    $ashape.draw;\r\n}\r\n\r\n$arectangle = Rectangle.new(x=>0, y=>0, width=>15, height=>15);\r\n$arectangle.width = 30;\r\n$arectangle.draw;\r\n
\r\nCheers,
\r\nBen
To deny the indirect purchaser, who in this case is the ultimate purchaser, the right to seek relief from unlawful conduct, would essentially remove the word consumer from the Consumer Protection Act\r\n- [link|http://www.techworld.com/opsys/news/index.cfm?NewsID=1246&Page=1&pagePos=20|Nebraska Supreme Court]
New Re: Corrected version
Thanks. I figured I missed some things.
--
-- Jim Weirich jim@weirichhouse.org [link|http://onestepback.org|http://onestepback.org]
---------------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
     Perl 6, Apocalypse 12 is out - (ben_tilly) - (47)
         Shapes in Perl 6 - (JimWeirich) - (46)
             Shapes again? aaaaaahhhhh! -NT - (tablizer) - (43)
                 Re: Shapes again? aaaaaahhhhh! - (JimWeirich) - (42)
                     re: aaaaaahhhhh! - (tablizer) - (41)
                         I like the background. :-) - (admin) - (32)
                             regarding formatting - (tablizer) - (31)
                                 Re: regarding formatting - (pwhysall) - (7)
                                     One man's cack is anothers......um - (tablizer) - (6)
                                         Duplicating the formatting stuff... - (admin) - (5)
                                             Re: CSS - (tablizer) - (4)
                                                 You said, "formatting" -NT - (admin) - (3)
                                                     Sorry, I meant in a general sense, not a per-element sense -NT - (tablizer) - (2)
                                                         Then you wanted "templating" instead. -NT - (ben_tilly) - (1)
                                                             You are right. That is a better word for it. -NT - (tablizer)
                                 Re: regarding formatting - (admin) - (7)
                                     goto contest - (tablizer) - (6)
                                         Re: goto contest - (admin) - (5)
                                             I already did an XBase version. (There is also an L version) - (tablizer) - (4)
                                                 I'm not talking about shapes. -NT - (admin) - (3)
                                                     What are you talking about? - (tablizer) - (2)
                                                         Your "peoples" example. -NT - (admin) - (1)
                                                             People database - (tablizer)
                                 Read for content - (jb4) - (14)
                                     All these years, and still no slamdunk OO evidence - (tablizer) - (13)
                                         How would you know that ?!? "Slam-dunked" X times over... - (CRConrad) - (12)
                                             Psychology, Psychology, Psychology - (tablizer) - (11)
                                                 And what else would you *EXPECT*? - (ben_tilly) - (10)
                                                     Goto's and OO both share INconsistency - (tablizer) - (5)
                                                         And there is one reader's imagination... -NT - (ben_tilly) - (4)
                                                             Dr. Codd was hallucinating? - (tablizer) - (3)
                                                                 Re: Dr. Codd was hallucinating? - (jb4) - (1)
                                                                     Doesn't look like it. - (Another Scott)
                                                                 It was a reference to an earlier post - (ben_tilly)
                                                     But in the immortal words of Ringo: - (jb4) - (3)
                                                         Goto's are a Rorschach test: we see what we hate in it -NT - (tablizer) - (2)
                                                             Go program in DCL, then. - (pwhysall) - (1)
                                                                 I think you missed my point -NT - (tablizer)
                         Purpose of Shapes - (JimWeirich) - (7)
                             sniggle :-) working code -NT - (boxley)
                             derth of more applicable examples - (tablizer) - (1)
                                 Re: derth of more applicable examples - (JimWeirich)
                             Your URL is broken - (ben_tilly) - (3)
                                 Nope. - (admin)
                                 Re: Your URL is broken - (JimWeirich) - (1)
                                     Very long URLs have ellipsis inserted in the URL. (new thread) - (Another Scott)
             Corrected version - (ben_tilly) - (1)
                 Re: Corrected version - (JimWeirich)

Man, what a sad thing to be known for...
58 ms