frankpfenning / C0

C0 Language
4 stars 0 forks source link

For loops can cause error in coin #56

Closed robsimmons closed 9 years ago

robsimmons commented 10 years ago

Student reported:

Hi,

I was using coin to do my homework, when I came across the error: "Error (INTERNAL, PLEASE REPORT): No mark for mExp", and I figured that I should report it.

Steps to reproduce: Load the file pelltest.c0 with coin (coin -d pelltest.c0) Execute the following:

-->for(int p = 1; p < 20; p++) {
... fastpell(p); }

This returns the error as stated above.

frankpfenning commented 10 years ago

Oh, shoot, this might be because I needed to change some marking of source expressions slightly to get -w (syntactic warnings) to work correctly. Seems to be a bad interaction with -d, somehow.

On Wed, Sep 11, 2013 at 10:25 PM, Robert J. Simmons < notifications@github.com> wrote:

Student reported:

Hi,

I was using coin to do my homework, when I came across the error: "Error (INTERNAL, PLEASE REPORT): No mark for mExp", and I figured that I should report it.

Steps to reproduce: Load the file pelltest.c0 with coin (coin -d pelltest.c0) Execute the following:

-->for(int p = 1; p < 20; p++) { ... fastpell(p); }

This returns the error as stated above.

— Reply to this email directly or view it on GitHubhttps://github.com/frankpfenning/C0/issues/56 .

Frank Pfenning, Professor and Head Department of Computer Science Carnegie Mellon University Pittsburgh, PA 15213-3891

http://www.cs.cmu.edu/~fp +1 412 268-6343

robsimmons commented 10 years ago

Penny reported something similar over the summer that I never tracked down, so I wouldn't necessarily blame -w just yet.

On Wed, Sep 11, 2013 at 10:57 PM, Frank Pfenning notifications@github.comwrote:

Oh, shoot, this might be because I needed to change some marking of source expressions slightly to get -w (syntactic warnings) to work correctly. Seems to be a bad interaction with -d, somehow.

On Wed, Sep 11, 2013 at 10:25 PM, Robert J. Simmons < notifications@github.com> wrote:

Student reported:

Hi,

I was using coin to do my homework, when I came across the error: "Error (INTERNAL, PLEASE REPORT): No mark for mExp", and I figured that I should report it.

Steps to reproduce: Load the file pelltest.c0 with coin (coin -d pelltest.c0) Execute the following:

-->for(int p = 1; p < 20; p++) { ... fastpell(p); }

This returns the error as stated above.

— Reply to this email directly or view it on GitHub< https://github.com/frankpfenning/C0/issues/56> .

Frank Pfenning, Professor and Head Department of Computer Science Carnegie Mellon University Pittsburgh, PA 15213-3891

http://www.cs.cmu.edu/~fp +1 412 268-6343

— Reply to this email directly or view it on GitHubhttps://github.com/frankpfenning/C0/issues/56#issuecomment-24292069 .

Robert J. Simmons simrob.com rjsimmon@cs.cmu.edu robsimmons@gmail.com Cell: 404-273-6890

robsimmons commented 9 years ago

Confirming that it is an issue with -d

whitewater:images rjsimmon$ coin
C0 interpreter (coin) 0.3.3 'Nickel' (r438, Thu Jan  8 22:56:01 EST 2015)
Type `#help' for help or `#quit' to exit.
--> for (int i = 0; i < 10; i++) {}

whitewater:images rjsimmon$ coin -d
C0 interpreter (coin) 0.3.3 'Nickel' (r438, Thu Jan  8 22:56:01 EST 2015)
Type `#help' for help or `#quit' to exit.
--> for (int i = 0; i < 10; i++) {}
Error (INTERNAL, PLEASE REPORT): No mark for mExp

will look at this again tonight.

robsimmons commented 9 years ago

Never found the actual bug, so while it annoys me I solved this by adding a fake mark in the ast->coin compiler.

frankpfenning commented 9 years ago

I never liked the design where the "marks" actually played a semantic role. It's too fragile and not well enough documented. But I wouldn't like it even if it were.

I think we need to get rid of it. Meeting some time?

On Wed, Jan 21, 2015 at 8:09 PM, Robert J. Simmons <notifications@github.com

wrote:

Never found the actual bug, so while it annoys me I solved this by adding a fake mark in the ast->coin compiler.

— Reply to this email directly or view it on GitHub https://github.com/frankpfenning/C0/issues/56#issuecomment-70960107.

Frank Pfenning, Professor and Head Department of Computer Science Carnegie Mellon University Pittsburgh, PA 15213-3891

http://www.cs.cmu.edu/~fp +1 412 268-6343 GHC 7019