From f5c4468d50a70f84676c6eef0cf75f7db0a4754d Mon Sep 17 00:00:00 2001 From: Maxwell Jeffress Date: Sat, 11 Apr 2026 09:44:48 +1000 Subject: [PATCH] Notify of list deprecation --- src/interpreter.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/interpreter.c b/src/interpreter.c index 3222ee8..e01293b 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -15,6 +15,8 @@ int currentInstruction = 0; bool isMainScopeGlobal = true; +bool listDeprecationWarning = true; + char* getFileContents(const char* filename); [[noreturn]] void customError(GroundArg type, GroundArg what, GroundInstruction* where, int whereLine, int exitCode) { @@ -963,6 +965,10 @@ GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scop break; } case SETLIST: { + if (listDeprecationWarning) { + printf("Lists are deprecated, please migrate to using the \"collections\" library soon.\n"); + listDeprecationWarning = false; + } if (in->args.length < 1) { runtimeError(TOO_FEW_ARGS, "Expecting 1 arg", in, currentInstruction); } @@ -980,6 +986,10 @@ GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scop break; } case SETLISTAT: { + if (listDeprecationWarning) { + printf("Lists are deprecated, please migrate to using the \"collections\" library soon.\n"); + listDeprecationWarning = false; + } if (in->args.length < 3) { runtimeError(TOO_FEW_ARGS, "Expecting 3 args", in, currentInstruction); } @@ -1016,6 +1026,10 @@ GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scop break; } case GETLISTAT: { + if (listDeprecationWarning) { + printf("Lists are deprecated, please migrate to using the \"collections\" library soon.\n"); + listDeprecationWarning = false; + } if (in->args.length < 2) { runtimeError(TOO_FEW_ARGS, "Expecting 2 args", in, currentInstruction); } @@ -1054,6 +1068,10 @@ GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scop break; } case GETLISTSIZE: { + if (listDeprecationWarning) { + printf("Lists are deprecated, please migrate to using the \"collections\" library soon.\n"); + listDeprecationWarning = false; + } if (in->args.length < 2) { runtimeError(TOO_FEW_ARGS, "Expecting 2 args", in, currentInstruction); } @@ -1078,6 +1096,10 @@ GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scop break; } case LISTAPPEND: { + if (listDeprecationWarning) { + printf("Lists are deprecated, please migrate to using the \"collections\" library soon.\n"); + listDeprecationWarning = false; + } if (in->args.length < 2) { runtimeError(TOO_FEW_ARGS, "Expecting 2 args", in, currentInstruction); }