8000 ChaiScript As A Behavior Engine - Redefinition Issue · ChaiScript ChaiScript · Discussion #569 · GitHub
[go: up one dir, main page]

Skip to content

ChaiScript As A Behavior Engine - Redefinition Issue #569

Answered by totalgee
Avienneau asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Aaron, what I mentioned in my earlier comment was an idea to return a Map of named functions for each loaded behaviour (or some other way to just return the behaviour data without defining it in global functions). Then you don't need to worry about prefixing things and unique names; instead you store them in a dictionary of named behaviours (each of which has any number of named "callback" functions). You don't store them in variables in the ChaiScript context, and you can redefine them (by loading again and updating the behaviour dictionary) whenever you want.

Here is a moderately simple example of that technique (though complex enough to show a few more possibilities)...it's just one…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@Avienneau
Comment options

@Avienneau
Comment options

Comment options

You must be logged in to vote
1 reply
@Avienneau
Comment options

8000
Answer selected by Avienneau
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
0