summary refs log tree commit diff stats
path: root/lib
Commit message (Expand)AuthorAgeFilesLines
* implemented locking levels; still incompleteAraq2014-09-271-0/+2
* deepCopy is instantiated when its corresponding type is instantiatedAraq2014-09-261-9/+9
* added $* for subexesAraq2014-09-241-0/+3
* made tests greenAraq2014-09-221-2/+2
* Merge branch 'bigbreak' of https://github.com/Araq/Nimrod into bigbreakAraq2014-09-221-2/+2
|\
| * Fix the C++ exception struct in nimbase.h.Reimer Behrends2014-09-211-2/+2
* | made some tests greenAraq2014-09-211-3/+4
|/
* Fix --gc:none with --cs:partial.Dominik Picheta2014-09-191-1/+1
* Merge branch 'devel' of https://github.com/Araq/Nimrod into bigbreakAraq2014-09-191-10/+18
|\
| * Various fixes to how the Boehm GC's interface.Reimer Behrends2014-09-181-10/+18
* | Merge branch 'bigbreak' of https://github.com/Araq/Nimrod into bigbreakAraq2014-09-194-1/+33
|\ \
| * | Fixes asyncnet example.Dominik Picheta2014-09-181-1/+2
| * | Adds socket creation for arbitrary domain, type and protocol.Dominik Picheta2014-09-184-0/+31
* | | updated pdcurses.nimAraq2014-09-191-3/+3
* | | cleaned up openssl.nim a bitAraq2014-09-191-41/+42
* | <
//: Calls can also generate products, using 'reply'.

