about summary refs log tree commit diff stats
path: root/053recipe_header.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-09-11 17:14:48 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-09-11 17:50:36 -0700
commitcdf0f349d1ad432d785cf69c7a136fff07258adf (patch)
treefe88b7b2039e9d50ce5b37cc115315a12f22d797 /053recipe_header.cc
parent68578a7828ce8300fa10b28b5f57e56723303e93 (diff)
downloadmu-cdf0f349d1ad432d785cf69c7a136fff07258adf.tar.gz
3324 - completely redo type abbreviations
The old approach with '&' and '@' modifiers turned out to be a bad idea
because it introduces notions of precedence. Worse, it turns out you
want different precedence rules at different times as the old test
alluded:

  x:@number:3  # we want this to mean (address number 3)
  x:address:@number  # we want this to mean (address array number)

Instead we'll give up and focus on a single extensible mechanism that
allows us to say this instead:

  x:@:number:3
  x:address:@:number

In addition it allows us to shorten other types as well:

  x:&:@:num

  type board = &:@:&:@:char  # for tic-tac-toe

Hmm, that last example reminds me that we don't handle abbreviations
inside type abbreviation definitions so far..
Diffstat (limited to '053recipe_header.cc')
-rw-r--r--053recipe_header.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/053recipe_header.cc b/053recipe_header.cc
index 3f3c5403..d385d41c 100644
--- a/053recipe_header.cc
+++ b/053recipe_header.cc
@@ -221,8 +221,8 @@ def foo x:number -> y:number [
 Transform.push_back(check_calls_against_header);  // idempotent
 :(code)
 void check_calls_against_header(const recipe_ordinal r) {
-  trace(9991, "transform") << "--- type-check calls inside recipe " << get(Recipe, r).name << end();
   const recipe& caller = get(Recipe, r);
+  trace(9991, "transform") << "--- type-check calls inside recipe " << caller.name << end();
   for (int i = 0; i < SIZE(caller.steps); ++i) {
     const instruction& inst = caller.steps.at(i);
     if (inst.operation < MAX_PRIMITIVE_RECIPES) continue;