[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scheme question: convert a range
From: |
David Kastrup |
Subject: |
Re: Scheme question: convert a range |
Date: |
Mon, 16 Nov 2015 21:59:44 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Simon Albrecht <address@hidden> writes:
> Hello,
>
> The subject certainly seems cryptic – it’s difficult to summarize, but
> an example will make it clear immediately.
> I want to write a scheme procedure, which takes a pair like #'(3 . 7)
> and returns a list with all the numbers in the range: #'(3 4 5 6 7)
> How is this done most easily?
(let ((x '(3 . 7)))
(iota (- (cdr x) (car x) -1) (car x)))
--
David Kastrup