From 0edd9b9fc60440213e4df926ea511419ee291f1e Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 15 Jun 2018 22:12:03 -0700 Subject: 4257 - abortive attempt at safe fat pointers I've been working on this slowly over several weeks, but it's too hard to support 0 as the null value for addresses. I constantly have to add exceptions for scalar value corresponding to an address type (now occupying 2 locations). The final straw is the test for 'reload': x:num <- reload text 'reload' returns an address. But there's no way to know that for arbitrary instructions. New plan: let's put this off for a bit and first create support for literals. Then use 'null' instead of '0' for addresses everywhere. Then it'll be easy to just change what 'null' means. --- 045closure_name.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to '045closure_name.cc') diff --git a/045closure_name.cc b/045closure_name.cc index e478337d..f5c8d2aa 100644 --- a/045closure_name.cc +++ b/045closure_name.cc @@ -9,9 +9,9 @@ :(scenario closure) def main [ default-space:space <- new location:type, 30 - 1:space/names:new-counter <- new-counter - 2:num/raw <- increment-counter 1:space/names:new-counter - 3:num/raw <- increment-counter 1:space/names:new-counter + 2:space/names:new-counter <- new-counter + 10:num/raw <- increment-counter 2:space/names:new-counter + 11:num/raw <- increment-counter 2:space/names:new-counter ] def new-counter [ default-space:space <- new location:type, 30 @@ -27,7 +27,7 @@ def increment-counter [ return y:num/space:1 ] +name: lexically surrounding space for recipe increment-counter comes from new-counter -+mem: storing 5 in location 3 ++mem: storing 5 in location 11 //: To make this work, compute the recipe that provides names for the //: surrounding space of each recipe. -- cgit 1.4.1-2-gfad0