From c3fd80de71ef1c85e057e1e278c9b4cdee25cff5 Mon Sep 17 00:00:00 2001 From: Nikolay Puzanov Date: Mon, 28 Nov 2022 16:14:52 +0300 Subject: [PATCH] Remove curry function --- embddr/common.scm | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/embddr/common.scm b/embddr/common.scm index e1dc0bb..e469478 100644 --- a/embddr/common.scm +++ b/embddr/common.scm @@ -3,11 +3,11 @@ (define-module (embddr common)) (import (srfi srfi-1) + (srfi srfi-26) (srfi srfi-60)) (export log2 clog2 round-to one? power-of-two? - curry curry-r transpose number->string-binary number->string-binary-slice @@ -42,16 +42,6 @@ (let ((k (expt 10 n))) (/ (round (* num k)) k))) -;;; Currying -;;; Example: ((curry-r f 1) 2 3) -> (f 1 2 3) -(define (curry f . args) - (lambda x (apply f (append args x)))) - -;;; Currying right -;;; Example: ((curry-r f 1) 2 3) -> (f 2 3 1) -(define (curry-r f . args) - (lambda x (apply f (append x args)))) - ;;; Transpose of matrix (list of lists) (define (transpose m) (apply map (cons list m))) @@ -150,7 +140,7 @@ (addrs (sort addrs >))) (map (lambda (addr) - (let ((others (remove (curry = addr) addrs)) + (let ((others (remove (cut = addr <>) addrs)) (abits (number->bits addr bit-width))) (cons addr