Skip to content

Commit

Permalink
Explain in comments why static argument mapping exists (because it is…
Browse files Browse the repository at this point in the history
… a good design but I wanted to replace it).
  • Loading branch information
gabordemooij committed Aug 30, 2024
1 parent 29cb9ae commit d149cfe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions base.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ ctr_object* ctr_object_case_do( ctr_object* myself, ctr_argument* argumentList )
* ✎ write: y, stop.
*/
ctr_object* ctr_object_message( ctr_object* myself, ctr_argument* argumentList ) {
//@important! we use a List because message+arguments would exceed argument limit!
ctr_object* message = ctr_internal_cast2string( argumentList->object );
ctr_object* arr = argumentList->next->object;
if ( arr->info.type != CTR_OBJECT_TYPE_OTARRAY ) {
Expand Down
1 change: 1 addition & 0 deletions world.c
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,7 @@ ctr_object* ctr_send_message(ctr_object* receiverObject, char* message, long vle
mesgArgument = (ctr_argument*) ctr_heap_allocate( sizeof( ctr_argument ) );
mesgArgument->object = ctr_build_string(message, vlen);
mesgArgument->next = argumentList;
//@important! static argument signatures because this is direct 1-to-1 map on actual methods! Don't be tempted to change to list!
if (argCount == 0 || argCount > 3) {
returnValue = ctr_send_message(receiverObject, CTR_DICT_RESPOND_TO, strlen(CTR_DICT_RESPOND_TO), mesgArgument);
} else if (argCount == 1) {
Expand Down

0 comments on commit d149cfe

Please sign in to comment.