hayeah / rubish

Ruby Interacive Shell
Other
60 stars 4 forks source link

>> and << for IO redirections #8

Open fgoepel opened 12 years ago

fgoepel commented 12 years ago

It would be nice if << and >> (and possibly push, pop) could be added as aliases for .i and .o. This would fit regular ruby since you can use those to work with all kinds of objects including IO and it would also fit with the usage of those in shells.

hayeah commented 12 years ago

hi,

<< and >> are cool to have, but not very practical because of ruby syntax issues. Ideally, you'd want to say

foo 1, 2, 3 << "file.name"

unfortunately, you have to say

foo(1, 2, 3) << "file.name"

fgoepel commented 12 years ago

Hmm, but don't you have the exact same problem with .i and .o anyways? They won't work without the parens either, if I'm not mistaken.

I still think it would be nice to have the option.