From 609ce75fd14ba72260eed1ce83cfa5dbc23cf679 Mon Sep 17 00:00:00 2001 From: arty Date: Wed, 15 May 2024 17:19:26 -0700 Subject: [PATCH] Add max into std --- max.clinc | 13 ------------- std/max.clinc | 11 +++++++++++ 2 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 max.clinc create mode 100644 std/max.clinc diff --git a/max.clinc b/max.clinc deleted file mode 100644 index 5ec6d54f..00000000 --- a/max.clinc +++ /dev/null @@ -1,13 +0,0 @@ -( - (defun max_inner (myless best_so_far mylist) - (if (not mylist) best_so_far - (if (a myless (list best_so_far (f mylist))) - (max_inner myless (f mylist) (r mylist)) - (max_inner myless best_so_far (r mylist)) - ) - ) - ) - (defun max (myless mylist) - (max_inner myless (f mylist) (r mylist)) - ) -) diff --git a/std/max.clinc b/std/max.clinc new file mode 100644 index 00000000..4fe7ef35 --- /dev/null +++ b/std/max.clinc @@ -0,0 +1,11 @@ +(defun max_inner (myless best_so_far mylist) + (if (not mylist) best_so_far + (if (a myless (list best_so_far (f mylist))) + (max_inner myless (f mylist) (r mylist)) + (max_inner myless best_so_far (r mylist)) + ) + ) +) +(defun max (myless mylist) + (max_inner myless (f mylist) (r mylist)) +)