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

Implementation of 'infix:=>' for Rakudo #85

Closed
p6rt opened this issue May 17, 2008 · 5 comments
Closed

Implementation of 'infix:=>' for Rakudo #85

p6rt opened this issue May 17, 2008 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented May 17, 2008

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

Searchable as RT54312$

@p6rt
Copy link
Author

p6rt commented May 17, 2008

From @bacek

Hello.

There is implementation of 'infix​:=>' for Rakudo

@p6rt
Copy link
Author

p6rt commented May 17, 2008

From @bacek

p.diff
Index: src/parser/grammar-oper.pg
===================================================================
--- src/parser/grammar-oper.pg	(revision 27566)
+++ src/parser/grammar-oper.pg	(working copy)
@@ -128,6 +128,7 @@
 proto infix:<:=> is equiv(infix:<=>) is pasttype('bind') { ... }
 proto infix:<::=> is equiv(infix:<=>) { ... }
 proto infix:<.=> is equiv(infix:<=>) { ... }
+proto infix:«=>» is equiv(infix:<=>) { ... }
 proto infix:<~=> is equiv(infix:<=>) { ... }
 proto infix:<+=> is equiv(infix:<=>) { ... }
 proto infix:<-=> is equiv(infix:<=>) { ... }
Index: src/classes/Pair.pir
===================================================================
--- src/classes/Pair.pir	(revision 27566)
+++ src/classes/Pair.pir	(working copy)
@@ -137,7 +137,43 @@
     .return($S2)
 .end
 
+=item get_string()    (vtable method)
 
+Return the pair in stringified form
+
+=cut
+
+.sub 'get_string' :vtable :method
+    $P0 = self.'perl'()
+    .return ($P0)
+.end
+
+=head1 Functions
+
+=cut
+
+.namespace
+
+=item infix:=>
+
+Create Pair
+
+=cut
+
+.sub 'infix:=>'
+    .param pmc key
+    .param pmc value
+    .local pmc pair
+
+    pair = new 'Perl6Pair'
+    setattribute pair, '$!key', key
+    setattribute pair, '$!value', value
+
+    .return (pair)
+
+    #.return (pair)
+.end
+
 =back
 
 =cut

@p6rt
Copy link
Author

p6rt commented May 21, 2008

From @jnthn

On Fri May 16 17​:27​:07 2008, bacek wrote​:

There is implementation of 'infix​:=>' for Rakudo

Thanks for this. Unfortunately, this doesn't quite work; we need to
handle this in the actions (for the time being, anyway) so we can use
pairs constructed in this way as a named parameter to a call. I've got
that in place just now.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented May 21, 2008

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

@p6rt
Copy link
Author

p6rt commented May 21, 2008

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

@p6rt p6rt closed this as completed May 21, 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