sunwinson
2012-11-12 14:10:05 UTC
I was confused about how "curlyBrackets" or "squareBrackets" are over rided by runtime.
[Example]
I saw some wonderful example about redefining curlyBrackets or squareBrackets, to create graceful DSL to handle the next txt file:
{
"Blair, Black": 10,
"John, Kelly": 11
}
Redefining "curlyBrackets" can operate the item one by by as a map.
[My Research]
I searched:
1. all slotNames of "Object" for "curlyBrackets", none was found.
2. source code of Io language, only find one instance in Lexer, which returns "curlyBrackets" as the name of IDENTIFIER token and finally become the name of IoObject/IoObjectData. The weird thing is, it seems no one is using IoObject name or IDENTIFIER in parser. May I miss anything in source code?
[My Guess]
1. "curlyBrackets" should be some one's secret slot name, but I didn't find in reference nor Object/Lobby.
2. "curlyBrackets" is specially proceed in parser, to check "if anyone implement that name, then use the specified method object".
Could anyone can help me to understand how this "curlyBrackets" works from complier perspective? Thanks a lot!
[Example]
I saw some wonderful example about redefining curlyBrackets or squareBrackets, to create graceful DSL to handle the next txt file:
{
"Blair, Black": 10,
"John, Kelly": 11
}
Redefining "curlyBrackets" can operate the item one by by as a map.
[My Research]
I searched:
1. all slotNames of "Object" for "curlyBrackets", none was found.
2. source code of Io language, only find one instance in Lexer, which returns "curlyBrackets" as the name of IDENTIFIER token and finally become the name of IoObject/IoObjectData. The weird thing is, it seems no one is using IoObject name or IDENTIFIER in parser. May I miss anything in source code?
[My Guess]
1. "curlyBrackets" should be some one's secret slot name, but I didn't find in reference nor Object/Lobby.
2. "curlyBrackets" is specially proceed in parser, to check "if anyone implement that name, then use the specified method object".
Could anyone can help me to understand how this "curlyBrackets" works from complier perspective? Thanks a lot!