Dot operator allow operators to be chained together. It is also the case that some things can be used in dot and non-dot forms, for instance count() and list.count(). These are functionally the same thing:
$MyList = "ant;bee";
$MyNumberA = count($MyList);
$MyNumberB = $MyList.count;
In this case both $MyNumberA and $MyNumberB will have a value of 2. So why have both? History! Tinderbox is actually 18-odd years old, very long lived in software terms. Although the app launched in 2002, it wasn’t until v.5.70 in late 2010 (see) that the first dot codes were added.
Indeed, you will see many functions have only a dot form as they are newer to the app. Thus whilst a count() and .count() pair of operators exist, there is a .reverse() but no dot-operator equivalent. But it’s not some existential challenge:
To take the second part first, it’s function is whatever that function does, but the rationale has long been described here (I originally documented this back when the feature was added). As described the point is chaining. Though perhaps obvious to those who’ve used modern coding languages (i.e. not many people!) the basic rationale is making purpose more explicit. This becomes apparent when you want to to do as task involving several discrete functions. Again these do the same:
$MyListA = functionC(functionB(functionA($MyList)));
$MyListB = functionA($MyList).functionB().functionC();
Both do the same, but note the first is more difficult to read (or understand as the functions have to be nested inside-out to be evaluated in the desired order (A>B>C), whereas the dot.chained method is (I’d argue) more understandable to a wider range of users
Well, if you read, as stated, @satikusala you will have noted his point that you don’t have to use every tool in the box and @PaulWalters point to him that the way to learn is to have a purpose.
I could tell you the hammer() tool is the best in the box, but to the person with a hammer everything is is a nail. It’s an , albeit unintentionally_, silly question to ask as different users will give you different ‘top’ lists as they use different aspects of the app.
Nearly all the codes listed here have example code. Have you tried them? That would be a better way to start. Even better, pick a task (not a whole workflow) and look at the function(s) you might need.
Trivial example. I’ve a list, in $MyList, “COW;ANT:DOG;BEE”. How do I get the second item in the list, once listed in alphabetical sort, and in lowercase? So, we need to sort the list, find item #2 and it lowercase:
$MyString = $MyList.sort.at(1).lowercase;
Wait, what’s the ,at(1)? We want item #2. So, we look up .at() and find it is zero-based †. The result is we get ‘bee’ in $MyString, and we learned how to use _three operators. Like I say start small.
†. IOW, the first item is number zero, second is 1, etc. Don’t shoot the messenger. Back in pre-historic computing days, every byte mattered so starting numbering from 0 rather an 1 made sense. Yes, unguessable to non-techies, but that’s coding for you. Like many trades, they evolve less fast than you think.
As Dr Lanning puts it in the film “I,Robot”:
“my responses are limited, you must ask the right questions”
But, seriously, that’s not snark. Pick a small task and solve it. This does two things: you learn some functionS) and you begin to see how you may use them to address your larger workflow. Tinderbox is not an app with a limited range of canned ‘choices’ of what you are allowed to use. Rather, it offers lots of tools that you choose to address your task. It’s a different way of working and why you’ll often read answers saying “it depends on what you are doing” or “there is mote than one way”.
