shithub: sl

Download patch

ref: c2c0a1d210da228c171d0aad1fe38848183cb4cf
parent: c0a64b0495e9517a553d76882c44e02f8d7e64a8
author: spew <spew@cbza.org>
date: Sun Apr 20 22:18:58 EDT 2025

lsd: use supplied arguments

--- a/src/plan9/lsd.sl
+++ b/src/plan9/lsd.sl
@@ -530,10 +530,10 @@
           (unless line (error "bad line number"))
           (lsd-file2pc (car s) line)))))
 
-(def (global-symbol s (:text NIL) (:data NIL))
+(def (global-symbol s (:text T t-set) (:data T d-set))
   «Return a symbol from the attached proc's symbol table or `NIL`.
 
-   Input is a `str`. Optionally specify whether to search only text
+   Input is a `str`. Optionally specify whether to search text
    symbols or data symbols. The default is to search both.
 
    Examples:
@@ -541,7 +541,8 @@
        (global-symbol "strecpy") → #(symbol "strecpy" #\T #p64(0x22be91))»
   :doc-group lsd
   (def (find tbl k) (and (has? tbl k) (get tbl k)))
-  (and (not text) (not data) (set! text T) (set! data T))
+  (and t-set (not d-set) (set! data NIL))
+  (and d-set (not t-set) (set! text NIL))
   (or (and text (find (global-text globals) s))
       (and data (find (global-data globals) s))))