VanL / shedskin

Shed Skin is an experimental compiler, that can translate pure, but implicitly statically typed Python (2.4-2.6) programs into optimized C++
0 stars 1 forks source link

*ERROR* TaskMgr.py:122: unbound identifier 'meuk' #142

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
[generating c++ code..]
*ERROR* TaskMgr.py:122: unbound identifier 'meuk'

code:
Var = Task["Function"](self)

What is the expected output? What do you see instead?
to work lol. To ahve a c++ output.

What version of the product are you using? On what operating system?
Newest one that is posted under downloads.

Please provide any additional information below.
Not sure what the error really means, but I think it is at that line from that 
number it gives.

The code calls that a function passing it "self" to the function so the 
function can call things from this function.

Original issue reported on code.google.com by adr2tra...@gmail.com on 8 Jul 2011 at 4:29

GoogleCodeExporter commented 9 years ago
I also added the file. It's my work, so I am giving you use to change it into 
c++. I know the code wont see a speed up really, but it be cool to see it 
working in c++. A sample use of the code can be found online here, also: 
http://www.python-forum.org/pythonforum/viewtopic.php?f=2&t=26365

It could be breaking a lot of rules for your setup, but I don't know lol. If 
you need more doc info, I will be happy to supply more help with in the code to 
better understand how it works.

Original comment by adr2tra...@gmail.com on 8 Jul 2011 at 4:39

Attachments:

GoogleCodeExporter commented 9 years ago
thanks for reporting! I'm afraid the program does several things that are 
(currently) not supported by shedskin. please see the sections 'typing 
restrictions' and 'python subset restrictions' in the documentation for 
details. 

for one, passing around methods is not supported. it also looks like there's a 
dictionary with different types of elements in there. the dictionary can 
probably rewritten as a class, but I don't know about the method passing.

I agree the error message can be clearer than 'meuk' thoug.. :-) so I will keep 
the issue open and see if I can provide a nicer message for shedskin 0.9.. 

thanks again!

Original comment by mark.duf...@gmail.com on 8 Jul 2011 at 9:21

GoogleCodeExporter commented 9 years ago

Original comment by mark.duf...@gmail.com on 8 Jul 2011 at 9:24

GoogleCodeExporter commented 9 years ago
Np ^^ I did find some c++ code that may fix it... not sure if it is the same 
idea... maybe a good read for when you do add method support. 
http://stackoverflow.com/questions/9410/how-do-you-pass-a-function-as-a-paramete
r-in-c

http://www.cprogramming.com/tutorial/function-pointers.html

Original comment by adr2tra...@gmail.com on 8 Jul 2011 at 9:52

GoogleCodeExporter commented 9 years ago
thanks! ;) I know how to implement them, but there are some nasty issues in the 
background.. 

Original comment by mark.duf...@gmail.com on 8 Jul 2011 at 3:12

GoogleCodeExporter commented 9 years ago
thanks again for reporting. I cleaned up the warnings a bit that get triggered 
by this. shedskin now explicitly mentions that method passing is not supported, 
instead of something about 'meuk', and doesn't abort the compilation process, 
but keeps on going now, producing other related warnings. so I'm marking this 
one as fixed.

Original comment by mark.duf...@gmail.com on 15 Jul 2011 at 12:34