-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pattern matching #40
Comments
Ack, it looks like I screwed up a merge somewhere. Give me some time and I'll try to dig up the working version from the git history. |
Fixed it, I think 316b4ac |
Nope, sorry, this still doesn't work. Two new testcases for pattern_test.py that fail: def test_block_entered(self):
" See https://github.com/lihaoyi/macropy/issues/40 "
with patterns:
return
raise Exception("with block not entered")
def test_pattern_function(self):
def sum(foo):
with patterns:
Foo(x, y) << foo
return x + y
self.assertEquals(sum(Foo(1, 2)), 3) |
Hmmm lemme take another look |
No hurry, I'll be busy with other things for a few days. |
@jnhnum1 could you take a look at this? |
yeah, I'm at work now but I'll take a look at it later tonight. |
I'm guessing we'll need to do this (#15) before we can be really confident of pattern matching working in the general case. |
I moved pattern matching (together with TCO) into |
Sorry, I probably screwed up more than one thing while doing the big refactorings (e.g. converting how block macros work) |
Pattern matching seems to be broken since 774461c, where also most of the tests got removed.
For example, the following code prints None on current revision (from readme):
The python code created (by unparse_ast) is following. Note the area function.
The text was updated successfully, but these errors were encountered: