ValueClass

blah blah blah

NAME

ValueClass - blah blah blah

SYNOPSIS

➜  ValueClass git:(main) raku -Ilib -MValueClass -e '


value-class Bla { has $.a = 42; has @b }

my $bla = Bla.new: :a(3.14);

say $bla.WHICH;

say $bla.a;

'
All attributes of a value-class should be value type
  in method <anon> at /Users/fernando/ValueClass/lib/MetamodelX/ValueClass.rakumod (MetamodelX::ValueClass) line 16
  in block <unit> at -e line 6

➜  ValueClass git:(main) raku -Ilib -MValueClass -e '


value-class Bla { has $.a = 42; method should-not-be-allowed { $!a = 13 } }

my $bla = Bla.new: :a(3.14);

say $bla.WHICH;

say $bla.a;

$bla.should-not-be-allowed

'
Bla|a|Rat|157/50
3.14
Attribute values of a value-class can't be changed
  in sub  at /Users/fernando/ValueClass/lib/MetamodelX/ValueClass.rakumod (MetamodelX::ValueClass) line 19
  in method should-not-be-allowed at -e line 4
  in block <unit> at -e line 12

DESCRIPTION

ValueClass is ...

AUTHOR

Fernando CorrĂȘa de Oliveira [email protected]

COPYRIGHT AND LICENSE

Copyright 2024 Fernando CorrĂȘa de Oliveira

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

ValueClass v0.0.1

blah blah blah

Authors

  • Fernando CorrĂȘa de Oliveira

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • MetamodelX::ValueClass
  • ValueClass

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.