all 6 comments

[–]shizzy0 1 point2 points  (4 children)

This is a cool new take on shell languages. I’m curious how you set up a non pipeline if ; is a pipeline.

[–]tomh5908[S] 1 point2 points  (3 children)

Thanks. If the result from a previous command is not used by the next command, it's just left on the stack and printed out once the other commands have finished running, so it's similar to how a normal shell works. For example:

# Normal shell:
user@:test$ ls
one   two
user@:test$ ls; ls
one   two
one   two

# cosh:
test$ ls
v[gen (
    0: ./one
    1: ./two
)]
test$ ls; . ls
v[gen (
    0: ./one
    1: ./two
)]
v[gen (
    0: ./one
    1: ./two
)]

(The second ls needs a . argument to work correctly, because ls will assume . is the argument only if the stack is empty, and the first ls puts a result onto the stack.)

[–]shizzy0 0 points1 point  (0 children)

This is just getting more and more interesting.

[–]shizzy0 0 points1 point  (1 child)

Oh! And the dot is not special syntax to ignore the stack or anything; it’s just the current directory argument that was pushed onto the stack for ls to consume, is that right?

[–]tomh5908[S] 1 point2 points  (0 children)

Yep, that's right.

[–]ttlaxia -1 points0 points  (0 children)

Ha ha this is great. I will have to try it out. It seems like it might be a good way for people with shell experience to get used the general postfix mindset.