Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Default Stringification of Objects #186

Closed
p6rt opened this issue Jul 26, 2008 · 5 comments
Closed

Add Default Stringification of Objects #186

p6rt opened this issue Jul 26, 2008 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jul 26, 2008

Migrated from rt.perl.org#57310 (status was 'resolved')

Searchable as RT57310$

@p6rt
Copy link
Author

p6rt commented Jul 26, 2008

From @chromatic

From masak in IRC today​:

  class A {}; say A.new
  <polyglotbot> OUTPUT[get_string() not implemented in class 'A'

The attached patch fixes that, but it doesn't work yet due to some sneaky
inheritance in P6Object. This has to wait on changes to vtable declaration
and identification.

-- c

@p6rt
Copy link
Author

p6rt commented Jul 26, 2008

From @chromatic

class_get_string.patch
=== languages/perl6/src/classes/Object.pir
==================================================================
--- languages/perl6/src/classes/Object.pir	(revision 29799)
+++ languages/perl6/src/classes/Object.pir	(local)
@@ -87,6 +87,18 @@
     .return $P0.'hash'()
 .end
 
+.sub 'get_string' :vtable :method
+    .local string what
+    what  = self.'WHAT'()
+
+    .local string name
+    name  = '<obj:'
+    name .= what
+    name .= '>'
+
+    .return( name )
+.end
+
 =item item()
 
 Return the scalar component of the invocant.  For most objects,

@p6rt
Copy link
Author

p6rt commented Nov 6, 2008

From @jnthn

On Sat Jul 26 12​:28​:54 2008, chromatic@​wgz.org wrote​:

From masak in IRC today​:

class A \{\}; say A\.new
\<polyglotbot> OUTPUT\[get\_string\(\) not implemented in class 'A'

The attached patch fixes that, but it doesn't work yet due to some sneaky
inheritance in P6Object. This has to wait on changes to vtable
declaration
and identification.

pmichaud has done this in r32373, so I think this ticket is now
redundant; closing.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Nov 6, 2008

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Nov 6, 2008

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Nov 6, 2008
@p6rt p6rt added the patch label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant