Changes between Version 10 and Version 11 of WritingEfficientMetaModelica
- Timestamp:
- 2014-10-30T07:51:20Z (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WritingEfficientMetaModelica
v10 v11 59 59 }}} 60 60 61 == try/catch == 62 Use try/catch syntax for doing stuff like the following: 63 {{{#!mo 64 // RML-style 65 algorithm 66 _ := matchcontinue() 67 case () equation 68 // Do something which might fail. 69 then (); 70 71 else equation 72 // Do something else. 73 then (); 74 end matchcontinue; 75 }}} 76 77 78 {{{#!mo 79 // OMC style 80 algorithm 81 try 82 // Do something which might fail. 83 else 84 // Do something else. 85 end try; 86 }}} 87 61 88 == Avoid matchcontinue, use tail recursion == 62 89 `matchcontinue` is slow. Whenever possible, use `match` instead. This avoids calling `setjmp`.