sstork / plaid-lang

Automatically exported from code.google.com/p/plaid-lang
0 stars 0 forks source link

Cannot set default field values, must manually instantiate #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
I've attached a test case that reproduces the problem.  On line 29 the field 
"head" is assigned a 
default of Nil value upon instantiation.  When the prepend() method is called, 
it pattern matches on 
the state of "head".  I've also attached an alternate version that works due to 
manual assignment to 
the head field at the point of instantiation.

What is the expected output? What do you see instead?
When calling prepend, it is expected that the field "head" will be either a 
Cons or Nil state.  Instead, 
an exception is thrown stating that the pattern match was exhausted.

I believe this is due to the fact that when the state is instantiated we set 
the head field to be a 
PlaidMethodMap instead of a PlaidObjectMap.

Original issue reported on code.google.com by mhahn...@gmail.com on 19 May 2010 at 7:13

Attachments:

GoogleCodeExporter commented 9 years ago
This is the "fixed" version of the test file.

Original comment by mhahn...@gmail.com on 19 May 2010 at 7:18

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by mhahn...@gmail.com on 20 May 2010 at 7:45