Re: How do I address individual elements inside an object

2020-12-18 Thread Laurent Rosenfeld via perl6-users
Hi Todd, 1. Yes, a class is a blueprint for manufacturing objects, you can construct as many object as you want. 2. As an example, you can try: say " Fruitstand in $FruitStand.location has $FruitStand.apples apples."; 2. As you declared your class the object attributes will not be mutable. But

Re: How do I address individual elements inside an object

2020-12-18 Thread Parrot Raiser
Although it's a standard term, "class" has a misleading connotation of "set". Using the "fruit" example, the class Fruit should indicate a set of relevant properties for a fruit, such as name, colour, taste, size, possibly cost/kilo. Individual variables can be defined as Fruit-type objects. Then $

Re: How do I address individual elements inside an object

2020-12-18 Thread William Michels via perl6-users
Hi Laurent, I get: Fruitstand in Fruit<140431957910656>.location has Fruit<140431957910656>.apples apples. [Rakudo v2020.10] Best, Bill. On Fri, Dec 18, 2020 at 5:29 AM Laurent Rosenfeld via perl6-users < perl6-us...@perl.org> wrote: > Hi Todd, > > 1. Yes, a class is a blueprint for manufact

Re: Missing NullPointerException

2020-12-18 Thread Konrad Bucheli via perl6-users
Hi Ralph I understand that this is about avoiding the pyramid of doom. And it is enjoyable that it can be avoided. Opt in. No programming language I worked so far has this semantics of method call. So we might name it differently as it is doing something different... -> that is the trap. (I am

Re: Missing NullPointerException

2020-12-18 Thread Konrad Bucheli via perl6-users
On 16.12.20 12:39, Brad Gilbert wrote:     with $drone.engine {         .start;         say "engine started";     } Now we get the inverse pyramid of doom. Above code does not the same as mine, it only improves the debugging output, but does not fail: with $drone.engine {

The SF Perl Raku Study Group, 12/20 at 1pm PDT

2020-12-18 Thread Joseph Brenner
"The mysterious insights that people have when speaking, listening, creating, and even when they are programming, are still beyond the reach of science; nearly everything we do is still an art." -- Donald Knuth, "Computer programming as an art", CACM, December 1974 The Raku Study Group Decembe

Re: How do I address individual elements inside an object

2020-12-18 Thread ToddAndMargo via perl6-users
On 12/18/20 9:42 AM, William Michels via perl6-users wrote: Hi Laurent, I get: Fruitstand in Fruit<140431957910656>.location has  Fruit<140431957910656>.apples apples. [Rakudo v2020.10] Best, Bill. Hi Bill, From my notes in progress: -T *** addressing values inside and object ***

.contains code?

2020-12-18 Thread ToddAndMargo via perl6-users
Hi All, Can anyone point me to the class declaration for contains: https://docs.raku.org/routine/contains I am looking for something like: class { method contains... Many thanks, -T

Re: .contains code?

2020-12-18 Thread ToddAndMargo via perl6-users
On 12/18/20 9:16 PM, ToddAndMargo via perl6-users wrote: Hi All, Can anyone point me to the class declaration for contains: https://docs.raku.org/routine/contains I am looking for something like:    class {   method contains... Many thanks, -T Kevin answered me off list.