Commit Graph

24 Commits

Author SHA1 Message Date
Kartik K. Agaram
9a81d7460f 3561 2016-10-22 16:56:07 -07:00
Kartik K. Agaram
78c5020531 3374 2016-09-16 23:57:55 -07:00
Kartik K. Agaram
d63cddeac0 3364 2016-09-15 13:23:00 -07:00
Kartik K. Agaram
555d95c168 3327 2016-09-11 18:17:46 -07:00
Kartik K. Agaram
ce2e604ec9 3285 2016-08-31 09:53:11 -07:00
Kartik K. Agaram
3369875ccd 3233 - change how Mu escapes strings
Thanks Sam Putman for helping think through this idea.

When you encounter a backslash, strip it out and pass through any
following run of backslashes. If we 'escaped' a single following
character like C, then the character '\' would be the same as:

  '\\' escaped once
  '\\\\' escaped twice
  '\\\\\\\\' escaped thrice (8 backslashes)

..and so on, the number of backslashes doubling each time. Instead, our
approach is to make the character '\' the same as:

  '\\' escaped once
  '\\\' escaped twice
  '\\\\' escaped thrice

..and so on, the number of backslashes merely increasing by one each
time.

This approach only works as long as backslashes aren't also overloaded
to create special characters. So Mu doesn't follow C's approach of
overloading backslashes both to escape quote characters and also as a
notation for unprintable characters like '\n'.
2016-08-20 19:44:07 -07:00
Kartik K. Agaram
00dd668593 3179 2016-08-13 21:21:08 -07:00
Kartik K. Agaram
2589de994d 3081
Thanks Ella Couch for reporting this.
2016-06-30 10:45:26 -07:00
Kartik K. Agaram
9c30b38376 3008 2016-05-25 18:56:37 -07:00
Kartik K. Agaram
acc4792d2f 2803
Show more thorough information about instructions in the trace, but keep
the original form in error messages.
2016-03-21 02:25:52 -07:00
Kartik K. Agaram
f1e09b1472 2775 - test rewrite-stash transform 2016-03-13 23:09:40 -07:00
Kartik K. Agaram
1ead356219 2735 - define recipes using 'def'
I'm dropping all mention of 'recipe' terminology from the Readme. That
way I hope to avoid further bike-shedding discussions while I very
slowly decide on the right terminology with my students.

I could be smarter in my error messages and use 'recipe' when code uses
it and 'function' otherwise. But what about other words like ingredient?
It would all add complexity that I'm not yet sure is worthwhile. But I
do want separate experiences for veteran programmers reading about Mu on
github and for people learning programming using Mu.
2016-03-08 01:46:47 -08:00
Kartik K. Agaram
1b76245c63 2712 2016-02-26 13:04:55 -08:00
Kartik K. Agaram
c4e143d6ea 2681 - drop reagent types from reagent properties
All my attempts at staging this change failed with this humongous commit
that took all day and involved debugging three monstrous bugs. Two of
the bugs had to do with forgetting to check the type name in the
implementation of shape-shifting recipes. Bug #2 in particular would
cause core tests in layer 59 to fail -- only when I loaded up edit/! It
got me to just hack directly on mu.cc until I figured out the cause
(snapshot saved in mu.cc.modified). The problem turned out to be that I
accidentally saved a type ingredient in the Type table during
specialization. Now I know that that can be very bad.

I've checked the traces for any stray type numbers (rather than names).

I also found what might be a bug from last November (labeled TODO), but
we'll verify after this commit.
2016-02-21 20:40:06 -08:00
Kartik K. Agaram
65c905fe84 2678
Start using type names from the type tree rather than the property tree
in most places. Hopefully the only occurrences of
'properties.at(0).second' left are ones where we're managing it. Next we
can stop writing to it.
2016-02-20 20:17:07 -08:00
Kartik K. Agaram
343bc5359b 2677
Include type names in the type tree. Though we aren't using them yet.
2016-02-20 08:54:42 -08:00
Kartik K. Agaram
8a3d101e3d 2689 - consistently use s-exp syntax in traces 2016-02-19 14:27:01 -08:00
Kartik K. Agaram
9f95c7451b 2685
Stack of plans for cleaning up replace_type_ingredients() and a couple
of other things, from main problem to subproblems:

  include type names in the type_tree rather than in the separate properties vector
  make type_tree and string_tree real cons cells, with separate leaf nodes
  redo the vocabulary for dumping various objects:
    do we really need to_string and debug_string?
    can we have a version with *all* information?
    can we have to_string not call debug_string?

This commit nibbles at the edges of the final task, switching from
member method syntax to global function like almost everything else. I'm
mostly using methods just for STL in this project.
2016-02-19 13:42:45 -08:00
Kartik K. Agaram
1f7e3c056c 2614 - still fixing bugs with missing '['
When skipping past some text (usually whitespace, but also commas and
comments) I need to always be aware of whether it's ok to switch to the
next line or not.
2015-12-02 17:11:58 -08:00
Kartik K. Agaram
08cf048f2a 2454
Another gotcha uncovered in the process of sorting out the previous
commit: I keep using eof() but forgetting that there are two other
states an istream can get into. Just never use eof().
2015-11-17 01:21:00 -08:00
Kartik K. Agaram
d18d1d3d2a 2452 2015-11-16 22:39:14 -08:00
Kartik K. Agaram
795f5244ab 2377 - stop using operator[] in map
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.
2015-11-06 11:17:25 -08:00
Kartik K. Agaram
5683823abe 2334 2015-10-31 21:56:17 -07:00
Kartik K. Agaram
8ad4b0f423 2317 2015-10-29 13:03:06 -07:00