:(scenario reply)
recipe main [
  1:number, 2:number <- f 34
]
recipe f [
  12:number <- next-ingredient
  13:number <- add 1, 12:number
  1
-7/+7
| * | resolved conflictAraq2014-09-1317-259/+352
| |\ \
| * \ \ merged things from develAraq2014-09-125-11/+51
| |\ \ \ | | | |/ | | |/|
| | * | manual merge of #1526Araq2014-09-111-1/+1
| | * | Threads work againAraq2014-09-111-32/+46
| | * | fixes #1444Araq2014-09-112-3/+3
| | * | Merge pull request #1404 from def-/strutils-countAndreas Rumpf2014-09-051-0/+35
| | |\ \
| | | * | overlapping as a parameter for count insteaddef2014-07-281-17/+9
| | | * | Add count procedures to strutilsdef2014-07-231-0/+43
| | * | | Merge pull request #1514 from fuzzthink/develSimon Hafner2014-09-021-2/+2
| | |\ \ \
| | | * | | Pointer -> pointer to fix compile error using --cs:partialfuzzthink2014-09-021-2/+2
| | * | | | Merge pull request #1509 from idlewan/cookiesAndreas Rumpf2014-09-011-6/+9
| | |\ \ \ \
| | | * | | | Secure and HttpOnly cookiesErwan Ameil2014-08-301-6/+9
| | * | | | | Escape ' and / when using escape in xmltreeErwan Ameil2014-08-301-0/+4
| | |/ / / /
* | | | | / NimFix on net and rawsockets modules.Dominik Picheta2014-09-132-8/+8
| |_|_|_|/ |/| | | |
* | | | | More docgen fixes.Dominik Picheta2014-09-137-228/+163
* | | | | Some docgen fixes.Dominik Picheta2014-09-132-3/+4
* | | | | Fixes fdSet CS problems in asyncio.Dominik Picheta2014-09-121-2/+2
* | | | | Lots of documentation improvements for asyncdispatch.Dominik Picheta2014-09-127-26/+183
|/ / / /
* | | | renamed URLencode to encodeUrlAraq2014-09-101-7/+9
"'same-as-ingredient' metadata overflows ingredients in: " << caller_instruction.to_string() << '\n' << end(); if (!is_dummy(caller_instruction.products.at(i)) && caller_instruction.products.at(i).value != caller_instruction.ingredients.at(ingredient_index).value) raise << maybe(current_recipe_name()) << "'same-as-ingredient' product from call to " << callee << " must be " << caller_instruction.ingredients.at(ingredient_index).original_string << " rather than " << caller_instruction.products.at(i).original_string << '\n' << end(); } } // End Reply finish_reply: break; // continue to process rest of *caller* instruction } //: Products can include containers and exclusive containers, addresses and arrays. :(scenario reply_container) recipe main [ 3:point <- f 2 ] recipe f [ 12:number <- next-ingredient 13:number <- copy 35 reply 12:point/raw # unsafe ] +run: result 0 is [2, 35] +mem: storing 2 in location 3 +mem: storing 35 in location 4 //: In mu we'd like to assume that any instruction doesn't modify its //: ingredients unless they're also products. The /same-as-ingredient inside //: the recipe's 'reply' will help catch accidental misuse of such //: 'ingredient-products' (sometimes called in-out parameters in other languages). :(scenario reply_same_as_ingredient) % Hide_warnings = true; recipe main [ 1:number <- copy 0 2:number <- test1 1:number # call with different ingredient and product ] recipe test1 [ 10:address:number <- next-ingredient reply 10:address:number/same-as-ingredient:0 ] +warn: main: 'same-as-ingredient' product from call to test1 must be 1:number rather than 2:number :(scenario reply_same_as_ingredient_dummy) % Hide_warnings = true; recipe main [ 1:number <- copy 0 _ <- test1 1:number # call with different ingredient and product ] recipe test1 [ 10:address:number <- next-ingredient reply 10:address:number/same-as-ingredient:0 ] $warn: 0 :(code) string to_string(const vector<double>& in) { if (in.empty()) return "[]"; ostringstream out; if (SIZE(in) == 1) { out << no_scientific(in.at(0)); return out.str(); } out << "["; for (long long int i = 0; i < SIZE(in); ++i) { if (i > 0) out << ", "; out << no_scientific(in.at(i)); } out << "]"; return out.str(); } //: Conditional reply. :(scenario reply_if) recipe main [ 1:number <- test1 ] recipe test1 [ reply-if 0, 34 reply 35 ] +mem: storing 35 in location 1 :(scenario reply_if_2) recipe main [ 1:number <- test1 ] recipe test1 [ reply-if 1, 34 reply 35 ] +mem: storing 34 in location 1 :(before "End Rewrite Instruction(curr)") // rewrite `reply-if a, b, c, ...` to // ``` // jump-unless a, 1:offset // reply b, c, ... // ``` if (curr.name == "reply-if") { if (curr.products.empty()) { curr.operation = Recipe_ordinal["jump-unless"]; curr.name = "jump-unless"; vector<reagent> results; copy(++curr.ingredients.begin(), curr.ingredients.end(), inserter(results, results.end())); curr.ingredients.resize(1); curr.ingredients.push_back(reagent("1:offset")); result.steps.push_back(curr); curr.clear(); curr.operation = Recipe_ordinal["reply"]; curr.name = "reply"; curr.ingredients.swap(results); } else { raise << "'reply-if' never yields any products\n" << end(); } } // rewrite `reply-unless a, b, c, ...` to // ``` // jump-if a, 1:offset // reply b, c, ... // ``` if (curr.name == "reply-unless") { if (curr.products.empty()) { curr.operation = Recipe_ordinal["jump-if"]; curr.name = "jump-if"; vector<reagent> results; copy(++curr.ingredients.begin(), curr.ingredients.end(), inserter(results, results.end())); curr.ingredients.resize(1); curr.ingredients.push_back(reagent("1:offset")); result.steps.push_back(curr); curr.clear(); curr.operation = Recipe_ordinal["reply"]; curr.name = "reply"; curr.ingredients.swap(results); } else { raise << "'reply-unless' never yields any products\n" << end(); } }