For comparison, here is an example of PythonrCOs match-statement. Like
all the good (i.e. non-C-based) designs, the designers saw no point in
having fall-through.
This is a very simple example, involving straight matching of values
against instances of an enum. There are also more complex
pattern-matching options available.
HererCOs an example that matches the type of the match-expression (not
its value) against various event subclasses:
events = iter(self.ws.events())
while True :
event = next(events, None)
if event == None :
break
For comparison, here is an example of PythonrCOs match-statement. Like
all the good (i.e. non-C-based) designs, the designers saw no point
in having fall-through.
This is a very simple example, involving straight matching of values
against instances of an enum. There are also more complex
pattern-matching options available.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 53:30:45 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,430 |