4 ms·
> but the examples are too hard for me: both sh & cosh Thanks, I'll look at adding some simpler examples. > I would have to look up `-0` The thing about '-0'
by tomhrr 4y ago
> but the examples are too hard for me: both sh & cosh
Thanks, I'll look at adding some simpler examples.
> I would have to look up `-0`
The thing about '-0' is that it's not required in cosh, because you're dealing with proper values instead of text streams. The problem that '-0' (and '-print0') is addressing doesn't arise.
> Why does cosh use ; the syntax kinda looks like they're not needed?
';' needs to be used to denote the previous string (token) as a function where that can't be determined from context. For example, if you type '1 2 +' and press enter, the shell will assume that because there's a function called '+', the intention is to run that function, but you could also enter '1 2 +;' (or '1 2 + ;') to get the same result. Whereas '1 2 + 1 2 + +' doesn't work, because the shell doesn't know if the first two '+' symbols are meant to be interpreted as function calls or just plain strings. The other place where it assumes that a function call is intended is at the end of an anonymous function, so `[1 2 +]` and [1 2 +;]` have the same effect.