;;; Ikarus Scheme -- A compiler for R6RS Scheme. ;;; Copyright (C) 2006,2007 Abdulaziz Ghuloum ;;; ;;; This program is free software: you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License version 3 as ;;; published by the Free Software Foundation. ;;; ;;; This program is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this program. If not, see . (library (ikarus.sort) (export list-sort vector-sort vector-sort!) (import (ikarus system $fx) (except (ikarus) list-sort vector-sort vector-sort!)) (module (sort-tail) (define (merge1 vector (sort-tail list v) (vector-length v)))) (define (vector-sort! list v) (vector-length v))]) (unless (null? ls) ($vector-set! v i ($car ls)) (f ($fx+ i 1) v ($cdr ls))))) )