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

Remove references to __get_string() and related methods in PGE POD #394

Closed
p6rt opened this issue Nov 7, 2008 · 10 comments
Closed

Remove references to __get_string() and related methods in PGE POD #394

p6rt opened this issue Nov 7, 2008 · 10 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Nov 7, 2008

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

Searchable as RT60384$

@p6rt
Copy link
Author

p6rt commented Nov 7, 2008

From @chrisdolan

The attached patch does s{__get_}{get_} on compilers/pge/PGE/
Match.pir to make POD match up with code.

@p6rt
Copy link
Author

p6rt commented Nov 7, 2008

From @chrisdolan

__get_string.patch
Index: compilers/pge/PGE/Match.pir
===================================================================
--- compilers/pge/PGE/Match.pir	(revision 32414)
+++ compilers/pge/PGE/Match.pir	(working copy)
@@ -333,7 +333,7 @@
 .end
 
 
-=item C<__get_bool()>
+=item C<get_bool()>
 
 Returns 1 if this object successfully matched the target string,
 0 otherwise.
@@ -347,7 +347,7 @@
     .return ($I1)
 .end
 
-=item C<__get_integer()>
+=item C<get_integer()>
 
 Returns the integer value of this match.
 
@@ -358,7 +358,7 @@
     .return ($I0)
 .end
 
-=item C<__get_number()>
+=item C<get_number()>
 
 Returns the numeric value of this match.
 
@@ -369,7 +369,7 @@
     .return ($N0)
 .end
 
-=item C<__get_string()>
+=item C<get_string()>
 
 Returns the portion of the target string matched by this object.
 

@p6rt
Copy link
Author

p6rt commented Nov 25, 2008

From @pmichaud

Actually, the vtable functions should not have method names at all --
i.e., instead of

.sub 'get_bool' :method :vtable

we should have

.sub '' :method :vtable('get_bool')

At present there may be some users of pge that expect to use the methods
directly -- as in​:

  $I0 = match.'get_bool'()

This will go away, and the correct approach is​:

  $I0 = istrue match

So, I've marked the old named-method invocation as deprecated for all
PGE and PCT items, and this can be done after the next release.

In the meantime I'll apply the patch to remove the leading underscores
in the POD. Thanks!

Pm

@p6rt
Copy link
Author

p6rt commented Nov 25, 2008

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

@p6rt
Copy link
Author

p6rt commented Nov 26, 2008

From @bacek

On Tue Nov 25 13​:12​:31 2008, pmichaud wrote​:

Actually, the vtable functions should not have method names at all --
i.e., instead of

.sub 'get_bool' :method :vtable

we should have

.sub '' :method :vtable('get_bool')

Hello,

there is small patch for Rakudo to anonymize vtable methods.

--
Bacek

@p6rt
Copy link
Author

p6rt commented Nov 26, 2008

From @bacek

anon.patch
diff --git a/languages/perl6/src/classes/Capture.pir b/languages/perl6/src/classes/Capture.pir
index e763e53..0152321 100644
--- a/languages/perl6/src/classes/Capture.pir
+++ b/languages/perl6/src/classes/Capture.pir
@@ -29,7 +29,7 @@ This file sets up the Perl 6 C<Capture> class.
 
 =cut
 
-.sub 'VTABLE_get_string' :method :vtable('get_string')
+.sub '' :method :vtable('get_string')
     $S0 = self.'list'()
     .return ($S0)
 .end
diff --git a/languages/perl6/src/classes/IO.pir b/languages/perl6/src/classes/IO.pir
index 210c843..5ed0a01 100644
--- a/languages/perl6/src/classes/IO.pir
+++ b/languages/perl6/src/classes/IO.pir
@@ -172,7 +172,7 @@ The IOIterator class implements the I/O iterator.
 
 =cut
 
-.sub get_bool :method :vtable
+.sub '' :method :vtable('get_bool')
     .local pmc PIO
     $P0 = getattribute self, "$!IO"
     PIO = getattribute $P0, "$!PIO"
@@ -201,7 +201,7 @@ Return the value inside this container in item context.
     .return($P0)
 .end
 
-.sub 'get_string' :vtable
+.sub '' :method :vtable('get_string')
     .tailcall self.'item'()
 .end
 
