From 87e9245c2b379f47cd075b2a1331e8a93f18f577 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 21 Jul 2022 08:12:05 -0700 Subject: compiler: try unsuffixed path before adding .tl * stdlib/compiler.tl (open-compile-streams): If the in-path is unsuffixed, try opening it without adding any suffix first. If that fails, then try .tl in that order. * txr.1: Documented. --- stdlib/compiler.tl | 4 ++-- txr.1 | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/stdlib/compiler.tl b/stdlib/compiler.tl index 585712f9..c7ac6009 100644 --- a/stdlib/compiler.tl +++ b/stdlib/compiler.tl @@ -2255,8 +2255,8 @@ (".txr" (error "~s: cannot compile TXR files" 'compile-file)) (".tl" (set in-stream (ignerr (open-file in-path)) out-path (or out-path `@{ip-nosuff}.tlo`))) - (t (set in-stream (or (ignerr (open-file `@{in-path}.tl`)) - (ignerr (open-file in-path))) + (t (set in-stream (or (ignerr (open-file in-path)) + (ignerr (open-file `@{in-path}.tl`))) out-path (or out-path `@{in-path}.tlo`)))) (unless in-stream diff --git a/txr.1 b/txr.1 index b90aade3..6d7aaab1 100644 --- a/txr.1 +++ b/txr.1 @@ -86002,12 +86002,12 @@ or .code .txr then it is considered suffixed, otherwise it is considered unsuffixed. If it is suffixed, then the actual pathname is the same as the tentative pathname. -In the unsuffixed case, two possible actual input pathnames are formed. First, +In the unsuffixed case, two possible actual input pathnames are considered. +First, if the unsuffixed path refers to a file that can be opened, then that +unsuffixed path is taken as actual path. Otherwise, the suffix .code .tl -is added to the tentative pathname. If that path exists, it is taken -taken as the actual path. Otherwise, the unmodified tentative path -is taken as the actual input path. +is added to the tentative pathname, and that becomes the actual path. If the actual path ends in the suffix .code .txr -- cgit v1.2.3