Skip to content

Commit

Permalink
Fix alist to dict handling in iOS 2.73
Browse files Browse the repository at this point in the history
Change-Id: Ibc83e0aae5d5fb58c89591079cb8117a08c105b9
  • Loading branch information
ewpatton authored and SusanRatiLane committed Jan 23, 2025
1 parent d84ccfd commit fbb7e1c
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions appinventor/schemekit/src/yail.m
Original file line number Diff line number Diff line change
Expand Up @@ -1430,12 +1430,25 @@ pic_value yail_get_simple_name(pic_state *pic) {

pic_get_args(pic, "o", &entries);

if (!yail_list_p(pic, entries)) {
YailDictionary *dict = nil;
if (yail_list_p(pic, entries)) {
YailList *listOfEntries = yail_list_objc(pic, entries);
dict = [YailDictionary dictionaryFromPairs:pic_cdr(pic, listOfEntries.value)];
} else if (pic_pair_p(pic, entries)) {
pic_value car = pic_car(pic, entries);
if (pic_eq_p(pic, pic_intern(pic, pic_str_value(pic, "*list*", 6)), car)) {
dict = [YailDictionary dictionaryFromPairs:pic_cdr(pic, entries)];
} else {
pic_error(pic, "YailDictionary:alistToDict: Received malformed list", 1, entries);
}
} else {
pic_error(pic, "YailDictionary:alistToDict: YailList required", 1, entries);
}
YailList *listOfEntries = yail_list_objc(pic, entries);
YailDictionary *dict = [YailDictionary dictionaryFromPairs:pic_cdr(pic, listOfEntries.value)];
return yail_make_native_yaildictionary(pic, dict);
if (dict != nil) {
return yail_make_native_yaildictionary(pic, dict);
} else {
return pic_nil_value(pic);
}
}

static pic_value
Expand Down

0 comments on commit fbb7e1c

Please sign in to comment.