6 ms·
A nice and friendly way to explain a concept that has a scary-sounding name. One little correction, though: your example for "alt" function says >>> iforwhil
by CodeMage 15y ago
A nice and friendly way to explain a concept that has a scary-sounding name. One little correction, though: your example for "alt" function says
>>> iforwhileorfor = alt(matchstr('if'), matchstr('while'), matchstr('for'))
>>> if_while_for('if')
('if', '')
>>> if_while_for('while')
('while', '')
>>> if_while_for('for')
('for', '')
>>> if_while_for('foof')
None
You need to either rename the variable to "if_while_for" or modify your function calls accordingly.
- apgwoz 15y agoOops! Thanks for noticing this. I'll make a fix.