packages feed

egison-3.2.12: lib/core/io.egi

;;;;;
;;;;; Collection.egi
;;;;;

;;;
;;; IO
;;;
(define $print
  (lambda [$x]
    (do {[(write-string x)]
         [(write-string "\n")]
         }
        [])))

(define $print-to-port
  (lambda [$port $x]
    (do {[(write-string-to-port port x)]
         [(write-string-to-port port "\n")]
         }
        [])))

;;;
;;; Collection
;;;
(define $each
  (lambda [$proc $xs]
    (match xs (list something)
      {[<nil> (do {} [])]
       [<cons $x $rs>
        (do {[(proc x)]
             [(each proc rs)]
             }
          [])]})))

;;;
;;; Others
;;;
(define $pure-rand
  (lambda [$s $e]
    (io (rand s e))))