[Jprogramming] Writing to files

Roger Hui rogerhui.canada at gmail.com
Fri Nov 18 09:25:27 HKT 2011


fread =: 1!:1
fwrite=: 1!:2
sfn   =: 3!:1   NB. string from noun
nfs   =: 3!:2   NB. noun from string

   a=: 'eleemosynary'; 1 2 4 8 16
   (sfn a) fwrite <'junkfoo'
   nfs fread <'junkfoo'
┌────────────┬──────────┐
│eleemosynary│1 2 4 8 16│
└────────────┴──────────┘
   a -: nfs fread <'junkfoo'
1



On Thu, Nov 17, 2011 at 5:09 PM, David Vaughan <purpleblues13 at googlemail.com
> wrote:

> How do I write a noun to a file? I'm trying to use
>
> noun 1!:2 <'file'
>
> but I'm just getting rank and domain errors with all the things I'm trying.
> Thanks.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>


More information about the Programming mailing list