Closed GoogleCodeExporter closed 8 years ago
thanks for reporting! :-)
the problem is the circular include, which shedskin doesn't handle correctly
yet (board imports piece, piece imports board..). cpython has no problem here
because of late binding.
moving WHITE, BLACK and EMPTY to piece.py and removing the import of board from
piece.py makes compilation go further. after removing some dynamic types as
indicated by shedskin the program compiles and runs.
I'm not sure I will be able to fix this before 0.7, but because circular
includes aren't very pretty anyway, it doesn't have too much priority.. it does
have to be fixed at some point, of course.
good luck with your program, and let me know if you run into anything else! :)
Original comment by mark.duf...@gmail.com
on 25 Nov 2010 at 11:32
Original comment by mark.duf...@gmail.com
on 25 Nov 2010 at 11:33
Hmm, I modified the code according to your directions, and Shedskin compiles
the code without warnings.
But now, when I type "make", G++ shows the following error:
In file included from board.hpp:5,
from main.hpp:6,
from main.cpp:1:
piece.hpp:26: error: ‘__board__’ has not been declared
piece.hpp:26: error: ‘brd’ was not declared in this scope
piece.hpp:26: error: expected primary-expression before ‘sq’
piece.hpp:26: error: initializer expression list treated as compound expression
piece.hpp:27: error: ‘__board__’ has not been declared
piece.hpp:27: error: ‘brd’ was not declared in this scope
piece.hpp:27: error: expected primary-expression before ‘sq’
piece.hpp:27: error: initializer expression list treated as compound expression
main.cpp: In function ‘void __main__::__init()’:
main.cpp:23: error: ‘__piece__::calc_moves’ cannot be used as a function
In file included from board.hpp:5,
from board.cpp:1:
piece.hpp:26: error: ‘__board__’ has not been declared
piece.hpp:26: error: ‘brd’ was not declared in this scope
piece.hpp:26: error: expected primary-expression before ‘sq’
piece.hpp:26: error: initializer expression list treated as compound expression
piece.hpp:27: error: ‘__board__’ has not been declared
piece.hpp:27: error: ‘brd’ was not declared in this scope
piece.hpp:27: error: expected primary-expression before ‘sq’
piece.hpp:27: error: initializer expression list treated as compound expression
However, if I modify main.py to:
# main.py
import board, piece
brd = board.Board()
brd.print_board()
This means there are problems passing brd to piece.calc_moves.
brd never gets modified, or returned, so I'm clueless.
Do you know whats going on?
I've included the new source, to help.
Original comment by kotux...@gmail.com
on 25 Nov 2010 at 8:27
Attachments:
ah, this is another problem that I fixed after 0.6. please pull from GIT:
gitorious.org/shedskin.
Original comment by mark.duf...@gmail.com
on 25 Nov 2010 at 9:08
Got it. Thanks!
Original comment by kotux...@gmail.com
on 25 Nov 2010 at 9:28
alright, after fixing a minor bug, the original program works from GIT now. it
may not work anymore after you change it though, because I still have to fix
one more problem for this to work in general.. so I will leave this issue open
until that one is solved, hopefully before 0.7 in about two weeks. thanks again
for reporting!
Original comment by mark.duf...@gmail.com
on 27 Nov 2010 at 2:17
fixed! :D
please let me know if you run into anything else!
Original comment by mark.duf...@gmail.com
on 27 Nov 2010 at 11:40
Original issue reported on code.google.com by
kotux...@gmail.com
on 25 Nov 2010 at 4:06Attachments: