Native marker for solidified code #191
Replies: 2 comments 20 replies
-
Do you mean that these symbols will generate a placeholder and then implement C native functions by myself? |
Beta Was this translation helpful? Give feedback.
-
Hello, sorry for this necro, however I am wondering whether something like this was ever implemented. I am facing an issue with this code: class SpectodaInterface
def init()
print('Initializing SpectodaInterface')
end
def emit(eventIdentifier, value)
print("[BE]: Called with eventIdentifier: "+ eventIdentifier + " and value: " + value)
native_emit(eventIdentifier, value)
end
end
import solidify
solidify.dump(SpectodaInterface) This will always call this error: class SpectodaInterface
def init()
print('Initializing SpectodaInterface')
end
def native_emit()
# To be implemented by the native side
end
def emit(eventIdentifier, value)
print("[BE]: Called with eventIdentifier: "+ eventIdentifier + " and value: " + value)
native_emit(eventIdentifier, value)
end
end
import solidify
solidify.dump(SpectodaInterface) But still no success. Note: The native_emit function is register using this Thank you |
Beta Was this translation helpful? Give feedback.
-
I have made some improvements in solidify that I need to upload...
Now
solidify
works with modules, classes, lists, maps... But when it comes to classes or modules with native functions, there is no way to mark them as native.I would like to have a Berry skeleton, solidify it and then add native functions. I see two alternatives to do that.
1/ add
native
keyworkPros: allow any name
Cons: adds a new reserved keyword
2/ use a naming convention, like any name starting with
ntv_
ornative_
Pros: no change in parser
Cons: naming by convention... Some people don't like it
Afterthoughts I prefer option 2.
Beta Was this translation helpful? Give feedback.
All reactions