This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """Reduce the Lean `Aeneas.Std.Error` enum to the cases that behave differently. | |
| The Lean library models Rust failures with a 7-constructor `Error` enum. Every one | |
| of `integerOverflow`, `divisionByZero`, `arrayOutOfBounds`, `maximumSizeExceeded` | |
| and `assertionFailure` is just a Rust panic, so they are all collapsed into | |
| `panic`, leaving only the genuine distinction between a panic and UB: | |
| inductive Error where | |
| | panic: Error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * @description: A code snippet that mimics the popular Select * SQL syntax in force.com's Apex language. | |
| */ | |
| // Initialize setup variables | |
| String objectName = 'Contact'; // modify as needed | |
| String query = 'SELECT'; | |
| Map<String, Schema.SObjectField> objectFields = Schema.getGlobalDescribe().get(objectName).getDescribe().fields.getMap(); | |
| // Grab the fields from the describe method and append them to the queryString one by one. |