Commit c0119f526f20fb6532b81a024ff7cf343c0ed13a

Thomas de Grivel 2024-11-22T14:20:13

fix list access

diff --git a/.ikc3_history b/.ikc3_history
index 4413ac4..e272940 100644
--- a/.ikc3_history
+++ b/.ikc3_history
@@ -1,5 +1,3 @@
-q
-exit
 exit(Ã)
 exit()
 Map.put(%{}, :a, 1)
@@ -97,3 +95,6 @@ points[3]
 points[0]
 points[1]
 points[2]
+"#{(F128) 0.0}"
+"#{(F128) 0.1}"
+
diff --git a/libkc3/list.c b/libkc3/list.c
index 9abdd02..9ebac71 100644
--- a/libkc3/list.c
+++ b/libkc3/list.c
@@ -40,11 +40,8 @@ s_tag * list_access (s_list *list, s_list *key, s_tag *dest)
   assert(key);
   assert(dest);
   key_first = &key->tag;
-  if (! uw_init_cast(&i, &sym_Uw, key_first)) {
-    err_puts("list_access: invalid key");
-    assert(! "list_access: invalid key");
-    return NULL;
-  }
+  if (! uw_init_cast(&i, &sym_Uw, key_first))
+    return tag_init_void(dest);
   key_next = list_next(key);
   if (! key_next)
     return list_at(list, i, dest);