Deutsch   English   Français   Italiano  
<v9dgpl$3d793$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: HenHanna <HenHanna@devnull.tb>
Newsgroups: comp.lang.lisp
Subject: Re: Descending
Date: Mon, 12 Aug 2024 10:29:24 -0700
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <v9dgpl$3d793$1@dont-email.me>
References: <v3up28$21qlk$1@dont-email.me> <v7p07b$1b339$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 12 Aug 2024 19:29:26 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="1732fa58404ae6011f4e2312f865f442";
	logging-data="3579171"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18KJ2zc5y/3V9AEuSysSvzS20jcP78RNA4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:rpAyLnpuDU6ZqBses+n40VgEx+Y=
Content-Language: en-US
In-Reply-To: <v7p07b$1b339$4@dont-email.me>
Bytes: 2367

On 7/23/2024 12:27 PM, HenHanna wrote:
> 
> On 6/7/2024 3:57 AM, B. Pym wrote:
>>
>> Ken Tilton wrote:
>>
>>>> I am having trouble coding a list traversal segment.
>>>>          eg list:
>>>>
>>>> (a (b) (c (e (h i)) (f (j))) (d (g)))
>>>>
>>>> I want to traverse this list in "preorder" and get the following
>>>> output:
>>>>
>>>>                  a b c e h i f j d g
>>>>
>>>> anyone have a code segment to this?
>>>>
>>>> thanks....
>>>>
>>>> Chris.
> 
> 
>>>
>>> Will this work?:
>>>
>>> (defun dump (list-or-atom)
>>>     (if (listp list-or-atom)
>>>        (dolist (loa list-or-atom)
>>>            (dump loa))
>>>        (format t "~s " list-or-atom)))
>>
>> Gauche Scheme:
>>
>> (define (dump list-or-atom)
>>    (cond ((null? list-or-atom) )
>>          ((list? list-or-atom)
>>            (begin
>>              (dump (car list-or-atom))
>>              (dump (cdr list-or-atom))))
>>          (#t (format #t ":~s " list-or-atom))))
>>
>> (dump '(a (b) (c (e (h i)) (f (j))) (d (g))))
>>    ===>
>>           :a :b :c :e :h :i :f :j :d :g          #t
>>
> 
> (i've added some spaces)
> 
> the good ol'  Flatten ?


is there a convention for  printing  a Colon ( : )    before  something?