This fully inlined merge sort works great when the range of possible input values is, for instance, every comparable number in Scheme, and the. A community for the Racket programming language: a modern batteries-included Lisp for general-purpose programming. Download Racket. In-Place Merge Sort *. If you want to avoid the space complexity required by having a scratch array, you can use the merge sort algorithm, but then move the data. #lang racket. (require (for-syntax racket/list)) ; for list functions. (define-syntax ( inline - sort stx). (syntax-case stx (). [(_ lst ) (with-syntax ([(vs. The post made me think about that issue a bit more, and I now have a neat way to generate unrolled/ inlined merge sorts that are significantly. All I want is someone to tell me how to convert a normal merge sort into an in- place . The full source code can be found here and the detailed.