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

Implemetation of list assignment for IOIterator #475

Closed
p6rt opened this issue Dec 9, 2008 · 5 comments
Closed

Implemetation of list assignment for IOIterator #475

p6rt opened this issue Dec 9, 2008 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 9, 2008

Migrated from rt.perl.org#61216 (status was 'rejected')

Searchable as RT61216$

@p6rt
Copy link
Author

p6rt commented Dec 9, 2008

From @bacek

Hello.

There is (temporary) patch for support list assignment for IOIterator.
E.g. $i = =$fh; @​a=$fh.

--
Bacek

@p6rt
Copy link
Author

p6rt commented Dec 9, 2008

From @bacek

io_assign.patch
commit 9e88b83f206a5b36af6e6c0d718ad9e1df3c4c3c
Author: Vasily Chekalkin <bacek@bacek.com>
Date:   Tue Dec 9 21:55:17 2008 +1100

    Implement 'infix:=(List,IOIterator)'

diff --git a/languages/perl6/src/classes/IO.pir b/languages/perl6/src/classes/IO.pir
index be67b70..3d5484d 100644
--- a/languages/perl6/src/classes/IO.pir
+++ b/languages/perl6/src/classes/IO.pir
@@ -235,6 +235,24 @@ Return the value inside this container in item context.
     .return(self)
 .end
 
+.namespace []
+
+=item infix:=
+
+Assign IOIterator to List
+
+FIXME: This method should be removed after implementing LazyLists
+
+=cut
+
+.sub 'infix:=' :multi(['List'], ['IOIterator'])
+    .param pmc list
+    .param pmc it
+    $P0 = getattribute it, '$!IO' 
+    $P1 = $P0.'lines'()
+    .tailcall 'infix:='(list, $P1)
+.end
+
 
 =back
 

@p6rt
Copy link
Author

p6rt commented Dec 9, 2008

From @jnthn

On Tue Dec 09 03​:11​:55 2008, bacek wrote​:

There is (temporary) patch for support list assignment for IOIterator.
E.g. $i = =$fh; @​a=$fh.

This isn't, I don't think, the right approach; instead, IOIterator
itself wanted the changes. So, done it a way I think is at least a bit
more correct, if not completely.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Dec 9, 2008

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

@p6rt
Copy link
Author

p6rt commented Dec 9, 2008

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

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