about summary refs log tree commit diff stats
path: root/064random.cc
Commit message (Collapse)AuthorAgeFilesLines
* 2377 - stop using operator[] in mapKartik K. Agaram2015-11-061-5/+5
| | | | | | | | | | | | | | | | I'm still seeing all sorts of failures in turning on layer 11 of edit/, so I'm backing away and nailing down every culprit I run into. First up: stop accidentally inserting empty objects into maps during lookups. Commands run: $ sed -i 's/\(Recipe_ordinal\|Recipe\|Type_ordinal\|Type\|Memory\)\[\([^]]*\)\] = \(.*\);/put(\1, \2, \3);/' 0[1-9]* $ vi 075scenario_console.cc # manually fix up Memory[Memory[CONSOLE]] $ sed -i 's/\(Memory\)\[\([^]]*\)\]/get_or_insert(\1, \2)/' 0[1-9]* $ sed -i 's/\(Recipe_ordinal\|Type_ordinal\)\[\([^]]*\)\]/get(\1, \2)/' 0[1-9]* $ sed -i 's/\(Recipe\|Type\)\[\([^]]*\)\]/get(\1, \2)/' 0[1-9]* Now mu dies pretty quickly because of all the places I try to lookup a missing value.
* 2258 - separate warnings from errorsKartik K. Agaram2015-10-061-3/+3
| | | | | | | At the lowest level I'm reluctantly starting to see the need for errors that stop the program in its tracks. Only way to avoid memory corruption and security issues. But beyond that core I still want to be as lenient as possible at higher levels of abstraction.
* 2232Kartik K. Agaram2015-10-011-5/+17
|
* 2226 - standardize warning formatKartik K. Agaram2015-10-011-2/+2
| | | | | | | | Always show recipe name where error occurred. But don't show internal 'interactive' name for sandboxes, that's just confusing. What started out as warnings are now ossifying into errors that halt all execution. Is this how things went with C and Unix as well?
* 1923Kartik K. Agaram2015-08-021-1/+1
| | | | | | | | | | Still iterating on the right way to handle incorrect number of ingredients. My first idea of creating null results doesn't really work once they're used in later instructions. Just add a warning at one place in the run loop, but otherwise only add products when there's something to save in them. Undoes some work around commit 1886.
* 1886 - gracefully handle malformed ingredientsKartik K. Agaram2015-07-291-1/+1
| | | | | | | | For example: x:number <- index y:address:array:number, 3 (forgetting to do a lookup) Thanks Caleb Couch.
* 1848 - core instructions now check for ingredientsKartik K. Agaram2015-07-251-1/+8
| | | | Also standardized warnings.
* 1777 - consistent terminology: 'product'Kartik K. Agaram2015-07-131-1/+1
|
* 1702 - experiment: start using 'ordinal' in namesKartik K. Agaram2015-07-041-3/+3
| | | | | | | It comes up pretty early in the codebase, but hopefully won't come up in the mu level until we get to higher-order recipes. Potentially intimidating name, but such prime real estate with no confusing overloadings in other projects!
* 1441 - give up on unit tests for 'random'Kartik K. Agaram2015-05-231-1/+2
| | | | | | | | | | I'd been hoping that I could simply pass in the previously-returned number to srand() to generate the next one in the series. But looks like rand() is more stateful than that. Another weirdness: I put in 'round' in the same layer because of the vague idea that it would help generate random integers. But that's all we get anyway.
* 1438Kartik K. Agaram2015-05-231-0/+42