V: Add operator overloading for `|`, at least in .vsh files, so we can pipe shit together

Created on 22 Dec 2019  路  3Comments  路  Source: vlang/v

Imagine being able to create more Bash-like .vsh scripts that do things like

xz -cd data.tar.xz | tar -xvf -

but in V:

exec('xz -cd data.tar.xz') | exec('tar -xvf -')

This may be overkill, but... kind of a fun idea!

Feature Request

Most helpful comment

...or maybe a simple function built into os would be plenty good enough:

pipe('xz -cd data.tar.xz', 'tar -xvf -')

All 3 comments

...or maybe a simple function built into os would be plenty good enough:

pipe('xz -cd data.tar.xz', 'tar -xvf -')

I think the pipe operator could be "overloaded" at some point for channels (between go routines) - for more information (incl. go routine reentrancy) see https://github.com/vlang/v/issues/1868 . Or maybe not for channels, but rather for instruction-level parallelism using similar principles as in zero-functional.

Good point @dumblob :+1:

Closing the idea above as this is unnecessarily complexity; an os.pipe function or similar would be better.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

clpo13 picture clpo13  路  3Comments

radare picture radare  路  3Comments

fidergo-stephane-gourichon picture fidergo-stephane-gourichon  路  3Comments

radare picture radare  路  3Comments

taojy123 picture taojy123  路  3Comments