wasmer-python
                                
                                
                                
                                    wasmer-python copied to clipboard
                            
                            
                            
                        Example of TableType FUNC_REF
Thanks for proposing a new feature!
Motivation
I want to import a FUNC_REF table into my module.
Proposed solution
I would like to see an example like this in the docs and tests:
    table = Table(store, TableType(Type.FUNC_REF, minimum=0, maximum=10 ), INITIAL_VALUE)
What is INITIAL_VALUE?
All the elements in the table will be set to the initial_value value. We must update the documentation accordingly, sorry for missing this!
I think the question is what kind of Value is needed for initial_value? I've tried Value.i32 and all the others and every time it raises an exception saying that "val is not funcref".
Table(STORE, TableType(Type.FUNC_REF, 8, 8), Value.i64(8))
#                      what do we put here? ^
                                    
                                    
                                    
                                
I have the same problem, maybe it is self address?
class Table:
    def __init__(self, store, tabletype):
        self.initial_value = Value.i64(id(self))
or it can be ignored?
I think the question is what kind of
Valueis needed forinitial_value? I've triedValue.i32and all the others and every time it raises an exception saying that "val is not funcref".Table(STORE, TableType(Type.FUNC_REF, 8, 8), Value.i64(8)) # what do we put here? ^
I also have this problem,Have you reached a conclusion