From e081ec9edf8c4ae79a8f16a4b6d9f6cc295cf391 Mon Sep 17 00:00:00 2001 From: w6vvn Date: Sat, 6 Sep 2025 11:39:14 -0700 Subject: [PATCH] implement an "up" command --- client.rkt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/client.rkt b/client.rkt index f236e94..1e0c3a9 100644 --- a/client.rkt +++ b/client.rkt @@ -29,6 +29,21 @@ (super-new) + (define/public (up-cmd) + (if (string=? (path->string + (simplify-path + (url->path current-url))) + "/") + + (displayln "already at root!") + + (let ([parent + (simplify-path + (build-path (url->path current-url) 'up) + #f)]) + (get (struct-copy url current-url + [path (url-path (path->url parent))]))))) + (define/public (go-cmd url-string) (if (non-empty-string? url-string) (let ()