about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
...
* 2860 - rename 'index-address' to 'put-index'Kartik K. Agaram2016-04-239-99/+78
|
* 2859 - rename 'get-address' to 'get-location'Kartik K. Agaram2016-04-235-1
(function factorial [
  (default-space:space-address <- new space:literal 30:literal)
  (n:integer <- next-input)
  { begin
    ; if n=0 return 1
    (zero?:boolean <- equal n:integer 0:literal)
    (break-unless zero?:boolean)
    (reply 1:literal)
  }
  ; return n*factorial(n-1)
  (x:integer <- subtract n:integer 1:literal)
  (subresult:integer <- factorial x:integer)
  (result:integer <- multiply subresult:integer n:integer)
  (reply result:integer)
])

(function main [
  (1:integer <- factorial 5:literal)
  ($print (("result: " literal)))
  (print-integer nil:literal/terminal 1:integer)
  ($print (("\n" literal)))
])
/tr> * 2838Kartik K. Agaram2016-04-161-1/+1 | * 2837 - fix up 2836Kartik K. Agaram2016-04-151-2/+22 | | | | | | On reflection I think I'd rather add a duplicate test that's closer to how I discovered the problem, without the masking bug in type-matching that was masking the simpler test in the previous commit. * 2836 - arcane bug in generic functionsKartik K. Agaram2016-04-152-0/+37 | | | | Thanks Caleb Couch for finding and reporting this. * 2835 - continue replacing 'get-address' with 'put'Kartik K. Agaram2016-04-151-14/+21 | | | | | | | | | | I have a tack now for issue 2 of 2829 (dealing with wait-for-location): have get-address and index-address return a type that can't be looked up. That way the worst that can happen with an address pointing to a freed location is a routine that randomly hangs and starts working again. And even that won't happen if you disallow transferring the new type across routines in ingredients or channels, just like I plan to do with 'address:shared'. * 2834 - make 'wait-for-location' more intuitiveKartik K. Agaram2016-04-152-11/+18 | | | | | | | Previously to watch an address we had to perform a lookup of it, which the instruction then proceeded to undo. This way wait-for-instruction no longer supports literal ingredients, but the real-world usage becomes cleaner. * 2833Kartik K. Agaram2016-04-141-1/+4 | * 2832 - support static arrays in rewrite_stashKartik K. Agaram2016-04-131-2/+18 | | | | Thanks Ella and Caleb for finding this. * 2831 - bugfix in static arraysKartik K. Agaram2016-04-132-10/+41 | | | | | | | | | | | I'd started using size_of() in transforms at some point, but not gotten around to actually updating it to support arrays before run-time. Wish there was a way I could statically enforce that something is only called at transform time vs runtime. Thanks Ella and Caleb Couch for finding this issue. Static arrays are likely still half-baked, but should get a thorough working-over in coming weeks. * 2830 - bring back deleted test from 2829Kartik K. Agaram2016-04-103-9/+26 | | | | Issue 1 in 2829 is now fixed. * 2829 - issues while switching to 'put'Kartik K. Agaram2016-04-104-51/+27 | | | | | | | | | | | | | | | | 1. It turns out we couldn't overload 'get' and 'get-address' until now, because transform_names looks for those names, and the resolve_ambiguous_calls transform happens before transform_names. Why does resolve_ambiguous_calls happen before transform_names? Because if my students made mistakes in the ingredients to an instruction they got overzealous errors from resolve_ambiguous_calls. Now this impacts 'put' as well, which is already overloaded for tables. Not sure what to do about this; I'm going to go back to the overzealous errors, and just teach students to visually scan past them for now. 2. I need addresses in a third place besides storing to containers and arrays, and managing the heap -- to synchronize routines. wait-for-location requires an address. Not sure what to do about this.. * 2828Kartik K. Agaram2016-04-101-3/+13 | * 2827 - start replacing 'get-address' with 'put'Kartik K. Agaram2016-04-102-0/+79 | | | | | | | Current plan: - get rid of get-address and index-address, and therefore any address that is not address:shared - rename address:shared to just 'shared' * 2826Kartik K. Agaram2016-04-101-4/+12 | * 2825Kartik K. Agaram2016-04-101-2/+2 | * 2824Kartik K. Agaram2016-04-102-11/+0 | | | | | Undo commit 9da3fc3118; looks like we don't need it anymore, and the test was poorly done. Let's see if we hit the error again. * 2823Kartik K. Agaram2016-04-102-7/+7 | * 2822Kartik K. Agaram2016-04-101-1/+1 | * 2821 - addresses before containersKartik K. Agaram2016-04-102-63/+46 | * 2820Kartik K. Agaram2016-04-011-1/+4 | * 2819Kartik K. Agaram2016-03-311-2/+2 | * 2818Kartik K. Agaram2016-03-283-7/+5 | * 2817Kartik K. Agaram2016-03-282-52/+2 | * 2816Kartik K. Agaram2016-03-273-3/+2 | | | | Move all bounds checks for types and recipes to one place. * 2815Kartik K. Agaram2016-03-272-2/+2 | * 2814Kartik K. Agaram2016-03-271-22/+22 | * 2813Kartik K. Agaram2016-03-271-0/+4 | * 2812Kartik K. Agaram2016-03-2799-2852/+3992 | * 2811Kartik K. Agaram2016-03-271-4/+4 |