#745: Make `newclass <STR>` and `newclass <PMC>` consistent
--------------------------------+-------------------------------------------
 Reporter:  Austin_Hastings     |        Type:  bug  
   Status:  new                 |    Priority:  minor
Milestone:                      |   Component:  none 
  Version:  1.2.0               |    Severity:  low  
 Keywords:  newclass,pmc,class  |        Lang:       
    Patch:                      |    Platform:  linux
--------------------------------+-------------------------------------------
 (I have marked this "bug" because a reading of the code suggests the
 behaviors are already in agreement. But see the attached file to show
 otherwise.)

 Creating a class via `newclass <STR>`
 {{{
 $P0 = newclass 'Dog'
 }}}
 does not add methods from the namespace. While creating the same class via
 `newclass <PMC>`
 {{{
 .local pmc class_info
 class_info = new 'Hash'

 class_info['name'] = 'Dog'
 $P0 = newclass class_info
 }}}

 will cause the namespace to be scanned for methods (if the PMC passes a
 series of validations).

 In fact, the documentation for `newclass` states that it accepts an
 optional PMC with init info: `newclass <STR>, <PMC>`, but this is
 unsupported in the ops.

 I believe the current behavior is acceptable, but the <STR> and <PMC>
 versions should behave the same w.r.t. harvesting methods from the
 namespace. (Alternatively, if there is to be a variant that does not scan
 for methods, it should be the <PMC> version under the control of a
 configuration setting in the PMC.)

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/745>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets

Reply via email to