diff --git a/languages/perl6/src/classes/List.pir b/languages/perl6/src/classes/List.pir
index 204f502..199eba0 100644
--- a/languages/perl6/src/classes/List.pir
+++ b/languages/perl6/src/classes/List.pir
@@ -43,7 +43,7 @@ Return a clone of this list.  (Clones its elements also.)
 =cut
 
 .namespace ['List']
-.sub 'clone' :vtable :method
+.sub '' :method :vtable('clone')
     .local pmc p6meta, result, iter
     $P0 = typeof self
     result = new $P0
@@ -65,7 +65,7 @@ Return the elements of the list joined by spaces.
 
 =cut
 
-.sub 'get_string' :vtable :method
+.sub '' :method :vtable('get_string')
     $S0 = join ' ', self
     .return ($S0)
 .end
diff --git a/languages/perl6/src/classes/Mapping.pir b/languages/perl6/src/classes/Mapping.pir
index f3d9f7d..f6cb26d 100644
--- a/languages/perl6/src/classes/Mapping.pir
+++ b/languages/perl6/src/classes/Mapping.pir
@@ -50,7 +50,7 @@ ourself in a ObjectRef.
 .end
 
 
-.sub 'get_string' :method :vtable
+.sub '' :method :vtable('get_string')
     $S0 = ''
     .local pmc iter
     iter = new 'Iterator', self
diff --git a/languages/perl6/src/classes/Object.pir b/languages/perl6/src/classes/Object.pir
index 09f4077..1336207 100644
--- a/languages/perl6/src/classes/Object.pir
+++ b/languages/perl6/src/classes/Object.pir
@@ -650,7 +650,7 @@ Returns a proto-object with an autovivification closure attached to it.
 
 =cut
 
-.sub get_pmc_keyed :vtable :method
+.sub '' :method :vtable('get_pmc_keyed')
     .param pmc what
 
     # We'll build auto-vivification hash of values.
diff --git a/languages/perl6/src/classes/Pair.pir b/languages/perl6/src/classes/Pair.pir
index 66efaa5..fcc077b 100644
--- a/languages/perl6/src/classes/Pair.pir
+++ b/languages/perl6/src/classes/Pair.pir
@@ -68,7 +68,7 @@ Stringify the Pair.
 
 =cut
 
-.sub 'get_string' :method :vtable
+.sub '' :method :vtable('get_string')
     $S0 = self.'key'()
     concat $S0, "\t"
     $S1 = self.'value'()
diff --git a/languages/perl6/src/classes/Range.pir b/languages/perl6/src/classes/Range.pir
index f81e0c6..14da86f 100644
--- a/languages/perl6/src/classes/Range.pir
+++ b/languages/perl6/src/classes/Range.pir
@@ -30,19 +30,19 @@ src/classes/Range.pir - methods for the Range class
 
 =cut
 
-.sub 'VTABLE_get_integer' :method :vtable('get_integer')
+.sub '' :method :vtable('get_integer')
     $P0 = self.'list'()
     $I0 = $P0
     .return ($I0)
 .end
 
-.sub 'VTABLE_get_number' :method :vtable('get_number')
+.sub '' :method :vtable('get_number')
     $P0 = self.'list'()
     $N0 = $P0
     .return ($N0)
 .end
 
-.sub 'VTABLE_get_string' :method :vtable('get_string')
+.sub '' :method :vtable('get_string')
     $P0 = self.'list'()
     $S0 = $P0
     .return ($S0)

@p6rt
Copy link
Author

p6rt commented Nov 27, 2008

From @pmichaud

there is small patch for Rakudo to anonymize vtable methods.

Not all of the Rakudo vtable functions should be anonymized -- i.e.,
'clone' is a real method as well.

Pm

@p6rt
Copy link
Author

p6rt commented Nov 27, 2008

From @pmichaud

PGE patch applied in r33256 -- moving ticket back to the perl6 queue so
that we can look at bacek's patch.

Pm

@p6rt
Copy link
Author

p6rt commented Dec 15, 2008

From @pmichaud

Closing ticket -- many of the vtable methods have been migrated, and the
rest are being taken care of as part of a general refactor of all of the
builtins.

Pm

@p6rt
Copy link
Author

p6rt commented Dec 15, 2008

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

@p6rt p6rt closed this as completed Dec 15, 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