Closed 9999years closed 3 years ago
rebellion doesn't use any advanced features, so we can get away with a simple replacement with (require ...) (provide (all-from-out ...)).
Python (sorry!!!!) script I used to refactor:
import subprocess files = subprocess.run(["grep", "-rlZ", "#lang reprovide"], check=True, capture_output=True).stdout.split(b"\0") for filename in files: if not filename: continue print(filename) with open(filename) as f: contents = f.read().split() if contents[:2] != ["#lang", "reprovide"]: print('not a reprovide file:', filename) continue contents = contents[2:] with open(filename, 'w', encoding='utf-8') as f: if contents: f.write("#lang racket/base" + "\n\n(require " + "\n ".join(contents) + ")\n" + "\n(provide (all-from-out " + "\n ".join(contents) + "))\n") else: f.write("#lang racket/base\n")
Update: fixed the parens I messed up.
rebellion doesn't use any advanced features, so we can get away with a simple replacement with (require ...) (provide (all-from-out ...)).
Python (sorry!!!!) script I used to refactor: