From: ··············@web.de
Subject: how to write a text file
Date: 
Message-ID: <1185444419.688318.215080@b79g2000hse.googlegroups.com>
Hi,

I have a n x m matrix filled with ones and zeros:
#2A((1 0 1 1 1 1 0)
    (1 0 1 1 1 1 1)
    (1 1 1 0 1 1 1)
    (1 1 1 1 0 1 1)
    (0 1 1 1 1 1 0))
I want to store the values of this matrix in a text file like that,
whereas a tab (\t) should be placed between the single values and a
newline (\n) at the end of each line:
1 0 1 1 1 1 0
1 0 1 1 1 1 1
1 1 1 0 1 1 1
1 1 1 1 0 1 1
0 1 1 1 1 1 0

How can I write this structure in a text file without using streams?

Thanks!
D.
From: Rainer Joswig
Subject: Re: how to write a text file
Date: 
Message-ID: <joswig-454E4A.12252126072007@news-europe.giganews.com>
In article <························@b79g2000hse.googlegroups.com>,
 ··············@web.de wrote:

> Hi,
> 
> I have a n x m matrix filled with ones and zeros:
> #2A((1 0 1 1 1 1 0)
>     (1 0 1 1 1 1 1)
>     (1 1 1 0 1 1 1)
>     (1 1 1 1 0 1 1)
>     (0 1 1 1 1 1 0))
> I want to store the values of this matrix in a text file like that,
> whereas a tab (\t) should be placed between the single values and a
> newline (\n) at the end of each line:


roughly:

WITH-OPEN-FILE direction output
  dotimes i
    dotimes j
      write element i j
      write tab
    write newline


> 1 0 1 1 1 1 0
> 1 0 1 1 1 1 1
> 1 1 1 0 1 1 1
> 1 1 1 1 0 1 1
> 0 1 1 1 1 1 0
> 
> How can I write this structure in a text file without using streams?

You can call system functions via a FFI.

Why would you not use streams?

> 
> Thanks!
> D.

-- 
http://lispm.dyndns.org