For string matching, you'd expect in(x, y) to tell you if x is a substring of y, that is, if "x in y". Analogously, you'd expect contains(x, y) to tell you if y is a substring of x.

calls its function str_detect, which offers no clue as to the order of the arguments.

@peterdrake

The syntax should explicitly indicate the preposition.

For example, this would be more clear:

for x in y; do ...

😄

@Pat My bash skills aren't as good. What would that do? I'm guessing the "for x in y;" would do nothing because the semicolon ends the statement, and then the next part would run regardless.

If you really want infix functions, you can do it easily in Haskell and with a hideous kludge in Python.

tomerfiliba.com/blog/Infix-Ope

@peterdrake

It's a BASH compound command. Like a for/next loop...

for x in y; do list; done

where "x" is a variable, "y" is a list of words, "list" is a list of commands. Each time through the loop, x gets set to the next word in the "y" list of words.

It's not a function and actually has little to do with what you were talking about. I just threw it out there to jovially add to the confusion.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.