export declare const scheme1Prelude = "\n;; the basics\n(define pi math-pi)\n(define e math-e)\n";
export declare const scheme2Prelude = "\n;; the bulk of our stuff goes here\n(define ($filter pred xs acc)\n    (cond \n        ((null? xs) (reverse acc))\n        ((pred (car xs)) ($filter pred (cdr xs) (cons (car xs) acc)))\n        (else ($filter pred (cdr xs) acc))))\n\n(define (filter pred xs)\n    ($filter pred xs '()))\n\n(define ($map f xs acc)\n    (if (null? xs)\n        (reverse acc)\n        ($map f (cdr xs) (cons (f (car xs)) acc))))\n\n(define (map f xs . xss)\n    (if (null? xss)\n        ($map f xs '())\n        ;; if map is variadic, we use the variadic version\n        ;; BUT do note that this may not utilise continuations\n        ;; properly!\n        (apply r7rs-map f (cons xs xss))))\n\n;; fold is defined as fold-left\n(define ($fold f acc xs)\n    (if (null? xs)\n        acc\n        ($fold f (f acc (car xs)) (cdr xs))))\n\n(define (fold f init xs . xss)\n    (if (null? xss)\n        ($fold f init xs)\n        (apply r7rs-fold f init (cons xs xss))))\n\n(define (fold-left f init xs . xss)\n    (if (null? xss)\n        ($fold f init xs)\n        (apply r7rs-fold-left f init (cons xs xss))))\n\n(define ($fold-right f init xs cont)\n    (if (null? xs)\n        (cont init)\n        ($fold f init (cdr xs) (lambda (acc) (cont (f (car xs) acc))))))\n\n(define (fold-right f init xs . xss)\n    (if (null? xss)\n        ($fold-right f init xs (lambda (x) x))\n        (apply r7rs-fold-right f init (cons xs xss))))\n\n(define (reduce f ridentity xs)\n    (if (null? xs)\n        ridentity\n        ($fold f (car xs) (cdr xs))))\n\n(define (reduce-left f ridentity xs)\n    (if (null? xs)\n        ridentity\n        ($fold f (car xs) (cdr xs))))\n\n(define (reduce-right f ridentity xs)\n    (if (null? xs)\n        ridentity\n        ($fold-right f (car xs) (cdr xs) (lambda (x) x))))\n\n(define ($append xs ys cont)\n    (if (null? xs)\n        (cont ys)\n        ($append (cdr xs) ys (lambda (zs) (cont (cons (car xs) zs))))))\n\n(define (append xs ys . xss)\n    (if (null? xss)\n        ($append xs ys (lambda (x) x))\n        (apply r7rs-append (cons xs (cons ys xss)))))\n";
export declare const scheme3Prelude = "\n;; destructive filter\n(define (filter! pred lst)\n  (cond ((null? lst) '())\n        ((pred (car lst)) (set-cdr! lst (filter! pred (cdr lst))) lst)\n        (else (filter! pred (cdr lst)))))\n\n;; streams are already nicely implemented in the scheme stdlib,\n;; we leave them as is for now\n";
export declare const scheme4Prelude = "\n(define call-with-current-continuation call/cc)\n";
export declare const schemeFullPrelude = "\n(define-syntax let\n    (syntax-rules ()\n        ((_ ((name val) ...) body restbody ...) \n         ((lambda (name ...) body restbody ...) val ...))\n    \n        ;; taken from https://stackoverflow.com/questions/78177041/is-there-a-way-to-implement-named-let-as-macro-to-make-it-work-with-petrofsky-le\n        ((_ name ((id init) ...) body0 body1 ...)\n         (((lambda (h)\n            ((lambda (x) (h (lambda a (apply (x x) a))))\n             (lambda (x) (h (lambda a (apply (x x) a))))))\n             (lambda (name) (lambda (id ...) body0 body1 ...))) init ...))))\n\n(define-syntax quasiquote\n    (syntax-rules (unquote unquote-splicing)\n        ((_ (unquote x)) x)\n        ((_ ((unquote-splicing x) . rest))\n            (append x (quasiquote rest)))\n        ((_ (a . rest))\n            (cons (quasiquote a) (quasiquote rest)))        \n        ((_ x) (quote x))))\n        \n(define-syntax cond\n  (syntax-rules (else)\n    ((_) (if #f #f))\n\n    ((_ (else val rest ...))\n     (begin val rest ...))\n\n    ((_ (test val rest ...))\n     (if test\n         (begin val rest ...)\n         (cond))) \n\n    ((_ (test val rest ...) next-clauses ...)\n     (if test\n         (begin val rest ...)\n         (cond next-clauses ...)))))\n\n";
