txr is an actively used programming language created in 2009. Programming Language for Convenient Data Munging

11Years Old ?Users ?Jobs
  • the txr website
  • txr first appeared in 2009
  • txr was created by Kaz Kylheku
  • Have a question about txr not answered here? Email me and let me know how I can help.

Example code from the web:

@(bind special-words ("arch." "var." "ver." "anci." "fam."))
@(bind ahash @(hash :equal-based))
@id @@ @alpha @@ @animal @@ @words
@  (rebind words @(split-str words " "))
@  (bind record (id alpha animal words))
@  (do (push record [ahash alpha]))
@(bind sorted-rec-groups nil)
   (defun popularity-sort (recs)
     (let ((histogram [group-reduce (hash)
                                    third (do inc @1)
                                    recs 0]))
      [sort recs > [chain third histogram]]))

   (dohash (key records ahash)
     (let (contains does-not combined)
       (each* ((r records)
               (w [mapcar fourth r]))
         (if (isec w special-words)
           (push r contains)
           (push r does-not)))
       (push (append (popularity-sort does-not)                                 
                     (popularity-sort contains))                                
   (set sorted-rec-groups [sort sorted-rec-groups :
                                [chain first second]]))
@  (repeat)
@    (repeat)
@(rep)@{sorted-rec-groups} @@ @(last)@{sorted-rec-groups " "}@(end)
@    (end)
@  (end)

Last updated August 9th, 2020

Edit txr on GitHub