2022-9-28 18:55 Dagfinn Ilmari MannsÃ¥ker <ilmari@ilmari.org> wrote: > Yuki Kimoto <kimoto.yuki@gmail.com> writes: > > > 2022å¹´9æ28æ¥(æ°´) 2:12 Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>: > > > >> TL;DR - please help review this large work ahead of PR-time, to avoid > >> surprises later on and make the process run smoother > >> (or explicitly opt-out) > [â¦] > > Before proceeding, I would like to discuss how to use the class > > and method syntax in existing source codes. > > What is there to discuss? Just make sure you don't have functions > called `class`, `field` or `method` that the new keywords would conflict > with, add `use feature 'class';` and use it. > > Existing code that just uses the classes and objects doesn't need to > know or care whether they're implemented with the `class` feature, some > other object system or manually, as long as the public API stays the > same. > > - ilmari > > People have many existing source codes such as the following ones. package MyClass; sub new { ... } # Many accessors sub my_accessor1 { # ... } sub my_accessor2 { # ... } sub my_accessorN { # ... } Suppose he wants to use the method keyword. He will rewrite the following codes. class MyClass { method new : common { ... } # Many accessors method my_accessor1 { # ... } method my_accessor2 { # ... } method my_accessorN { # ... } In the currently planned implementation this will not work because of the redefine of the new method.Thread Previous | Thread Next