From icon-group-sender Mon Apr 27 08:09:24 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA18112 for ; Mon, 27 Apr 1998 08:09:23 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06896; Mon, 27 Apr 1998 08:09:20 -0700 Date: Fri, 24 Apr 1998 13:14:00 -0700 From: Gregg Townsend Message-Id: <9804242014.AA14229@hawk.CS.Arizona.EDU> To: dpfj@globalnet.co.uk, icon-group Subject: Re: Using icon pipe features Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1078 Most Unix utilities will buffer their output if it's connected to a pipe. That means that even if you were able to open a two-way pipe to something like "sed", you wouldn't be able to just write it a line and then read the filtered result. You'd need to write enough lines to make sed flush its buffer before you'd be able to read anything back. This, of course, gets somewhat tricky, because sed can block if too much accumulates in its output pipe. The tough part is that the buffering is going on inside the forked process where you can't generally control it. I've speculated that it might be possible to make something work using pseudo-terminals (pttys), but I haven't tried it. --------------------------------------------------------------------------- Gregg Townsend Gould-Simpson Building gmt@cs.arizona.edu Staff Scientist 1040 E. 4th St. 32 13 45N 110 57 16W Dept. of Computer Science PO Box 210077 tel: +1 520 621 4325 The University of Arizona Tucson, AZ 85721-0077 fax: +1 520 621 4246 From icon-group-sender Mon Apr 27 08:07:35 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA17994 for ; Mon, 27 Apr 1998 08:07:35 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07928; Mon, 27 Apr 1998 08:07:32 -0700 Message-Id: <3.0.5.32.19980424030719.007b7960@doors> X-Sender: bgbauer#alpha.delta.edu@doors X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Fri, 24 Apr 1998 03:07:19 -0700 To: "Icon Group" From: Scissors Subject: Re: Win32 API support for Icon Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 4187 Hello, Thanks for all the replys. Im new to the group, so I hope I havent brought up a topic that has been over talked. Im glad people have shown interest though. I've been feeling quite stranded since I began looking for a compiler. (Is Icon considered a full fledged compiler? Or is the interpreter just stacked into that 175K that my tiny programs seem to take up?) Once I decided to try out Icon I felt even more alone. Which is sad, because as I said previously, I like the language. If I keep up with Icon. (I plan to for atleast a few small programs, or until I hit a real 'Limitation'.) So let me clear up my original post. Im not really looking for the full win32 api. Just a few 'key' elements (explained further down). Anyway, all I was really wondering was if there were ways to do what C/C++ programs can do in windows. I cant afford Borland or VC++ and the books it would take to delve into C/C++. Im not even sure if I want to invest that amount of time. So I cant really learn a few of the suggestions that were made. It would be too frustrating and confusing at this point. All I was "hoping" there was, was a few ways to interface with (Im sure every one has a different opinion on this) but 'key' elements of the windows interface. The registry, where my current project needs to obtain information. (As will a future project I am planning). The registry is actually one of my biggest limits. I feel like its 'key' because much of windows 'look and feel' is stored there in settings. If I could read the registry, I could find the users preferred 'edit area font' and 'text color', all of the users preferences I could know without the user needing to set them. I could read Ole settings to know what programs open what types of documents. (Useful if say I wrote an HTML editor, and wanted to be able to allow them to browse the document. (of course I can just do this with system("Start newfile.html"). My current project involves reading in a serialized index file. Now, if I could read the registry, I could easily know exactly where the program that created it, and the file itself, is located on disk, without needing to prompt the user. The path to the file, is already stored in the registry. This doesnt apply so much to the older win3.1, but both win95/NT maintain a registry. Its a key element to the O/S. Im guessing this ability is already included in Icon, because of Icons use of the File Open, Font Selection, Color Selection dialogues matching the 'look and feel' of Windows. The ability to interface Windows API, I mean. Maybe Im confused, but couldnt Icon offer a 'pass through' type of call which allows calling most WinAPI functions? Like I said, Im new to this, so maybe that is harder to implement than I am realising. But that is what I was really seeking. This may be what one of the replys what trying to point out, when it mentioned a need for a DLL Guru. An MFC*.dll guru. Who could create the interface. I realise Icon is a free research langauge, and that its portability is of concern. I just was interested in knowing how far Icon can stretch. So... Ive written a ReadIni(), and WriteIni() procedure. Im putting together an iowin.icn Procedure file, for anyone interested. Mostly its stuff that I needed, that wasnt in io.icn, or that the io.icn version didnt seem to handle correctly for windows based systems. Im currently creating a Registry procedure also. Ive got to rework it though because of limits I found where calls to system() which create files (or atleast a call to regedit) dont appear to be releasing the files before system() returns. It's just a "work-around", and im not sure writing to the registry in this manner would be %100 safe, which is why I wish I could do it correctly. I'll find out in implementing it though. Other than the bug with 'repeated reads' I Can read the registry now. If you're interested in this, let me know. I'd like to know how many more of you out there are working on win95/nt. And what procedures you may have created which are win95/nt based. bgbauer (My originally post was via usenet 'AKA' Mr Plow). From icon-group-sender Mon Apr 27 08:10:29 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA18203 for ; Mon, 27 Apr 1998 08:10:28 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA09125; Mon, 27 Apr 1998 08:10:26 -0700 Message-Id: <3.0.5.32.19980426052832.007a9be0@doors> X-Sender: bgbauer#alpha.delta.edu@doors X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Sun, 26 Apr 1998 05:28:32 -0700 To: "Icon Group" From: Scissors Subject: A few basic questions Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 741 Hi, Im having a little trouble understanding a few of what are probably basic Icon programming methods. Is it possible to evaluate expression and assign at the same time in this manner? if \var := expr then fail meaning : if /expression then fail else var := expression It may seem trivial, but for some reason I find myself wanting to use the first version by default. Its easier to type and understand, takes up less lines on the screen, but when I cant find the correct format to get it to work. Also is it acceptable to use "if expr then expr else expr" all on the same line? Its getting harder to move around in my code as it gets longer with it all '{' and '}'d on multiple lines. Also what are string images used for? From icon-group-sender Mon Apr 27 08:10:50 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA18221 for ; Mon, 27 Apr 1998 08:10:50 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07008; Mon, 27 Apr 1998 08:10:47 -0700 From: Otfried Geffert Date: Mon, 27 Apr 1998 08:51:20 GMT Message-Id: <19980427.8512058@og-1042.stardiv.de> Subject: Re: Using icon pipe features To: Derek Paul Freeman-Jones Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <353F9415.83BD5C5B@globalnet.co.uk> References: <353F9415.83BD5C5B@globalnet.co.uk> X-Mailer: Mozilla/3.0 (compatible; StarOffice/4.0; WinNT/Win95) X-Priority: 3 (Normal) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 966 As I think a _pipe_ is a unidirectional thing. So I think you can't open it for reading and writing from the same process. For a similar problem I used: - opened the real file for reading - wrote the processed file to a temporary file - renamed the temporary file to the real filename Sorry, I see this is not what you wanted. Otfried >>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<< Derek Paul Freeman-Jones on Using icon pipe=20 features: > icon-group, >=20 > I need to extend the functionality of the procedure 'open' when=20 running > a process eg. >=20 > pipe_in :=3D open ( "/usr/bin/ls", "p" ) >=20 > at present the process can only be opened for reading OR writing. Has= > anyone done any development work on enabling the process to be BOTH > written to and read from? >=20 > I don't if I have to write a new procedure to plug in to Icon 'popen'= > for example. >=20 > Many thanks in advance. >=20 >=20 > Derek Freeman-Jones >=20 >=20 From icon-group-sender Mon Apr 27 12:42:24 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA29629 for ; Mon, 27 Apr 1998 12:42:18 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA08647; Mon, 27 Apr 1998 12:42:15 -0700 Date: Mon, 27 Apr 98 09:55:24 PDT Message-Id: <9804271655.AA02872@bermuda.synopsys.com> From: Shamim Mohamed To: Gregg Townsend Cc: dpfj@globalnet.co.uk, icon-group@baskerville.CS.Arizona.EDU Subject: Re: Using icon pipe features In-Reply-To: <9804242014.AA14229@hawk.CS.Arizona.EDU> References: <9804242014.AA14229@hawk.CS.Arizona.EDU> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 548 [plug follows] Gregg writes: > Most Unix utilities will buffer their output if it's connected to a > pipe. That means that even if you were able to open a two-way pipe to > something like "sed", you wouldn't be able to just write it a line and > then read the filtered result. One way (the right way?) to do this is by forking and having one copy write to sed and the other reading the output. Support for all this is in Unicon; an example (an implementation of script(1)) is in the documentation: http://www.drones.com/unicon/ -s From icon-group-sender Mon Apr 27 20:37:56 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id UAA27960 for ; Mon, 27 Apr 1998 20:37:45 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07462; Mon, 27 Apr 1998 20:37:42 -0700 Message-Id: <3544EF25.E0A905CB@globalnet.co.uk> Date: Mon, 27 Apr 1998 21:48:37 +0100 From: Derek Paul Freeman-Jones X-Mailer: Mozilla 4.01 [en] (Win95; I) Mime-Version: 1.0 To: Shamim Mohamed Cc: Gregg Townsend , icon-group@baskerville.CS.Arizona.EDU, Shamim Mohamed Subject: Re: Using icon pipe features X-Priority: 3 (Normal) References: <9804242014.AA14229@hawk.CS.Arizona.EDU> <9804271655.AA02872@bermuda.synopsys.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 155 All, Many thanks for all your help, Shamim has provided me with the source code I needed to read from and write to an exec'ed process. Thanks Derek From icon-group-sender Mon Apr 27 20:38:31 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id UAA27967 for ; Mon, 27 Apr 1998 20:38:31 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA08915; Mon, 27 Apr 1998 20:38:28 -0700 Message-Id: <3.0.5.32.19980427182410.007a92d0@doors> X-Sender: bgbauer#alpha.delta.edu@doors X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Mon, 27 Apr 1998 18:24:10 -0700 To: swampler@noao.edu (Steve Wampler) From: Scissors Subject: Re: A few basic questions Cc: "Icon Group" In-Reply-To: References: <3.0.5.32.19980426052832.007a9be0@doors> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1168 At 08:24 AM 4/27/98 -0700, you wrote: >Try any of the following: > >var := expr | fail > >if not (var := expr) then fail > >> Also is it acceptable to use "if expr then expr else expr" all on the same >> line? Its getting harder to move around in my code as it gets longer with >> it all '{' and '}'d on multiple lines. > >Acceptable, but not considered good practice. Well, thats what I expected, but I'd hoped I was using an older form. : / What about this example: if expression then { expression expression } Saving one line with the last '}' being moved up? > >> Also what are string images used for? > >Uh, string image of what? String images of different things have different >uses. Well, for example one of the functions in icon is: image (x) : s -- produce string image Produces a string image of x. Under what circumstances would this be used? I realise (I think) what an image is, but im not sure why I wouldnt need an image of an object, if I have the object itself? There is also an IPL procedure: fullimag.icn Procedures to produce complete image of structured data Or am I better of not worrying about that for now? : ) From icon-group-sender Wed Apr 29 12:22:14 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA21969 for ; Wed, 29 Apr 1998 12:22:14 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10283; Wed, 29 Apr 1998 12:22:11 -0700 Message-Id: <3.0.5.32.19980429075520.007a38f0@doors> X-Sender: bgbauer#alpha.delta.edu@doors X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 29 Apr 1998 07:55:20 -0700 To: "Icon Group" From: Scissors Subject: EOL Termination Sequences. Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1599 Is anyone out there using Win95/dos? Im having a terrible time with eol termination sequences. Two problems mostly. Ive set the WI Line termination option to linebreak=CRLF but for some reason, every so often. (seems to be random as far as I can tell.) I will save a file, and *BANG* all the 100+ lines of text lose their EOL's and end up in four lines at the top of my window. For the most part this is happening inside of notepad. If I edit a file that was saved using WI, it appears to be using strange EOL's which Notepad zaps on saving the file. Ive never encountered this before using Icon, and it doesnt happen when Im editing anything but Icon source. Ive checked the settings, all seems fine. : / Help!?! Secondly, im loading a file using: lines := [] lines := filetext(fname) when I find the line I wish to insert text after, I have been using lines[i] := lines[i] || "\r\l" || "what I want to insert" (The reason Im 'appending it' is because when I tried it before, it would allow me to add any new lines to 'lines[]'. When I first created the procedure, I was attempting to slide all the remaining down a notch, thus freeing up one of list[], so I could then inserting the new line. But it would not add anything beyond the original *line.) ok, so this all works ok... until I open the file in notepad, and save it. then the line I inserted last shows up as Previous TextNew Text is "\r\l" the incorrect line termination sequence? I tried "\r\n" and it does the same. What is the correct EOL for dos/win? Thanks for any help in advance jebediah@bigfoot.com From icon-group-sender Wed Apr 29 12:22:53 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA21995 for ; Wed, 29 Apr 1998 12:22:53 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10611; Wed, 29 Apr 1998 12:22:50 -0700 Message-Id: <3.0.5.32.19980429091743.00798100@doors> X-Sender: bgbauer#alpha.delta.edu@doors X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 29 Apr 1998 09:17:43 -0700 To: "Icon Group" From: Scissors Subject: RE: EOL Termination Sequences. Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 884 Ok, I got into thinking about this. Here's whats happening. I realised I Can open a file in DOS edit, and it shows the IBM/ASCII characters. So I opened the file I was trying to insert the line into and at the end of that line, and only that line, there is just a carriage return. Any Idea why when I inserted "\r\l" it is only placing "\r"? So I also opened up files Ive been editing using WI, and every line ends in a carriage return. The little musical symbol in dos edit. When a normal text file Ive edited using notepad, or even dos edit shows no end of line characters at all. Even if I add one right then, it isnt shown? Has anyone else noticed a problem like this? Maybe something is wrong just on my setup. Anyone have any suggestions what I might do to fix this? Thanks, (and sorry for writing yet again... still getting used to Icon.) jebediah@bigfoot.com From icon-group-sender Thu Apr 30 08:10:43 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA05998 for ; Thu, 30 Apr 1998 08:10:42 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA11574; Thu, 30 Apr 1998 08:10:39 -0700 Message-Id: X-Mailer: Novell GroupWise 4.1 Date: Thu, 30 Apr 1998 10:02:52 -0500 From: Charles Hethcoat To: icon-group@optima.CS.Arizona.EDU Subject: RE: EOL Termination Sequences. -Reply Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1880 I use NT 4--not that I'm so very fond of it--and I had so many odd little problems with Notepad that I banished it from my machine. I found PFE (Programmer's File Editor) to be a far superior choice across the board. Pertinent to your problem is that PFE is knowledgable of line termination sequences in both DOS and Unix. I haven't used Wi that much yet, so I cannot comment on any possible problems there. I would suggest trying the same things you were doing, only with PFE instead of Notepad, and see if it helps. If not, well, you've at least eliminated one possible source of the problem. You can get PFE for free from: Alan Phillips ( A.Phillips@lancaster.ac.uk ) ( http://www.lancs.ac.uk/people/cpaap/pfe ) Charles Hethcoat Senior Engineer, Analysis Department Oceaneering Space Systems, Inc. 16665 Space Center Blvd., Houston, Texas 77058 USA chethcoa@oss.oceaneering.com Voice: 281-228-5568 Fax: 281-488-2027 >>> Scissors 1998 Apr 29, 11:17am >>> Ok, I got into thinking about this. Here's whats happening. I realised I Can open a file in DOS edit, and it shows the IBM/ASCII characters. So I opened the file I was trying to insert the line into and at the end of that line, and only that line, there is just a carriage return. Any Idea why when I inserted "\r\l" it is only placing "\r"? So I also opened up files Ive been editing using WI, and every line ends in a carriage return. The little musical symbol in dos edit. When a normal text file Ive edited using notepad, or even dos edit shows no end of line characters at all. Even if I add one right then, it isnt shown? Has anyone else noticed a problem like this? Maybe something is wrong just on my setup. Anyone have any suggestions what I might do to fix this? Thanks, (and sorry for writing yet again... still getting used to Icon.) jebediah@bigfoot.com From icon-group-sender Thu Apr 30 08:10:10 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA05988 for ; Thu, 30 Apr 1998 08:10:09 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA11144; Thu, 30 Apr 1998 08:10:06 -0700 Message-Id: <3.0.5.32.19980430041203.007b14b0@doors> X-Sender: bgbauer#alpha.delta.edu@doors X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Thu, 30 Apr 1998 04:12:03 -0700 To: "Icon Group" From: Scissors Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3513 Thanks for the responses. I should get around to trying out just '\n' tonight. And see if that solves the problem. At 11:10 PM 4/29/98 -0500, you wrote: >Hi, > >I am not sure quite what is happening with your EOL terminations. Wi's >linebreak=CRLF feature is not supposed to turn itself off accidentally and >at random. After I opened up the files and got to looking at it I noticed it isnt random. All of the files I've edited using WI appear to have the same 'musical note' ending for lines. So the files are appearing fine, until I open, and then save them in notepad, which loses all of the EOL marks. Im using WI, and the Win32 version of Icon on win 95. (But only working so far with DOS Console programming. (Ive only been using WI so far because I like having a project file, so I can switch back and forth. I cant figure out how to compile with it yet, so I do this on the command line.) Wi could be writing out the files in a way that notepad doesn't >like, and it shouldn't be that hard to identify the problem if that's the >case. I'll try to reproduce your bug, and get back to you. It may just be a win 95 problem, as you mentioned NT uses differnt EOL's. >Regarding your list of lines, there is no easy way in Icon to insert an >element into the middle of the list, but it is easy to grow the list by >calling put(L, "a new element") and thenyou can slide the elements down >a notch as you suggested. > >> is "\r\l" the incorrect line termination sequence? I tried "\r\n" and it >> does the same. What is the correct EOL for dos/win? > >Under DOS Icon, you just use "\n" as your newline character and the "\n" is >converted to "\r\n". Will this work with Win 95 version of Icon? Im assuming so... > Windows NT uses the UNIX convention that \n is an EOL >so again the \r is generally not needed. Win32 applications like Windows Icon >are native on NT, but legacy programs like notepad may still require \r\n. >To write old DOS-style lines you might say \r\n. Note that write() appends >its own \n, so to write hello in a DOS file you would say write("hello\r"). >There is no \l character in Icon as far as I know. > >I'm happy to help work through the newline problems you are experiencing. >First thing will be for me to try going back and forth between notepad >and wi. I tinkered with it a bit today, and I got it so that I Can insert the line correctly. It appears as two lines now. I believe I switched the EOL's I was trying to use, to "\l". (Which I got from the help file as below under Escape sequences). \f formfeed \\ backslash \l linefeed (newline) \ddd octal code \n newline (linefeed) \xdd hexadecimal code \r carriage return \^c control code But now when I attempt to tab(match()) the 'most recently' inserted line I get no match. Apparantly it is being interpreted in my Read() as being part of the previous line still. This only affects the last line I inserted this way, because after I read() the file in again, and write() it out, it corrects the problem, due to write() adding the correct EOL's. Hopefully using "\n" will fix this for me : )! I looked through WI's code, but all I saw for an EOL Seq. assignment was it being set to CRLF, which I couldnt determine where it knew what the value of CRLF was. If you do find some way to overcome this, please let me know so I Cant edit it into WI. Until then I will remember not to save in notepad! Youch! Thanks to all! > >Clint Jeffery, jeffery@cs.utsa.edu > > > > From icon-group-sender Fri May 1 07:57:42 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id HAA25027 for ; Fri, 1 May 1998 07:57:41 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13255; Fri, 1 May 1998 07:57:38 -0700 Message-Id: <3.0.5.32.19980430163932.007a5370@alpha.delta.edu> X-Sender: bgbauer@alpha.delta.edu X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Thu, 30 Apr 1998 16:39:32 -0700 To: "Icon Group" From: Scissors Subject: Re: EOL Termination Sequences. Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 465 Thanks Clinton, and all who replied. Using "\n" fixed the problems I was having with my program. Is there a way for me to edit this into the WI source? (Meaning which line no.?) The only line I saw regarding this was in the mainloop() I believe, where the menu options are handled. it just assigns linebreak="CRLF" if I remember right. Where is it getting the meaning of CRLF? (I guess I Should look myself and figure that out. : P) Thanks again, B From icon-group-sender Tue May 5 08:53:49 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA14721 for ; Tue, 5 May 1998 08:53:32 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA16453; Tue, 5 May 1998 08:53:29 -0700 Date: Mon, 4 May 1998 22:09:13 -0500 Message-Id: <199805050309.WAA30479@segfault.cs.utsa.edu> From: Clinton Jeffery To: icon-group@optima.CS.Arizona.EDU Subject: Windows Icon update Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1087 The Windows Icon distribution at ringer.cs.utsa.edu/pub/icon/nt/binaries/ has been updated. This is a maintenance release that includes no new features, but incorporates fixes for the following problems reported by users, mainly from reports posted to the icon-group mailing list: Hardwired paths removed from generated .EXE's (fix suggested by Mark Evans -- thanks Mark!) Improvements to system() under Win95 and NT (fix suggested by Mike Stradley -- thanks Mike!) Elimination of most "junk" logfiles left in root directory after abnormal program termination. WildCard expansion support added to nticonx and generated console apps. Bugfix: WinButton(), Windows native buttons Bugfix: FillRectangle when using colored patterns Bugfix: Wi should no longer write extra carriage returns into files. My thanks to everyone who sent me comments or reported a problem. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Tue May 5 17:13:05 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id RAA21103 for ; Tue, 5 May 1998 17:13:05 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA16917; Tue, 5 May 1998 17:13:01 -0700 Message-Id: X-Mailer: Novell GroupWise 4.1 Date: Tue, 05 May 1998 17:45:32 -0500 From: Charles Hethcoat To: icon-group@optima.CS.Arizona.EDU Subject: Followup to PDF problem Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 351 I just downloaded IPD284 perfectly in PDF format...no problems. But the PostScript version scrambles GhostScript! What gives? Good luck. Charles Hethcoat Senior Engineer, Analysis Department Oceaneering Space Systems, Inc. 16665 Space Center Blvd., Houston, Texas 77058 USA chethcoa@oss.oceaneering.com Voice: 281-228-5568 Fax: 281-488-2027 From icon-group-sender Wed May 6 08:50:05 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA22328 for ; Wed, 6 May 1998 08:50:04 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA17324; Wed, 6 May 1998 08:50:01 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Tue, 05 May 1998 20:04:44 -0600 From: Terry Murray Message-Id: <354FC528.4D86@kc-primary.net> Organization: Primary Network. http://www.primary.net Sender: icon-group-request@optima.CS.Arizona.EDU Reply-To: tmurray@primary.net Subject: AI use for Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1096 I'm writing a program with icon that reads an email message and determines the who, what, when, where and by whom. At least that is what I am trying to do. This message would come form a supervisor to the human resources department asking them to promote Mr. Any Body to a New Title on a certain date. By having all the employees names prior to running the program I weight each name based on its reletive position to the other name within the organization to get a fuzzy match. One of which must be a supervisor. I've never tried using AI technology before so I looking for someone who has done something similar that would share with me their text parse-ing process for ideas. I'm currently looking for words that match my list as for the 'what' the matching terms would be 'promote, demote, reassign, realign, fire...'. Likewise, 'who' is the list of employees. I'm now working on the 'when' to search for dates. I need a different method than giving the program every possible date in every possible way. Does someone have a program that would pick a date out of a sentence? Terry From icon-group-sender Wed May 6 12:36:51 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA07362 for ; Wed, 6 May 1998 12:36:51 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA15209; Wed, 6 May 1998 12:36:47 -0700 From: gep2@computek.net Date: Wed, 6 May 1998 12:04:42 -0500 Message-Id: <199805061704.MAA14525@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: AI use for Icon To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2300 > I'm writing a program with icon that reads an email message and determines the who, what, when, where and by whom. At least that is what I am trying to do. This message would come form a supervisor to the human resources department asking them to promote Mr. Any Body to a New Title on a certain date. By having all the employees names prior to running the program I weight each name based on its reletive position to the other name within the organization to get a fuzzy match. One of which must be a supervisor. I've never tried using AI technology before so I looking for someone who has done something similar that would share with me their text parse-ing process for ideas. I'm currently looking for words that match my list as for the 'what' the matching terms would be 'promote, demote, reassign, realign, fire...'. Likewise, 'who' is the list of employees. Sounds like an interesting problem! For the "fuzzy match" I think that one interesting way to at least help winnow down the possibilities would be to examine the intersection of the character sets of the different names. Those which have a high intersection (all but a "few" characters) can be then examined more closely. For a better "fuzzy compare" function I've liked the use of overlapping character pairs (including a blank added to the start and end of each name). I think that character ADJACENCY is an important aspect of the "visual similarity" of two words or names. > I'm now working on the 'when' to search for dates. I need a different method than giving the program every possible date in every possible way. Does someone have a program that would pick a date out of a sentence? Certainly it ought to be very easy to parse NUMERIC dates. And since most formats of dates (with the exception of things like "the first of May") have numeric characters associated with them, I wouldn't think it would be so difficult to zero in on a very small number of possibilities, which could then be processed by more exhaustive "multi-alternative" patterns. It sounds like a fun project, in any case... if you decide you'd like to farm it out, I would enjoy taking a stab at it. :-) Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Wed May 6 12:36:37 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA07359 for ; Wed, 6 May 1998 12:36:36 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA18434; Wed, 6 May 1998 12:36:33 -0700 From: eka@corp.cirrus.com (Eka Laiman) Message-Id: <199805061638.JAA29265@sims-rd.corp.cirrus.com> Subject: Re: AI use for Icon To: tmurray@primary.net Date: Wed, 6 May 1998 09:35:07 -0700 (PDT) Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <354FC528.4D86@kc-primary.net> from "Terry Murray" at May 5, 98 08:04:44 pm X-Mailer: ELM [version 2.4 PL24alpha3] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1470 Terry wrote: > I'm writing a program with icon that reads an email message > and determines the who, what, when, where and by whom. At least > that is what I am trying to do. > ...... edited .... I have to do "incoming mail filtering" myself. In my case, due to my belonging to certain kind of SIG (Special Interest Group), it is quite common for me to receive 50+ mails a day. This large number of incoming mail can potentially shield me from "business" related mails which require my attention. To avoid this, every incoming mail will be automatically be passed through a "mail filter". If the mail comes the mentioned SIG, they will automatically be accumulated in a "special mail folder" without notifying me of their arrivals; otherwise, the mail will be passed through just like normal mails that do not go through the filter. If you are working with UNIX or Linux, the best way to do this kind of filtering is through "procmail" which is well documented. You can do a search in the internet for various pages explaining how this works, a tutorial of using this facility is also available. Since procmail pass the mail as a "stream of text" and the blank line separate the mail header from the body of the mail, you can easily do filtering based on "content" or "mail header". In fact the list server program known as "majordomo" works this way. The method used is to "hash" (icon's implementation is through "table") each field in the mail header. -eka- From icon-group-sender Wed May 6 16:37:16 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA17698 for ; Wed, 6 May 1998 16:37:16 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA14346; Wed, 6 May 1998 16:37:12 -0700 Message-Id: X-Mailer: Novell GroupWise 4.1 Date: Wed, 06 May 1998 17:55:54 -0500 From: Charles Hethcoat To: icon-group@optima.CS.Arizona.EDU Subject: AI use for Icon -Reply Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1963 Terry Murray wrote: >...message would come form a supervisor to the human resources department asking them to promote Mr. Any Body to a New Title on a certain date. By having all the employees names prior to running the program I weight each name based on its reletive position to the other name within the organization to get a fuzzy match. If you get a fuzzy name match algorithm together, it sure would be a nice contribution to the Icon library...I don't know much about the methods used in these types of searches, but I'll give it some thought also. >I'm now working on the 'when' to search for dates. I need a different method than giving the program every possible date in every possible way. My first impulse says to try to find candidates for the elements first: year, month, day of week, and day written in every possible way. Then dope out month from day separately, based partly on proximity, and then put the date in a canonical form such as yyyy-mm-dd. December could be written (in English) as Dec or December (possibly misspelled), or as 12. Years could be 1998 or 98 or '98. Days could be 1..N where N is a well-known function of month (28..31). By "proximity" I mean, for example, that a numeric month should be followed very shortly afterward by viable candidates for year and day, or it's probably not a date. A date like 7/9 is ambiguous internationally: July 9 in the U.S. but September 7 in Europe. This can usually be resolved by knowing the origin of the writer. Delimiters seem only to be slashes, dashes or spaces. Seems like a job tailormade for Icon string scanning and tables. >Does someone have a program that would pick a date out of a sentence? Sorry, I don't. It would make a another great library contribution. Charles Hethcoat Senior Engineer, Analysis Department Oceaneering Space Systems, Inc. 16665 Space Center Blvd., Houston, Texas 77058 USA chethcoa@oss.oceaneering.com From icon-group-sender Thu May 7 08:43:42 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA18770 for ; Thu, 7 May 1998 08:43:42 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA16115; Thu, 7 May 1998 08:43:38 -0700 Message-Id: <3.0.5.32.19980506220526.007b0e20@doors> X-Sender: bgbauer#alpha.delta.edu@doors X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 06 May 1998 22:05:26 -0700 To: "Icon Group" From: Scissors Subject: AI Use for Icon Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 740 Well, this idea may not work, but the first thing that came to my mind was to create a program which prompted the user for thier input, and then pre- formatted it correctly, so after it is recieved, it can be easily processed for the needed info. I think the easiest way to do this would be a javascript web page with forms. This would allow you to easily make sure all the required fields are filled, and that when they are sent out they are formatted correctly, for the easiest possible processing later. Do all the people involved in this have access to a web browser? (PS. Javascript/HTML would probably be MUCH easier to implement than all of the complex work it sounds like fuzzy logic parsing would involve.) Good luck, JS From icon-group-sender Thu May 7 08:43:50 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA18789 for ; Thu, 7 May 1998 08:43:50 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA16697; Thu, 7 May 1998 08:43:46 -0700 Message-Id: <3.0.5.32.19980506221248.00798ce0@doors> X-Sender: bgbauer#alpha.delta.edu@doors X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 06 May 1998 22:12:48 -0700 To: "Icon Group" From: Scissors Subject: AI Use for Icon Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 494 I forgot to include it in my previous response, but one not so used but easy to implement forms submit action is "mailto:" Your user could fill out the form, and when they hit 'submit' it would automatically be emailed to the correct address. This would remove the need for a CGI script, or any server involvement really. Good luck again, B Bauer If you're interested I could toss together a sample javascript/html page which would give an idea how easy this way of doing it could be. From icon-group-sender Thu May 7 12:42:47 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA06155 for ; Thu, 7 May 1998 12:42:47 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA16998; Thu, 7 May 1998 12:42:43 -0700 From: gep2@computek.net Date: Thu, 7 May 1998 12:19:46 -0500 Message-Id: <199805071719.MAA26136@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: AI Use for Icon To: icon-group@optima.CS.Arizona.EDU In-Reply-To: <3.0.5.32.19980506221248.00798ce0@doors> X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 726 Certainly if they can put the stuff in a mailed form, this eliminates the main hassles of parsing the stuff. Certainly **no** need for Javashit to do this, and no CGI stuff either. Almost all browsers (even the really limited ones) can handle this. If you visit my Web page and particularly the Guest Book page (download a copy of the HTML to your system), you can see how simple the HTML is for this... the resulting forms get mailed through normal E-mail and are relatively easy to process using either S*BOL or Icon. If you don't HAVE to handle freeform text, of course the problem is simpler. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Mon May 11 08:15:03 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA10090 for ; Mon, 11 May 1998 08:15:03 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA09862; Mon, 11 May 1998 08:14:59 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Sun, 10 May 1998 06:58:41 +0100 From: David Feustel Message-Id: <35554211.42AA67BA@ix.netcom.com> Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Com Version of ICON Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 143 Is there a Com version of ICON? I'd like to try using ICON with VBScript for an application involving Server-side Web Programming. Thanks. From icon-group-sender Wed May 13 07:42:13 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id HAA17886 for ; Wed, 13 May 1998 07:42:13 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22189; Wed, 13 May 1998 07:42:08 -0700 Message-Id: <3.0.5.32.19980512173306.007a7c40@doors> X-Sender: bgbauer#alpha.delta.edu@doors X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Tue, 12 May 1998 17:33:06 -0700 To: "Icon Group" From: Scissors Subject: Order of operations Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 793 Hi again, Still trying to learn Icon's little intricasies, so I have another question. In what order would the following code be interpreted? if var := "string" then var2 := "string2" & var3 := "string3" is this interpreted as: if var := "string" then { var2 := "string2" var3 := "string3" # this line only done if previous line succeeds? } or is it interpreted as: if var := "string" then { var2 := "string2" var2 := (var3 := "string3") #resulting in var2 == "string3"? } Ok, im also confused about this syntax: "abcdefg" ? var := move(1) & move(2) Here would the end result of var == "bc"? or "a" And what about in this situation. (sort of applies to my first question). "abcdefg" ? move(1) & var := move(2) would the result be var == "bc" ? Thanks, scissors From icon-group-sender Wed May 13 07:42:30 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id HAA17889 for ; Wed, 13 May 1998 07:42:29 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22013; Wed, 13 May 1998 07:42:25 -0700 Message-Id: <3.0.5.32.19980512175257.007a7c40@doors> X-Sender: bgbauer#alpha.delta.edu@doors X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Tue, 12 May 1998 17:52:57 -0700 To: "Icon Group" From: Scissors Subject: Determining O/S Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 967 Oh, I thought of another question thats been bugging me. What is the easiest way to determine the O/S your running on? I would have no idea how to determine unix, and Im uncertain the 'best' way to determine if the O/S is win3.1, win95, or winNT? Would it be best to use some of the ifdef lines I've noticed in io.icn for o/s secific code? if so what are the available definitions? At first I thought code similar to this would work (which is from yescr.icn): if find("UNIX",&features) then { expressions } else if find("MS-DOS", &features) then { expressions } else if find("MS Windows NT", &features) then { expressions } But this would lump win3.1 (win32s) with win95, and NT, and i believe it wouldnt give any indication of if the app is console, or windowed. Code i'm working on now would need to act differently on win3.1 than it would on win95/nt. Any help, suggestions, or comments welcome. Thanks, scissors From icon-group-sender Thu May 14 07:48:19 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id HAA23358 for ; Thu, 14 May 1998 07:48:18 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA24525; Thu, 14 May 1998 07:48:13 -0700 Message-Id: X-Mailer: Novell GroupWise 4.1 Date: Wed, 13 May 1998 15:22:55 -0500 From: Charles Hethcoat To: icon-group@optima.CS.Arizona.EDU Subject: Determining O/S -reply Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_23774126.8FEE8660" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 4339 This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=_23774126.8FEE8660 Content-Type: text/plain Content-Disposition: inline Scissors wrote: >But this would lump win3.1 (win32s) with win95, and NT, and i believe it wouldnt give any indication of if the app is console, or windowed. I ran: procedure main() every write(&features) end on my NT system. The console-mode version reports: MS Windows NT ASCII co-expressions environment variables external functions large integers system function and wi reports: MS Windows NT ASCII co-expressions environment variables external functions large integers system function file attributes * MS Windows * Win32 * where items marked * do not appear in NT console mode. So I guess if "Win32" doesn't appear, it must be Win(32s or 16)? I have Icon on Win 95 at home, so I will have wait until tonight to try that. A more fundamental question is, "How do I determine whether I'm running on Windows or Unix?" It turns out that it's not as easy as I thought! When I run the command "ver" in a console window, I get: NT 4.0: "Windows NT Version 4.0" Win95: "Windows 95 Version blah" When I tried the obvious answer (put a few lines in the program that would run the "ver" command and write the result to a temporary file), I found that redirecting the command output to a file just sendt it all to the bit bucket in Windows. I also checked all commands for failure, but nothing failed! Here is the program: procedure main() every write(&features) system("ver > tmp$$$") | stop("Could not execute 'ver'") f := open("tmp$$$") | stop("Could not open tmp$$$") version := read(f) | stop("Could not read tmp$$$") close(f) | stop("Could not close tmp$$$") remove("tmp$$$") | stop("Could not remove tmp$$$") write() write(version) end Something similar should work in Unix, except I'm not sure what the Unix equivalent of 'ver' is. Assuming it exists, this program should work on Unix. So, if it fails to work, it must be running under Windows :-/ Charles Hethcoat --=_23774126.8FEE8660 Content-Type: message/rfc822 Received: from optima.cs.arizona.edu ([192.12.69.5]) by oceaneering.com (GroupWise SMTP/MIME daemon 4.1 v3) ; Wed, 13 May 98 09:43:58 CDT Received: from baskerville.CS.Arizona.EDU (baskerville.CS.Arizona.EDU [192.12.69.35]) by optima.cs.arizona.edu (8.9.0.Beta5/8.9.0.Beta5) with ESMTP id HAA15312; Wed, 13 May 1998 07:43:39 -0700 (MST) Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id HAA17889 for ; Wed, 13 May 1998 07:42:29 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22013; Wed, 13 May 1998 07:42:25 -0700 Message-Id: <3.0.5.32.19980512175257.007a7c40@doors> X-Sender: bgbauer#alpha.delta.edu@doors X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Errors-To: icon-group-errors@CS.Arizona.EDU Date: Tue, 12 May 1998 19:52:57 -0500 From: Scissors To: icon-group@optima.CS.Arizona.EDU Subject: Determining O/S Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Oh, I thought of another question thats been bugging me. What is the easiest way to determine the O/S your running on? I would have no idea how to determine unix, and Im uncertain the 'best' way to determine if the O/S is win3.1, win95, or winNT? Would it be best to use some of the ifdef lines I've noticed in io.icn for o/s secific code? if so what are the available definitions? At first I thought code similar to this would work (which is from yescr.icn): if find("UNIX",&features) then { expressions } else if find("MS-DOS", &features) then { expressions } else if find("MS Windows NT", &features) then { expressions } But this would lump win3.1 (win32s) with win95, and NT, and i believe it wouldnt give any indication of if the app is console, or windowed. Code i'm working on now would need to act differently on win3.1 than it would on win95/nt. Any help, suggestions, or comments welcome. Thanks, scissors --=_23774126.8FEE8660-- From icon-group-sender Thu May 14 07:48:46 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id HAA23365 for ; Thu, 14 May 1998 07:48:45 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA23981; Thu, 14 May 1998 07:48:40 -0700 Message-Id: <199805141002.MAA28619@capway.com> From: "Vladimir Grodzenski" To: icon-group@optima.CS.Arizona.EDU Date: Thu, 14 May 1998 11:58:42 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: Annoying things Reply-To: Vladimir Priority: urgent Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 604 1. Close one of the opened windows or dialogs (by clicking the CLOSE button in the upper-right corner) will cause the program termination. This is really annoying. 2. Under Windows95 the function system() does not work properly: system("wordpad " || filename) No way to list the directory: system("DIR > FOO.TXT") or system("COMMAND /C DIR > FOO.TXT") Well, this is mentioned in IPD271b document, but still how the h*ll can we get the list of files then!? I'd suggest to implement some WinOpen dialog returning a list of files (with filter, multiple selection etc. etc.) From icon-group-sender Thu May 14 12:24:44 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA12478 for ; Thu, 14 May 1998 12:24:34 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22110; Thu, 14 May 1998 12:24:30 -0700 Message-Id: <199805141509.RAA25422@capway.com> From: "Vladimir Grodzenski" To: icon-group@optima.CS.Arizona.EDU Date: Thu, 14 May 1998 17:05:33 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: Re: AI use for Icon Reply-To: Priority: urgent In-Reply-To: <199805061704.MAA14525@axp.cmpu.net> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1140 On 6 May 98 at 12:04, Gordon Peterson wrote: > For the "fuzzy match" I think that one interesting way to at least > help winnow down the possibilities would be to examine the > intersection of the character sets of the different names. Those > which have a high intersection (all but a "few" characters) can be > then examined more closely. > > For a better "fuzzy compare" function I've liked the use of > overlapping character pairs (including a blank added to the start > and end of each name). Another approach: for each employee 'name' create a table, the keys of which will be the characters from 'name' and values - their occurence in 'name'. Such as: T := table(0) every T [!name] +:= 1 We can define "sort of a difference" between two tables (T1,T2): procedure tdiff(T1, T2) local T, weight weight := 0 T := table(0) every k := key(T1) | key(T2) do T [k] := abs( T1[k] - T2[k] ) every weight +:= !T return weight end Vladimir Grodzenski ================================================= E-mail: vladimir.grodzenski@capway.com CompuServe: 100700,526 ================================================= From icon-group-sender Thu May 14 12:24:48 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA12481 for ; Thu, 14 May 1998 12:24:48 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22028; Thu, 14 May 1998 12:24:43 -0700 Message-Id: <3.0.5.32.19980514113425.007b1e80@doors> X-Sender: bgbauer#alpha.delta.edu@doors X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Thu, 14 May 1998 11:34:25 -0700 To: "Icon Group" From: Scissors Subject: system command in win95 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1697 Im using win95 and have a few successful uses of the system command, but i havent tried it with piping or redirection. I dont doubt it is causing a problem for you though. So, i've had success with it, but I find it VERY slow. If youre sending the output to another file... try pausing for 10 seconds, and then reading the file. I use a system command system("regedit /e etc...") which exports part of the registry to a file if you arent familiar with it. And I have had to implement a large pause before I can find the file! if I do: system(prog) # any command which creates a new? file every 1 to 50000 do if exists(newfile) then break # file created if not exists(newfile) then stop("file not created") Of course, this is just a work around. It was working... but only if my loop was VERY generous. My conclusion was that system releases before the command is totally finished. I have no way of knowing who is to blame, dos or icon. As for the listing of files in a dir... Look in io.icn. It contains procedures for reading directories. I believe it uses internal commands and interupts, and should be much faster and better than system("DIR"). I havent tried them, so I cant explain, maybe someone else can. One I believe is DOS_Dir_list? or something similar... there are a few, check em out. And finally, another work around, but it will accomplish what you need, is to write a batch file, then run it. Such as: batch := open("C:\temp\ver.bat", "w") write(batch, "VER > ver.log") close(batch) system("C:\temp\ver.bat") Then try reading. Its possible this may not work either though, if system() is releasing too soon. *shrug* It's worth a try though. From icon-group-sender Fri May 15 16:46:38 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA22344 for ; Fri, 15 May 1998 16:46:38 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA24168; Fri, 15 May 1998 16:46:33 -0700 Comments: Authenticated sender is From: Iain Alexander To: icon-group@optima.CS.Arizona.EDU Date: Fri, 15 May 1998 21:50:22 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: Re: Annoying things Priority: normal In-Reply-To: <199805141002.MAA28619@capway.com> X-Mailer: Pegasus Mail for Win32 (v2.54) Message-Id: <895265449.105374.0@stryx.demon.co.uk> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1612 On 14 May 98 at 11:58, Vladimir Grodzenski wrote: > 2. Under Windows95 the function system() does not work properly: > system("wordpad " || filename) Unfortunately, the Windows version of system() requires the file extension to be specified before it will work. In addition, wordpad is not normally on the search path, so you would have to give the full pathname: system("C:\\PROGRA~1\\ACCESS~1\\WORDPAD.EXE noname.icn") or system("C:\\Program Files\\Accessories\\Wordpad.exe noname.icn") On 14 May 98 at 11:34, Scissors wrote: > if I do: > > system(prog) # any command which creates a new? file > every 1 to 50000 do if exists(newfile) then break # file created > if not exists(newfile) then stop("file not created") > > Of course, this is just a work around. It was working... but only if my > loop was VERY generous. My conclusion was that system releases before the > command is totally finished. I have no way of knowing who is to blame, dos or > icon. The two system(wordpad)s above behave differently - the first waits until wordpad has exited, the second returns immediately. IIRC system(something.bat) waits for the batch file to complete. Presumably if it thinks you are a 32-bit application (because you specified a long filename) running another 32-bit application it returns immediately, otherwise it waits!? I imagine Icon has no real choice other than to use the Windows system() interface directly, and all this weirdness is down to the latter. -- Iain Alexander PGP 1024-bit key id B501A0AD ia@stryx.demon.co.uk I.Alexander@bsn0106.wins.icl.co.uk From icon-group-sender Mon May 18 08:32:49 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA11112 for ; Mon, 18 May 1998 08:32:49 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA26695; Mon, 18 May 1998 08:32:44 -0700 Message-Id: <3.0.5.32.19980517140924.007a5450@doors> X-Sender: bgbauer#alpha.delta.edu@doors (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Sun, 17 May 1998 14:09:24 -0700 To: "Icon Group" From: Scissors Subject: Checking if a directory exists Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 213 What is the easiest way, aside from having to chdir(), to check if a directory exists in windows? I've tried exists(dir || "\\nul") but it doesn't appear to work. Any ideas? suggestions? Thanks, scissors From icon-group-sender Mon May 18 08:32:42 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA11095 for ; Mon, 18 May 1998 08:32:37 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA25440; Mon, 18 May 1998 08:32:32 -0700 Message-Id: <199805161337.PAA01330@capway.com> From: "Vladimir Grodzenski" To: icon-group@optima.CS.Arizona.EDU Date: Sat, 16 May 1998 15:34:05 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: Re: Annoying things Reply-To: Priority: urgent References: <199805141002.MAA28619@capway.com> In-Reply-To: <895265449.105374.0@stryx.demon.co.uk> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 706 On 15 May 98 at 21:50, Iain Alexander wrote: > system("C:\\PROGRA~1\\ACCESS~1\\WORDPAD.EXE noname.icn") > or > system("C:\\Program Files\\Accessories\\Wordpad.exe noname.icn") Surprisingly, the second solution (i.e. with long names) does not work under my Windows95... The first one with DOS file names works fine. Weird! OTOH, I still cannot figure out how to list the directory since the DOS "DIR" command system("dir > foo") does nor redirect output to a file... Using Int86 function is not possible in WinIcon. Vladimir Grodzenski ================================================= E-mail: vladimir.grodzenski@capway.com CompuServe: 100700,526 ================================================= From icon-group-sender Mon May 18 08:32:19 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA11068 for ; Mon, 18 May 1998 08:32:17 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22190; Mon, 18 May 1998 08:32:12 -0700 Date: Fri, 15 May 1998 23:43:41 -0500 Message-Id: <199805160443.XAA09845@segfault.cs.utsa.edu> From: Clinton Jeffery To: ia@stryx.demon.co.uk Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <895265449.105374.0@stryx.demon.co.uk> (message from Iain Alexander on Fri, 15 May 1998 21:50:22 +0000) Subject: Re: Annoying things Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 705 Hi Iain, Thanks for your helpful remarks on Windows Icon's system() function. Up until the most recent binaries, advertized a week or two ago, system() was implemented using WinExec() in a less than perfect way. This less-than-perfect method is still the best I know how to do under Win32s/Windows 3.1, but the latest binaries now use spawnvp() under Windows95 and Windows NT, giving much improved behavior on those platforms. Anyone who wants to help me improve system() or implement files opened using the "pipe" modes, please drop me a line. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Mon May 18 12:44:11 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA24536 for ; Mon, 18 May 1998 12:44:11 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22953; Mon, 18 May 1998 12:44:06 -0700 Date: Mon, 18 May 1998 13:25:59 -0500 Message-Id: <199805181825.NAA29555@segfault.cs.utsa.edu> From: Clinton Jeffery To: vladimir.grodzenski@capway.com Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <199805161337.PAA01330@capway.com> (grodzens@capway.com) Subject: Re: Annoying things Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1673 > system("C:\\PROGRA~1\\ACCESS~1\\WORDPAD.EXE noname.icn") > or > system("C:\\Program Files\\Accessories\\Wordpad.exe noname.icn") Surprisingly, the second solution (i.e. with long names) does not work under my Windows95... The first one with DOS file names works fine. Weird! I suspect that the command-line argument processing breaks up the latter string incorrectly at the first space character unless the command is quoted: > system("\"C:\\Program Files\\Accessories\\Wordpad.exe\" noname.icn") but I haven't checked to see if that is a proper fix yet. > OTOH, I still cannot figure out how to list the directory since the > DOS "DIR" command system("dir > foo") does nor redirect output to a > file... Using Int86 function is not possible in WinIcon. Under Windows Icon, open(dirname) should return a file value that produces the filenames in the directory, one per line. With the present #ifdef's, this may only be enabled for the wicont program, not with nticont, but it should be easy to enable it for both. Going back to your original system("dir > foo") example, I would note that dir is an "internal" program built-in to command.com or cmd.exe and that you may be able to get better behavior by explicitly naming the desired invocation of your command interpreter, something like system("C:\\WINDOWS\\COMMAND.COM /C /Q dir >foo") but redirection in such a case might still be a problem; I'll put it on my bug list and check it out. UNIX (Linux) works much better! Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Mon May 18 12:44:00 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA24522 for ; Mon, 18 May 1998 12:44:00 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA20657; Mon, 18 May 1998 12:43:55 -0700 Message-Id: X-Mailer: Novell GroupWise 4.1 Date: Mon, 18 May 1998 11:01:53 -0500 From: Charles Hethcoat To: icon-group@optima.CS.Arizona.EDU Subject: Re: Annoying things Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2634 Iain Alexander wrote: >I imagine Icon has no real choice other than to use the Windows system() interface directly, and all this weirdness is down to the latter. The recent announcement of Unicon has me thinking. I believe the Icon community should set a more explicit goal of insuring portability between systems, including weird ones. (Naturally, a lot of the porting headaches involve coping with Windows.) Right now there are two Windows systems out there: Windows 95 and NT. They both are "Win32", but are very different underneath, apparently. I imagine most of the Windows comments made on this group pertain to Win95, but WinNT may be more important from a corporate-visibility viewpoint. Anyway, I don't think the portability issues for these two OSs are the same. Concerning NT: There is an interesting article in the June 1998 issue of Performance Computing (nee Unix Review): "Architecture of POSIX and OpenNT". This discusses the low-level system design of the OpenNT product, which is a port of UNIX to run over the NT kernel. IMHO, it raises some interesting questions about the correct strategy for assuring software portability between Unix and Windows NT. (Especially now that we Icon types have Unicon.) A quote: "This article discusses some of the hurdles...a narrowly focused development community may be fueling erroneous perceptions about about portability between the two platforms." Their approach: OpenNT just bypasses most of the Win32 junk, and the related porting problems, and works directly to the Windows NT kernel. It seems that Unicon could run on NT with almost no changes if a similar approach were used. Concerning Win 95: One solution would seem to be to implement minimal POSIX capabilities into or alongside the Win32 layer...at least enough to permit Unicon to work on it. I envision a replacement for the DOS window...call it, oh, let's just say Winix (TM ;^). It need not be a full UNIX system. It would be installed like 4DOS or other DOS replacement shells. Once installed, the necessary hooks would be there for Unicon to run. Apropos of portability, does anyone remember the Software Tools Users Group? Portability was their thing. In the days before C became universally available, they (we, for I was one of them) used to run a very consistent, very Unix-like programming layer on systems as diverse as OS/370, Primos, VMS, and Harris Vulcan (!). All implemented in Fortran. Cheers, Charles Hethcoat Oceaneering Space Systems, Inc. 16665 Space Center Blvd., Houston, Texas 77058 USA chethcoa@oss.oceaneering.com Voice: 281-228-5568 Fax: 281-488-2027 From icon-group-sender Tue May 19 08:44:19 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA11196 for ; Tue, 19 May 1998 08:44:18 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA15726; Tue, 19 May 1998 08:44:12 -0700 Date: Mon, 18 May 1998 19:53:12 -0500 Message-Id: <199805190053.TAA31385@segfault.cs.utsa.edu> From: Clinton Jeffery To: CHETHCOA@oss.oceaneering.com Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: (message from Charles Hethcoat on Mon, 18 May 1998 11:01:53 -0500) Subject: UNIX on top of NT Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1144 [Charlie Hethcoat pointed us at an article on OpenNT, a commercial UNIX package that runs on top of Windows NT.] That article in Performance Computing sounds interesting. UNIX on NT people might also be interested in a paper by Korn from the 1997 USENIX conference which describes a full UNIX implementation on NT done at AT&T that consists of libraries and command-line programs that run on NT and Win95. Their package co-exists with the Win32 stuff in the same application. In both te case of OpenNT and the AT&T thing, the main problem I have is that the software is not quite free enough to base Windows Icon upon it. I will work on, or work with people on, a Windows implementation of the POSIX facilities provided by Unicon. If any of these UNIX on NT packages are really free software, they might make the job easier, but a large subset of Unicon can be done on Windows fairly easily in any case. It is mostly a question of finding the time (or the right person) to do it. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Thu May 21 08:57:28 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA18936 for ; Thu, 21 May 1998 08:57:28 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28817; Thu, 21 May 1998 08:57:22 -0700 Date: Wed, 20 May 1998 18:09:03 -0700 From: Gregg Townsend Message-Id: <9805210109.AA27090@hawk.CS.Arizona.EDU> To: icon-group Subject: Jcon: A Java-based Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 982 We are pleased to announce the general distribution release of version 1.0 of "Jcon," an experimental Java-based Icon implementation. Jcon is a new Java-based implementation of the Icon programming language. The Jcon translator, written in Icon, generates Java class files that execute in conjunction with a run-time system written in Java. Jcon is an essentially complete implementation of the core Icon language, lacking only a few things such as chdir() that cannot be done in Java. Large integers are not implemented, and only rudimentary graphics are present. Jcon is an experimental research project and should be viewed in that light. We are distributing Jcon because it is interesting. Its performance does not match that of the standard Icon interpreter, which is still preferred for production and everyday use. Please visit http://www.cs.arizona.edu/icon/jcon/ for more information about Jcon's status and distribution. Gregg Townsend Todd Proebsting From icon-group-sender Tue May 26 12:40:28 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA27051 for ; Tue, 26 May 1998 12:40:27 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06721; Tue, 26 May 1998 12:40:21 -0700 From: F.G.van.Dorp@digimedia.nl (F.G. van DORP) To: icon-group@optima.CS.Arizona.EDU Subject: 1-st impressions Date: Sat, 23 May 1998 12:56:24 GMT Message-Id: <3568c329.5170584@smtp.NL.net> X-Mailer: Forte Agent 1.01/16.397 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8BIT Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1764 As the subject says, here are some Icon phenomena which, after experimenting for a couple of weeks, struck me as interesting, peculiar, awkward, etc. : 0) Scope restriction inside procedures automatic and no special syntax for variables (v. PERL e.g.) 1) WHILE - you can't use the "{" without the DO in front. 2) MUTUAL EVAL. - doesn't backtrack, only difference with the COMPOUND EXPR. seems to be the option of selecting the outcome expression. 3) INDEXING very consistent (strings, lists, sets, even records) 4) SETS can't be concatenated (no automatic conversion to lists and back) 5) &FAIL equivalent to NOT &NULL and \&NULL 6) PROC() doesn't work unless the procedure has been called at least once. 7) can't get RE_FIND (from IPL) to match greedily 8) STRING SCANNING is rather low-level (position-centered) and so a bit awkward (had to write most high-level functions myself), same applies to.... 9) CO-EXPRESSIONS: powerful (possibilities for declarative programming, "lazy" evaluation, etc.) but not very intuitive and (low-level) behavior sometimes puzzling - at times ^CE or @^CE won't work, while CE:=^CE seems to do the trick. - below are 3 expressions in order of evaluation time (approx. 1x, 4x, 8x) every write(lazy{z:=(1 to 50000), (5 > z)}) every write(5 > (1 to 50000)) every write( (z:=(1 to 50000),(5 > z))) procedure lazy(p) local a,b,c a:=get(p); b:=get(p) while (c:=(@a @ ^b)) do {suspend c} end ------------------------------------------------------------------------------------------------- Great concise language overall, but generators and especially co-expressions not easy to get into Bob. ====== From icon-group-sender Tue May 26 12:41:06 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA27062 for ; Tue, 26 May 1998 12:41:06 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01479; Tue, 26 May 1998 12:41:00 -0700 Date: Mon, 25 May 1998 08:18:17 -0700 From: Ralph Griswold Message-Id: <9805251518.AA02290@jupiter.CS.Arizona.EDU> To: icon-group Subject: forwarded message Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2300 From: "Paul A. Sue" To: icon-project@optima.CS.Arizona.EDU Message-Id: <0825660C.006C0CCA.00@notes.bctel.com> Date: Fri, 22 May 1998 11:48:10 -0800 Subject: Help Me Promote Icon! Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Status: RO Hi, [Sorry to bother you, but no one seems to be responding to me post to comp.lang.icon.] I'm a very recent convert to Icon, and thought I'd use it here at work to write a simple translator that I had originally written in C and Perl. I wanted to show that Icon would be an ideal language for many of the projects at my company. Anyhow, here's the Perl script along with sample input and output to give you an idea of what I'm trying to do. Thanks in advance, Paul ================================================= Paul A. Sue, Consultant ISM-BC AD/M Voice-mail: (604) 432-4316 Pager: (604) 473-2811 E-mail: paul@wsi.ca or paul_sue@notes.bctel.com [From comp.lang.icon] --------------------- Start of included file ---------------------------- From: Paul A. Sue Subject: Newbie question Date: Thursday, May 14, 1998 1:46 PM Hi, I'm wondering if anyone can help me "translate" the following Perl script to the Icon equivalent. [Perl gurus feel free to improve on my perl script if you wish!] Thanks in advance, Paul #!/usr/local/bin/perl while (<>) { chomp; if (/[a-z]/) { # --- convert from Directory to M/F format s#$#//#; s#^([a-z])#\*\1#; s#(\s+)([a-z])# \*\2#g; s#([a-z]+)([A-Z]+)#\1\(\2\)#g; tr/a-z/A-Z/; @result = split; $index = $#result; if ($index > 0) { $result[$index - 1] .= ","; } } else { # --- convert from M/F to Directory format s#//$##; s#,##g; tr/A-Z/a-z/; s#(\()(.*)(\))#\U\2#g; s#(^([a-z])|(\s+[a-z]))#\U\1\E#g; s#\*##g; @result = split; } print "@result\n"; next; } Sample input/output: input of: "MacDonald John" gives output of: "MAC(D)ONALD, JOHN//" input of: "*VAN *DER(C)ORTLAND, NICK//" gives output of: "van derCortland Nick" --------------------- End of included file ---------------------------- From icon-group-sender Tue May 26 12:39:49 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA26985 for ; Tue, 26 May 1998 12:39:49 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00443; Tue, 26 May 1998 12:39:43 -0700 From: Guy Laden Message-Id: <199805222014.XAA02171@orion.math.tau.ac.il> Subject: Writing compilers in Icon To: icon-group@baskerville.CS.Arizona.EDU Date: Fri, 22 May 1998 23:14:55 +0300 (GMT+0300) X-Mailer: ELM [version 2.4 PL25] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 493 I noticed the newly announced implementation of Jcon is written in Icon. I was wondering whether anybody can comment on how suitable they find Icon for writing compilers? Do any of Icon's unique features prove especially useful for this task? I'm wondering more about generators and goal-directed evaluation; the built-in data-structures are obviously useful. btw, does anybody have an Icon grammar they are willing to share that is suitable for recursive descent parsing? Regards, Guy. From icon-group-sender Tue May 26 12:40:28 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA27049 for ; Tue, 26 May 1998 12:40:15 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA31487; Tue, 26 May 1998 12:40:09 -0700 Message-Id: <199805231036.MAA17216@capway.com> From: "Vladimir Grodzenski" To: jeffery@cs.utsa.edu Date: Sat, 23 May 1998 12:33:14 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: Re: Annoying things Reply-To: Cc: icon-group@optima.CS.Arizona.EDU Priority: urgent In-Reply-To: <199805181825.NAA29555@segfault.cs.utsa.edu> References: <199805161337.PAA01330@capway.com> (grodzens@capway.com) Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1008 On 18 May 98 at 13:25, you wrote: > Under Windows Icon, open(dirname) should return a file value that > produces the filenames in the directory, one per line. With the > present #ifdef's, this may only be enabled for the wicont program, > not with nticont, but it should be easy to enable it for both. Thanks for the suggestion, it works! You should however mention it in the Icon reference otherwise we can only guess... Are there some other "undocumented" features like with Microsoft? :-) After opening the directory we get a list of both files and [sub]directories so the only way I found to distinguish them is check the failure with chdir(name) which is rather unusual... Of course, we have to exclude the "." and ".." directories from the list. Anyway, it works and even allows to easily recurse directories. Vladimir Grodzenski ================================================= E-mail: vladimir.grodzenski@capway.com CompuServe: 100700,526 ================================================= From icon-group-sender Tue May 26 12:40:58 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA27055 for ; Tue, 26 May 1998 12:40:53 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA26931; Tue, 26 May 1998 12:40:47 -0700 Date: Sat, 23 May 1998 10:24:33 -0500 Message-Id: <199805231524.KAA05320@segfault.cs.utsa.edu> From: Clinton Jeffery To: vladimir.grodzenski@capway.com Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <199805231036.MAA17216@capway.com> (grodzens@capway.com) Subject: Re: Annoying things Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1203 [open(dirname) gives a file that returns a directory's filenames, one per line] > Thanks for the suggestion, it works! You should however mention > it in the Icon reference otherwise we can only guess... Are there > some other "undocumented" features like with Microsoft? :-) Oops. Well, at least I release the source code. :-) Actually, the reason that directory reading is not yet documented is that it is likely to change. For these kind of operating system interactions whatever I implement and document needs to be consistent with Shamim Mohamed's POSIX interface for Icon, Unicon. His interface supports open(dirname) but specifies more complete file information returned for each directory entry, such as permissions, ownership, and timestamps. Prior to this I had made open(dirname) simpler, and some graduate students of mine had implemented a separate function for such file attributes, fattrib(). He and I need to talk about it a bit more, but I am likely to adopt his semantics for the lines returned by open(dirname). Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Wed May 27 08:21:10 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA03028 for ; Wed, 27 May 1998 08:21:10 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01621; Wed, 27 May 1998 08:21:04 -0700 Message-Id: <356B9C3B.15DA6101@charlie.cns.iit.edu> Date: Tue, 26 May 1998 23:53:15 -0500 From: "Thomas W. Christopher" Organization: Illinois Institute of Technology X-Mailer: Mozilla 4.05 [en] (WinNT; I) Mime-Version: 1.0 To: Guy Laden Cc: icon-group@baskerville.CS.Arizona.EDU Subject: Re: Writing compilers in Icon References: <199805222014.XAA02171@orion.math.tau.ac.il> Content-Type: multipart/mixed; boundary="------------D07FD781A7537D236717351D" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 8242 This is a multi-part message in MIME format. --------------D07FD781A7537D236717351D Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I have found Icon quite pleasant for compiler writing, although not for production quality compilers. I use them for teaching. See: http://www.iit.edu/~tc/toolsfor.htm I found generators a lot more useful for writing my parser generator than for writing compilers themselves. I have used coexpressions for scanners, but I don't currently due to the difficulty of explaining it to students. My parser uses string invocation of procedures. All the grammar symbols, including action symbols, are represented by strings in my parse tables. The action symbols are the names of the semantic routines to call. I'll attach a grammar for Icon that my LL(k) parser generator, tcllk, can handle. If you pass it through: iconx tcllk -p icon.grm you might be able to use the after-translation version of the grammar for recursive descent, although it's a lot easier to use my parser generator and parser. A few suggestions for scanning tokens in Icon and passing them on to the parser: 1) queue up the tokens leaving the scanner before the parser sees them, use the queue to do (2) and (3); 2) remove duplicate ";" and end-of-line symbols; 3) remove end-of-line symbols preceeding or following symbols like "do", "then", "else"; 4) fix the panic-mode error recovery to respond to an unexpected end-of-line symbol by throwing it away without comment. Guy Laden wrote: > I noticed the newly announced implementation of Jcon is written in Icon. > I was wondering whether anybody can comment on how suitable they > find Icon for writing compilers? Do any of Icon's unique features > prove especially useful for this task? I'm wondering more about > generators and goal-directed evaluation; the built-in data-structures > are obviously useful. > > btw, does anybody have an Icon grammar they are willing to share > that is suitable for recursive descent parsing? > > Regards, > Guy. -- Thomas W. Christopher --------------------- tc@charlie.cns.iit.edu Associate Prof., Illinois Inst. of Tech.--- http://www.iit.edu/~tc Principal, Tools of Computing LLC.--------- http://www.toc-press.com --------------D07FD781A7537D236717351D Content-Type: application/x-unknown-content-type-grm_auto_file; name="icon.grm" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="icon.grm" c3RhcnQgOiBwcm9ncmFtLg0KcHJvZ3JhbSA9IGRlY2xhcmF0aW9uDQoJfCBkZWNsYXJhdGlv biBwcm9ncmFtDQoJLg0KZW9zID0gIjsiIHwgRU9MIC4NCmRlY2xhcmF0aW9uID0gbGlua19k ZWNsYXJhdGlvbg0KCXwgZ2xvYmFsX2RlY2xhcmF0aW9uDQoJfCByZWNvcmRfZGVjbGFyYXRp b24NCgl8IHByb2NlZHVyZV9kZWNsYXJhdGlvbg0KCS4NCmxpbmtfZGVjbGFyYXRpb24gPSAi bGluayIgbGlua19saXN0DQoJLg0KbGlua19saXN0ID0gZmlsZV9uYW1lDQoJfCBmaWxlX25h bWUgIiwiIGxpbmtfbGlzdA0KCS4NCmZpbGVfbmFtZSA9IGlkZW50aWZpZXINCgl8IHN0cmlu Z19saXRlcmFsDQoJLg0KZ2xvYmFsX2RlY2xhcmF0aW9uID0gImdsb2JhbCIgaWRlbnRpZmll cl9saXN0DQoJLg0KI2lkZW50aWZpZXJfbGlzdF9vcHQgPSBpZGVudGlmaWVyX2xpc3R8Lg0K aWRlbnRpZmllcl9saXN0ID0gaWRlbnRpZmllcg0KCXwgaWRlbnRpZmllcl9saXN0ICIsIiBp ZGVudGlmaWVyDQoJLg0KcmVjb3JkX2RlY2xhcmF0aW9uID0gDQoJICAicmVjb3JkIiBpZGVu dGlmaWVyICIoIiBmaWVsZF9saXN0X29wdCAiKSINCgkuDQpmaWVsZF9saXN0X29wdCA9IGZp ZWxkX2xpc3QNCgl8DQoJLg0KZmllbGRfbGlzdCA9IGZpZWxkX25hbWUNCgl8IGZpZWxkX2xp c3QgIiwiIGZpZWxkX25hbWUNCgkuDQpmaWVsZF9uYW1lID0gaWRlbnRpZmllcg0KCS4NCnBy b2NlZHVyZV9kZWNsYXJhdGlvbiA9DQoJICBwcm9jX2hlYWRlciBsb2NhbHNfb3B0IGluaXRp YWxfb3B0IGV4cHJlc3Npb25fc2VxdWVuY2UgImVuZCINCgkuDQpwcm9jX2hlYWRlciA9IA0K CSAgInByb2NlZHVyZSIgaWRlbnRpZmllciAiKCIgcGFyYW1ldGVyX2xpc3Rfb3B0ICIpIiBl b3MNCgkuDQpwYXJhbWV0ZXJfbGlzdF9vcHQgPSBwYXJhbWV0ZXJfbGlzdA0KCXwgDQoJLg0K cGFyYW1ldGVyX2xpc3QgPSBpZGVudGlmaWVyDQoJfCBpZGVudGlmaWVyICJbIiAiXSINCgl8 IGlkZW50aWZpZXIgIiwiIHBhcmFtZXRlcl9saXN0DQoJLg0KbG9jYWxzX29wdCA9IGxvY2Fs cw0KCXwNCgkuDQpsb2NhbHMgPSBsb2NhbF9zcGVjaWZpY2F0aW9uIGlkZW50aWZpZXJfbGlz dA0KCXwgbG9jYWxfc3BlY2lmaWNhdGlvbiBpZGVudGlmaWVyX2xpc3QgZW9zIGxvY2Fscw0K CS4NCmxvY2FsX3NwZWNpZmljYXRpb24gPSAibG9jYWwiIA0KCXwgInN0YXRpYyINCgkuDQpp bml0aWFsX29wdCA9ICJpbml0aWFsIiBleHByZXNzaW9uIGVvcw0KCXwNCgkuDQpleHByZXNz aW9uX3NlcXVlbmNlID0gZXhwcmVzc2lvbl9vcHQNCgl8IGV4cHJlc3Npb25fc2VxdWVuY2Ug ZW9zIGV4cHJlc3Npb25fb3B0DQoJLg0KZXhwcmVzc2lvbl9vcHQgPSBleHByZXNzaW9uDQoJ fA0KCS4NCmV4cHJlc3Npb24gPQ0KCSAgImJyZWFrIiBleHByZXNzaW9uX29wdA0KCXwgImNy ZWF0ZSIgZXhwcmVzc2lvbg0KCXwgInJldHVybiIgZXhwcmVzc2lvbl9vcHQNCgkjfCAic3Vz cGVuZCIgZXhwcmVzc2lvbl9vcHQgZG9fY2xhdXNlX29wdA0KCXwgInN1c3BlbmQiIGV4cHJl c3Npb25fb3B0IHN1c3BlbmRfZG9fY2xhdXNlX29wdA0KCXwgImZhaWwiDQoJfCAibmV4dCIN Cgl8ICJjYXNlIiBleHByZXNzaW9uICJvZiIgInsiIGNhc2VfbGlzdCAifSINCgl8ICJpZiIg ZXhwcmVzc2lvbiAidGhlbiIgZXhwcmVzc2lvbiBlbHNlX2NsYXVzZV9vcHQNCgl8ICJyZXBl YXQiIGV4cHJlc3Npb24NCgkjfCAid2hpbGUiIGV4cHJlc3Npb24gZG9fY2xhdXNlX29wdA0K CSN8ICJ1bnRpbCIgZXhwcmVzc2lvbiBkb19jbGF1c2Vfb3B0DQoJI3wgImV2ZXJ5IiBleHBy ZXNzaW9uIGRvX2NsYXVzZV9vcHQNCgl8ICJ3aGlsZSIgZXhwcmVzc2lvbiB3aGlsZV9kb19j bGF1c2Vfb3B0DQoJfCAidW50aWwiIGV4cHJlc3Npb24gdW50aWxfZG9fY2xhdXNlX29wdA0K CXwgImV2ZXJ5IiBleHByZXNzaW9uIGV2ZXJ5X2RvX2NsYXVzZV9vcHQNCgl8IGV4cHIxDQoJ Lg0KI2RvX2NsYXVzZV9vcHQgPSAiZG8iIGV4cHJlc3Npb258Lg0Kc3VzcGVuZF9kb19jbGF1 c2Vfb3B0ID0gImRvIiBleHByZXNzaW9ufC4NCndoaWxlX2RvX2NsYXVzZV9vcHQgPSAiZG8i IGV4cHJlc3Npb258Lg0KdW50aWxfZG9fY2xhdXNlX29wdCA9ICJkbyIgZXhwcmVzc2lvbnwu DQpldmVyeV9kb19jbGF1c2Vfb3B0ID0gImRvIiBleHByZXNzaW9ufC4NCg0KZWxzZV9jbGF1 c2Vfb3B0ID0gImVsc2UiIGV4cHJlc3Npb24NCgl8DQoJLg0KY2FzZV9saXN0ID0gY2FzZV9j bGF1c2UNCgl8IGNhc2VfbGlzdCBlb3MgY2FzZV9jbGF1c2UNCgkuDQpjYXNlX2NsYXVzZSA9 IGV4cHJlc3Npb24gIjoiIGV4cHJlc3Npb24NCgl8ICJkZWZhdWx0IiAiOiIgZXhwcmVzc2lv bg0KCS4NCmV4cHIxCT0gZXhwcjEgIiYiIGV4cHIyDQoJfCBleHByMg0KCS4NCmV4cHIyCT0g ZXhwcjIgIj8iIGV4cHIzDQoJfCBleHByMw0KCS4NCmV4cHIzCT0gICBleHByNCAiOj0iIGV4 cHIzDQoJfCBleHByNCAiOj06IiBleHByMw0KCXwgZXhwcjQgIjwtIiBleHByMw0KCXwgZXhw cjQgIjwtPiIgZXhwcjMNCgl8IGV4cHI0IG9wX2FzZ24gZXhwcjMNCgl8IGV4cHI0DQoJLg0K ZXhwcjQJPSBleHByNCAidG8iIGV4cHI1DQoJfCBleHByNCAidG8iIGV4cHI1ICJieSIgZXhw cjUNCgl8IGV4cHI1DQoJLg0KZXhwcjUJPSBleHByNSAifCIgZXhwcjYNCgl8IGV4cHI2DQoJ Lg0KZXhwcjYJPSBleHByNiAiPCIgZXhwcjcNCgl8IGV4cHI2ICI8PSIgZXhwcjcNCgl8IGV4 cHI2ICI9IiBleHByNw0KCXwgZXhwcjYgIj49IiBleHByNw0KCXwgZXhwcjYgIj4iIGV4cHI3 DQoJfCBleHByNiAifj0iIGV4cHI3DQoJfCBleHByNiAiPDwiIGV4cHI3DQoJfCBleHByNiAi PDw9IiBleHByNw0KCXwgZXhwcjYgIj09IiBleHByNw0KCXwgZXhwcjYgIj4+PSIgZXhwcjcN Cgl8IGV4cHI2ICI+PiIgZXhwcjcNCgl8IGV4cHI2ICJ+PT0iIGV4cHI3DQoJfCBleHByNiAi PT09IiBleHByNw0KCXwgZXhwcjYgIn49PT0iIGV4cHI3DQoJfCBleHByNw0KCS4NCmV4cHI3 CT0gZXhwcjcgInx8IiBleHByOA0KCXwgZXhwcjcgInx8fCIgZXhwcjgNCgl8IGV4cHI4DQoJ Lg0KZXhwcjgJPSBleHByOCAiKyIgZXhwcjkNCgl8IGV4cHI4ICItIiBleHByOQ0KCXwgZXhw cjggIisrIiBleHByOQ0KCXwgZXhwcjggIi0tIiBleHByOQ0KCXwgZXhwcjkNCgkuDQpleHBy OQk9IGV4cHI5ICIqIiBleHByMTANCgl8IGV4cHI5ICIvIiBleHByMTANCgl8IGV4cHI5ICIl IiBleHByMTANCgl8IGV4cHI5ICIqKiIgZXhwcjEwDQoJfCBleHByMTANCgkuDQpleHByMTAJ PSBleHByMTEgIl4iIGV4cHIxMA0KCXwgZXhwcjExDQoJLg0KZXhwcjExCT0gZXhwcjExICJc IiBleHByMTINCgl8IGV4cHIxMSAiQCIgZXhwcjEyDQoJfCBleHByMTEgIiEiIGV4cHIxMg0K CXwgZXhwcjEyDQoJLg0KZXhwcjEyCT0gIm5vdCIgZXhwcjEyDQoJfCAifCIgZXhwcjEyDQoJ fCAiISIgZXhwcjEyDQoJfCAiKiIgZXhwcjEyDQoJfCAiKyIgZXhwcjEyDQoJfCAiLSIgZXhw cjEyDQoJfCAiLiIgZXhwcjEyDQoJfCAiLyIgZXhwcjEyDQoJfCAiXCIgZXhwcjEyDQoJfCAi PSIgZXhwcjEyDQoJfCAiPyIgZXhwcjEyDQoJfCAifiIgZXhwcjEyDQoJfCAiQCIgZXhwcjEy DQoJfCAiXiIgZXhwcjEyDQoJfCBleHByMTMNCgkuDQpleHByMTMJPSAiKCIgZXhwcmVzc2lv bl9saXN0ICIpIg0KCXwgInsiIGV4cHJlc3Npb25fc2VxdWVuY2UgIn0iDQoJfCAiWyIgZXhw cmVzc2lvbl9saXN0ICJdIg0KCXwgZXhwcjEzICIuIiBmaWVsZF9uYW1lDQoJfCBleHByMTMg IigiIGV4cHJlc3Npb25fbGlzdCAiKSINCgl8IGV4cHIxMyAieyIgZXhwcmVzc2lvbl9saXN0 ICJ9Ig0KCXwgZXhwcjEzICJbIiBzdWJzY3JpcHRfbGlzdCAiXSINCgl8IGlkZW50aWZpZXIN Cgl8IGtleXdvcmQNCgl8IGxpdGVyYWwNCgkuDQoNCmV4cHJlc3Npb25fbGlzdCA9IGV4cHJl c3Npb25fb3B0DQoJfCBleHByZXNzaW9uX2xpc3QgIiwiIGV4cHJlc3Npb25fb3B0DQoJLg0K c3Vic2NyaXB0X2xpc3QgPSBzdWJzY3JpcHQNCgl8IHN1YnNjcmlwdF9saXN0ICIsIiBzdWJz Y3JpcHQNCgkuDQpzdWJzY3JpcHQgPSBleHByZXNzaW9uDQoJfCBleHByZXNzaW9uICI6IiBl eHByZXNzaW9uDQoJfCBleHByZXNzaW9uICIrOiIgZXhwcmVzc2lvbg0KCXwgZXhwcmVzc2lv biAiLToiIGV4cHJlc3Npb24NCgkuDQprZXl3b3JkID0gIiYiIGlkZW50aWZpZXINCgkuDQps aXRlcmFsID0gc3RyaW5nX2xpdGVyYWwNCgl8IGludGVnZXJfbGl0ZXJhbA0KCXwgcmVhbF9s aXRlcmFsDQoJfCBjc2V0X2xpdGVyYWwNCgkuDQoNCg== --------------D07FD781A7537D236717351D-- From icon-group-sender Wed May 27 08:20:59 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA03009 for ; Wed, 27 May 1998 08:20:58 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA32250; Wed, 27 May 1998 08:20:52 -0700 Message-Id: <4FD6422BE942D111908D00805F3158DF0757B2CE@red-msg-52.dns.microsoft.com> From: Todd Proebsting To: "'Guy Laden'" , icon-group@baskerville.CS.Arizona.EDU Subject: RE: Writing compilers in Icon Date: Tue, 26 May 1998 13:22:48 -0700 X-Mailer: Internet Mail Service (5.5.2328.0) Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2106 I really enjoyed writing Jcon's translator in Icon. (I had help from Denise Todd, Bob Alexander and Gregg Townsend.) I made little use of goal-directed evaluation, although generators were great fun to use. In fact, the whole translator setup is based on a series of co-expressions that feed one another as a series of filters, which would have been very painful without generators. For instance, to translate a file, file.icn, into ucode files file.u1 and file.u2, the magic incantation is % jtran preproc file.icn : yylex : parse : u_gen_File -out:file This directs the translator to create a 4-stage pipe: preprocessing, lexing, parsing, and generating ucode. Each stage is a co-expression that eats the output of the previous co-expression as input. For fun, try the following pipelines: % jtran preproc file.icn : echo % jtran preproc file.icn : yylex : echo % jtran preproc file.icn : yylex : parse : echo Each will give you some idea as to what each stage communicates to the next. (NOTE: The colons must be separated from the commands by whitespace. Also, "echo" filter can be given a "-verbose" flag for really chatty output.) I don't have an Icon grammar that is suitable for recursive-descent parsing, BUT jtran has just such a parser in it. Check the file tran/parse.icn. (The command above that ends in "parse : echo" will give you some idea of the abstract syntax trees built by the parser.) Todd -----Original Message----- From: Guy Laden [mailto:guy@math.tau.ac.il] Sent: Friday, May 22, 1998 1:15 PM To: icon-group@baskerville.CS.Arizona.EDU Subject: Writing compilers in Icon I noticed the newly announced implementation of Jcon is written in Icon. I was wondering whether anybody can comment on how suitable they find Icon for writing compilers? Do any of Icon's unique features prove especially useful for this task? I'm wondering more about generators and goal-directed evaluation; the built-in data-structures are obviously useful. btw, does anybody have an Icon grammar they are willing to share that is suitable for recursive descent parsing? Regards, Guy. From icon-group-sender Wed May 27 08:21:22 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA03054 for ; Wed, 27 May 1998 08:21:21 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA29918; Wed, 27 May 1998 08:21:15 -0700 From: Otfried Geffert Date: Wed, 27 May 1998 11:37:39 GMT Message-Id: <19980527.11373903@og-1042.stardiv.de> Subject: Re: Writing compilers in Icon To: Guy Laden Cc: icon-group@baskerville.CS.Arizona.EDU In-Reply-To: <199805222014.XAA02171@orion.math.tau.ac.il> References: <199805222014.XAA02171@orion.math.tau.ac.il> X-Mailer: Mozilla/3.0 (compatible; StarOffice/4.0; WinNT/Win95) X-Priority: 3 (Normal) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1125 Hi Guy, in 'The Icon programming language' 3rd edition from Griswold &=20 Griswold they describe how to use Icon for syntax analysis using - alternation - recursive lists=20 - generators to represent syntactical constructs on page 220-226. It's really worth reading.=20 I myself wrote a compiler/linker, but I used lex/yacc and C, because I did'nt know Icon in those days. With Icon I would have implemented=20= it much faster, especially because of the builtin data structures. Regards, Otfried >>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<< Guy Laden wrote: > I noticed the newly announced implementation of Jcon is written in=20= Icon.=20 > I was wondering whether anybody can comment on how suitable they=20 > find Icon for writing compilers? Do any of Icon's unique features > prove especially useful for this task? I'm wondering more about > generators and goal-directed evaluation; the built-in data-structures = > are obviously useful. >=20 > btw, does anybody have an Icon grammar they are willing to share > that is suitable for recursive descent parsing? >=20 > Regards, > Guy. >=20 From icon-group-sender Fri May 29 08:30:13 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA13437 for ; Fri, 29 May 1998 08:30:13 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA24809; Fri, 29 May 1998 08:30:06 -0700 Message-Id: <3.0.5.32.19980528174121.007b0680@doors> X-Sender: bgbauer#alpha.delta.edu@doors X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Thu, 28 May 1998 17:41:21 -0700 To: gep2@computek.net From: Scissors Subject: Re: Determining O/S Cc: "Icon Group" In-Reply-To: <199805271056.FAA08434@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 334 At 05:56 AM 5/27/98 -0500, you wrote: >Note that under Windows (of any flavor) the program can be changed from >"console" to "windowed" at any time, and vice-versa, and without advance notice. How? Isnt the program limited to console only, if compiled with NTICONT? and Windowed only, if compiled with WICONT? hmm... B Bauer From icon-group-sender Mon Jun 1 09:05:23 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id JAA02631 for ; Mon, 1 Jun 1998 09:05:22 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06428; Mon, 1 Jun 1998 09:05:16 -0700 Date: Fri, 29 May 98 22:28:40 -0400 Message-Id: <9805300228.AA0191@valinet.com> From: Paul Abrahams To: jeffery@cs.utsa.edu Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <199805231524.KAA05320@segfault.cs.utsa.edu> (message from Clinton Jeffery on Sat, 23 May 1998 10:24:33 -0500) Subject: Re: Annoying things Reply-To: abrahams@acm.org Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1627 >>>>> On Sat, 23 May 1998 10:24:33 -0500, Clinton Jeffery said: |vladimir> [open(dirname) gives a file that returns a directory's |vladimir> filenames, one per line] Thanks for the suggestion, it works! |vladimir> You should however mention it in the Icon reference otherwise |vladimir> we can only guess... Are there some other "undocumented" |vladimir> features like with Microsoft? :-) |Clint> Oops. Well, at least I release the source code. :-) |Clint> Actually, the reason that directory reading is not yet |Clint> documented is that it is likely to change. For these kind of |Clint> operating system interactions whatever I implement and document |Clint> needs to be consistent with Shamim Mohamed's POSIX interface for |Clint> Icon, Unicon. His interface supports open(dirname) but |Clint> specifies more complete file information returned for each |Clint> directory entry, such as permissions, ownership, and timestamps. |Clint> Prior to this I had made open(dirname) simpler, and some |Clint> graduate students of mine had implemented a separate function |Clint> for such file attributes, fattrib(). He and I need to talk |Clint> about it a bit more, but I am likely to adopt his semantics for |Clint> the lines returned by open(dirname). Given the variances among operating systems, perhaps there ought to be a convention that the first space-delimited item in each line produced by open(dirname) is the filename. This does seem close to my earlier suggestion that reading a directory should act as a generator of the filenames within the directory. Paul (Paul Abrahams) From icon-group-sender Mon Jun 1 09:05:41 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id JAA02642 for ; Mon, 1 Jun 1998 09:05:35 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA04735; Mon, 1 Jun 1998 09:05:28 -0700 Message-Id: <3.0.5.32.19980530023718.007aa100@doors> X-Sender: bgbauer#alpha.delta.edu@doors X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Sat, 30 May 1998 02:37:18 -0700 To: "Icon Group" From: bauerb Subject: Re: Determining O/S Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3679 >At 05:56 AM 5/27/98 -0500, GEP wrote: >>Note that under Windows (of any flavor) the program can be changed from >>"console" to "windowed" at any time, and vice-versa, and without advance >>notice. >> How? Isnt the program limited to console only, if compiled with NTICONT? >> and Windowed only, if compiled with WICONT? >As near as I can tell, you are right. I don't know what he means here. >Clint, jeffery@cs.utsa.edu Ok, I guess the easiest way for me to explain, is give a few examples. I've created a procedure DateInFormat(i, s1):s2 i an integer of the seconds past the standard 'base year' of 1970. (optional, default is current time). s1 a string template for the Date. Example: "dddd, MMMM dd, yyyy" or "MM/dd/yy". (optional, default is the users current preference, as determined using 'localization' settings for windows. s2 a string of the date in the format of s1. Examples: (using above templates) "Tuesday, March 10, 1987" or "3/10/87" So I can do something similar to sdate := DateInFormat(secs) and have the date formatted in the standard the user is used to, or if I specify a format, in that format (which could even be something like DateInFormat(,"Today is dddd") : "Today is Tuesday". Ok, in this situation, the localization (and timezone bias etc.) settings for win3.1 are located in win.ini, but the localization settings for win95 and NT are located in the registry. In win95 they are 'left' in the win.ini, but arent maintained, so daylight savings time isnt accounted for, and neither are changes to timezones after the user first installs Win95. (In my situation, Ive moved from -5 to -8 hoursfromGMT since installing win95, which means at times the win.ini settings for timezone are up to 4 hours incorrect.) So this is why It would matter if Im in Win3.1 or Win95/NT. The procedure would need to gather 'defaults' from separate places depending on what O/S it's run on (and yet another location from UNIX if one exists). I realise I can use system("VER > VER.TMP") but so far I've had trouble with system() commands which create new files (as was talked about in previous posts). Im just wondering the 'fastest' and 'least overhead' way to determine O/S. Win3.1/Win32's cant count the same as Win95 in this case, so the &features way Ive noticed people use I don't think will work. About the "console" or "window": The main program I am working on now, I originally coded all to work as a DOS Command line utility. Im ready now, to take the source, and begin adding windows features, and compile using wincont. I would like to not have to maintain 2 separate versions of source, and separately compiled executables, just to offer 2 different versions of the program. 1 for DOS, one for Windows. Im wondering if its possible to do something similar to: If \win then WindowWrite("My output") # run as a windows app else write("My output") # run as console app (Forgive me but I cant remember the function to write to a window yet.) >From testing, ive noticed I will now need to go through all my source, and alter any of the commands I used to give status reports, changing them from 'write()' to the correct "Windows" command, otherwise programs compiled with WICONT seem to create a new window just for write() output. But if I change them all, I lose the ability to run the app in DOS mode. So i'll have to maintain two separate versions. Is there a way to run a program compiled with wicont, as a console app? and keeps its output to the console, and not a window? Hopefully I havent confused you more, I appologise if I have. scissors From icon-group-sender Mon Jun 1 13:51:26 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id NAA25760 for ; Mon, 1 Jun 1998 13:51:25 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06925; Mon, 1 Jun 1998 13:51:19 -0700 Date: Mon, 1 Jun 1998 12:47:16 -0500 (CDT) From: Chris Tenaglia To: icon-group@optima.CS.Arizona.EDU Subject: disp.icn Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1993 >From cdt@post.its.mcw.edu Mon Jun 1 12:38:06 1998 Status: O X-Status: Newsgroups: Date: Mon, 1 Jun 1998 12:38:06 -0500 (CDT) From: Chris Tenaglia To: icon-group@cs.arizona.edu Subject: disp.icn Fcc: sentmail Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Here's a little snippet I found useful. We use mostly PCs but the unix servers still have apps in Xwindows. As we log in from various PCs, the DISPLAY variable in the unix shell needs to change. So here is disp.icn Environment solaris/unix. c-shell. telnet session. After I compile it onto the path I put this line in .cshrc setenv DISPLAY `disp` Note : If you have other telnet sessions from other computers simultaneously, you may get their display instead. You also must the X-server running on your PC/MAC/Xterm as appropriate. Tested on : SunOS xxx 5.5.1 Generic_103640-14 sun4m sparc SUNW,SPARCstation-5 Enjoy. #################################################################### # # file : disp.icn # desc : determine the "DISPLAY" variable for Xwindows in a solaris # unix session # use : disp (called by .login or .cshrc) # # update by what # 01-jun-1998 tenaglia initial write # procedure main() com1 := "env >disp.tmp" system(com1) in := open("disp.tmp") every line := !in do if match("USER",line) then self := parse(line,'= ')[2] close(in) com2 := "who >disp.tmp" system(com2) in := open("disp.tmp") every line := !in do if match(self,line) then display := parse(line,' \t')[6] close(in) remove("disp.tmp") write(display[2:-1],":0.0") end # # parse a string into a list with respect to a delimiter # procedure parse(line,delims) static chars chars := &cset -- delims tokens := [] line ? while tab(upto(chars)) do put(tokens,tab(many(chars))) return tokens end ################################################################# From icon-group-sender Mon Jun 1 16:29:35 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA08263 for ; Mon, 1 Jun 1998 16:29:34 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02320; Mon, 1 Jun 1998 16:29:27 -0700 Date: Mon, 1 Jun 1998 17:11:58 -0500 Message-Id: <199806012211.RAA06897@segfault.cs.utsa.edu> From: Clinton Jeffery To: abrahams@acm.org Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <9805300228.AA0191@valinet.com> (message from Paul Abrahams on Fri, 29 May 98 22:28:40 -0400) Subject: Re: Annoying things Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1036 [Paul Abrahams wrote:] Given the variances among operating systems, perhaps there ought to be a convention that the first space-delimited item in each line produced by open(dirname) is the filename. This is not a bad suggestion. Certainly the format of the string should follow conventions that preserve portability. Some operating systems (Macintosh, and recent versions of Windows) allow spaces in filenames! This does seem close to my earlier suggestion that reading a directory should act as a generator of the filenames within the directory. That's because my current Windows directory reading facility was inspired directly by your suggestion. It was a good suggestion, Paul! It isn't technically a generator, although you can use the generate operator (!) to get a generator of filenames, as in: f := open(dirname) every filename := !f do ... Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Mon Jun 1 16:29:41 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA08266 for ; Mon, 1 Jun 1998 16:29:40 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07315; Mon, 1 Jun 1998 16:29:34 -0700 Date: Mon, 01 Jun 98 18:53:29 -0400 Message-Id: <9806012253.AA0156@valinet.com> From: Paul Abrahams To: jeffery@cs.utsa.edu Cc: abrahams@acm.org, icon-group@optima.CS.Arizona.EDU In-Reply-To: <199806012211.RAA06897@segfault.cs.utsa.edu> (message from Clinton Jeffery on Mon, 1 Jun 1998 17:11:58 -0500) Subject: Re: Annoying things Reply-To: abrahams@acm.org Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1062 >>>>> On Mon, 1 Jun 1998 17:11:58 -0500, Clinton Jeffery said: |Paul> Given the variances among operating systems, perhaps there ought |Paul> to be a convention that the first space-delimited item in each |Paul> line produced by open(dirname) is the filename. |Clint> This is not a bad suggestion. Certainly the format of the |Clint> string should follow conventions that preserve portability. |Clint> Some operating systems (Macintosh, and recent versions of |Clint> Windows) allow spaces in filenames! I care less about what the convention is than that there be one. You're right, of course, about the space-in-file-names issue, but that can be an issue even in making sense of the returned value within a single OS context. Quoting the filename is one solution, although even that isn't adequate if filenames can contain quotes. The two alternatives that come to mind that are completely general are (a) using quotes, with internal quotes doubled, and (b) using backslashes to quote the next character. Paul Abrahams From icon-group-sender Tue Jun 2 09:05:15 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id JAA11208 for ; Tue, 2 Jun 1998 09:05:15 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07969; Tue, 2 Jun 1998 09:05:08 -0700 Date: Mon, 01 Jun 98 22:45:58 -0400 Message-Id: <9806020245.AA0199@valinet.com> From: Paul Abrahams To: ok@atlas.otago.ac.nz Cc: icon-group@optima.CS.Arizona.EDU Subject: Retrieving directory contents Reply-To: abrahams@acm.org Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1236 >>>>> On Tue, 2 Jun 1998 13:29:00 +1200 (NZST), "Richard A. O'Keefe" said: |Richard> A directory-with-file-attributes is NOT a sequence of text |Richard> lines; it is NOT a sequence, and its elements are NOT lines of |Richard> text. Icon has the notational resources to describe what a |Richard> directory IS quite directly, and it would be a shame not to |Richard> use them. |Richard> What is a directory with attributes? It is a partial function |Richard> from name strings to attributes. |Richard> Something like |Richard> directory(DirectoryNameString [, |Richard> FilePatternWithWildCards]) -> table with strings as keys and |Richard> attribute records as value |Richard> would be the perfect fit to Icon. Generation can then be |Richard> based on the existing key generation. That certainly seems like a good approach - but I'd hate to see the whole idea of system-independent directory processing lost because the solution seems too elaborate or requires too much work. I'm concerned about the best being the enemy of the good here. What I care about more than anything else is seeing *some* system-independent method of retrieving the names of the files in a given directory. Paul Abrahams From icon-group-sender Tue Jun 2 09:05:21 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id JAA11212 for ; Tue, 2 Jun 1998 09:05:21 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05080; Tue, 2 Jun 1998 09:05:14 -0700 Date: Mon, 1 Jun 1998 23:43:37 -0500 Message-Id: <199806020443.XAA08820@segfault.cs.utsa.edu> From: Clinton Jeffery To: ok@atlas.otago.ac.nz Cc: abrahams@acm.org, icon-group@optima.CS.Arizona.EDU In-Reply-To: <199806020129.NAA09045@atlas.otago.ac.nz> (ok@atlas.otago.ac.nz) Subject: Directory access facilities Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 996 [Richard O'Keefe points out that directories are more like tables than they are like files, and suggests a built-in function that returns a table mapping file names to records of attributes, like in Tcl.] Well, this is the kind of thing that gets object-oriented modeling people excited. A directory *is* a file (it has persistent state, lives in the file system name space, etc.) and it *is* a table (set of keys that map onto values). Your point is well-taken. From a table it would be trivial to use key(T) to generate the filenames for the common case that Paul wanted. If you push the table analogy to its logical extreme, though, you should implement the directory/table operations as direct manipulations on the file system, like in the language EZ. Anyone else have ideas (or votes) on how to do directory access facilities? Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Tue Jun 2 09:05:06 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id JAA11202 for ; Tue, 2 Jun 1998 09:05:05 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03901; Tue, 2 Jun 1998 09:04:58 -0700 Date: Tue, 2 Jun 1998 13:29:00 +1200 (NZST) From: "Richard A. O'Keefe" Message-Id: <199806020129.NAA09045@atlas.otago.ac.nz> To: abrahams@acm.org, jeffery@cs.utsa.edu Subject: Re: Annoying things Cc: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1620 [Paul Abrahams wrote:] Given the variances among operating systems, perhaps there ought to be a convention that the first space-delimited item in each line produced by open(dirname) is the filename. This is not a bad suggestion. Given that UNIX, MacOS, and Win95/WinNT filenames may contain any number of spaces, it is in fact a pretty BAD suggestion. For true system portability, whatever convention is followed should be completely independent of file name spelling. A directory-with-file-attributes is NOT a sequence of text lines; it is NOT a sequence, and its elements are NOT lines of text. Icon has the notational resources to describe what a directory IS quite directly, and it would be a shame not to use them. What is a directory with attributes? It is a partial function from name strings to attributes. Something like directory(DirectoryNameString [, FilePatternWithWildCards]) -> table with strings as keys and attribute records as value would be the perfect fit to Icon. Generation can then be based on the existing key generation. It would be a good idea to look at TCL, which works quite nicely multiplatform. On the evidence of TCL, it would be possible to have file attribute records with fields atime, ctime, dev, executable, gid, ino, mode, mtime, nlink, owned, readable, readonly, size, type, uid, writable on all systems, group, owner on UNIX, archive, hidden, system on Windows, and hidden, creator, mactype on MacOS. Let's face it, one of the important steps in the transition from SNOBOL to Icon was to step *away* from 'everything's a string'. From icon-group-sender Tue Jun 2 09:05:28 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id JAA11215 for ; Tue, 2 Jun 1998 09:05:27 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA09119; Tue, 2 Jun 1998 09:05:20 -0700 Message-Id: <35740ACA.4373@gte.net> Date: Tue, 02 Jun 1998 09:23:06 -0500 From: MJE Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Cc: evans@gte.net Subject: EditPad References: <9806012253.AA0156@valinet.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 234 Here is a freeware replacement for Windows 95/NT's NotePad: http://www.ping.be/jg/ The user comments on this web site say it's fabulous. I saw it in the May 7 1998 issue of EDN, p. 72. Try it out on your Icon code. Mark Evans From icon-group-sender Tue Jun 2 12:30:47 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA18463 for ; Tue, 2 Jun 1998 12:30:47 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA09174; Tue, 2 Jun 1998 12:30:40 -0700 From: gep2@computek.net Date: Tue, 2 Jun 1998 11:34:02 -0500 Message-Id: <199806021634.LAA25018@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Directory access facilities To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 989 > [Richard O'Keefe points out that directories are more like tables than they are like files, and suggests a built-in function that returns a table mapping file names to records of attributes, like in Tcl.] > Well, this is the kind of thing that gets object-oriented modeling people excited. A directory *is* a file (it has persistent state, lives in the file system name space, etc.) and it *is* a table (set of keys that map onto values). Your point is well-taken. From a table it would be trivial to use key(T) to generate the filenames for the common case that Paul wanted. If you push the table analogy to its logical extreme, though, you should implement the directory/table operations as direct manipulations on the file system, like in the language EZ. Good points all. Now let's not forget the multi-level hierarchical structure of file directories... Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Tue Jun 2 12:30:33 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA18450 for ; Tue, 2 Jun 1998 12:30:32 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05039; Tue, 2 Jun 1998 12:30:25 -0700 Date: Tue, 2 Jun 1998 09:19:59 -0700 From: Gregg Townsend Message-Id: <9806021619.AA28016@hawk.CS.Arizona.EDU> To: icon-group Subject: Re: Directory access facilities Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 194 I'd prefer a simple built-in function that would generate the names of the files contained in a directory, e.g. contents(s) with other mechanisms (if any) used for finding attributes. Gregg From icon-group-sender Tue Jun 2 12:31:01 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA18473 for ; Tue, 2 Jun 1998 12:31:00 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA08664; Tue, 2 Jun 1998 12:30:53 -0700 From: gep2@computek.net Date: Tue, 2 Jun 1998 11:49:24 -0500 Message-Id: <199806021649.LAA27265@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Directory and file access To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2651 Actually, another point here comes to mind, too. More than fifteen years ago, I was involved in the design effort for a new operating system at a computer manufacturer (Datapoint, in fact) and I thought it made sense to finally rationalize the bizarre disparity in dealing with various hierarchies of data storage. Consider, in a modern network: You have one or more file servers, which usually are each named, and which are looked up using special calls. You have one or more volumes per file server, which are usually each named (and where normally one shouldn't have to worry at the programming level as to which server is hosting the volume in question today) and which are looked up using special calls. You have multiple levels of named subdirectories on each volume and which are looked up using special calls. You have multiple named files within each subdirectory, and which are looked up using yet again special calls. If the file is a library, archive (ZIP for example) or PDS, you have a directory of members within that file which must be looked up using still other special calls. If the file is an ISAM (or other keyed file) you have to do key searches within the file using OTHER special calls. It strikes me that a good operating system would generalize and unify ALL of these into a single, coherent hierarchical named storage system where the concept of "directory" and "file" and "member" and "volume" would all be quite blurred. One would want a variety of functions perhaps including: Position sequential forward Position forward by key Position sequential backward Position backward by key Update last record read Append new record (with/without a key) Ascend Descend Search by key Seek to specified physical position Read current record data Once one is positioned to the "directory" in question, one would "open a file" by "search by key" using the "filename", then "descend" into the file. One cool thing about such a structure is that the concept of "primary and secondary records" comes quite naturally... There are no shortage of interesting approaches which could be very nice from a usage standpoint if one is willing to abandon some of the old concepts. The fact of eliminating the incredible mess of all these currently competing and dissimilar lookup methods and replacing them by a single unified approach would go a long way toward a simpler, more robust, and (I think) better system. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Tue Jun 2 17:20:14 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id RAA06773 for ; Tue, 2 Jun 1998 17:20:13 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06876; Tue, 2 Jun 1998 17:20:06 -0700 Comments: Authenticated sender is From: Iain Alexander To: icon-group@optima.CS.Arizona.EDU Date: Tue, 2 Jun 1998 23:08:33 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: Re: Annoying things Priority: normal In-Reply-To: <9805300228.AA0191@valinet.com> References: <199805231524.KAA05320@segfault.cs.utsa.edu> (message from Clinton Jeffery on Sat, 23 May 1998 10:24:33 -0500) X-Mailer: Pegasus Mail for Win32 (v2.54) Message-Id: <896825323.1016855.0@stryx.demon.co.uk> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 470 On 29 May 98 at 22:28, Paul Abrahams wrote: > Given the variances among operating systems, perhaps there ought to be a > convention that the first space-delimited item in each line produced by > open(dirname) is the filename. Unfortunately, space is a valid character in a filename in Win95/NT/Unix. Of course, you could always return a record. -- Iain Alexander PGP 1024-bit key id B501A0AD ia@stryx.demon.co.uk I.Alexander@bsn0106.wins.icl.co.uk From icon-group-sender Tue Jun 2 17:20:07 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id RAA06770 for ; Tue, 2 Jun 1998 17:20:07 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06570; Tue, 2 Jun 1998 17:20:00 -0700 Date: Tue, 02 Jun 98 17:46:37 -0400 Message-Id: <9806022146.AA0151@valinet.com> From: Paul Abrahams To: gmt@baskerville.CS.Arizona.EDU Cc: icon-group@baskerville.CS.Arizona.EDU In-Reply-To: <9806021619.AA28016@hawk.CS.Arizona.EDU> (message from Gregg Townsend on Tue, 2 Jun 1998 09:19:59 -0700) Subject: Re: Directory access facilities Reply-To: abrahams@acm.org Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1015 >>>>> On Tue, 2 Jun 1998 09:19:59 -0700, Gregg Townsend said: |Gregg> I'd prefer a simple built-in function that would generate the |Gregg> names of the files contained in a directory, e.g. contents(s) |Gregg> with other mechanisms (if any) used for finding attributes. I wonder how useful it is to have names of subdirectories intermingled with names of files. Gordon Peterson's point about the importance of traversing the directory tree is worth considering. For instance, opening a directory might yield a set (or sequence) containing two kinds of objects, subdirectories and files. This is an approach I hadn't thought about previously. There have been a lot of elegant approaches to this problem suggested. My own bias is for whatever is least controversial, on the grounds that that's the one most likely to be implemented. Clearly the level of aesthetic sensitivity in this community is very high, so the risk of ending up with a kludge is small. Paul Abrahams From icon-group-sender Wed Jun 3 08:17:33 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA00838 for ; Wed, 3 Jun 1998 08:17:33 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10605; Wed, 3 Jun 1998 08:17:26 -0700 From: gep2@computek.net Date: Wed, 3 Jun 1998 00:21:44 -0500 Message-Id: <199806030521.AAA23309@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Directory access facilities To: icon-group@baskerville.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 404 > I'd prefer a simple built-in function that would generate the names of the files contained in a directory, e.g. contents(s) with other mechanisms (if any) used for finding attributes. Personally, I think a bigger issue is how to handle recursion into lower-level subdirectories. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Wed Jun 3 08:17:24 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA00835 for ; Wed, 3 Jun 1998 08:17:23 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07445; Wed, 3 Jun 1998 08:17:16 -0700 From: "Nevin :-] Liber" To: Subject: Re: Directory access facilities Date: Tue, 2 Jun 1998 21:00:33 -0500 Message-Id: <01bd8e93$64a4caa0$c37546cf@NEVIN> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.71.1712.3 X-Mimeole: Produced By Microsoft MimeOLE V4.71.1712.3 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1478 From: Gregg Townsend To: icon-group@baskerville.CS.Arizona.EDU Date: Tuesday, June 02, 1998 2:26 PM Subject: Re: Directory access facilities >I'd prefer a simple built-in function that would generate the names >of the files contained in a directory, e.g. > contents(s) >with other mechanisms (if any) used for finding attributes. I agree with you here, Gregg. Probably need to, as a minimum, add a second function to determine if a given string refers to a directory name. Something like: dir(sDirectory) - generator that returns filenames in directory string(sDirectory), one name at a time. No guarantee to the order in which directory entries are returned. isdir(sDirectory) - returns sDirectory if string(sDirectory) refers to a directory; otherwise fails One might be tempted to use initial failure from dirname() to determine if a given directory is empty; however, this doesn't work in general, as on some systems it might not be possible to differentiate between a non-existant directory and an empty directory. I would also vote against filtering out "." and ".."; dir() should return an accurate representation of what is in the directory, and not require any special casing (and it is trivial to filter this out at a higher level). __ Nevin ":-)" Liber (847) 816-9926 Senior Software Engineer, Pendragon Software From icon-group-sender Wed Jun 3 08:17:46 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA00846 for ; Wed, 3 Jun 1998 08:17:46 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA09051; Wed, 3 Jun 1998 08:17:39 -0700 Message-Id: X-Mailer: Novell GroupWise 4.1 Date: Wed, 03 Jun 1998 09:49:31 -0500 From: Charles Hethcoat To: icon-group@optima.CS.Arizona.EDU Subject: Retrieving directory contents -Reply Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2707 "Richard A. O'Keefe" said: |Richard> A directory-with-file-attributes is NOT a sequence of text |Richard> lines; it is NOT a sequence, and its elements are NOT lines of |Richard> text. >>> Paul Abrahams 1998 Jun 01, 09:45pm >>> said: >What I care about more >than anything else is seeing *some* >system-independent method of >retrieving the names of the files in a given >directory. I think each of these gentlemen makes good points. File and directory names are a problem, but a bigger problem is the one of locating stuff (host machines, servers, users, files, and devices like printers) in general. Where I work, we run PCs with Windows of various flavors, Netware with NDS and bindery emulation, and NT network with its means of naming things. We also have TCP/IP and its addressing methods. In addition, I run Linux. Accessing all this from an Icon program isn't very easy. I haven't figured out a good and reasonably universal answer, and it sounds like a lot of people have the same problem. Leaving aside a moment the question of what is a good way to represent these directories in Icon, I think the fundamentally correct answer is to find a consistent, publically available programming interface to all of these file and directory systems that were designed by different parties at different times for different reasons. So I would ask the Icon group to think about how all these system naming collisions and conflicts might be reconciled in a sensible way--so that programs that access them can work no matter what system they run on, and in a vendor-independent manner. (Netware and Microsoft, maybe others, are competing to define "the" correct way of doing it, but who knows whose ox is being gored in the process?) I think Linux already has a good answer. Its /proc "virtual filesystem" is a clean and undemanding way to put system-dependent information up for programmers (meaning their programs) to access. The kernel's internal data certainly isn't all string-based, but /proc makes it look that way. It is easy for a relatively unsophisticated programmer to understand what is being offered and to access it without having to know how the internals work. No language changes are required to do this; just a one-time hack to link this hypothetical /proc-like API into the Icon interpreter and you have it. Then all you have to do in your Icon program is open the appropriate /proc subdirectory and read it using the existing facilities in the language. The question is, can the Icon community come up with this API once for every platform? (Linux source is available as a model.) Charles Hethcoat chethcoa@oss.oceaneering.com From icon-group-sender Wed Jun 3 12:46:07 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA10570 for ; Wed, 3 Jun 1998 12:46:06 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA09162; Wed, 3 Jun 1998 12:45:59 -0700 From: gep2@computek.net Date: Wed, 3 Jun 1998 12:45:30 -0500 Message-Id: <199806031745.MAA31997@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Directory access facilities To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 929 > One might be tempted to use initial failure from dirname() to determine if a given directory is empty; however, this doesn't work in general, as on some systems it might not be possible to differentiate between a non-existant directory and an empty directory. And how about directories which contain entries which you're not allowed to see? > I would also vote against filtering out "." and ".."; dir() should return an accurate representation of what is in the directory, Oh, jeez... I don't see ANY value in returning "." at least, whether it's "there" (for OS purposes) or not. What's the point, after all??? > ...and not require any special casing (and it is trivial to filter this out at a higher level). Trivial doesn't mean anything different, here, than "recurring and familiar nuisance". Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Thu Jun 4 08:06:16 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA20231 for ; Thu, 4 Jun 1998 08:06:15 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07072; Thu, 4 Jun 1998 08:06:08 -0700 Message-Id: <199806040951.LAA20259@capway.com> From: "Vladimir Grodzenski" To: gep2@computek.net Date: Thu, 4 Jun 1998 11:47:32 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: Re: Directory access facilities Reply-To: Cc: icon-group@optima.CS.Arizona.EDU Priority: urgent In-Reply-To: <199806031745.MAA31997@axp.cmpu.net> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 822 On 3 Jun 98 at 12:45, Gordon Peterson wrote: > > I would also vote against filtering out "." and ".."; dir() should return an > > accurate representation of what is in the directory, > > Oh, jeez... I don't see ANY value in returning "." at least, whether > it's "there" (for OS purposes) or not. What's the point, after > all??? By the way, When you open(dirname) in Icon you'll get the list of files and directories, including "." and ".." The 'dirname' may be any valid "d:\\dir" string except the root!!! However open("d:\.") will provide the list in the root directory. All this is logical but far from being elegant :-) Vladimir Grodzenski ================================================= E-mail: vladimir.grodzenski@capway.com CompuServe: 100700,526 ================================================= From icon-group-sender Thu Jun 4 08:05:59 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA20204 for ; Thu, 4 Jun 1998 08:05:59 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10470; Thu, 4 Jun 1998 08:05:52 -0700 Message-Id: <35766713.6286@gte.net> Date: Thu, 04 Jun 1998 04:21:23 -0500 From: MJE Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Directory access facilities References: <01bd8e93$64a4caa0$c37546cf@NEVIN> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 223 I haven't followed this thread, but whatever you guys decide, make sure that we can get a list of filenames that match some filtering criteria, based on partial name, file type, modification date, or anything else. Mark From icon-group-sender Thu Jun 4 08:05:51 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA20190 for ; Thu, 4 Jun 1998 08:05:50 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA11122; Thu, 4 Jun 1998 08:05:42 -0700 Date: Thu, 4 Jun 1998 14:20:21 +1200 (NZST) From: "Richard A. O'Keefe" Message-Id: <199806040220.OAA29849@atlas.otago.ac.nz> To: icon-group@optima.CS.Arizona.EDU, nevin@pendragon-software.com Subject: Re: Directory access facilities Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 5259 In reponse to messages like >I'd prefer a simple built-in function that would generate the names >of the files contained in a directory, e.g. > contents(s) >with other mechanisms (if any) used for finding attributes. and I agree with you here, Gregg. Probably need to, as a minimum, add a second function to determine if a given string refers to a directory name. Something like: I'd like to say that people seem to have missed the point of my reference to Tcl/Tk. The point is that there is an *existing* *multiplatform* implementation of this idea that *works*. We don't have to design. We can steal. The *last* thing we have any shadow of an excuse for doing is bodging together yet another incompatible design by appealing to "preferences". Of course Tcl/Tk isn't the only thing around that one might reasonably copy. There's the POSIX 'glob' function, for example, which is given a pathname with wilcards and some options, and returns an array of strings (in which any character whatsoever except \0 may occur). One could have a very nice interface _based_ on glob(3c) + stat(2); any platform offering FindFirst/FindNext can emulate glob() easily enough. Nevin Liber wrote: I would also vote against filtering out "." and ".."; dir() should return an accurate representation of what is in the directory, and not require any special casing (and it is trivial to filter this out at a higher level). But where did you get the idea that the presence of "." and ".." was 'an accurate representation of what is in the directory'? There are POSIX implementations that go to some trouble to fake these entries because the _real_ directory format _doesn't_ have them. Do you want to filter them out when you know they've been faked and include them when you know they haven't? It's better if they are _always_ present or _always_ absent whatever is really on the disc. Note that the POSIX.1 standard (ok, so I have an old copy) says very clearly and explicitly 5.1.2.2 43 The readdir() function shall not return directory entries containing empty names. ===> 44 It is unspecified whether entries are returned for dot or dot-dot. B5.1.2 2956 The directory entries for dot and dot-dot are optional. POSIX does not provide a 2957 way to test a priori for their existence because an application that is portable 2958 must be written to look for (and usually ignore) those entries. There really are "POSIX" systems where those things AREN'T on the disk. And of course there are non-POSIX systems that don't use "." or ".." for anything particular. Indeed, there's one file system I retain considerable fondness for where the directory namespace and the file namespace are disjoint, so that the same name _can_ be used for a directory and a file at the same time, and often is. E.g. (MAT212X)THESIS/PLOTTER/SOURCE ON USERPACK => Algol source form (MAT212X)THESIS/PLOTTER ON USERPACK => executable code where .../PLOTTER is a file name and .../PLOTTER/ is a directory name. To the best of my knowledge there isn't any Icon implementation for that machine, but there's a standard C compiler and a near-enough-to-POSIX OS interface, so there _could_ be an Icon implementation. This _does_ count as a criticism of 'imitate Tcl/Tk' and 'imitate POSIX' because it strongly suggests that separate functions for finding directories and finding files would be appropriate. (That's the way I did it for Quintus Prolog, with file_member_of_directory(Directory[, Pattern], File) directory_member_of_directory(Directory[, Pattern], SubDir) file_property(File, Property, Value) directory_property(Directory, Property, Value) operations. Mind you, that had to be portable across MacOS, MS-DOS, Unix, VMS, VM/CMS, MVS, and Xerox Lisp (XNS) so it was a bit more portable than Icon may need to be.) As I've hinted above, we could patch around this particular problem by insisting that directory names always end with a (native) separator and file names not; this will work straight out of the box on many UNIX systems where dirname/ is equivalent to dirname/., but can reasonably be faked anywhere, so a single interface will do. One particular point about citing Tcl/Tk is the file license.terms in the Tcl8.0 distribution, which says amongst other things The authors hereby grant permission to use, copy, modify, distribute, and license this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. No written agreement, license, or royalty fee is required for any of the authorized uses. Modifications to this software may be copyrighted by their authors and need not follow the licensing terms described here, provided that the new terms are clearly indicated on the first pagev of each file where they apply. What this means is that if the Icon interface is based on the Tcl/Tk interface, two important benefits follows: - a multiplatform interface which is *known* to be usable will be available for very little design effort - a multiplatform *tested* implementation will be available *free*. I must ask: why reinvent what we can steal? From icon-group-sender Thu Jun 4 12:30:25 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA06878 for ; Thu, 4 Jun 1998 12:30:25 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA12324; Thu, 4 Jun 1998 12:30:18 -0700 From: "Nevin :-] Liber" To: Subject: Re: Directory access facilities Date: Thu, 4 Jun 1998 12:47:30 -0500 Message-Id: <01bd8fe0$d860a2e0$c37546cf@NEVIN> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.71.1712.3 X-Mimeole: Produced By Microsoft MimeOLE V4.71.1712.3 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 5285 -----Original Message----- From: Richard A. O'Keefe To: icon-group@optima.CS.Arizona.EDU ; nevin@pendragon-software.com Date: Thursday, June 04, 1998 10:11 AM Subject: Re: Directory access facilities Let me preface this by saying that I know very little about Tcl/Tk; basically, playing around with "tclsh" and checking out the man pages at . >I'd like to say that people seem to have missed the point of my reference >to Tcl/Tk. The point is that there is an *existing* *multiplatform* >implementation of this idea that *works*. We don't have to design. >We can steal. If it is the appropriate abstractions for the language at hand. I don't believe it is. >The *last* thing we have any shadow of an excuse for doing is bodging >together yet another incompatible design by appealing to "preferences". My "preferences" come from using the language for the last 14 years, and I suspect that Gregg Townsend has been using it even longer than I have. I think I have a pretty good sense of what fits in the language and what doesn't. It appears that Tcl/Tk is a language where everything is a string. For instance, "glob" returns a string of encoded filenames; one has to encode some the filenames, because they may contain embedded seperators, embedded encoding characters, etc. In a shell this works, since a shell parses each and every command line, and provides facilities for dividing a delimiter-seperated string into seperate strings. Icon does not do this, nor does it have builtin facilities for "unquoting" an encoded filename. In order to use this, there would have to be a higher-level function that breaks up the string, gets rid of any quoting characters that aren't part of the filename, and either returns a list of, or more likely, generate a list of filenames. Considering the lower level system already keeps filenames as seperate entities, it seems that we are doing a lot of work for nothing. Now, one might argue that "glob" allows regular expressions for filtering. However, regular expressions aren't used anywhere else in Icon; it would look like a wart on the language. What I am looking for is minimal functionality that will get me the filenames broken up one filename at a time, since it is easy to build the more complex stuff on top of that from within Icon. Gregg's suggestion of a generator that does just that meets that criterion nicely. >But where did you get the idea that the presence of "." and ".." was 'an >accurate representation of what is in the directory'? There are POSIX >implementations that go to some trouble to fake these entries because the >_real_ directory format _doesn't_ have them. And on "real" systems, "." and ".." don't necessarily do what you expect. For instance, most shells interpret them differently. Do a "cd /foo/bar/../baz", and the shell would put you in "/foo/baz", yet if you actually traversed the directories, you could be in "/baz", if "/foo/bar" was a symbolic link to "/", for instance. It's hard to encapsulate all of this functionality without providing a full filesystem API. Whatever the lower-level C functions return is what the Icon equivalent should generate. >To the best of my knowledge there isn't any Icon implementation for that >machine, but there's a standard C compiler and a near-enough-to-POSIX >OS interface, so there _could_ be an Icon implementation. I don't believe POSIX is a requirement of Icon right now. >As I've hinted above, we could >patch around this particular problem by insisting that directory names >always end with a (native) separator and file names not But nothing else in Icon follows this convention. Strings don't have special embedded terminators; lists don't have special embedded terminators, etc. If you add a seperator or directory marker, you have to add a way of quoting the seperator or directory marker (since a file name might legitimately end with the directory marker) and functions to remove the quotes. This is much messier than having a generator suspend filenames one at a time, and a seperate function to test if it is a directory. Also, what if you are creating a directory name somewhere else in your program? You have to have a function that turns a string into a directory name. To use EE terms, I much prefer out-of-band signaling to in-band signaling. Since we can get filenames already seperated (out-of-band signaling, since something outside of the string itself indicates that this object represents a directory), it is cleaner than having to parse a string (in-band signaling, since whether or not it is a directory is encoded in the string) when I just want to get the filename out of it. Now, I do understand your point about systems where directories are in seperate namespaces. The cleanest solution would be to have two seperate generators; one which returns regular files, and one which returns directories. I don't know if this is worth the effort, since so few systems out there have seperate namespaces. __ Nevin ":-)" Liber (847) 816-9926 Senior Software Engineer, Pendragon Software From icon-group-sender Thu Jun 4 12:30:11 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA06870 for ; Thu, 4 Jun 1998 12:30:10 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10387; Thu, 4 Jun 1998 12:30:03 -0700 Date: Thu, 4 Jun 1998 11:38:20 -0400 (EDT) From: "Christopher W. Milner" To: icon-group@optima.CS.Arizona.EDU Subject: jcon question In-Reply-To: <35766713.6286@gte.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 498 I hope this is the correct forum for this type of question... I am fairly innocent of the ways of Java. Is there a way to compile an icon program using jcont such that it will become an applet? Assuming this can be done, what sort of HTML incantation is required? EXAMPLE: go from the following icon program: procedure main() write("Hello, Madge") end to an applet and html file. Many thanks, Chris Milner Graduate Research Assistant Department of Computer Science University of Virginia From icon-group-sender Thu Jun 4 12:30:17 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA06873 for ; Thu, 4 Jun 1998 12:30:17 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28252; Thu, 4 Jun 1998 12:30:10 -0700 From: gep2@computek.net Date: Thu, 4 Jun 1998 10:54:24 -0500 Message-Id: <199806041554.KAA20858@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Directory access facilities To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 529 > I haven't followed this thread, but whatever you guys decide, make sure that we can get a list of filenames that match some filtering criteria, based on partial name, file type, modification date, or anything else. I'll be happy if I can get a comprehensive list (INCLUDING subdirectories), I'll gladly do the other filtering (that's more likely to be application specific, anyhow) at the higher levels. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Thu Jun 4 16:21:49 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA18384 for ; Thu, 4 Jun 1998 16:21:49 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10228; Thu, 4 Jun 1998 16:21:41 -0700 Message-Id: <3576F8AF.611F@gte.net> Date: Thu, 04 Jun 1998 14:42:39 -0500 From: MJE Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Directory access facilities References: <199806041554.KAA20858@axp.cmpu.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 872 gep2@computek.net wrote: > > > I haven't followed this thread, but whatever you guys decide, make sure > that we can get a list of filenames that match some filtering criteria, > based on partial name, file type, modification date, or anything else. > > I'll be happy if I can get a comprehensive list (INCLUDING subdirectories), I'll > gladly do the other filtering (that's more likely to be application specific, > anyhow) at the higher levels. > > Gordon Peterson > http://www.computek.net/public/gep2/ > Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ If you want to make work for yourself, OK, but I want calls to support such filtering so that I don't have to write the code. That's why I put this note up. I've done it just as you suggest, and I don't like it. The filters chosen by the programmer are the application-specific part. Mark From icon-group-sender Fri Jun 5 08:38:44 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA18863 for ; Fri, 5 Jun 1998 08:38:43 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA12493; Fri, 5 Jun 1998 08:38:36 -0700 Date: Thu, 4 Jun 1998 17:33:41 -0700 From: Gregg Townsend Message-Id: <9806050033.AA02697@hawk.CS.Arizona.EDU> To: cwm2n@cs.virginia.edu, icon-group Subject: Re: jcon question Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 698 From icon-group-sender@baskerville.CS.Arizona.EDU Thu Jun 4 12:30:56 1998 Is there a way to compile an icon program using jcont such that it will become an applet? No. Jcon creates stand-alone Java programs and there is no interface to the applet system or provision for creating applets. --------------------------------------------------------------------------- Gregg Townsend Gould-Simpson Building gmt@cs.arizona.edu Staff Scientist 1040 E. 4th St. 32 13 45N 110 57 16W Dept. of Computer Science PO Box 210077 tel: +1 520 621 4325 The University of Arizona Tucson, AZ 85721-0077 fax: +1 520 621 4246 From icon-group-sender Fri Jun 5 08:38:51 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA18866 for ; Fri, 5 Jun 1998 08:38:50 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA12425; Fri, 5 Jun 1998 08:38:43 -0700 From: gep2@computek.net Date: Thu, 4 Jun 1998 21:32:01 -0500 Message-Id: <199806050232.VAA10433@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Directory access facilities To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1701 >>> I haven't followed this thread, but whatever you guys decide, make sure > that we can get a list of filenames that match some filtering criteria, > based on partial name, file type, modification date, or anything else. >> I'll be happy if I can get a comprehensive list (INCLUDING subdirectories), I'll gladly do the other filtering (that's more likely to be application specific, anyhow) at the higher levels. > If you want to make work for yourself, OK, but I want calls to support such filtering so that I don't have to write the code. The problem with such things is that the "based on...or anything else" usually ends up making the filter parameterization so darned complicated that you end up always having to look it all up... there are so many possible tests (like "I want files with .dbf extensions, modified since April 30th 1997, with size greater than 5Mb but less than 10Mb... but only if the Accounting department has write permission for them..."). The thing I want to avoid is having to put OTHER tests in there just to exclude dumb stuff (like the basically useless "." subdirectory entry, and probably the ".." one too) which you basically never need to see or use anyhow. And I'd like to be able to avoid having to write (each time) all the recursion code to traverse the subdirectory tree... that's the kind of fiddly stuff that I'd like to see built in. The kind of stuff that you're asking for can probably be built rather trivially at the user/application level, and without adding much to the code that they'd have to have anyhow. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Fri Jun 5 12:55:16 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA27539 for ; Fri, 5 Jun 1998 12:55:15 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13632; Fri, 5 Jun 1998 12:55:08 -0700 Message-Id: <35782CAD.4F7E@gte.net> Date: Fri, 05 Jun 1998 12:36:45 -0500 From: MJE Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Directory access facilities References: <199806050232.VAA10433@axp.cmpu.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 261 Presumably one could ask for all files with no filters and get what you want. You and I have different opinions about what is trivial at the application level. I will put in my filters, and you can leave yours out to do the filtering inside your app. Mark From icon-group-sender Mon Jun 8 08:18:24 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA19526 for ; Mon, 8 Jun 1998 08:18:22 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13889; Mon, 8 Jun 1998 08:18:15 -0700 Message-Id: <199806071520.RAA01123@capway.com> From: "Vladimir Grodzenski" To: evans@gte.net Date: Sun, 7 Jun 1998 17:17:02 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: Re: Directory access facilities Reply-To: Cc: icon-group@optima.CS.Arizona.EDU Priority: urgent In-Reply-To: <35782CAD.4F7E@gte.net> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 635 On 5 Jun 98 at 12:36, MJE wrote: > Presumably one could ask for all files with no filters and get what > you want. You and I have different opinions about what is trivial > at the application level. I will put in my filters, and you can > leave yours out to do the filtering inside your app. procedure dirlist(path, recurse_flag, filter) return list of subdirectories end procedure filelist(-idem-) return list of files end Vladimir Grodzenski ================================================= E-mail: vladimir.grodzenski@capway.com CompuServe: 100700,526 ================================================= From icon-group-sender Mon Jun 8 13:38:51 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id NAA14876 for ; Mon, 8 Jun 1998 13:38:51 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA16084; Mon, 8 Jun 1998 13:38:43 -0700 Date: Mon, 8 Jun 1998 08:34:15 -0700 From: Ralph Griswold Message-Id: <9806081534.AA20674@jupiter.CS.Arizona.EDU> To: icon-group Subject: Graphics programming book Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 348 The recently published book "Graphics Programming in Icon" is now available from the Icon Project. The price is $45, which includes parcel post shipping to addresses in the United States, Canada, and Mexico. Air parcel post shipping to other countries is $18 additional. For information about the book, see http://www.cs.arizona.edu/icon/gb/ From icon-group-sender Tue Jun 9 08:29:15 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA00493 for ; Tue, 9 Jun 1998 08:29:14 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA15308; Tue, 9 Jun 1998 08:29:06 -0700 Date: Tue, 9 Jun 1998 13:27:10 +1200 (NZST) From: "Richard A. O'Keefe" Message-Id: <199806090127.NAA12029@atlas.otago.ac.nz> To: evans@gte.net, vladimir.grodzenski@capway.com Subject: Re: Directory access facilities Cc: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 987 procedure dirlist(path, recurse_flag, filter) return list of subdirectories end What's a recurse flag? If it's just true/false, it's no use. How do you control whether mount points are crossed? Whether symbolic links (aliases in MacSpeak) are followed? How cycles (possible in the presence of aliases) are to be handled? Is the list depth first, breadth first, or alphabetic (ascii or by locale)? What are the arguments of the filter and what can it request? What about directories that are known to be directories but cannot be read? What about symbolic links whose target has disappeared? procedure filelist(-idem-) return list of files end Ditto. People could at least take a serious look at ftw()/nftw(). Other people have had three-quarter baked ideas; no need for us to half-bake our own. nftw() exists because ftw(), which is richer than this proposal, just plain wasn't good enough. If people won't buy "copy tcl", will they buy "look hard at nftw()?" From icon-group-sender Tue Jun 9 17:37:20 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id RAA04371 for ; Tue, 9 Jun 1998 17:37:20 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA16062; Tue, 9 Jun 1998 17:37:12 -0700 Date: Tue, 9 Jun 1998 17:36:07 -0500 (CDT) From: Chris Tenaglia To: icon-group@optima.CS.Arizona.EDU Subject: Icon for CGI Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 991 Been trying to experiment with Icon V9 as a cgi engine. wrote a little script that generates a value hmtl page to stdout. It's called by an input form. I get the following message from Netscape : _______________________________________________________ Server Error This server has encountered an internal error which prevents it from fulfilling your request. The most likely cause is a misconfiguration. Please ask the administrator to look for messages in the server's error log. _______________________________________________________ The chmod for executable and iconx and icont are 755. icont works fine to compile, the telnet iconx runs interactively. What am I missing to get the CGI to run it? Thanks in advance Chris Tenaglia (system manager) | The future foretold, Medical College of Wisconsin | The past explained, 8701 W. Watertown Plank Rd. | The present largely appologized for. Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor From icon-group-sender Wed Jun 10 08:14:31 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA15048 for ; Wed, 10 Jun 1998 08:14:31 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA08142; Wed, 10 Jun 1998 08:14:23 -0700 From: gep2@computek.net Date: Wed, 10 Jun 1998 09:01:52 -0500 Message-Id: <199806101401.JAA22815@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Directory access facilities To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2143 > What's a recurse flag? If it's just true/false, it's no use. How do you control whether mount points are crossed? Whether symbolic links (aliases in MacSpeak) are followed? How cycles (possible in the presence of aliases) are to be handled? Is the list depth first, breadth first, or alphabetic (ascii or by locale)? What are the arguments of the filter and what can it request? What about directories that are known to be directories but cannot be read? What about symbolic links whose target has disappeared? > People could at least take a serious look at ftw()/nftw(). Other people have had three-quarter baked ideas; no need for us to half-bake our own. nftw() exists because ftw(), which is richer than this proposal, just plain wasn't good enough. ...and this kind of stuff is an excellent example of why so many programmers just say "screw it!" and end up writing code that's appropriate to the OS they have to support... for 95% of us, that's Win95/NT/DOS. Frankly, if I have to go through all these dumb gyrations to support (in theory) some BS that I don't have to worry about anyhow, then it's easier to just solve the problem in some other way. Example: I don't have to worry about aliases and file structure closed loops. I don't care in the slightest if my program won't ever run on a Mac! Sure, there are other markets (like Unix) but I'll gladly give those niche markets to other people, if I can have all the rest. :-) Hey, once you get the list, you can sort it (if you care) any way you like. IF that matters to you. As for the filter, the ultimate filter is to process the list elements using string scanning (I agree with the previous poster that it would be inappropriate to use a reg-ex style filter expression here). What I'm concerned about is getting the basic data. Once that's done, I'm confident I can do what I need to with it. I don't so much like the system trying to second-guess me and trying to provide me (in advance) with every possible variant. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Thu Jun 11 13:21:58 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id NAA13161 for ; Thu, 11 Jun 1998 13:21:54 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA18280; Thu, 11 Jun 1998 13:21:46 -0700 Message-Id: <3.0.5.32.19980611115520.00a2fc20@post.its.mcw.edu> X-Sender: cdt@post.its.mcw.edu X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Thu, 11 Jun 1998 11:55:20 To: icon-group@optima.CS.Arizona.EDU From: Chris Tenaglia Subject: More CGI background Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1523 I was having no progress. Here's a little more detail. I found other resources on the web, even a teacher's slide set. Seems easy in that form. Any programming language should work, so I decided to try a simple shell script like "testme" in the cgi directory. ---------------------------------------------------- #!/bin/csh echo "Content type: text/html" echo "" echo "" echo "This is the title" echo "" echo "" echo "

Beginning Page

" echo "

" echo "Here is some free form text" echo "" echo "" --------------------------------------------------- Which is called by this html page: --------------------------------------------------- This is the CGI testing Title

Mondo Header

Here's a crazy TEST web page!

--------------------------------------------------------- Still it sits for a few minutes and I get an internal server error message. Put icont and iconx in the cgi-bin directory and did the patchstr. Recompiled and the icode looks good and runs fine from telnet. I have some other things I am trying. I hope to post the result once I get past this hurdle. Thanks to all who responded so far. Chris. From icon-group-sender Fri Jun 12 07:53:48 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id HAA25541 for ; Fri, 12 Jun 1998 07:53:48 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA16995; Fri, 12 Jun 1998 07:53:39 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Fri, 12 Jun 1998 04:21:46 GMT From: mark@IcanFixYourEmail.com (Mark McWiggins) Message-Id: <3580ac6c.321131@news.supernews.com> Organization: The World's Usenet -- http://www.Supernews.com Sender: icon-group-request@optima.CS.Arizona.EDU Subject: NT "console application" version? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 324 Hi -- Anybody have a binary for an NT "console application" version of Icon? A client of mine is using an Icon-based app in a Visual C++ "wizard", and he doesn't want the extra windows popping up on every run. Thanks in advance. -- Mark McWiggins mark@IcanFixYourEmail.com +1 425 957 0848 (voice) +1 425 957 7654 (fax) From icon-group-sender Fri Jun 12 12:59:26 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA10316 for ; Fri, 12 Jun 1998 12:59:25 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06248; Fri, 12 Jun 1998 12:59:17 -0700 Date: Fri, 12 Jun 1998 09:59:47 -0500 Message-Id: <199806121459.JAA18915@segfault.cs.utsa.edu> From: Clinton Jeffery To: mark@IcanFixYourEmail.com Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <3580ac6c.321131@news.supernews.com> (mark@IcanFixYourEmail.com) Subject: Re: NT "console application" version? Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 610 > Anybody have a binary for an NT "console application" version of Icon? Windows Icon comes with a binary nticont.exe that produces console applications based on nticonx.exe. At the moment, you have to use them from a command line (or a makefile or whatever). I'll save this note as a request to add support for nticont into the Wi program; it will be trivial to do this in an ugly way, and more work (but easy) to do it in a way that looks good. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Fri Jun 12 13:00:45 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id NAA10438 for ; Fri, 12 Jun 1998 13:00:44 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA09724; Fri, 12 Jun 1998 13:00:36 -0700 Message-Id: <3.0.5.32.19980612110154.00a1de00@post.its.mcw.edu> X-Sender: cdt@post.its.mcw.edu X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Fri, 12 Jun 1998 11:01:54 -0500 To: icon-group@optima.CS.Arizona.EDU From: Chris Tenaglia Subject: cgi progress Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1071 Many thanks again to those pointing out typos and nuances. The next hurdle has to do with the FORM
This works. icont actually generates a shell script with a binary icode attachment. For some reason the http server did not like that script. It looks like: ------------------------------------------------------------------------- #!/bin/sh case $# in 0) exec "${ICONX-/db1/local/httpd/cgi-bin/bioet/iconx}" "$0";; *) exec "${ICONX-/db1/local/httpd/cgi-bin/bioet/iconx}" "$0" "$@";; esac [executable Icon binary follows] ... ------------------------------------------------------------------------- But iconx can skip over the script and run the icode. Nifty. So next comes passing parameters. I now the form should be using name/value pairs. doesn't seem to work. Unfortunately they've removed the c compilers so I can't generate a compiled executable via iconc. Any other tips? Regards, Chris. From icon-group-sender Mon Jun 15 08:24:23 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA17281 for ; Mon, 15 Jun 1998 08:24:14 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22228; Mon, 15 Jun 1998 08:24:05 -0700 Date: Sat, 13 Jun 1998 01:55:45 +0100 Message-Id: <199806130055.BAA12301@gairsay.aiai.ed.ac.uk> From: Jeff Dalton Subject: Re: More CGI background To: Chris Tenaglia , icon-group@optima.CS.Arizona.EDU In-Reply-To: Chris Tenaglia's message of Thu, 11 Jun 1998 11:55:20 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 502 > I was having no progress. Here's a little more detail. > I found other resources on the web, even a teacher's > slide set. Seems easy in that form. Any programming > language should work, so I decided to try a simple > shell script like "testme" in the cgi directory. > ---------------------------------------------------- > #!/bin/csh > echo "Content type: text/html" > echo "" You need to echo a blank line after the headers, that is (in this case), after the "Content type" line. -- jeff From icon-group-sender Mon Jun 15 08:24:33 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA17293 for ; Mon, 15 Jun 1998 08:24:32 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA18164; Mon, 15 Jun 1998 08:24:23 -0700 From: shamim@Synopsys.COM (Shamim Zvonko Mohamed) Message-Id: <9806150114.AA18119@bermuda.synopsys.com> Subject: Re: Directory access facilities To: jeffery@cs.utsa.edu Date: Sun, 14 Jun 1998 18:14:18 -0700 (PDT) Cc: ok@atlas.otago.ac.nz, abrahams@acm.org, icon-group@optima.CS.Arizona.EDU In-Reply-To: <199806020443.XAA08820@segfault.cs.utsa.edu> from "Clinton Jeffery" at Jun 1, 98 11:43:37 pm X-Mailer: ELM [version 2.4 PL24] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1112 Clint writes: > Anyone else have ideas (or votes) on how to do directory access > facilities? My admittedly biased and possibly Unix-centric view: we don't need any elaborate solutions, I think the idea of each read() returning one entry from the directory is the best one. This finesses all the issues of quoting blanks, quotes, wildchars etc. etc. If you need more information about the entry, you use the function that performs this query. In Unicon, you use stat(), which returns a record. Here's the "ls" example: f := open(".") | stop( ... ) while write( format( stat( read(f) ) ) ) (For clarity I left out some pretty features like sorting the names, and that you'd want to use lstat instead of stat, etc. Look at the Unicon docs for more info.) Someone wanted a directory to be like a table. Yes, a directory is a "lookup" type of object but not on all systems. We should stick to a clean and simple interface that will work unambiguously without all sorts of special cases. Others have already pointed out why a space-separated string of all the entries is a bad idea. -s Shamim Mohamed From icon-group-sender Mon Jun 15 08:25:04 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA17367 for ; Mon, 15 Jun 1998 08:25:04 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA20242; Mon, 15 Jun 1998 08:24:55 -0700 Message-Id: <199806151304.PAA12785@capway.com> From: "Vladimir Grodzenski" To: mark@IcanFixYourEmail.com (Mark McWiggins) Date: Mon, 15 Jun 1998 15:00:11 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: Re: NT "console application" version? Reply-To: Cc: icon-group@optima.CS.Arizona.EDU Priority: urgent In-Reply-To: <3580ac6c.321131@news.supernews.com> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 805 On 12 Jun 98 at 4:21, you wrote: > Anybody have a binary for an NT "console application" version of > Icon? A client of mine is using an Icon-based app in a Visual C++ > "wizard", and he doesn't want the extra windows popping up on every > run. If your customer doesn't want to have windows popping up, tell him not to open windows in his program, that's it. The Windows Icon does not oblige you to open windows if you don't want to! :-))) OTOH, the console application means a console will be opened. Console is a window, isn't it? In my opinion, you have to use the Windows Icon instead of "nt console" Icon. Vladimir Grodzenski ================================================= E-mail: vladimir.grodzenski@capway.com CompuServe: 100700,526 ================================================= From icon-group-sender Mon Jun 15 08:24:43 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA17299 for ; Mon, 15 Jun 1998 08:24:43 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13109; Mon, 15 Jun 1998 08:24:34 -0700 From: shamim@Synopsys.COM (Shamim Zvonko Mohamed) Message-Id: <9806150137.AA18187@bermuda.synopsys.com> Subject: Re: Directory access facilities To: gep2@computek.net, icon-group@optima.CS.Arizona.EDU Date: Sun, 14 Jun 1998 18:37:56 -0700 (PDT) In-Reply-To: <199806031745.MAA31997@axp.cmpu.net> from "gep2@computek.net" at Jun 3, 98 12:45:30 pm X-Mailer: ELM [version 2.4 PL24] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 891 Gregg writes: > I'd prefer a simple built-in function that would generate the names > of the files contained in a directory Gordon Peterson: > Personally, I think a bigger issue is how to handle recursion into > lower-level subdirectories. Why? The obvious approach works: procedure ls(s) local dir dir := open(s) while file := read(dir) do { if file == "." | ".." then next r := stat(file) if r.mode[1] == "d" then ls(s || delim || file) } end (I should point out that my view is Unix-centric so I think in terms of entries like . and .. and queries called stat(); there are likely to be similar things in other systems. Mutatis mutandis.) Gordon Peterson: > Oh, jeez... I don't see ANY value in returning "." at least, whether it's > "there" (for OS purposes) or not. What's the point, after all??? Well, I might want to implement "ls"! -s From icon-group-sender Mon Jun 15 16:24:49 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA18510 for ; Mon, 15 Jun 1998 16:24:49 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA19502; Mon, 15 Jun 1998 16:24:40 -0700 From: gep2@computek.net Date: Mon, 15 Jun 1998 14:52:04 -0500 Message-Id: <199806151952.OAA02701@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Directory access facilities To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1993 >> Anyone else have ideas (or votes) on how to do directory access > facilities? > My admittedly biased and possibly Unix-centric view: we don't need any elaborate solutions, I think the idea of each read() returning one entry from the directory is the best one. This finesses all the issues of quoting blanks, quotes, wildchars etc. etc. "Finesses" -> "Ignores". > If you need more information about the entry, you use the function that performs this query. In Unicon, you use stat(), which returns a record. Here's the "ls" example: > f := open(".") | stop( ... ) while write( format( stat( read(f) ) ) ) The problem (if you want something RELIABLE) with this kind of thing is that on multitasking systems (especially those crossing boundaries through a network) the entries can be changing (and entries even being added and deleted) WHILE you are retrieving your way through them. It's much more robust to return a snapshot, which at least _was_ valid and consistent at the time the snapshot was taken. It's entirely possible that (for example) the read(f) returns a temporary file name, which is no longer there by the time the stat() is issued for it. If stat() failed (e.g.) in such a case, then you'd terminate your while loop prematurely. Agreed that it's almost as flakey to try to load a snapshot into a table in memory... where that table could be of nearly arbitrary size... due to both the memory space available to hold it, and the (atomic) time it takes to generate such a potentially huge table. > ...We should stick to a clean and simple interface that will work unambiguously without all sorts of special cases. Like the old saying, it should be "as simple as possible... BUT NO SIMPLER." > Others have already pointed out why a space-separated string of all the entries is a bad idea. Agreed, that's not a good solution. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Tue Jun 16 08:31:21 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA25119 for ; Tue, 16 Jun 1998 08:31:21 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA20768; Tue, 16 Jun 1998 08:31:12 -0700 From: "Nevin :-] Liber" To: Subject: Re: Directory access facilities Date: Mon, 15 Jun 1998 19:36:29 -0500 Message-Id: <01bd98be$cdb2d7a0$c37546cf@NEVIN> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.71.1712.3 X-Mimeole: Produced By Microsoft MimeOLE V4.71.1712.3 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2468 From: gep2@computek.net To: icon-group@optima.CS.Arizona.EDU Date: Monday, June 15, 1998 6:26 PM Subject: Re: Directory access facilities >> My admittedly biased and possibly Unix-centric view: we don't need any >elaborate solutions, I think the idea of each read() returning one entry >from the directory is the best one. This finesses all the issues of quoting >blanks, quotes, wildchars etc. etc. >"Finesses" -> "Ignores". But in this case, ignoring them is the Right Solution. >The problem (if you want something RELIABLE) with this kind of thing is that on >multitasking systems (especially those crossing boundaries through a network) >the entries can be changing (and entries even being added and deleted) WHILE you >are retrieving your way through them. It's much more robust to return a >snapshot, which at least _was_ valid and consistent at the time the snapshot was >taken. It's not ANY more robust, since the underlying C calls (which the Icon runtime has to make in order to get the data) make no atomicity guarantees (on Unix, MacOS, etc.) when querying all the entries in a directory. >It's entirely possible that (for example) the read(f) returns a temporary file >name, which is no longer there by the time the stat() is issued for it. And how is this magically fixed? This happens with the C API, which means that it will happen with the Icon API. Pretending it doesn't won't make the problem go away. >If >stat() failed (e.g.) in such a case, then you'd terminate your while loop >prematurely. Which makes the code incorrect even with your solution, since the window of vunerability between the time you get the filename and the time you stat the file is still there. In either case, the code has to be modifed to something like every s := Files(sDirectory) do { write(format(stat(s))) } >Like the old saying, it should be "as simple as possible... BUT NO SIMPLER." And the solution where we have a function that generates directory entries (and I don't believe we should overload read(), since this shares almost nothing in common with read()) is, IMHO, that solution. What you are trying to graft onto it are atomicity guarantees, and that is impossible since you need the underlying OS to make those guarantees. __ Nevin ":-)" Liber (847) 816-9926 Senior Software Engineer, Pendragon Software From icon-group-sender Tue Jun 16 12:49:59 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA17945 for ; Tue, 16 Jun 1998 12:49:58 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22238; Tue, 16 Jun 1998 12:49:49 -0700 Message-Id: <358690D9.58E@gte.net> Date: Tue, 16 Jun 1998 10:35:53 -0500 From: MJE Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Directory access facilities References: <01bd98be$cdb2d7a0$c37546cf@NEVIN> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 465 Could I propose that the authors of the more verbose commentaries in this thread channel their energies into actually doing what they are talking about? I'm all for lively debate but at some juncture the gang should start making demonstrations to prove points. I mean, there are teenage hackers out there doing useful shareware who don't sit around contemplating how to do useful shareware. Then we can all compare for ourselves and vote. Cheers! Mark Evans From icon-group-sender Tue Jun 16 16:22:31 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA25846 for ; Tue, 16 Jun 1998 16:22:30 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA20066; Tue, 16 Jun 1998 16:22:21 -0700 Date: Tue, 16 Jun 98 13:00:25 PDT Message-Id: <9806162000.AA20449@bermuda.synopsys.com> From: Shamim Mohamed To: evans@gte.net Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Directory access facilities In-Reply-To: <358690D9.58E@gte.net> References: <01bd98be$cdb2d7a0$c37546cf@NEVIN> <358690D9.58E@gte.net> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 418 > Could I propose that the authors of the more verbose commentaries in > this thread channel their energies into actually doing what they are > talking about? Well, I'm not sure if my commentaries were among these verbose ones, but I have already implemented my ideas! My apologies for yet another blatant plug; they are part of Unicon: http://www.drones.com/unicon/ Any and all comments appreciated. -s From icon-group-sender Wed Jun 17 09:13:55 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id JAA10731 for ; Wed, 17 Jun 1998 09:13:51 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21188; Wed, 17 Jun 1998 09:13:41 -0700 From: gep2@computek.net Date: Tue, 16 Jun 1998 20:34:21 -0500 Message-Id: <199806170134.UAA19159@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Directory access facilities To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3521 >>> My admittedly biased and possibly Unix-centric view: we don't need any >elaborate solutions, I think the idea of each read() returning one entry >from the directory is the best one. This finesses all the issues of quoting >blanks, quotes, wildchars etc. etc. >> "Finesses" -> "Ignores". > But in this case, ignoring them is the Right Solution. I suppose you're entitled to your opinion, but I certainly don't agree. >>The problem (if you want something RELIABLE) with this kind of thing is that on multitasking systems (especially those crossing boundaries through a network) the entries can be changing (and entries even being added and deleted) WHILE you are retrieving your way through them. It's much more robust to return a snapshot, which at least _was_ valid and consistent at the time the snapshot was taken. > It's not ANY more robust, since the underlying C calls (which the Icon runtime has to make in order to get the data) make no atomicity guarantees (on Unix, MacOS, etc.) when querying all the entries in a directory. I don't argue that there might be bugs in the underlying calls, but the point is that you're using those current bugs as an excuse to propagate those BY DESIGN into the higher levels too. It's entirely possible that one COULD fix the underlying problems... but it wouldn't help if the higher levels were still inherently unsound. >> It's entirely possible that (for example) the read(f) returns a temporary file name, which is no longer there by the time the stat() is issued for it. > And how is this magically fixed? In this case, because you (presumably) wouldn't have to call STAT() at all. Even if it DID fail after a call, you would probably need to deal with that status differently than the "ambiguous failure" problem in the code's WHILE loop as was listed > This happens with the C API, which means that it will happen with the Icon API. Pretending it doesn't won't make the problem go away. Again, it's one thing for there to be a bug in the underlying API. It's another thing entirely for that inherently poor design to propagate those faults to higher level programs. >>If stat() failed (e.g.) in such a case, then you'd terminate your while loop >prematurely. >Which makes the code incorrect even with your solution, since the window of vunerability between the time you get the filename and the time you stat the file is still there. If you get a table with filenames and directories, then you don't have to STAT yourself to find out whether you need to recurse or not. > In either case, the code has to be modifed to something like > every s := Files(sDirectory) do { write(format(stat(s))) } >> Like the old saying, it should be "as simple as possible... BUT NO SIMPLER." > And the solution where we have a function that generates directory entries (and I don't believe we should overload read(), since this shares almost nothing in common with read()) is, IMHO, that solution. Again, you're entitled to your opinion. But I still don't agree with you. > What you are trying to graft onto it are atomicity guarantees, and that is impossible since you need the underlying OS to make those guarantees. It's not impossible that someday the underlying OS WILL make those guarantees. If the supporting calls are such that they are still ineffective, then fixing it in the OS doesn't solve anything. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Wed Jun 17 13:57:47 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id NAA22965 for ; Wed, 17 Jun 1998 13:57:47 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA17602; Wed, 17 Jun 1998 13:57:38 -0700 From: WHITSTON@ltu.edu Date: Wed, 17 Jun 1998 12:45:27 -0400 (EDT) Subject: Icon and Linux To: ICON-GROUP@optima.CS.Arizona.EDU Message-Id: <01IYCDENCCIO8Y4XA8@LTU.EDU> X-Vms-To: ICON-GROUP@OPTIMA.CS.ARIZONA.EDU X-Vms-Cc: WHITSTON Mime-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 207 To the group: In the July issue of the "Linux Journal" (Issue 51), there is an article on about Icon -- written by Clinton Jeffery and Shamim Mohamed Howard Whitston Lawrence Tech. Univ. whitston@ltu.edu From icon-group-sender Thu Jun 18 12:58:11 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA01774 for ; Thu, 18 Jun 1998 12:58:11 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22775; Thu, 18 Jun 1998 12:58:01 -0700 Message-Id: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 18 Jun 1998 11:28:04 -0800 To: icon-group@baskerville.CS.Arizona.EDU From: Michael Shafto Subject: here's a funnny one! Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2511 This is a kind of semi-meta-story about Icon: It's not really about Icon, but it's a lot funnier if you have written a bit of Icon code. I was at home playing with my laptop like a cub bear with a box of candy. I had 8 text files consisting of Icon source code (about 10 pages of print-out per file). I could have, as in years past, copied these files onto a diskette, put the diskette in my pocket, and trekked off to work. But no. In the spirit of learning by doing, I dragged the files into a 'Transfer' folder on my laptop, and dragged them out of a similar folder on my work computer. I edited away for a while (mercifully, as it turned out, altering only three of the eight files), dragged 'em back into the work 'Transfer' folder, and out again on the laptop at home. This is where the funny part happens: The demons which had been lashed to the oars of the file transfer process had surgically removed every token preceded by a backslash (\). Let that sink in for a minute while I provide a few examples: "\n" "\B0" and lots of other things map to "" \x[3] maps to [3] (\smfun)(ar) maps to ()(ar) \Ck_disable maps to _disable [sic -- demons break for _] if \altered then bazz(fazz) maps to if then bazz(fazz) dyv <:= \ymin dyv >:= \ymax n := N+1 maps to dyv <:= dyv >:= n := N+1 Funny, no? Even funnier is the following conjecture: Let wu (or Griswold's Fraction) be the probability that an Icon procedure containing at least one such alteration will compile with a "no errors" message. Then wu is in the closed interval (0.67,0.75). Telecommuters everywhere, beware! I have no idea what "software product" is responsible for this problem (certainly it has nothing to do with Icon), but I'm a little suspicious of the RTF step which I know is part of this transfer sequence. Anyway, the experience is a bit like sitting on a cactus, and I expect to be in recovery for a few more days. Mike ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- Mike Shafto (mshafto@mail.arc.nasa.gov) Chief, Human-Automation Integration Research Branch On detail (6/1/98 - 9/30/98) to the Computational Sciences Division http://olias.arc.nasa.gov/ Mail Stop 262-4 NASA-Ames Research Center Moffett Field, CA 94035-1000 --------------------------------------------------------------- Those are my principles. If you don't like them I have others. -- Groucho Marx --------------------------------------------------------------- From icon-group-sender Thu Jun 18 16:57:11 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA11670 for ; Thu, 18 Jun 1998 16:57:11 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA23991; Thu, 18 Jun 1998 16:57:01 -0700 Message-Id: <3.0.5.32.19980618154152.00a5c210@post.its.mcw.edu> X-Sender: cdt@post.its.mcw.edu X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Thu, 18 Jun 1998 15:41:52 -0500 To: icon-group@optima.CS.Arizona.EDU From: Chris Tenaglia Subject: re: here's a funny one Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 661 Regarding the magic munge file transfer mentioned by Mike Shafto, I have also seen something like that. We have business software that prints to local printers by telneting to a dos session the output directly to lpt1: So I think, cool, this is a nice little file transfer program I'll make a handy little programming environment by tweeking some of the parameters and then up and down loading the modules. I was disappointed that that the transfer also did something with \ and { and } (curly braces). It would also impact C programmers as well. So I'm just sticking to a plain vanilla FTP for the time being. When things get so smart, they're dumb. Chris. From icon-group-sender Fri Jun 19 12:38:33 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA22247 for ; Fri, 19 Jun 1998 12:38:33 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28231; Fri, 19 Jun 1998 12:38:23 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 19 Jun 1998 13:30:56 GMT From: cdt@post.its.mcw.edu (Chris Tenaglia) Message-Id: <6mdp6g$k4g@wiscnews.wiscnet.net> Organization: Medical College of Wisconsin - Milwaukee, WI Sender: icon-group-request@optima.CS.Arizona.EDU Subject: CGI progress Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 4413 Finally, some progress. Maybe its not the optimal approach, but given this particular unix environment it can be made to work well. Here's a summary ... 1. CGI program outputs Content-Type: text/html and a blank line. 2. The output is good HTML 3. The GET method is needed to accept data from a form. 4. There are useful environment variables. This is where the input data can be found. Icon can parse it quite easily. 5. icont and iconx installed in the CGI directory 6. I used a frontend to run the cgi program. This is because we did not have a C compiler to use iconc to make pure executables. So then the url looks like cgi-bin/iconx?program... and it seemed like parameters/variables beyond 'program' where not reachable. ################################################################### # # file : docgi.icn # desc : this program is a cgi learning experiment # use : called by cgi in the web server # # update by what # 08-jun-1998 tenaglia initial write # global nvp # name-value table procedure main(param) query := getenv("QUERY_STRING") | "interactive" method:= getenv("REQUEST_METHOD") | "interactive" path := getenv("PATH_INFO") | "unknown" remote:= getenv("REMOTE_USER") | "unknown" adrs := getenv("REMOTE_ADDR") | "interactive" log := open("/db1/local/httpd/cgi-bin/bioet/docgi.log","a") write(log,adrs," Accessed DOCGI at ",&dateline," with ",query) close(log) fi := open("/db1/local/httpd/cgi-bin/bioet/docgi.cnt") bump := read(fi) + 1 close(fi) fo := open("/db1/local/httpd/cgi-bin/bioet/docgi.cnt","w") write(fo,bump) close(fo) nvp := table("n/a") parts := parse(query,'&') every part := !parts do { pair := parse(part,'=') ident := unurl(pair[1]) value := unurl(pair[2]) nvp[ident] := value } write("Content-type: text/html") write("") write("") write("") write("This is the CGI Generated Title") write("") write("") write("") write("

Big Header

") write("

") write("Here's a crazy web page!

") write("The parameter was :",param[1],"

") write("The query string var is :",query,"

") write("") write("") write("") every xxx := key(nvp) do { write("") } write("
Name PartsValue Parts
NAMEVALUE
",xxx,"",nvp[xxx],"
") write("

") write("

") write("") write("") write("") write("") write("") write("") write("
CGI ParametersCGI Values
Method",method,"
Path",path,"
Username",remote,"") write("
Remote address",adrs,"
Page counter",bump,"
") write("") write("") end # # parse a string into a list with respect to a delimiter # procedure parse(line,delims) static chars chars := &cset -- delims tokens := [] line ? while tab(upto(chars)) do put(tokens,tab(many(chars))) return tokens end # # This procedure maps the wierd characters out of cgi query strings # procedure unurl(text) static hex initial { hex := table("") hex["0"] := 0 ; hex["1"] := 1 ; hex["2"] := 2 ; hex["3"] := 3 hex["4"] := 4 ; hex["5"] := 5 ; hex["6"] := 6 ; hex["7"] := 7 hex["8"] := 8 ; hex["9"] := 9 ; hex["a"] := 10; hex["A"] := 10 hex["b"] := 11; hex["B"] := 11; hex["c"] := 12; hex["C"] := 12 hex["d"] := 13; hex["D"] := 13; hex["e"] := 14; hex["e"] := 14 hex["f"] := 15; hex["F"] := 15 } work := map(text,"+"," ") cache := [] every i := 1 to *work do if work[i] == "%" then put(cache,i) while i := pop(cache) do { nyb1 := work[i+1] nyb2 := work[i+2] if (nyb1 == "") | (nyb2 == "") then next raw := hex[nyb1] * 16 + hex[nyb2] byte := char(raw) work[i+:3] := byte } return work end ################################################################### -- Chris Tenaglia (system manager) | The future foretold, Medical College of Wisconsin | The past explained, 8701 W. Watertown Plank Rd. | The present largely appologized for. Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor From icon-group-sender Fri Jun 19 12:38:53 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA22260 for ; Fri, 19 Jun 1998 12:38:53 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13686; Fri, 19 Jun 1998 12:38:43 -0700 From: pygmy@eskimo.com (Frank Sergeant) To: icon-group@baskerville.CS.Arizona.EDU Subject: using Icon for database application Date: Fri, 19 Jun 1998 12:11:28 -0500 Reply-To: frank.sergeant@pobox.com Message-Id: Lines: 186 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 8752 I was in the process of attempting to pick my new language for a particular application when the July '98 _Linux Journal_ arrived containing the Jeffery/Mohamed article "A Glimpse of Icon". I enjoyed the article and that led to reading the Linux Gazette article and various Icon Newsletters, archived mailing list, etc. I'm now reading the 1983 edition of _The Icon Programming Language_ (Icon v. 5). I'd like to discuss some of my questions and concerns related to Icon and its use in my application in hopes of hearing your comments and suggestions. Please feel free to email me or to post to the list as you prefer. I maintain a medical accounts receivable application that is installed in 12 or 13 small medical offices. Two of us are involved: Hal for sales (if you can call it that) and me for the programming and technical support. I took it over nearly 4 years ago and have been improving it and cleaning it up since then. It is written in Clipper (the dBASE or xBASE language) and consists of around 150,000 lines of source. It runs under DOS (or a DOS box in Windows). More work is needed to clean it up further to make it easier to maintain. Our typical customer has two or three PCs and runs under a "file server" model with either DOS/Lantastic or with W95 for the networking. Thus, all workstations access the database files (*.DBF) and index files. (Any workstation crashing puts the data files on the server at risk.) I am interested in moving more toward a "client/server" model where all access to the data files is handled by a process on the server ("put all your eggs in one basket then _watch_ the basket"). I am not interested in buying or having our customers buy a commercial SQL database system. I plan to handle the programming of the data access myself. One obvious decision to make is whether to do the cleaning up in Clipper before I convert or to convert and clean up as I go. Here are the reasons I am considering changing languages (to the degree I know my own thinking): 1. Protect the data better by restricting its access to a single program on the server. 2. Reduce network traffic (by not dragging the database and index files over the ethernet) to speed up the application. This is not a problem on an ethernet, as it is fast enough, but opens the door to making the application usable even over a modem. 3. By going to a 32-bit Windows program we get out of the 16-bit Windows step child environment. My feeling is that 16-bit applications are more likely to suffer from Windows bugs than 32-bit "native" applications. 4. Offering a "Windows" version of the program might occasionally attract a customer who would not consider a plain DOS application -- and might help keep current customers. 5. Open the door to working in a mixed operating system environment. In particular, for even better reliability, customers could use a Linux box as the server. 6. Our history of sales has been dismal. Still, we have our core of loyal customers that use it year after year and cheerfully pay our small ($300/year) annual maintenance fee. I am in this for the long run. If we never make another sale, I intend to support these customers forever. However, I need to do this as efficiently as possible, as I need to take on other work to keep eating. So, platform and vendor independence seem like worthy goals. This seems to rule out VO (CA-Visual Objects, supposedly the Windows-based successor to Clipper) and Delphi which run only on Windows. Perhaps I should consider Java, but I think I am suffering from hype poisoning. Python and Perl sound good to me primarily because of the delightfully literateness of the Pythona Perl books' authors. I'm agreeable to the idea that Perl's syntax is too muddy. Perl still looks good. (Can anyone comment on the various tradeoffs between these languages and Icon?) Icon questions (or comments) 1. How do you think all this fits with Icon? 2. I gather Windows Icon can make a normal looking Windows application (rather than a Motif-ish application) and that I probably could figure out how to do this by reviewing the source code for Wi. Does that sound reasonable? Would _Graphics Programming in Icon_ help? (I'm not interested in drawing pictures, etc, just in the UI part.) 3. How fast is an Icon application? For example, I ran the Python Megawidgets demo program that puts up a screen full of entry fields (Pentium 90 with 48 MB RAM) and the fields rippled slowly onto the screen rather than just popping up instantly. I'm afraid that would be too slow. Many of our customers' machines are not even up to a P90/48MB, e.g. '486 8MB. (Some even use slow '386s and one uses one or two '286s, but I would expect they would be willing to upgrade.) My point is the application must be fast enough on moderate hardware as I can't expect all customer machines to be the latest and fastest. 4. How big would the .EXE file be? From a newsletter, I understand there is the 200K or 300K overhead for the Icon interpreter. How does .EXE file size grow after this? (I imagine this is hard to answer, but perhaps you can give me some idea.) Currently our .EXE is about 850K, so I can live with that size, but would prefer smaller. 5. Is a sockets interface only available for Unicon or is it also available for Wicon? I would hope the client programs on the workstations could connect via sockets to the server running either on a Windows 95 or Linux machine. The client machines would almost certainly be W95 machines. If sockets are not built in to Icon, how hard is it to make calls to the Win32 system? How about to routines produced by MSVC or Borland C? Perhaps I could write the socket access routines in C and call them from Icon? 6. So far I haven't been able to track down Idol. A url or two for Idol on the web site seemed to give an "invalid" message. Since I had also been considering Python for this application, it seems I should consider using Idol if I use Icon, right? 7. I currently make extensive use of Clipper's "ragged arrays". These are essentially lists where the elements can be of any type including other lists. It looks like Icon's lists would just drop in and work the same. 8. The current app is about 150,000 lines (over 100 source code files). How does Icon handle applications of this size? I think the app is currently more complex than is required. All we do, really, is keep track of, display, modify various lists -- lists of doctors, patients, insurance companies, charges, paygments, and such. (How hard can it be?) 9. The data, ignoring index files, probably runs 2 to 10 MB in most offices. At the larger sizes, much of the data is relatively inactive and could be rolled out to archives. On a modern machine, all the data would fit in RAM. I am not talking about an application with gigabytes of data and 200 workstations and multiple servers. We currently use dBASE style .DBF files. These have fixed width fields. As an experiment, I converted some of our data files to variable width, delimited files Smith, George|1234 W. 17th Street|etc|etc|etc and was surprised to find it reduced file size by about two-thirds. I'm not sure this is typical, but it looks like going to variable width fields would save a lot of space, making the data fit even more easily into RAM, reducing the time of reading from disk, etc. The cost would be the slower parsing of records to locate the individual fields. Any thoughts about the tradeoffs here? 10. I have been very impressed with Bertrand Meyer's _Object Oriented Software Construction_. Can anyone comment on the differences between Eiffel and Icon, that is, why I might prefer Icon over Eiffel, etc? All comments, suggestions, corrections gratefully received. -- Frank frank.sergeant@pobox.com From icon-group-sender Mon Jun 22 08:02:49 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA28044 for ; Mon, 22 Jun 1998 08:02:49 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA25812; Mon, 22 Jun 1998 08:02:38 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 19 Jun 1998 14:28:57 -0500 From: moss@tim.risc.sps.mot.com (Matthew Moss) Message-Id: <6mee5pINNhc0@tim.risc.sps.mot.com> Organization: Motorola, Inc. -- Austin,TX Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Wanted: small meta-data language Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1638 I'm hoping someone can help identify an existing language that fills my needs. I've posted to the .awk and .icon groups as well, since my needs are similar (and maybe a match) to those languages, but I am unsure of how well they would work on binary data chunks. Anyway, I'm looking for an existing "meta-data" language. My purpose is to port such a beast to the PalmOS. Such a language would most likely be interpreted, not compiled, would provide some methods for pattern matching in both text and binary, and would operate primarily on binary data (with text objects within the binary stream). The idea is to easily allow 3rd-party applications a simple and common method to accessing other databases. (IE, I might create a scheduling app that reads through the built-in datebook database to see if there are any conflicts). Such a language would define the structure of the database and allow in-place modification and reading of data. For example, assuming that the address book data structure was defined, I could write C-code somewhat like this: if (!strcmp ("Acme Company", GET_STRING(ref, "company"))) /* do action */ where GET_STRING is an entry point into the gawk/icon/sed/other meta-data language, ref is a pointer to the data record, and "company" is the field name within the meta-data language definition for the address book database. The whole idea is to provide one library with multiple meta-data definitions for each library. I don't know if such a thing/language exists, so I'm hoping someone out there can tell me "yes" or "no" before I write the whole thing myself. Thanks in advance.... From icon-group-sender Mon Jun 22 08:03:22 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA28059 for ; Mon, 22 Jun 1998 08:03:21 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA26604; Mon, 22 Jun 1998 08:03:11 -0700 From: gep2@computek.net Date: Fri, 19 Jun 1998 20:37:26 -0500 Message-Id: <199806200137.UAA25365@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: using Icon for database application To: icon-group@baskerville.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 10567 > ...I maintain a medical accounts receivable application that is installed in 12 or 13 small medical offices. Two of us are involved: Hal for sales (if you can call it that) and me for the programming and technical support. I took it over nearly 4 years ago and have been improving it and cleaning it up since then. It is written in Clipper (the dBASE or xBASE language) and consists of around 150,000 lines of source. It runs under DOS (or a DOS box in Windows). That's a fairly huge Clipper application... I'd think that if it were written really utilizing the tools present to best advantage (native report writers etc etc... I use FoxPro for several of my clients) that it would be able to be a whole lot smaller than that. >... (Any workstation crashing puts the data files on the server at risk.) I've written a program (in S*BOL) which reads through xBASE .DBF files and "repairs" this kind of "not a database file" problems. It fixes many kinds of scrogged fields in the header, and particularly fixes the length irregularities which usually create this symptom. > I am interested in moving more toward a "client/server" model where all access to the data files is handled by a process on the server ("put all your eggs in one basket then _watch_ the basket"). Personally, I don't much like that approach (no surprise, as I was the guy who invented the first commercially successful LAN software in 1976). It's not only just putting all your eggs in one basket (from a security standpoint) but it's also a reversion to what I call "mainframe think". It puts a limitation of how much processor power you can cluster around that shared database... your potential user/application fanout is greatly reduced, IMHO. > I am not interested in buying or having our customers buy a commercial SQL database system. I agree with you there... I've (for example) yet to see a SINGLE Oracle-type application which I think has responsiveness, cost, and efficiency which are all respectable. > I plan to handle the programming of the data access myself. One obvious decision to make is whether to do the cleaning up in Clipper before I convert or to convert and clean up as I go. My personal feeling is that I'd leave the code pretty much as is, and probably leave it pretty much in xBASE. For all the wonderful things in Icon, Icon (at least I've not seen them) doesn't have the kind of sweeping database-style features that xBASE-type systems have. (And here I'm talking about things like the wonderful report writers and such which are so cool in FoxPro and the like). Screen-and-field-oriented data entry features (with verification features, automatic relationships, etc etc) really are a dandy thing to have. Icon doesn't even have native ISAM file support, and that's just about a minimum pre-requisite for any serious business use (IMHO). > 1. Protect the data better by restricting its access to a single program on the server. I believe that there are FoxPro (xBASE) flavor "server" engines available... which would satisfy this goal (FWIW) without requiring a complete application rewrite. > 2. Reduce network traffic (by not dragging the database and index files over the ethernet) to speed up the application. This is not a problem on an ethernet, as it is fast enough, but opens the door to making the application usable even over a modem. There are other ways to do that, whether by thin-client approaches (ICK) or by things like ReachOut, PC-Anywhere, etc etc. > 3. By going to a 32-bit Windows program we get out of the 16-bit Windows step child environment. My feeling is that 16-bit applications are more likely to suffer from Windows bugs than 32-bit "native" applications. Perhaps, although they also tend to be simpler and more mature, too... so I don't think it's all that certain that the applications are really more reliable. In all the time I've been working with FoxPro (for DOS) I have seen few (if any) legitimate BUGS in the FoxPro package itself. It seems to overall be very stable. > 4. Offering a "Windows" version of the program might occasionally attract a customer who would not consider a plain DOS application -- and might help keep current customers. I haven't found this to be an issue (with my current customers, anyhow) and they seem to greatly appreciate the better responsiveness of the text-mode applications. > 5. Open the door to working in a mixed operating system environment. In particular, for even better reliability, customers could use a Linux box as the server. I think that, from a reliability and support standpoint, it's in most cases just plain dumb to go to a mixed-OS environment. You're talking about a minor advantage at best, and usually introducing an awful lot of potential for incompatibilities. Especially at smaller clients, I think that maintaining a Linux system is so alien to everything else they know that it's at minimum something to do only with the greatest of trepidation. > 6. Our history of sales has been dismal. Still, we have our core of loyal customers that use it year after year and cheerfully pay our small ($300/year) annual maintenance fee. I am in this for the long run. If we never make another sale, I intend to support these customers forever. However, I need to do this as efficiently as possible, as I need to take on other work to keep eating. Personally, especially in that case, I wouldn't want to do a rewrite of the package just to change languages!!! > ...So, platform and vendor independence seem like worthy goals. What a strange conclusion to come to, based on those concerns! Given that probably NONE of your current clients are running Linux, and that none of them likely have any desire to run Linux, I'm wondering how on earth you think it's a great idea to lob that grenade their direction. > ...This seems to rule out VO (CA-Visual Objects, supposedly the Windows-based successor to Clipper) and Delphi which run only on Windows. I think those also run on NT, which (if you're going to not use W9x) is probably a better alternative than going to Linux. My perception is that in five or ten years, the corporate environment is going to be a lot more NT-like than it will be Unix-like. If and when we get ready to migrate most of my current clients' systems from FoxPro or xBASE to Win-native stuff, it will more likely be to FoxPro for Windows. > ....Perhaps I should consider Java, but I think I am suffering from hype poisoning. Not just that, but I don't want to be in the middle of a pissing match between Bill Gates and Sun. (If it came to that, Bill will win it). > ....Python and Perl sound good to me primarily because of the delightfully literateness of the Pythona Perl books' authors. My reaction to Perl is that I can't imagine for the life of me why anybody familiar with either S*BOL or Icon would use it in preference to the other two. > ...I'm agreeable to the idea that Perl's syntax is too muddy. Perl still looks good. (Can anyone comment on the various tradeoffs between these languages and Icon?) You know, for "general purpose programming" I still really like S*BOL and Icon (hell, even C/C++ for stuff that's that intensive). But business programming is NOT really "general purpose programming"... it's much more file-and-database intensive, has more demanding requirements on data entry and verification, involves a lot more report generation, and tends to be less algorithm-intensive. > 8. The current app is about 150,000 lines (over 100 source code files). How does Icon handle applications of this size? It probably would handle it fine, although (depending on how the application is written... the fact that it's 150K lines is perhaps a red flag) my suspicion is that the app in Icon would be substantially LARGER in terms of lines of code. > ...I think the app is currently more complex than is required. All we do, really, is keep track of, display, modify various lists -- lists of doctors, patients, insurance companies, charges, paygments, and such. (How hard can it be?) Don't underestimate the value of all the behind-the-scenes features that xBASE-style languages provide to simplify the programmer's life!! > 9. ...We currently use dBASE style .DBF files. These have fixed width fields. As an experiment, I converted some of our data files to variable width, delimited files > Smith, George|1234 W. 17th Street|etc|etc|etc > and was surprised to find it reduced file size by about two-thirds. I'm not sure this is typical, but it looks like going to variable width fields would save a lot of space, making the data fit even more easily into RAM, reducing the time of reading from disk, etc. The cost would be the slower parsing of records to locate the individual fields. Any thoughts about the tradeoffs here? I think that, with 32Mb of RAM costing maybe $50 or thereabouts and 6Gb hard drives going for about $200-250, any discussion of saving bytes by increasing programmer effort is probably pretty silly. If you're really worried about stuff like this, let me suggest that (instead of application-specific forms of compression like this) you'd be *far* better off to use Stacker or even Microsoft's own disk compression software. It's also a big PITA (doing it yourself) when it comes time to update records, since compressed records usually are nontrivial to update in place. > All comments, suggestions, corrections gratefully received. I hope this helps you! I'm NOT trying to turn you away from Icon or S*BOL... they're both wonderful languages... but personally, when I'm presented with a problem like you're dealing with, I tend to favor FoxPro (essentially, like Clipper) to solve it... and adding some modules in S*BOL or whatever to attack the problems more amenable to those languages when appropriate. The right tool for the right job. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Mon Jun 22 08:03:36 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA28069 for ; Mon, 22 Jun 1998 08:03:35 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28396; Mon, 22 Jun 1998 08:03:25 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Sat, 20 Jun 1998 10:27:31 +0100 From: Ian Stirling <0000358B8083.NO_UCE@mauve.demon.co.uk> Message-Id: <0000358B8083.NO_UCE@mauve.demon.co.uk> Organization: None. Sender: icon-group-request@optima.CS.Arizona.EDU References: <6mee5pINNhc0@tim.risc.sps.mot.com>, <6mf0fo$a2l$1@supernews.com> Subject: Re: Wanted: small meta-data language Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1080 In comp.lang.awk Scott wrote: : Have you considered something like JavaScript (ECMA Script). The language : itself is pretty easy, and it shouldn't be that hard to implement from : scratch if needed be. That shouldn't be necessary though as both Netscape : and Microsoft have released source for it (I don't know if MS is still doing : that though). : Matthew Moss wrote in message <6mee5pINNhc0@tim.risc.sps.mot.com>... :> :>I'm hoping someone can help identify an existing language that fills :>my needs. I've posted to the .awk and .icon groups as well, since my :>needs are similar (and maybe a match) to those languages, but I am :>unsure of how well they would work on binary data chunks. I assume you've looked at the palmpilot software archive, Lots of languages have been ported. -- See http://www.mauve.demon.co.uk/ |Linux PDA, cheap electronics/PC bits sale. See_header,_for_UCE_policy___________|_____________________________Ian_Stirling. If it can't be expressed in figures, it is not science, it is opinion. Robert A Heinlein. From icon-group-sender Mon Jun 22 12:50:51 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA11483 for ; Mon, 22 Jun 1998 12:50:51 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA27571; Mon, 22 Jun 1998 12:50:41 -0700 Message-Id: <3.0.5.32.19980622102318.00a34530@post.its.mcw.edu> X-Sender: cdt@post.its.mcw.edu X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Mon, 22 Jun 1998 10:23:18 To: icon-group@optima.CS.Arizona.EDU From: Chris Tenaglia Subject: RE: Wanted : Small meta data language Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1808 I designed a similar database package years ago. I think what you mean is an INI file design. I called my package Attercop, wrote it around 1983, and ported to Icon in 1989. The database is stored in a flat file with \xFE as field delimiters. I thought about having an \xFF delimiter for a field with "many" potential elements. Typically, data is in a .dat file. In this example, the metafile is called userbase.atcp. So typing "attercop userbase" opens this metafile which tells attercop where the data is, how it's layed out, and also contains some display, sort, and print preferences. attercop then displays a menu for performing various maintenance and reporting on the data. But with a known interface other programs (even CGI) could make use of it. A unix compressed version of attercop is downloadable from http://www.execpc.com/~cdt if one wants to look more closely at it. ____________________________________________________________________________ ___________ data in /export/home/cdt/srch/userbase.dat header is General User Accounts fields are UserName UID_____ GID_____ Phone FullName Dept Email_ __ HomeDir_ Profile_ lengths are 10 6 6 14 30 35 35 21 8 look up 1 sort on 5 print using 1 57 mishp5/200_dplx n/a title begin MCWSUN USER ACCOUNTS REPORT &PAGE FOR &DATE USERNAME UID GID PHONE NUMBER FULLNAME LAST NAME DEPARTMENT NAME EMAIL ADDRESS HOMEDIR PROFILE ========== ====== ====== ============== ============================== ==== ================ =================================== ========================= ========== ===================== ======= title end ____________________________________________________________________________ ____________ From icon-group-sender Mon Jun 22 16:44:43 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA22859 for ; Mon, 22 Jun 1998 16:44:43 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28717; Mon, 22 Jun 1998 16:44:32 -0700 From: pygmy@eskimo.com (Frank Sergeant) To: icon-group@baskerville.CS.Arizona.EDU Subject: Re: using Icon for database application Date: Mon, 22 Jun 1998 15:22:26 -0500 Reply-To: frank.sergeant@pobox.com Message-Id: Lines: 18 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 623 I recently wrote: > Python and Perl sound good to me > primarily because of the delightfully literateness > of the Pythona Perl books' authors. I'm agreeable > to the idea that Perl's syntax is too muddy. Perl ^^^^ > still looks good. (Can anyone comment on the > various tradeoffs between these languages and Icon?) Oops, that was a typo. I meant to say that, while I'm tentatively ready to reject Perl because of its syntax, _Python_ still looks good. -- Frank frank.sergeant@pobox.com From icon-group-sender Mon Jun 22 16:44:52 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA22862 for ; Mon, 22 Jun 1998 16:44:51 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA23562; Mon, 22 Jun 1998 16:44:41 -0700 Date: Mon, 22 Jun 1998 16:39:26 -0500 Message-Id: <199806222139.QAA25152@segfault.cs.utsa.edu> From: Clinton Jeffery To: frank.sergeant@pobox.com Cc: icon-group@baskerville.CS.Arizona.EDU In-Reply-To: (pygmy@eskimo.com) Subject: Re: using Icon for database application Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 7013 [Frank Sergeant offered a discussion of a large Clipper application that he is maintaining, followed by a number of Icon questions.] Hi Frank, I'm glad you liked the Linux Journal article on Icon. While I disagree with Gordon Peterson's answers to your questions on many or most points, he did say several things that are very true; you will have to figure out for yourself which of his comments are relevant for your application. I suspect Gordon has more experience than I with xBase languages (although I did program-for-hire in dBase III and Foxbase). I've done a lot more Icon programming than Gordon, who frequently posts about Snobol in the Icon group, bless his heart! > Icon questions (or comments) > 1. How do you think all this fits with Icon? Icon isn't a special-purpose database language. Its built-in types are designed for flexible data manipulation in main memory. If that's what you want to do, you are all set; if not, you should look for a database language, or think about connecting Icon to a third-party database engine. There's more on memory requirements in your question 9 below. > 2. I gather Windows Icon can make a normal looking > Windows application (rather than a Motif-ish > application) and that I probably could figure out > how to do this by reviewing the source code for Wi. > Does that sound reasonable? Would _Graphics > Programming in Icon_ help? Well, you shouldn't have to learn it by studying source code. Both the on-line reference and an appendix in "Graphics Programming in Icon" discuss these functions, which are quite simple. > 3. How fast is an Icon application? In your hypothetical client/server architecture, the database engine performance will be your bottleneck. Icon's graphics are plenty fast enough for 486 clients, but Icon would not be suitable for the server software unless either (a) enough main memory was available to fit all the indices and preferably the data as well, or (b) you extended Icon to access a third-party database, such as Postgres or mSQL. > 4. How big would the .EXE file be? How does .EXE file size grow after [the 200/300K interpreter]? It grows at a moderate rate :-) depending on how effectively you are using the built-in features. The virtual machine is by nature higher-level and potentially more compact than many languages, but if you write many thousands of lines of Pascal-like (or xBase-like) code, it will be huge. One wart I know of at present: if you use tons of different record types you get penalized (this is true, for example, of the Motif-like portable widgets in the Icon Program Library). I thought a student had fixed this for me, but his "field table compression" has some bugs that need fixing before we turn it on and leave it on by default. > Currently our .EXE is about 850K, so I can live with that size, > but would prefer smaller. I think the Icon program would be larger, unless your rewrite substantially reduces the number of lines of code to exploit Icon's built-in features. If you just translated xBase line-by-line into Icon the result will be huge. Clipper is (was?) a fine commercial-quality product. > 5. Is a sockets interface only available for Unicon or > is it also available for Wicon? Ah, its time for some vaporware. Sockets are only available on Unix at the present time. I've merged Unicon into my main source tree so that I can start porting it to Windows, but I have to wrangle with some other problems in Icon 9.3.2 before I take that on. > If sockets are not built in to Icon, how hard is it to make > calls to the Win32 system? How about to routines > produced by MSVC or Borland C? Perhaps I could > write the socket access routines in C and call them > from Icon? I keep getting nibbles, but so far no one has volunteered to implement this kind of access. You can get the Windows Icon source and make such extensions yourself, and if you build something really useful I'd certainly like to incorporate it into the main public domain Windows Icon distribution. > 6. So far I haven't been able to track down Idol. A url or two for > Idol on the web site seemed to give an "invalid" message. > it seems I should consider using Idol if I use Icon, right? My apologies; there was a reorganization that left a bad symbolic link. The main Idol web site is now www.cs.utsa.edu/research/idol/ and I am in the process of packaging a release of Windows Idol. You should consider using Idol if you want to write object-oriented applications or have a large complex application with many user-defined types. > 7. I currently make extensive use of Clipper's "ragged arrays". > These are essentially lists where the elements can be of any > type including other lists. It looks like Icon's lists would > just drop in and work the same. Yes, or better. > 8. The current app is about 150,000 lines (over 100 source code > files). How does Icon handle applications of this size? Icon is generally tuned for speed, rather than to minimize space requirements. I've heard reports of Unix Icon programs in the million line range, but haven't seen a Windows Icon program in the 100K range yet. My impression is that Windows manages virtual memory much worse than UNIX or Linux. On old 486's with 8MB of memory you may run into terrible problems unless you split the application up into a thin "client" program that can access a server with more muscle. > I think the app is currently more complex than is required. > All we do, really, is keep track of, display, modify various > lists -- lists of doctors, patients, insurance companies, > charges, paygments, and such. (How hard can it be?) This is generally vastly easier in Icon than in an xBase language. > 9. The data, ignoring index files, probably runs 2 to > 10 MB in most offices. At the larger sizes, much of > the data is relatively inactive and could be rolled > out to archives. On a modern machine, all the data > would fit in RAM. I heartily recommend memory-based databases! Memory is cheap. The server should have lots of memory. > 10. I have been very impressed with Bertrand Meyer's > _Object Oriented Software Construction_. Can anyone > comment on the differences between Eiffel and Icon, > that is, why I might prefer Icon over Eiffel, etc? Icon is dynamically typed, offers a lot more flexibility, and has a much higher-level set of built-in data structures and operators. Eiffel is a very good object-oriented systems language geared more for multi-programmer efforts that might otherwise be written in C++ or Ada. You write a lot more lines of code in Eiffel to do the same work. Eiffel may run quite a bit faster; I am not sure how much. Cheers, Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Wed Jun 24 08:08:45 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA01699 for ; Wed, 24 Jun 1998 08:08:44 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA29429; Wed, 24 Jun 1998 08:08:34 -0700 From: pygmy@eskimo.com (Frank Sergeant) To: icon-group@baskerville.CS.Arizona.EDU Subject: Re: using Icon for database application Date: Tue, 23 Jun 1998 16:33:31 -0500 Reply-To: frank.sergeant@pobox.com Message-Id: In-Reply-To: <199806200137.UAA25365@axp.cmpu.net> Lines: 233 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 10427 Gordon, I very much appreciate your comments and suggestions. I don't think I can agree completely yet, but you've given me food for thought. gep2@computek.net (Gordon Peterson) wrote: > > xBASE language) and consists of around 150,000 lines of > > source. It runs under DOS (or a DOS box in Windows). > > That's a fairly huge Clipper application... I'd think that if it > were written really utilizing the tools present to best advantage ... > that it would be able to be a whole lot smaller than that. I agree that it is large and that it could/should be smaller. I attribute this to my predecessors on the project. There has been a good bit of redundancy in the system. For example, when I took it over I found 6 monthly statement routines: 1 set of 3 for each of 3 possible forms for printing a single statement and a similar set of 3 routines for printing all statements. Obviously, this multiplies the opportunities for errors and increases the difficulty of wrapping one's mind around the system. All reports were written individually, duplicating the line counting and report heading logic each time. Etc. I have gradually been factoring out the commonalities but a lot of work remains. I understand how such (unfactored) code comes about: there is no money to be made yet there is an obligation to do something (or at least appear to do something) to solve a current emergency, and so the most hurried quickest immediate fix is applied without regard to the long range maintenance problems it creates, cutting and pasting rather than analyzing and simplifying. > >... (Any workstation crashing puts the data files on the server at > risk.) > > I've written a program (in S*BOL) which reads through xBASE > .DBF files and "repairs" this kind of "not a database file" > problems. It fixes many kinds of scrogged fields in the > header, and particularly fixes the length irregularities > which usually create this symptom. I'm going to quote two more parts of your message out of order so they will be near the above quote. > reliable. In all the time I've been working with FoxPro > (for DOS) I have seen few (if any) legitimate BUGS in the > FoxPro package itself. It seems to overall be very stable. > I think that, from a reliability and support standpoint, > it's in most cases just plain dumb to go to a mixed-OS > environment. I'm not sure it is a bug in the FoxPro package (or in Clipper), but _how come you have those S*BOL repair programs_ if FoxPro and the environment (and the OS) are so damn stable? I think there are several factors. One is whether the hardware, especially the RAM, is fully reliable or partially (intermittently) defective. The best method I know of to determine this is to run what I call the Linux stress test (compile the Linux kernel). I've written up a little article about this ("Stress Testing Hardware") and put it on my web site. So, being able to run (and later rerun) this stress test to verify the hardware is a beneficial side effect of having Linux available. Also, I am convinced Linux is a more reliable operating system than W95 (and perhaps WNT). Another factor in data integrity is what I was referring to when I called it "putting all my eggs in one basket", but that isn't really the best analogy. The eggs were already in one basket, that is, the application's data resided on a single machine, the file server. The problem is that all the workstations independently access that data. If any one of those machines fails, the data is at risk. Putting a UPS on the server isn't enough, etc. But, if I move to "client/server" then it seems I could arrange things so nothing the clients do can endanger the data on the server. Therefore, I remove several potential points of failure. Another factor _may_ be bugs in W95. It was interesting to read over the bug history list for Kermit. Item after item referred to bugs they had located in W95 that were not present either in OS/2 or in WNT. With regard to file server record locking and such, there is the W95 "vredir" problem and several "fixes" from Microsoft and several Knowledge Base articles about it. The Knowledge Base articles are gibberish as far as I am concerned. So, it may be dumb to go to a mixed OS environment. But, it may be dumber to use Windows by itself. Anyway, I'm not saying you are wrong about this. I've had my own strong reservations about recommending Linux for my customers due to the support problem. I have figured that if W95 screws up, they might perhaps blame Microsoft, but if Linux screws up they will blame me. Nevertheless, I have talked customers through (or have gone to the office to do it myself) various reconfigurations of W95 and its networking. I am beginning to think Linux cannot cause me any more trouble than W95 is causing me. Plus, Linux should be much easier to administer remotely, and that could be worth a lot. So, I am not saying I will demand customers use a Linux server, just that I see a possible advantage to keeping my options open. (Although it was W3.11, not W95, I've had a customer phone because our app would no longer run. "What do you mean", I asked. It turned out the shortcut icon on the desktop had disappeared. Well, I talked them through setting up the shortcut again. Can you believe it? The shortcut disappeared and _they_ didn't remove it (so they said, but I suspect they did somehow by accident). I know our program didn't remove it. Would Linux really cause me more trouble than that?) > Icon doesn't even have native ISAM file support, and that's > just about a minimum pre-requisite for any serious business > use (IMHO). Hmmm. So it looks like I am back to the question of whether all of the data would fit in RAM. I think it would. I'll try to run some tests. > I believe that there are FoxPro (xBASE) flavor "server" > engines available... which would satisfy this goal (FWIW) > without requiring a complete application rewrite. This is a good point. There are two products in particular that I have heard good things about. One is Advantage Database Server. It just costs money and requires a dedicated NT (or Novell) server which costs money. I think we are talking about some thousands of dollars per customer (that I think they do not wish to pay). But, Advantage gets rave reviews. The other is RASQL/B which provides an interface from Clipper to Btrieve. Again, substantial money for each customer. Both of these seem like overkill, remembering that our typical office has two or three computers. > > 2. Reduce network traffic (by not dragging the database > > There are other ways to do that, whether by thin-client > approaches (ICK) or by things like ReachOut, PC-Anywhere, etc etc. Well, these solutions seem to require dedicating a machine at a central office for use by remote office (and possibly vice versa), since Windows isn't multi-user. I could see it for occasional use. We do have one customer using PC-Anywhere sometimes to access the office machine from home. > I think that, with 32Mb of RAM costing maybe $50 or > thereabouts and 6Gb hard drives going for about $200-250, > any discussion of saving bytes by increasing programmer > effort is probably pretty silly. I generally agree with this. My point was not so much to save bytes on disk, but to allow the entire database to reside in RAM. I am not saying that is a general solution for every business application, just that it might well fit our application considering the size of our databases. Then, bang!, with it all in RAM, certain complexities seem to disappear. Well, I need to do some testing. (And, although 32MB of RAM might seem cheap at $50, there is also the problem of how to get it put into the machine. Will the customer do that himself? I don't want to have to do it for him, but I might have to. So, really, the cost is greater than just the $50.) > If you're really worried about stuff like this, let me > suggest that (instead of application-specific forms of > compression like this) you'd be *far* better off to use > Stacker or even Microsoft's own disk compression software. It will be a cold day in hell before I use Microsoft's disk compression. (Do I feel a chill in the room?). Maybe I'm living too far in the past, but disk compression has caused too many problems. Is it really reliable now? I'm still very suspicious of all the disk compression products. Certainly (until convinced otherwise), I would buy larger hard disks first and recommend the same to my customers. > It's also a big PITA (doing it yourself) when it comes time > to update records, since compressed records usually are > nontrivial to update in place. Well, I've got to think all this through. But, if the data would indeed fit in RAM, wouldn't Icon take care of the updating in place automatically? I'd have the responsibility of initially loading the data from disk at the start of the day (or the start of the year or the start of the hour depending on which operating system was in use) and writing it back out later. I envision writing out log files as I go so the database could be reconstructed in case of a power failure, etc. > I hope this helps you! Yes. At least it makes me think and reconsider my opinions and prejudices. > The right tool for the right job. It is hard to argue with that. On the other hand, it is not impossible. There are costs to sticking entirely with Clipper. There are costs to change. Which will be best considering the short term and the long term? > The right tool for the right job. It seems possible that there could be a language, possibly Icon or Python, or possibly a combination of two languages, that might generally be good enough for most programming tasks even if it wasn't the absolute best for any single one of those tasks, and not _too_ bad for all the other tasks so that I would be better off doing _everything_ in that one language (or two) when you consider the efficiencies of working with just one or two languages instead of 30 (fill in the blank) perfect languages each perfect for its own task. This is just a conjecture, but it seems likely to me to be true. -- Frank (in sunny and hot San Marcos, Texas) frank.sergeant@pobox.com http://www.eskimo.com/~pygmy (for the Stress Testing article) From icon-group-sender Wed Jun 24 08:08:34 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA01691 for ; Wed, 24 Jun 1998 08:08:34 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13548; Wed, 24 Jun 1998 08:08:23 -0700 From: pygmy@eskimo.com (Frank Sergeant) To: icon-group@baskerville.CS.Arizona.EDU Subject: Re: using Icon for database application Date: Tue, 23 Jun 1998 20:03:06 -0500 Reply-To: frank.sergeant@pobox.com Message-Id: In-Reply-To: <199806222139.QAA25152@segfault.cs.utsa.edu> Lines: 179 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 7986 Clint Jeffery, jeffery@cs.utsa.edu wrote: > While I disagree with > Gordon Peterson's answers to your questions on many or most points, I'm glad to hear that. Even if Gordon is correct in all his points, I'm going to have to work toward them slowly. He does bring up (albeit politely) the possibility, worth considering, that I am out of my mind. > I've done a lot more Icon > programming than Gordon, who frequently posts about Snobol in the Icon > group, bless his heart! All I know (?) about Snobol was that I'd heard over the years that it was "good for string processing". Now I gather it is the father, or favorite uncle, of the Icon language. > Icon isn't a special-purpose database language. Its built-in types are > designed for flexible data manipulation in main memory. If that's what > you want to do, you are all set; When you put it that way, I think it is clear that that _is_ what I want to do. (Also, it should be perfectly suitable for sequetial file processing, right? That should work very well for producing reports.) There remains the question as to whether the data will actually fit in RAM so that I _can_ do what I want to do. I'm inclined to think it will fit, but I need to do some tests. > if not, you should look for a database language, or think about > connecting Icon to a third-party database engine. There's more on > memory requirements in your question 9 below. I am now thinking about using the variable length, delimited format with all the data in RAM. If that doesn't work out, I gather from a later comment you made that I could write extension routines in C as modifications to the Icon source. I think I could do that to give Icon direct/random access to database files. I am set up here with MSVC/C++, BC/C++, Watcom, and several other C compilers (which strikes me as very strange for someone who definitely is not a fan of C -- oh well). Of course, I suspect there are details to study in order to coordinate properly with Icon, so I'd rather not rush into this. However, I'm familiar with the C and Win32 file access routines. Another possibility would seem to be doing the same thing to get access to Win32 socket routines and use them to communicate with a (possibly bare-bones) database server, written in anything, possibly C. So, I am encouraged to think the straight forward, all Icon, data in RAM approach might work fine but that if it doesn't, I have not necessarily painted myself into a corner. > > 2. I gather Windows Icon can make a normal looking > > Windows application (rather than a Motif-ish > > application) and that I probably could figure out > > how to do this by reviewing the source code for Wi. > Well, you shouldn't have to learn it by studying source code. You understood I meant to use the source for Wi as an example of how to put up the various menus, entry fields, and such, right? That is, the menus and such in the Wi application look "normal" for Windows, whereas those in VIB do not. Since Wi is written in Icon, I figured it must be possible to get that "normal" Windows look and that Wi would show how. > Both the on-line reference and an appendix in "Graphics > Programming in Icon" discuss these functions, which are quite > simple. I have the book on order. I'm very much looking forward to it. At the moment, Python and Icon are largely tied in my mind. I would be delighted to hear more comments that might help me understand their relative tradeoffs. One thing that worries me about Python is that its preferred GUI seems to be Tk. I used Tk a little (with Tcl) several years ago, prior to it getting a "native look and feel" and wasn't crazy about it. Also, a demo of a extension to Tk, PMW (Python Mega Widgets), seemed way too slow. So, that Icon might have an easy to use, fast GUI makes me think I will like it better than Python with Tk. > Icon's graphics are plenty fast enough for 486 clients, but > Icon would not be suitable for the server software unless > either (a) enough main memory was available to fit all the > indices and preferably the data as well, or How does keeping just the indices in RAM solve the problem if Icon does not have direct access to the data file? > One wart I know of at present: if you use tons of different > record types you get penalized (this is true, for example, I guess I would have a record type for each database plus other record types for anything I could treat as an object. On the bright side, you might well have this fixed before I'm ready to put the app in production. > I think the Icon program would be larger, unless your > rewrite substantially reduces the number of lines of code to > exploit Icon's built-in features. If you just translated > xBase line-by-line into Icon the result will be huge. > Clipper is (was?) a fine commercial-quality product. I think I could knock perhaps a third off the source code side by rewriting it properly in Clipper. I would hope to take advantage of Icon's features to make it even smaller. All this is guess work until I try it out. > Ah, its time for some vaporware. Sockets are only > available on Unix at the present time. < calling Win32 routines from Icon > > I keep getting nibbles, but so far no one has volunteered to implement this > kind of access. You can get the Windows Icon source and make such > extensions yourself, and if you build something really useful I'd certainly > like to incorporate it into the main public domain Windows Icon > distribution. Ok. I find this very encouraging. As slowly as I am moving, you may well have it all ready before I need it. Or, if I do need it sooner, I might be able to write specific calls to the socket routines. I'll be glad to send you anything I do in this area, but I'm a long way from it at the moment. Another idea that occurred to me, if only as a proof of concept, if sockets aren't available, would be to have the client and server communicate via files on a RAM disk on the server. Another possibility might be to have the server generate HTML and let the clients be any old web browsers. (I have some user interface concerns here, though.) > The main Idol web site is now www.cs.utsa.edu/research/idol/ and I am > in the process of packaging a release of Windows Idol. You should consider > using Idol if you want to write object-oriented applications or have a large > complex application with many user-defined types. Thanks. I'll take a look when it is ready. > Icon is generally tuned for speed, rather than to minimize space > requirements. I've heard reports of Unix Icon programs in the million line > range, but haven't seen a Windows Icon program in the 100K range yet. If things go well, my rewrite would be under 100K, so that sounds ok. > My impression is that Windows manages virtual memory much > worse than UNIX or Linux. I don't doubt it. I'm rather annoyed with Windows at the moment, so I'm ready to believe any bad thing about it. Although, W95 almost never crashes on me any more now that I fixed my hardware. Prior to that, it would crash perhaps one or more times a day. But, at that same time, with the defective hardware, I would usually run Linux for more hours per day on the same machine and Linux would essentially _never_ crash on me. So, my conclusion is that with equivalent hardware Linux is the better operating system and goes out of its way to take care of you and your data while Windows does not. > On old 486's with 8MB of memory you may run into terrible > problems unless you split the application up into a thin > "client" program that can access a server with more muscle. I think I can do that. It would be easier to say a customer must have _one_ fast machine as a server, than to say _every_ machine in the office must be a fast machine. Thanks for your other comments as well. -- Frank frank.sergeant@pobox.com From icon-group-sender Thu Jun 25 08:29:42 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA12971 for ; Thu, 25 Jun 1998 08:29:42 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA31216; Thu, 25 Jun 1998 08:29:31 -0700 From: pygmy@eskimo.com (Frank Sergeant) To: icon-group@baskerville.CS.Arizona.EDU Subject: Re: using Icon for database application Date: Wed, 24 Jun 1998 21:42:41 -0500 Reply-To: frank.sergeant@pobox.com Message-Id: In-Reply-To: Lines: 28 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 933 I wrote: > > Icon's graphics are plenty fast enough for 486 clients, but > > Icon would not be suitable for the server software unless > > either (a) enough main memory was available to fit all the > > indices and preferably the data as well, or > > How does keeping just the indices in RAM solve the > problem if Icon does not have direct access to the data > file? What led me to the above comment was "Input and output in Icon are sequential and line oriented. There are neither random access facilities nor format conversions." on page 88 of _The Icon Programming Language_ (1st edition? anyway dated 1983). I realize I'm reading an out of date book which describes version 5, but I saw a comment or two on the list that I misunderstood as confirming the above quote. Now I realize Icon has seek() which solves my concerns about random access to files. -- Frank frank.sergeant@pobox.com From icon-group-sender Thu Jun 25 12:22:16 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA06255 for ; Thu, 25 Jun 1998 12:22:16 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA30605; Thu, 25 Jun 1998 12:22:05 -0700 Message-Id: <35927650.3744@gte.net> Date: Thu, 25 Jun 1998 11:09:52 -0500 From: MJE Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@baskerville.CS.Arizona.EDU Subject: Icon Variants References: <199806222139.QAA25152@segfault.cs.utsa.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 535 Dear Group, Would someone who is knowledgeable please provide a list of all current variants on the Icon language, including (1) web URL's, (2) platform support data, (3) how many people are working on each and within what time frame (i.e. current alpha/beta/release status), and (4) likelihood of future incorporation into the "official" Icon. I have seen blurbs about Godiva, Jcon, Unicon, and on and on, but I don't have a clue whether these projects are simply tangents or fundamental to the future of Icon itself. Mark Evans From icon-group-sender Fri Jun 26 15:40:05 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id PAA16803 for ; Fri, 26 Jun 1998 15:40:04 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA30768; Fri, 26 Jun 1998 15:39:53 -0700 Sender: rwg@fns.com Message-Id: <3593FF9A.4A241736@fns.com> Date: Fri, 26 Jun 1998 16:07:54 -0400 From: Robbie Gilbert Organization: Fujitsu Network Communications X-Mailer: Mozilla 4.05 [en] (X11; I; SunOS 5.5.1 sun4u) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Forcing Generator to Return a List of Values Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1016 Hi, I have a newbie question: I would like to know if there is a function or procedure that will repeatedly evaluate an expression which is a generator and return ALL the results in a list. I could write such a procedure very easily (maybe only 2 lines?) using the every-do control structure but if there is one already in the program library, I would prefer to use the standard. I found evallist but that seems to construct an entire program and exec it which seems expensive for my purposes. I also checked list construction and type conversion to see if there was a way to "force" a list context around an expression evaluation but couldn't find any. I want to assign the list of values and since assignment only takes the first value, things like "| expr" only seem to produce one value. I need some intervening procedure or function to "collect" all the values generated. The list constructor doesn't do the job since it only evaluates its second argument, the expr, once. Robbie Gilbert rwg@fns.com From icon-group-sender Fri Jun 26 15:39:37 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id PAA16608 for ; Fri, 26 Jun 1998 15:39:36 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA18130; Fri, 26 Jun 1998 15:39:25 -0700 Message-Id: X-Mailer: Novell GroupWise 4.1 Date: Fri, 26 Jun 1998 16:19:56 -0500 From: Charles Hethcoat To: icon-group@optima.CS.Arizona.EDU Subject: TeX editor (Newsletter #47) Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 621 Hi, I was reviewing some old Icon newsletters and came across the item in Newsletter 47 about some student projects in graphics programming. There is mention that an unnamed student wrote a TeX editor. I found no further references to this program. I could use a graphical TeX editor. Is this one available? I would be very interested in taking a look at the source code and trying to run it. If it's incomplete that doesn't bother me as long as the basic design is good. Thanks. Charles Hethcoat Oceaneering Space Systems, Inc. 16665 Space Center Blvd., Houston, Texas 77058 USA chethcoa@oss.oceaneering.com From icon-group-sender Mon Jun 29 08:41:51 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA06745 for ; Mon, 29 Jun 1998 08:41:51 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA29145; Mon, 29 Jun 1998 08:41:39 -0700 Date: Sun, 28 Jun 1998 22:37:17 -0500 Message-Id: <199806290337.WAA12295@segfault.cs.utsa.edu> From: Clinton Jeffery To: rwg@fns.com Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <35970836.34465163@fns.com> (message from Robbie Gilbert on Sun, 28 Jun 1998 23:21:26 -0400) Subject: Re: Forcing Generator to Return a List of Values Reply-To: jeffery@segfault.cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1299 [Robbie Gilbert provides a helper procedure and uses co-expression invocation p{} to solve his problem of turning a generator's result sequence into a list.] Hi Robbie, You've got some coding problems to fix, but when you fix them the general approach you describe will work and is attractively concise. However, it is not cheap. If you need to do this 10 times in your program, you have a great solution. If you need to do it many thousands of times, you had best not create a new co-expression every time you capture a generator's results. The reason is that each co-expression requires substantial memory for its own stack, and the memory for co-expressions is not allocated and reclaimed in the same, efficient way that most Icon values are. This is just my impression. I am a big co-expression advocate and would welcome corrections and anecdotes from persons who have happily used thousands of co-expressions in a single program! Remember, you are only going to save one line of code over: L := [] every put(L, generator_expression) Perhaps if you do an experiment and collect some timings, that will influence you! Cheers, Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Mon Jun 29 08:42:08 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA06781 for ; Mon, 29 Jun 1998 08:42:06 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA30182; Mon, 29 Jun 1998 08:41:55 -0700 Message-Id: <199806291302.PAA27566@capway.com> From: "Vladimir Grodzenski" To: icon-group@optima.CS.Arizona.EDU Date: Mon, 29 Jun 1998 15:02:12 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: Bug in FillRectangle function ? Reply-To: Cc: jeffery@cs.utsa.edu Priority: urgent Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1282 (I am using the last Windows Icon downloaded from -UTSA- FTP site) Here is just a very quick note on one example from Graphics book which uses "drawop=reverse" attribute (i.e. drawing the same figure twice in "reverse" mode must erase the figure). Page 88. (or on the CD, Examples Chapter 4, glide.icn), the following example does not work: WAttrib("drawop=reverse") every x := 1 to 100 do { FillRectangle(x, 100, 10, 20) WDelay(1) FillRectangle(x, 100, 10, 20) } Here the rectangle is simply not filled! The effect may be obtained with the different code: every x := 1 to 100 do { WAttrib("drawop=copy") FillRectangle(x, 100, 10, 20) WDelay(1) WAttrib("drawop=reverse") FillRectangle(x, 100, 10, 20) } I also tried the DrawCircle(), DrawRectangle() and even FillCircle() instead of FillRectangle(). All of these functions worked fine in the way described in the Graphics book. Well, assuming that FillRectangle is just buggy and all Draw***() functions work with "drawop=reverse" attribute, I am surprised that DrawString() does not. Why doesn't it? Vladimir Grodzenski ================================================= E-mail: vladimir.grodzenski@capway.com CompuServe: 100700,526 ================================================= From icon-group-sender Mon Jun 29 08:41:34 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA06696 for ; Mon, 29 Jun 1998 08:41:33 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21982; Mon, 29 Jun 1998 08:41:22 -0700 Sender: rwg@fns.com Message-Id: <35970836.34465163@fns.com> Date: Sun, 28 Jun 1998 23:21:26 -0400 From: Robbie Gilbert Organization: Fujitsu Network Communications X-Mailer: Mozilla 4.05 [en] (X11; I; SunOS 5.5.1 sun4u) Mime-Version: 1.0 To: jeffery@segfault.cs.utsa.edu Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Forcing Generator to Return a List of Values References: <199806270618.BAA10281@segfault.cs.utsa.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1928 Clinton Jeffery wrote: > Hi, > > I am sure you got deluged with answers, so I will be brief. Yes, it is > useful occasionally to collect all the results from a generator and put them > in a list, and no, there isn't a standard library function. In fact, if you > think about it, a library procedure would not help you. You need to write > the code yourself, either in your own helper procedure, or directly in the > place where you've got the generator and need the list. Fortunately, as you > say, its only a couple of lines. > > Clint Jeffery Clint, Thanks for the response. Actually yours was the only one I've gotten so far. I think a procedure can help; how about: procedure collectAll (expressions) local results results := [] every C := !expressions do every result := |@C do results |||:= [result] return results end This procedure is invoked using braces as explained on page 116 of the The Icon Programming Language (3rd ed.), in the section on user-defined control structures: # args is some list foo := collectAll { ! args } This procedure takes a comma-separated list of co-expressions (in this example, there is only one, !args), grabs all the results and returns them in a list. (This may need some refinement to work properly for all kinds of expressions, I just finished writing it so I haven't tested it thoroughly yet. Also the list concatenation may not be very efficient--there may be a better way but I'm new to this language.) Hopefully I can pass any valid expression as an arg and get a list of the results back. This is what I was trying to accomplish and seems to be fairly general. This seems like a natural, common task and given Icon's strengths in this type of thing I thought there would already be something like this in the program library--didn't want to reinvent the wheel. Thanks, Robbie rwg@fns.com From icon-group-sender Mon Jun 29 08:41:59 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA06764 for ; Mon, 29 Jun 1998 08:41:59 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00698; Mon, 29 Jun 1998 08:41:47 -0700 Sender: rwg@fns.com Message-Id: <35970F72.40125E54@fns.com> Date: Sun, 28 Jun 1998 23:52:18 -0400 From: Robbie Gilbert Organization: Fujitsu Network Communications X-Mailer: Mozilla 4.05 [en] (X11; I; SunOS 5.5.1 sun4u) Mime-Version: 1.0 To: jeffery@segfault.cs.utsa.edu Cc: Icon Mailing List Subject: Re: Forcing Generator to Return a List of Values References: <199806290337.WAA12295@segfault.cs.utsa.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2116 Clint, Thanks for the input! Yes, I've already discovered some coding problems and am working on fixing them. This is only for a small (as you say, around 10) number of iterations, so it shouldn't be too expensive in that sense, but being a newbie I didn't realize co-expressions were memory-intensive. I realized I was only saving one line of code but I hate to use a line of code for something as trivial as initialization. Collecting all the values and assigning them seems such a natural operation, especially if this is an operation that can be reused. As you say, though, the performance hit may not justify the succintness of the expression. I will do some timings and see. Thanks again, Robbie rwg@fns.com Clinton Jeffery wrote: > [Robbie Gilbert provides a helper procedure and uses co-expression invocation > p{} to solve his problem of turning a generator's result sequence into a list.] > > Hi Robbie, > > You've got some coding problems to fix, but when you fix them the general > approach you describe will work and is attractively concise. However, it is > not cheap. If you need to do this 10 times in your program, you have a > great solution. If you need to do it many thousands of times, you had best > not create a new co-expression every time you capture a generator's results. > The reason is that each co-expression requires substantial memory for its > own stack, and the memory for co-expressions is not allocated and reclaimed > in the same, efficient way that most Icon values are. > > This is just my impression. I am a big co-expression advocate and would > welcome corrections and anecdotes from persons who have happily used > thousands of co-expressions in a single program! > > Remember, you are only going to save one line of code over: > L := [] > every put(L, generator_expression) > > Perhaps if you do an experiment and collect some timings, that will influence > you! > > Cheers, > > Clint Jeffery, jeffery@cs.utsa.edu > Division of Computer Science, The University of Texas at San Antonio > Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Mon Jun 29 08:41:14 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA06667 for ; Mon, 29 Jun 1998 08:41:14 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA31475; Mon, 29 Jun 1998 08:41:02 -0700 X-Sender: nevin@pop.interaccess.com (Unverified) Message-Id: In-Reply-To: <01bda15c$16b0f180$c37546cf@NEVIN> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Sat, 27 Jun 1998 03:51:31 -0500 To: icon-group@optima.CS.Arizona.EDU From: "Nevin :-] Liber" Subject: Re: Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 943 Robbie Gilbert wrote: >I would like to know if there is a function or procedure >that will repeatedly evaluate an expression which is a >generator and return ALL the results in a list. I could >write such a procedure very easily (maybe only 2 >lines?) using the every-do control structure but if there is >one already in the program library, I would prefer to use >the standard. I don't know if there is a standard one in the IPL, but as you pointed out, it is fairly trivial to write: procedure genlist(pGenerator, LArguments[]) local L L := list() every put(L, pGenerator ! LArguments) return L end -- Nevin ":-)" Liber (847) 816-9926 Senior Software Engineer, Pendragon Software Pendragon Software Corporation 1580 South Milwaukee Avenue, Suite 515 Libertyville, IL 60048-3776 voice: (847) 816-9660 fax: (847) 816-9710 From icon-group-sender Mon Jun 29 08:41:21 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA06676 for ; Mon, 29 Jun 1998 08:41:21 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01032; Mon, 29 Jun 1998 08:41:09 -0700 Message-Id: <35970078.4332DA12@ix.netcom.com> Date: Sun, 28 Jun 1998 22:48:24 -0400 From: Phillip Lee Thomas Reply-To: thomaspl@acm.org X-Mailer: Mozilla 4.05 [en] (Win95; U) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Retrieving lists from tables Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 575 I'm working on a project where it would be most convenient to store information in a table where the index is a list and the value is a record; however, I find it not obvious how to retrieve the data as lists are retrieved by their ID number, not their value. Any suggestions? record ref(part1,part2) # Initially... t := table() L := ["house","horse"] t[L] := ref(1,2) # Later... L2 := ["house","horse"] Now I want to find out if a list with the content of L2 is in table t, and if so to augment the value of its part1. -- Phillip Thomas From icon-group-sender Mon Jun 29 16:24:34 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA25642 for ; Mon, 29 Jun 1998 16:24:34 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01832; Mon, 29 Jun 1998 16:24:22 -0700 From: Guy Laden Message-Id: <199806291912.WAA25423@orion.math.tau.ac.il> Subject: Re: Retrieving lists from tables To: thomaspl@acm.org Date: Mon, 29 Jun 1998 22:12:36 +0300 (GMT+0300) Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <35970078.4332DA12@ix.netcom.com> from "Phillip Lee Thomas" at Jun 28, 98 10:48:24 pm X-Mailer: ELM [version 2.4 PL25] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 943 > I'm working on a project where it would be most convenient to store > information in a table where the index is a list and the value is a > record; however, I find it not obvious how to retrieve the data as lists > are retrieved by their ID number, not their value. Any suggestions? > > record ref(part1,part2) > # Initially... > t := table() > L := ["house","horse"] > t[L] := ref(1,2) > # Later... > L2 := ["house","horse"] > Now I want to find out if a list with the content of L2 is in table t, > and if so to augment the value of its part1. I'd be happy to hear of solutions from experienced Icon programmers. My solution in a similar case was to create a string out of the list and to use it as key. I didn't have to handle arbitrary strings in my application so encoding the list as a string was simple. Perhaps the codeobj module from the IPL can be used if more generality is needed. Regards, Guy From icon-group-sender Mon Jun 29 16:24:27 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA25635 for ; Mon, 29 Jun 1998 16:24:26 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01169; Mon, 29 Jun 1998 16:24:14 -0700 Message-Id: <3597BA27.532@gte.net> Date: Mon, 29 Jun 1998 11:00:39 -0500 From: MJE Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Retrieving lists from tables References: <35970078.4332DA12@ix.netcom.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 876 Would a two-way table help? You would have to maintain a second table indexed by record that stores the list keys. Every time you do an action on the first table, you have to do it also on the second one to keep them synchronized. Mark Phillip Lee Thomas wrote: > > I'm working on a project where it would be most convenient to store > information in a table where the index is a list and the value is a > record; however, I find it not obvious how to retrieve the data as lists > are retrieved by their ID number, not their value. Any suggestions? > > record ref(part1,part2) > # Initially... > t := table() > L := ["house","horse"] > t[L] := ref(1,2) > # Later... > L2 := ["house","horse"] > Now I want to find out if a list with the content of L2 is in table t, > and if so to augment the value of its part1. > > -- Phillip Thomas From icon-group-sender Mon Jun 29 16:25:14 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA25709 for ; Mon, 29 Jun 1998 16:25:14 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA29304; Mon, 29 Jun 1998 16:25:02 -0700 Date: Mon, 29 Jun 1998 14:06:04 -0700 From: Gregg Townsend Message-Id: <9806292106.AA22085@hawk.CS.Arizona.EDU> To: icon-group Subject: Re: Icon Variants Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1612 [ In response to Mark Evans' query about the various versions of Icon: ] We (Ralph Griswold and Gregg Townsend) maintain the "master source copy" of Icon at the University of Arizona. The source code is distributed as part of packages configured for particular platforms. Periodic updates are available by subscription. We also produce and distribute the source and binary packages for Unix and provide web/FTP space for other platforms. The Icon web site is at http://www.cs.arizona.edu/icon/ and it includes a list of versions available for various platforms. We regard Icon as a mature language and we have no plans for major changes or additions. Clint Jeffery of UT San Antonio maintains the Windows version of Icon. This is also a released product, but work continues on a more active basis. See http://www.cs.utsa.edu/research/icon/ Clint also distributes Idol, an object-oriented variant of Icon. Unicon, from Shamim Mohamed, adds many POSIX-inspired built-in functions to Unix Icon. It is available through his web page at http://www.drones.com/unicon/ Todd Proebsting and Gregg Townsend are actively working on Jcon, a new Java-based implementation of Icon, and intend to release a new and faster version later this year. We don't know where this will ultimately lead. See http://www.cs.arizona.edu/icon/jcon/ These are the versions of Icon that have been in the news lately. There may be other things going on that we're not aware of. --------------------------------------------------------------------------- Gregg Townsend Ralph Griswold The University of Arizona From icon-group-sender Tue Jun 30 08:00:15 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA28489 for ; Tue, 30 Jun 1998 08:00:15 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02125; Tue, 30 Jun 1998 08:00:03 -0700 Message-Id: <35983EEB.F39CA405@ix.netcom.com> Date: Mon, 29 Jun 1998 21:27:08 -0400 From: Phillip Lee Thomas Reply-To: thomaspl@acm.org X-Mailer: Mozilla 4.05 [en] (Win95; U) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Retrieving lists from tables References: <199806300034.TAA13464@segfault.cs.utsa.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 560 Thanks to Mark Evans, R. Clayton, Shamim Mohamed, Guy Laden, and Clint Jeffery for your very acute replies. It looks like double-entry bookkeeping has found its place in the solution to this problem. In the particular instance there appears to be little to help avoiding the maintenance of both string and list representations during the entire life of the processing. The IPL has a list function l_find that does match one list as a substring of another but that doesn't help much in table lookups. OK. Time to ponder your collective insights. Phillip From icon-group-sender Tue Jun 30 08:00:26 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA28495 for ; Tue, 30 Jun 1998 08:00:25 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01984; Tue, 30 Jun 1998 08:00:13 -0700 Message-Id: <35985E94.B8AC0267@ix.netcom.com> Date: Mon, 29 Jun 1998 23:42:12 -0400 From: Phillip Lee Thomas Reply-To: thomaspl@acm.org X-Mailer: Mozilla 4.05 [en] (Win95; U) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Retrieving lists from tables References: <35970078.4332DA12@ix.netcom.com> <3597BA27.532@gte.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 645 After pondering the solutions sent in, the following appears to involve the least processing without making the code absolutely undebugable: record ref(L,part1,part2) # keep list as first element of record ..... t := table() hashval := hash(L) if \t[hashval] then t[hashval].part1 +:= 1 else t[hashval] := ref(L,1,1) .... # later retrieval of the list for further processing can be done through # converting the table to a sorted list or whatever is appropriate. procedure hash(L) # return some string unique to each list L end Thanks again to all who responded. Phillip From icon-group-sender Tue Jun 30 08:00:45 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA28503 for ; Tue, 30 Jun 1998 08:00:45 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00768; Tue, 30 Jun 1998 08:00:32 -0700 Date: Tue, 30 Jun 1998 08:23:23 -0500 (CDT) From: Chris Tenaglia To: icon-group@optima.CS.Arizona.EDU Subject: sample CGI Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2869 This CGI stuff is a snap once you get the hang of it. Here's a sample. This is a CGI to return the time remainting till the turn of the century. It also records visits in a logfile. I was able to run it at http://www.mcw.edu/cgi-bin/bioet/cdown where it will be for a few days. As usual the file permissions are the most sensitive issue. Here's the source; _______________________________________________________________ # # file : cdown.icn # desc : This program returns countdown information till # the turn of the century # use : to be called by a cgi script in a web page : .../cgi-bin/cdown # note : 730 days from 1/1/1998 to 1/1/2000 # # update by what # 29-jun-1998 tenaglia initial write # procedure main() write("content-type: text/html") write() write("") write("") write("") write("Century Countdown") write("") write("") write("") write("

") write("

Century CountDown !

") write("

") write("") write("") # # gather the time fields from the current moment # date := &date time := &clock delta:= [0,31,59,90,120,151,181,212,243,273,304,334,365] year := parse(date,'/')[1] month:= parse(date,'/')[2] day := parse(date,'/')[3] hour := parse(time,':')[1] min := parse(time,':')[2] sec := parse(time,':')[3] # # calculate the time left until 1/1/2000 # diff := (year - 1998) * 365 + delta[month] + day remains := 730 - diff part1 := 24 - hour part2 := 60 - min part3 := 60 - sec write("") write("", "", "") write("

") write("Today is ",&dateline,"

There are ",remains," days,
And ",part1," hours,
",part2," minutes,
",part3," seconds until 2000 A.D.
") write("

") write("") write("") # # record visits # computer:= getenv("REMOTE_ADDR") logfile := open("cdown.log","a") write(logfile,"CDOWN accessed ",&dateline," from ",computer) close(logfile) end # # parse a string into a list with respect to a delimiter # procedure parse(line,delims) static chars chars := &cset -- delims tokens := [] line ? while tab(upto(chars)) do put(tokens,tab(many(chars))) return tokens end _______________________________________________________________ Chris Tenaglia (system manager) | The future foretold, Medical College of Wisconsin | The past explained, 8701 W. Watertown Plank Rd. | The present largely appologized for. Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor From icon-group-sender Tue Jun 30 16:30:43 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA28910 for ; Tue, 30 Jun 1998 16:30:37 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01012; Tue, 30 Jun 1998 16:30:25 -0700 Date: Tue, 30 Jun 1998 13:51:21 -0700 From: Ralph Griswold Message-Id: <9806302051.AA16354@jupiter.CS.Arizona.EDU> To: vladimir.grodzenski@capway.com Subject: Re: Bug in FillRectangle function ? Cc: icon-group Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 148 drawop=reverse does not work properly in Windows Icon. You'll find this and a few other things on pages 474-475 of the graphics programming book. From icon-group-sender Mon Jul 6 08:16:31 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA17672 for ; Mon, 6 Jul 1998 08:16:30 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA04087; Mon, 6 Jul 1998 08:16:17 -0700 Message-Id: <199807040137.UAA13830@newmonics.com> X-Sender: whm@newmonics.com (Unverified) X-Mailer: QUALCOMM Windows Eudora Pro Version 4.0 Date: Fri, 03 Jul 1998 18:43:06 -0700 To: icon-group@optima.CS.Arizona.EDU From: "William H. Mitchell" Subject: Icon routine to convert UNIX internal time to ASCII? Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 204 Has anybody got an Icon routine to convert a UNIX internal time, measured as the number of seconds since midnight GMT, 1/1/1970, into ASCII? I couldn't find anything in the IPL that seemed applicable. From icon-group-sender Tue Jul 7 17:00:37 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id RAA03697 for ; Tue, 7 Jul 1998 17:00:36 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA08522; Tue, 7 Jul 1998 17:00:23 -0700 Message-Id: <35A2750A.E12A0673@aasaa.ofe.org> Date: Tue, 07 Jul 1998 13:20:42 -0600 From: David Starner X-Mailer: Mozilla 4.05 [en] (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Stripping excessive spaces Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 549 I've just started programming in Icon, and I came across the problem of removing all the starting and ending spaces from a string. This was my solution, but I think it's terribly inefficent. Can some one help me with a better way to do this? procedure clip(s1) if type(s1) == "null" then fail s1 ?:= { tab(many(' ')) & tab(0) } s1 := reverse(s1) s1 ?:= { tab(many(' ')) & tab(0) } s1 := reverse(s1) return s1 end -- David Starner - dvdeug@hotmail.com, dstarner98@aasaa.ofe.org GURPS: http://www.geocities.com/TimesSquare/Ring/7895/ From icon-group-sender Wed Jul 8 14:01:48 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id OAA02640 for ; Wed, 8 Jul 1998 14:01:47 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10420; Wed, 8 Jul 1998 14:01:34 -0700 From: "Nevin :-] Liber" To: Cc: "David Starner" Subject: Re: Stripping excessive spaces Date: Tue, 7 Jul 1998 19:55:41 -0500 Message-Id: <01bdaa0b$2191b000$c37546cf@NEVIN> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.71.1712.3 X-Mimeole: Produced By Microsoft MimeOLE V4.71.1712.3 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2099 >I've just started programming in Icon, and I came across the problem of >removing all the starting and ending spaces from a string. This was my >solution, but I think it's terribly inefficent. Can some one help me >with a better way to do this? The built-in function trim() does the bulk of what you want to do. Check out the documentation at . If you are looking to express the algorithm as a one-liner, the following should suffice: procedure clip(s, c) /c := ' ' s := string(s) | runerr(103, s) c := cset(c) | runerr(104, c) return reverse(trim(reverse(trim(s, c)), c)) end If the "inefficiency" of reversing a string twice bothers you, you might wish to write it as: procedure clip(s, c) /c := ' ' s := string(s) | runerr(103, s) c := cset(c) | runerr(104, c) trim(s, c) ? { tab(many(c)) return tab(0) } end These are both a little more general than what you asked for, as you can clip any arbitrary cset (which defaults to space) instead of just spaces. Also, this behaves a little differently than your algorithm does, as it aborts with a runtime error instead of just failing if s is not convertible to a string (and c is not null and not convertible to a cset). If you wanted to generalize this a little more, say to use different csets for the left and right sides (defaulting the left clip to space if none is provided, and defaulting the right clip to be the same as the left clip if non is provided), you might write it as: procedure clip(s, cLeft, cRight) /cLeft := ' ' /cRight := cLeft s := string(s) | runerr(103, s) cLeft := cset(cLeft) | runerr(104, cLeft) cRight := cset(cRight) | runerr(104, cRight) trim(s, cRight) { tab(many(cLeft)) return tab(0) } __ Nevin ":-)" Liber (847) 816-9926 Senior Software Engineer, Pendragon Software From icon-group-sender Wed Jul 8 14:02:10 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id OAA02671 for ; Wed, 8 Jul 1998 14:02:09 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10436; Wed, 8 Jul 1998 14:01:56 -0700 Date: Tue, 7 Jul 1998 21:42:48 -0500 (CDT) From: Chris Tenaglia To: David Starner Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Stripping excessive spaces In-Reply-To: <35A2750A.E12A0673@aasaa.ofe.org> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1117 try new := reverse(trim(reverse(trim(str)))) Chris Tenaglia (system manager) | The future foretold, Medical College of Wisconsin | The past explained, 8701 W. Watertown Plank Rd. | The present largely appologized for. Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor On Tue, 7 Jul 1998, David Starner wrote: > Date: Tue, 07 Jul 1998 13:20:42 -0600 > From: David Starner > To: icon-group@optima.CS.Arizona.EDU > Subject: Stripping excessive spaces > > I've just started programming in Icon, and I came across the problem of > removing all the starting and ending spaces from a string. This was my > solution, but I think it's terribly inefficent. Can some one help me > with a better way to do this? > > procedure clip(s1) > if type(s1) == "null" then fail > s1 ?:= { > tab(many(' ')) & tab(0) > } > s1 := reverse(s1) > s1 ?:= { > tab(many(' ')) & tab(0) > } > s1 := reverse(s1) > return s1 > end > -- > David Starner - dvdeug@hotmail.com, dstarner98@aasaa.ofe.org > GURPS: http://www.geocities.com/TimesSquare/Ring/7895/ > From icon-group-sender Wed Jul 8 14:02:01 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id OAA02663 for ; Wed, 8 Jul 1998 14:02:01 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA09408; Wed, 8 Jul 1998 14:01:47 -0700 Date: Tue, 7 Jul 1998 18:22:02 -0700 From: Ralph Griswold Message-Id: <9807080122.AA26095@jupiter.CS.Arizona.EDU> To: icon-group Subject: Forwarded information request Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1878 >From shawakfa@charlie.cns.iit.edu Sun Jul 5 22:54:08 1998 Received: from baskerville.CS.Arizona.EDU by jupiter.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22602; Sun, 5 Jul 1998 22:54:05 -0700 Received: from optima.cs.arizona.edu (optima.CS.Arizona.EDU [192.12.69.5]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with ESMTP id WAA22879 for ; Sun, 5 Jul 1998 22:46:11 -0700 (MST) Received: from charlie.cns.iit.edu (root@charlie.cns.iit.edu [198.87.195.70]) by optima.cs.arizona.edu (8.9.0.Beta5/8.9.0.Beta5) with SMTP id WAA19228 for ; Sun, 5 Jul 1998 22:46:09 -0700 (MST) Received: from charlie.cns.iit.edu (as5121.dialup.iit.edu [198.87.167.62]) by charlie.cns.iit.edu (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id AAA23478 for ; Mon, 6 Jul 1998 00:46:05 -0500 Message-Id: <35A065D7.3C850679@charlie.cns.iit.edu> Date: Mon, 06 Jul 1998 00:51:19 -0500 From: Emad Shawakfa Reply-To: shawakfa@charlie.cns.iit.edu Organization: Illinois Institute of Technology X-Mailer: Mozilla 4.05 [en] (Win95; I) Mime-Version: 1.0 To: icon-project@optima.CS.Arizona.EDU Subject: Calling Icon programs from other languages. Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Status: RO Hello, I am currently a PhD student at IL Institute of Technology where I am doing some natural language processing. Icon is a very good programming language to deal with text and do parsing for any text inpu. Is it possible for me to call a parser written in icon from other programming languages such as VC++ 5.0? if not, are there any translators that can translate from/to Icon source code? Thanks, - Emad Shawakfa PhD Student, Computer Science Dept, IL Institute of Technology shawakfa@charlie.cns.iit.edu From icon-group-sender Wed Jul 8 14:02:22 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id OAA02674 for ; Wed, 8 Jul 1998 14:02:16 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28049; Wed, 8 Jul 1998 14:02:03 -0700 Message-Id: <199807081244.OAA00040@capway.com> From: "Vladimir Grodzenski" To: David Starner Date: Wed, 8 Jul 1998 14:44:08 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: Re: Stripping excessive spaces Reply-To: Cc: icon-group@optima.CS.Arizona.EDU Priority: urgent In-Reply-To: <35A2750A.E12A0673@aasaa.ofe.org> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 945 I'd write your procedure in this way: procedure clip(s) s ? { tab(many(' ')) return trim(tab(0)) } end On 7 Jul 98 at 13:20, David Starner wrote: > I've just started programming in Icon, and I came across the problem > of removing all the starting and ending spaces from a string. This > was my solution, but I think it's terribly inefficent. Can some one > help me with a better way to do this? > > procedure clip(s1) > if type(s1) == "null" then fail > s1 ?:= { > tab(many(' ')) & tab(0) > } > s1 := reverse(s1) > s1 ?:= { > tab(many(' ')) & tab(0) > } > s1 := reverse(s1) > return s1 > end > -- > David Starner - dvdeug@hotmail.com, dstarner98@aasaa.ofe.org > GURPS: http://www.geocities.com/TimesSquare/Ring/7895/ > > Vladimir Grodzenski ================================================= E-mail: vladimir.grodzenski@capway.com CompuServe: 100700,526 ================================================= From icon-group-sender Wed Jul 8 14:01:45 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id OAA02622 for ; Wed, 8 Jul 1998 14:01:39 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05744; Wed, 8 Jul 1998 14:01:25 -0700 Date: Tue, 7 Jul 1998 17:14:37 -0700 From: kwalker@sfo.harbinger.com (Ken Walker) Message-Id: <199807080014.RAA02444@varda.premenos.com> To: icon-group@optima.CS.Arizona.EDU, dstarner98@aasaa.ofe.org Subject: Re: Stripping excessive spaces Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: IBoK7ybSEBHiGKAtRZMTtw== Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 536 > Date: Tue, 07 Jul 1998 13:20:42 -0600 > From: David Starner > > I've just started programming in Icon, and I came across the problem of > removing all the starting and ending spaces from a string. This was my > solution, but I think it's terribly inefficent. Can some one help me > with a better way to do this? Your code to remove leading spaces looks fine to me, but I would use trim() to remove trailing spaces. Ken Walker, kenneth.walker@sfo.harbinger.com Harbinger Coporation, Concord, Ca. 94520 From icon-group-sender Tue Jul 14 08:17:12 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA10004 for ; Tue, 14 Jul 1998 08:17:08 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA26913; Tue, 14 Jul 1998 08:16:54 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Tue, 14 Jul 1998 10:15:40 +0200 From: Anders Holtsberg Message-Id: <35AB13AC.145D@maths.lth.se> Organization: Lund University Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Icon language: Sockets Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 515 Is networking supported in Icon? I tried to look in the book and its index and in the FAQ but I can't find it. I found file and pipe support but not socket support. What I want to do is a small multiplayer game program. -- Andy == Anders Holtsberg =========================== andersh@maths.lth.se == Department of Mathematical Statistics Phone +46 46 222 4953 Lund University Fax +46 46 222 4623 == Box 118, S-221 00 LUND, Sweden == http://www.maths.lth.se/matstat == From icon-group-sender Tue Jul 14 16:29:09 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA08073 for ; Tue, 14 Jul 1998 16:29:07 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10864; Tue, 14 Jul 1998 16:28:53 -0700 From: "Mike Levine" To: Subject: RE: Icon language: Sockets Date: Tue, 14 Jul 1998 20:24:54 +0100 Message-Id: <000001bdaf5d$14513e90$08c566c3@aftergov> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal In-Reply-To: <35AB13AC.145D@maths.lth.se> X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1253 Good question. I am very interested in this too. Games, especially Multi-user (MU*) types are used in many fields of Psychology and Sociology and are written in C, C++ to parse multi-user input (100+ simultaneous socket connections). The language efficiency of 3GL/4GL programming language text processing has been the subject of debate for some time and I would like to conduct research of ICON and traditional languages within this niche. Kind Regards Mike Levine > -----Original Message----- > From: icon-group-request@CS.Arizona.EDU > [mailto:icon-group-request@CS.Arizona.EDU]On Behalf > Of Anders Holtsberg > Sent: Tuesday, July 14, 1998 9:16 AM > To: icon-group@optima.CS.Arizona.EDU > Subject: Icon language: Sockets > > > Is networking supported in Icon? I tried to look in > the book and its > index and in the FAQ but I can't find it. I found > file and pipe support > but not socket support. What I want to do is a > small multiplayer game > program. > > -- Andy > > == Anders Holtsberg =========================== > andersh@maths.lth.se == > Department of Mathematical Statistics > Phone +46 46 222 4953 > Lund University > Fax +46 46 222 4623 > == Box 118, S-221 00 LUND, Sweden == > http://www.maths.lth.se/matstat == > > > From icon-group-sender Tue Jul 14 16:29:20 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA08109 for ; Tue, 14 Jul 1998 16:29:19 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13928; Tue, 14 Jul 1998 16:29:05 -0700 Date: Tue, 14 Jul 1998 15:26:25 -0500 Message-Id: <199807142026.PAA25970@segfault.cs.utsa.edu> From: Clinton Jeffery To: andersh@maths.lth.se Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <35AB13AC.145D@maths.lth.se> (message from Anders Holtsberg on Tue, 14 Jul 1998 10:15:40 +0200) Subject: Re: Icon language: Sockets Reply-To: jeffery@segfault.cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1021 > Is networking supported in Icon? I tried to look in the book and its > index and in the FAQ but I can't find it. I found file and pipe support > but not socket support. What I want to do is a small multiplayer game > program. On common UNIX platforms, the answer is yes; on other platforms the answer is so far, no. On UNIX, your options are: 1. use loadfunc() to call C functions in the Icon Program Library, developed by Gregg Townsend, or 2. use Unicon, the variant of Icon with high level POSIX extensions developed by Shamim Mohamed, available at www.drones.com/unicon You are right, this sounds like a good question for the FAQ. :-) As a silly aside, it is possible to develop multiplayer X Window games using the graphics facilities of "100% Pure Icon", just open windows on each player's display! X Windows is great that way. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Tue Jul 14 16:29:31 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA08113 for ; Tue, 14 Jul 1998 16:29:31 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA14528; Tue, 14 Jul 1998 16:29:16 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 14 Jul 1998 20:07:39 GMT From: espie@liafa.jussieu.fr (Marc Espie) Message-Id: <6ogdqb$js3$1@vishnu.jussieu.fr> Organization: None Sender: icon-group-request@optima.CS.Arizona.EDU References: <35AB13AC.145D@maths.lth.se> Subject: Re: Icon language: Sockets Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 681 In article <35AB13AC.145D@maths.lth.se>, Anders Holtsberg wrote: >Is networking supported in Icon? I tried to look in the book and its >index and in the FAQ but I can't find it. I found file and pipe support >but not socket support. What I want to do is a small multiplayer game >program. I don't have the url handy, but if you look more closely at the icon web pages, you'll find a project which extends Icon to support common Unix system calls, including socket support. -- Marc Espie |anime, sf, juggling, unicycle, acrobatics, comics... |AmigaOS, OpenBSD, C++, perl, Icon, PostScript... | `real programmers don't die, they just get out of beta' From icon-group-sender Thu Jul 16 08:48:22 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA26365 for ; Thu, 16 Jul 1998 08:48:21 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA11710; Thu, 16 Jul 1998 08:48:06 -0700 From: Otfried Geffert Date: Thu, 16 Jul 1998 09:10:27 GMT Message-Id: <19980716.9102789@og-1042.stardiv.de> Subject: No graphics books To: icon-group@optima.CS.Arizona.EDU X-Mailer: Mozilla/3.0 (compatible; StarOffice/4.0; WinNT/Win95) X-Priority: 3 (Normal) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 722 Unpublished in Europe Once upon a time=20 there was a programmer in Germany, who used Icon=20 for everyday work. He heard about graphics=20 and about a book to come. He waponed himself=20 with patience, because writing a book was a hard and a time=20 consuming work. January of '98 he ordered the book. A couple of month later the author sent a mail that the book was published. And the retailer for Europe sent a mail to the bookstore 'We are sorry the book is sold out'. And the programmer sang: (apologies to the Beatles) Whisper words of wisdom Let it be Write in C And hoped that this was not the end of the story. Angrily=20 from Germany, Otfried From icon-group-sender Thu Jul 16 12:22:56 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA05954 for ; Thu, 16 Jul 1998 12:22:55 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05494; Thu, 16 Jul 1998 12:22:40 -0700 Date: Thu, 16 Jul 1998 13:13:06 -0500 Message-Id: <199807161813.NAA27758@segfault.cs.utsa.edu> From: Clinton Jeffery To: og@stardiv.de Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <19980716.9102789@og-1042.stardiv.de> (message from Otfried Geffert on Thu, 16 Jul 1998 09:10:27 GMT) Subject: Re: Yes graphics books Reply-To: jeffery@segfault.cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 566 Otfried, The book is not sold out. The book is brand new and has not even appeared in American bookstores yet. It is available right now from the Icon Project, and it can be ordered on-line from www.peer-to-peer.com. It can also be ordered from www.amazon.com, but it only just appeared there and they don't have it in stock yet. My uneducated guess is that it should start appearing in stores in the next 2-3 months. If you don't want to wait for the retail book distribution channel, I would order it from Icon Project! Cheers, Clint, jeffery@cs.utsa.edu From icon-group-sender Fri Jul 17 08:42:11 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA07264 for ; Fri, 17 Jul 1998 08:42:10 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10953; Fri, 17 Jul 1998 08:41:55 -0700 Message-Id: <199807171230.OAA02421@capway.com> From: "Vladimir Grodzenski" To: Otfried Geffert Date: Fri, 17 Jul 1998 14:30:06 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: Re: No graphics books Reply-To: Cc: icon-group@optima.CS.Arizona.EDU Priority: urgent In-Reply-To: <19980716.9102789@og-1042.stardiv.de> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 450 On 16 Jul 98 at 9:10, Otfried Geffert wrote: > January of '98 > he ordered the book. I ordered the book directly online from the Editor Peer-to-Peer about 5 weeks ago, an I got it three weeks ago. http://www.peer-to-peer.com/catalog/language/icong.html Vladimir Grodzenski ================================================= E-mail: vladimir.grodzenski@capway.com CompuServe: 100700,526 ================================================= From icon-group-sender Fri Jul 17 08:42:00 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA07261 for ; Fri, 17 Jul 1998 08:41:59 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13986; Fri, 17 Jul 1998 08:41:44 -0700 Message-Id: <199807170754.IAA01247@holyrood.ed.ac.uk> Date: 17 Jul 98 08:54:49 BST From: Roger Hare Subject: Graphics book To: icon-group@optima.CS.Arizona.EDU Reply-To: rjhare@ed.ac.uk Organisation: Edinburgh Parallel Computing Centre Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 569 > I would order it from Icon Project! Seconded! My local bookshop here in Edinburgh told me that it wasn't available yet. These tales are put out by bookshops when they don't actually know the answer to your query, I am sure. I ordered mine from the Icon Project - it arrived in about 14 days (less time than I would have expected from the bookshop), and the extra postage costs just about equalled the markup which would have been added on by the bookshop, so it cost the same (within 13 pence if I remember rightly - about 8 cents or 30 pfennig (?)). Roger Hare From icon-group-sender Fri Jul 17 16:50:18 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA11906 for ; Fri, 17 Jul 1998 16:50:14 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA18627; Fri, 17 Jul 1998 16:49:58 -0700 From: pygmy@eskimo.com (Frank Sergeant) To: icon-group@baskerville.CS.Arizona.EDU Subject: Re: using Icon for database application Date: Fri, 17 Jul 1998 14:25:32 -0500 Reply-To: frank.sergeant@pobox.com Message-Id: In-Reply-To: Lines: 120 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 4593 My fooling around with Icon continues as I try to decide on the future direction of the database application (currently in Clipper) that I discussed earlier. Here is an update along with some additional questions. I have had the _Graphics Programming in Icon_ book for awhile and am enjoying it. I suppose I still do not fully appreciate some of the special/unique features of Icon. I guess that will come with time. Meanwhile, it looks like all the data processing can be done comfortably in Icon by using its simple features that I already understand. One appeal to me of Icon was that much of what I do in Clipper seems to map conveniently to Icon. For example, the arrays/lists in both are 1-based and can hold elements of mixed types, missing parameters default to Nil/&null, etc. That leaves two areas of concern: the GUI (under Windows) and TCP/IP socket connections (to communicate between the workstations and the server, both running Icon). GUI: I tried the TextDialog() function and at first thought it might be a show stopper. The appearance looked a little too Unixy and not enough like native Windows. By trying various color combinations and font sizes, however, I got something that I might be able to live with. I put up a simple example with 4 text entry fields and two buttons. Unfortunately, the tab key only moves among the 4 text fields and never gets to the buttons. Is there a way to add the buttons to the tab list? Also, the editing in the text fields was not at all what a Windows user would expect (home, end, high-lighted replacement, etc did not seem to work at all). I need to try it some more, but the first example I tried with VIB with 3 entry fields and a few buttons just didn't work right at all. I could click in one field with the mouse and see the I-bar cursor appear but when I started typing, the text appeared in a different entry field. Again, the editing didn't work and so forth. Anyway, for my database project, I might not want to build the screens with VIB. I think I would prefer to build them procedurally. The main reason is that the Clipper code is filled with "@ SAY GET" statements such as @ 10, 20 SAY "First Name" GET FNAME PICTURE "@!" and I might rather mechanically convert all of them to put up a "reasonable" entry form (and later make it prettier). So, I might not need VIB after all. If you think I'm overlooking some strong points of VIB, please enlighten me. Then I stumbled upon a mention of some native Windows features in Technical Report CS-97-9 "Version 9 of Icon for Microsoft Windows" on the UTSA site. I experimented a little with WinMenuBar(), WinScrollBar(), and WinButton() which all seem to work perfectly and give the conventional Windows sculpted appearance. I even understood how to attach events to the menu items and buttons. I tried WinEditRegion() but didn't fully understand how to work with it. The editing part did seem to work properly with home, end, high-lighted replacement, etc. However, I didn't see how to get out of it or how to make it into a single line edit field (or even a fixed multi line edit field), that is, I couldn't get rid of the scroll bars and couldn't "escape" from the edit region or see exactly how to tie it into the rest of the program. I haven't tried looking for the source for this. It might explain everything. Are there other native Windows widgets? Especially, a single line edit field? Anyway, I am now so close to seeing how I would do everything GUI-related that my application would need, that I feel sure the remaining pieces can either be found or worked around. SOCKETS: I gathered from some other postings that the Unix version has a socket interface and also a general mechanism for calling arbitrary external (e.g. C) routines but that the Windows version does not. (?) I tried looking briefly at the Icon source to see whether I might see how to add the socket routines and such. I decided now is not the time for me to try to do this. It reminded me of the joke I saw posted to comp.lang.python that went something like this: You have a problem. You say to yourself, "I know! I'll use Regular Expressions." Now you have two problems. Have I overlooked a way already built into Windows Icon to call an external routine? If so, that might solve the socket question. If not, I probably can wait on that and perhaps used a shared directory and let the processes communicate via files for the present. All comments and suggestions and criticisms welcomed. -- Frank frank.sergeant@pobox.com From icon-group-sender Mon Jul 20 08:13:34 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA20103 for ; Mon, 20 Jul 1998 08:13:31 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA19698; Mon, 20 Jul 1998 08:13:15 -0700 Date: Sun, 19 Jul 1998 21:16:59 -0500 Message-Id: <199807200216.VAA31067@segfault.cs.utsa.edu> From: Clinton Jeffery To: frank.sergeant@pobox.com Cc: icon-group@baskerville.CS.Arizona.EDU In-Reply-To: (pygmy@eskimo.com) Subject: Re: using Icon for database application Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3705 > Frank Sergeant wrote: > I tried the TextDialog()... > Unfortunately, the tab key only moves among the 4 text > fields and never gets to the buttons. Is there a way > to add the buttons to the tab list? This is a good question! TextDialog's author(s) can answer it better than I could. > the editing in the text fields was not at all what a Windows user > would expect (home, end, high-lighted replacement, etc > did not seem to work at all). Well, it is not native to Windows and was not written what that in mind. It would be possible to enhance the text vidgets to support more special keys, but no one is working on it that I know of. > Anyway, for my database project, I might not want to build the screens > with VIB. I think I would prefer to build them procedurally. You could certainly write a program to translate clipper codes into IPL calls to create the appropriate vidgets directly. We have also had success here in dynamically constructing VIB-compatible lists of strings in order to produce interfaces that are customized at runtime. To do this we started with a VIB interface and then added parameters to the VIB-generated code that are inserted into the list of interface component strings. > I tried WinEditRegion() but didn't fully understand... > I didn't see how to get out of it or how to make > it into a single line edit field (or even a fixed multi > line edit field) The facility is at present very simple and very general purpose. It was not intended to replace single-line text input vidgets. To use WinEditRegion you define a rectangle area on the screen in which the user can edit multiple lines of text. The program views the result as one big string. You can't "get out of it"; if it is part of a temporary interaction you can put it in a dialog, in its own temporary window, or resize it to be 0 pixels in size. > I couldn't see exactly how to tie it into the rest of the program. There is, deviously, no event produced during editing and no changes to the program's control flow as a result of editing; the user just changes the contents of the region when they feel like it. You can check a flag to tell if a region is modified, and you read the contents of the region (a string) via a single call to WinEditRegion(). A typical application might do this, for example, in response to a Save... menu option. The program wi.icn is an example. > Are there other native Windows widgets? Especially, > a single line edit field? One could be added. This is the first request I've had for it. All the native facilities presently supported are described in the Windows Icon technical report. This fall I should get an opportunity to look at what else might be added from Windows' core API. > I gathered from some other postings that the Unix version has a socket > interface and also a general mechanism for calling arbitrary external > (e.g. C) routines but that the Windows version does not. (?) This is correct. > Have I overlooked a way already built into Windows Icon > to call an external routine? No, there is no external interface at present. I would love it if someone would implement loadfunc() for Windows. I've had 2-3 rumors of projects that might include such an effort, but nothing concrete. My own plans include porting most or all of Unicon to Windows (Unicon's easy network facilities should be reasonably easy to port), but I have no immediate plans to work on an external interface until a student volunteers to help do it. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Mon Jul 20 08:13:41 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA20109 for ; Mon, 20 Jul 1998 08:13:40 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21274; Mon, 20 Jul 1998 08:13:24 -0700 Message-Id: From: "Hall, Joe T (Joe)" To: icon-group@optima.CS.Arizona.EDU Subject: New graphics book Date: Mon, 20 Jul 1998 09:19:44 -0500 Mime-Version: 1.0 X-Mailer: Internet Mail Service (5.5.1960.3) Content-Type: text/plain Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 487 I think that Chapter 2 of the new graphics books is the very best and most concise description of Icon I've every read. _______________________________________________________________ Lucent Technologies O Bell Labs Innovations Joe T. Hall Distinguished Member of Technical Staff Ph: 630-713-1237 Flexent Architecture & Estimation Fax: 630-713-3888 Email: jthall@lucent.com _______________________________________________________________ From icon-group-sender Mon Jul 20 12:38:50 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA12033 for ; Mon, 20 Jul 1998 12:38:49 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07615; Mon, 20 Jul 1998 12:38:34 -0700 From: Kostas Oikonomou Date: Mon, 20 Jul 1998 15:35:07 -0400 (EDT) To: icon-group@optima.CS.Arizona.EDU Subject: Reading numbers from a file X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-Id: <13747.39630.559540.280143@mara> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 484 Hello, This is probably a dumb question, but there doesn't seem to be an easy way to read a numbers from a file with Icon. I mean a file consisting of lines, each line being a list of numbers (integers or reals), separated by blanks. I finally wrote my own routine, but I don't want to reinvent thw wheel... (I looked in the procs/ library, and found pack/unpack in binary.icn. But I don't see how to get unpack to do what I want.) Thanks for your help. Kostas Oikonomou From icon-group-sender Mon Jul 20 12:38:33 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA12025 for ; Mon, 20 Jul 1998 12:38:32 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA18623; Mon, 20 Jul 1998 12:38:17 -0700 Date: Mon, 20 Jul 1998 08:39:20 -0700 From: Ralph Griswold Message-Id: <9807201539.AA00844@jupiter.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU, jthall@lucent.com Subject: Re: New graphics book Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 215 Thanks for your nice remark about chapter 2 of the Icon graphics programming book (wrote that chapter myself). Would you consider adding your thoughts to be "reader's comments" for the book on amazon.com? Ralph From icon-group-sender Wed Jul 22 09:36:58 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id JAA02246 for ; Wed, 22 Jul 1998 09:36:57 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA18600; Wed, 22 Jul 1998 09:36:41 -0700 From: dae_alt@juno.com To: icon-group@optima.CS.Arizona.EDU Date: Tue, 21 Jul 1998 17:41:48 PDT Subject: Prior Messages Message-Id: <19980721.174149.3439.0.dae_alt@juno.com> X-Mailer: Juno 1.49 X-Juno-Line-Breaks: 0-8 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 409 Hello: Is there a place on the web to look at previous messages from icon-group? As a newbie to Icon, most likely my question have been asked and answered. Thanks. _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866] From icon-group-sender Wed Jul 22 13:51:31 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id NAA20629 for ; Wed, 22 Jul 1998 13:51:30 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA20771; Wed, 22 Jul 1998 13:51:14 -0700 Date: Wed, 22 Jul 1998 10:15:36 -0700 From: Ralph Griswold Message-Id: <9807221715.AA04959@jupiter.CS.Arizona.EDU> To: dae_alt@juno.com, icon-group@optima.CS.Arizona.EDU Subject: Re: Prior Messages Cc: slm@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 208 You can get prior messages to icon-group from either our ftp or web sites. For the web, connect to http://www.cs.arizona.edu/icon/ftp/newsgrp You'll see message by year and for recent years, subsection. From icon-group-sender Wed Jul 22 13:51:48 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id NAA20647 for ; Wed, 22 Jul 1998 13:51:48 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA23494; Wed, 22 Jul 1998 13:51:32 -0700 From: pygmy@eskimo.com (Frank Sergeant) To: icon-group@baskerville.CS.Arizona.EDU Subject: Re: using Icon for database application Date: Wed, 22 Jul 1998 15:03:02 -0500 Reply-To: frank.sergeant@pobox.com Message-Id: <2Vkt1Yv1uQST084yn@eskimo.com> Lines: 126 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 5611 Oh, I've been moving slowly. I think I got too excited seeing the native W95 menus and buttons working and unjustifiably thought everything else would work out also. I overlooked the text entry fields, the picklists, and so forth. TextDialog() as well as VIB seem useless to me at the moment. Perhaps I could dive into the Icon source code and modify TextDialog() to work the way I want. Ditto for implementing native text entry fields etc based upon the current interface to native buttons. However, from the brief glance I gave the code a few weeks ago I think I just do not want to take on what may be such a large and possibly fruitless task. I believe Clint has confirmed that winicon does not have a built-in method of calling external C routines, so that makes adding other native W95 widgets (and sockets) more difficult. I have been almost ready to give up Icon for this project (but glad to keep it available for plain text processing). However, I see two possibilities that remain for using winicon. The first is to write my own widgets using the built-in Icon graphics routines. That is, instead of trying to call native W95 widgets, I just "draw" them on the screen myself, position the cursor explicitly, catch each keystroke, etc. etc. This could well be easier than trying to figure out the interface to Windows and the Icon source code. This might be a reasonable approach. It still leaves the question of socket access. I think I could write a tiny program in C that handles the socket connection and communicates with the Icon process via a shared disk file. This would seem to be an acceptable work around until winicon gets socket support. The other possibility is to decide to let web browsers handle the user interface. Then, I'm back to being able to use Icon in purely text mode. It can generate the HTML to send via the web server to the browser. My book on JavaScript arrived yesterday. Using an older MSIE browser to view some of the book's examples makes me think this just might work. JavaScript seems to let me catch the keystroke events (I really want my users to be able to do with keystrokes everything they can now do with keystrokes!) and generate my own 'submit' requests, rather than requiring the user to click on 'submit'. Anyway, the examples didn't look too bad. I've downloaded a newer Netscape which I'll try to install later today and then take another look at the JavaScript examples. The buttons, picklists, text entry fields, and so forth looked pretty good under MSIE. The fonts were ugly, but perhaps they could be changed. The browser's own tool bar and menu bar still took up far too much screen real estate but I think (from the JavaScript book) that I can create a full-screen window. In my depression (following my earlier elation) over Icon, I've reconsidered VO (Computer Assoicates' Visual Objects), Delphi, Python with Tk, Python with a COM interface to Delphi, Object REXX, a raw C engine that reads the widget information from a text file (which Icon could then write), etc. Object REXX is definitely out. The examples I tried were too slow even on a P166 with 48MB RAM and a copy of the Object REXX run-time would need to be purchased for each machine in each customer's office. To hell with that. I probably could learn VO or Delphi eventually. VO looks better but I found periodic slow-downs when browsing over the network that seem unacceptable (and unexplainable). The Python COM Delphi might produce very pretty screens but is a whole 'nuther learning experience I'd rather avoid. I may decide that Python with Tk is fast enough after all. At least Python has sockets built in (as I understand it). I don't really want to build my own GUI engine in raw C. The graphapp C GUI library looks good so that's still a possibility. JPython (Python written in Java, and so having access to the Java GUI widgets) is another possibility. I guess I'll try to push further with JavaScript/Icon and possibly the Python/Tk and see what happens. > I suppose what I'm finding odd for me is that I usually > use icon because of the way it handles text, not > because of its graphics capabilities. So, we have a terrible inversion. (Well, perhaps only I have it). Would should be the difficult/important part of the application (the actual data processing) is very easy. Would should be the trivial part (put up the GUI) is a nightmare of endless "gotchas". > You might also find the zero notation useful (end of > record, line, whatever) if you have data kept in a list > of varying length. Yes, I love that in Icon. Python is zero-based and so cannot use 0 as the end of list indicator. Other than that, Python's array/list/dictionary handling looks very much like Icon's (to my untrained eye). Of course, since my Clipper code is already one-based, it would be less error prone to move to one-based Icon rather than to zero-based Python. > Anyway, I was glad to see your post to the icon-group. > I think we should see some work soon on the problem out > of Arizona and Texas. My understanding is that the > Arizona group did most of the work on vib. Disclaimer: This post is meant mostly to express my current state of mind (it is possible this state of mind was affected somewhat by working until very late last night and then awakening to customer problems early this morning). No offense is meant to the hard working, good natured, helpful Icon and Python people. All suggestions, comments, criticisms cheerfully received either by posting or direct email. -- Frank frank.sergeant@pobox.com From icon-group-sender Wed Jul 22 17:37:52 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id RAA27739 for ; Wed, 22 Jul 1998 17:37:51 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA04329; Wed, 22 Jul 1998 17:37:35 -0700 Message-Id: <3.0.5.32.19980722163020.00a5fbc0@post.its.mcw.edu> X-Sender: cdt@post.its.mcw.edu X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 22 Jul 1998 16:30:20 To: Kostas Oikonomou , icon-group@optima.CS.Arizona.EDU From: Chris Tenaglia Subject: Re: Reading numbers from a file In-Reply-To: <13747.39630.559540.280143@mara> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1212 try a variation of this: ------------------------------ # # read space delimited lines of numbers # procedure main() while line := read() do { numbers := parse(line,' ') #split the line into numbers every value := !numbers do process(value) # process each number } end # # parse a string into a list with respect to a delimiter # procedure parse(line,delims) static chars chars := &cset -- delims tokens := [] line ? while tab(upto(chars)) do put(tokens,tab(many(chars))) return tokens end # # whatever # procedure process(n) .......... end ----------------------------------- At 03:35 PM 7/20/98 -0400, Kostas Oikonomou wrote: > >Hello, > >This is probably a dumb question, but there doesn't seem to be an easy way to >read a numbers from a file with Icon. I mean a file consisting of lines, each >line being a list of numbers (integers or reals), separated by blanks. > >I finally wrote my own routine, but I don't want to reinvent thw wheel... > >(I looked in the procs/ library, and found pack/unpack in binary.icn. But I >don't see how to get unpack to do what I want.) > >Thanks for your help. > > Kostas Oikonomou > > From icon-group-sender Tue Jul 28 16:33:27 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA08147 for ; Tue, 28 Jul 1998 16:33:26 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28615; Tue, 28 Jul 1998 16:33:09 -0700 From: dae_alt@juno.com To: icon-group@optima.CS.Arizona.EDU Date: Tue, 28 Jul 1998 14:32:18 PDT Subject: Xcode puzzlement Message-Id: <19980728.143221.2807.0.dae_alt@juno.com> X-Mailer: Juno 1.49 X-Juno-Line-Breaks: 0-2,4-65 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1483 To Icon user group: I cannot figure this out. Program 1 writes to disk and reads from disk the file 'xstore', which it uses in xdecode(). Program 2 reads the same file as Program 1, but xdecode() fails. (Run Program1 first, to create the disk file 'xstore') Help! #--------------------------------------------- #program1.icn link xcode record testit( a,b,c) procedure main() #write it f := open("xstore","w") x := testit() x.a := "doug" x.b := 34 x.c := "mardi gras" xencode(x,f) close(f) #read it g := open("xstore") y := xdecode(g) \y | stop("y is null") close(g) write(y.a) write(y.b) write(y.c) end #--------------------------------------------- #program2.icn link xcode record testit( a,b,c) procedure main() #write it # f := open("xstore","w") # x := testit() # x.a := "doug" # x.b := 34 # x.c := "mardi gras" # xencode(x,f) # close(f) #read it g := open("xstore") y := xdecode(g) \y | stop("y is null") close(g) write(y.a) write(y.b) write(y.c) end #----------------------------------- I have no idea why xdecode() fails in program2. The code is identical to that in program1 - Doug Edmunds - edmunds@ethergate.com --- END OF REAL MESSAGE --- (Don't bother to read past here) _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866] From icon-group-sender Wed Jul 29 16:48:56 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA22260 for ; Wed, 29 Jul 1998 16:48:55 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22653; Wed, 29 Jul 1998 16:48:38 -0700 Date: Wed, 29 Jul 1998 15:34:00 -0700 From: Sandy Miller Message-Id: <9807292234.AA25219@kingfisher.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Subject: moderator on vacation Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: NrzGn1zYZvFn8i+R6M6kpQ== Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 247 I will be on vacation from Thursday, July 29 until Monday, August 10. There will be nobody moderating the incoming icon-group and forwarding it to the mailing list until I return. I hope this doesn't cause any major problems for anyone. -sandy From icon-group-sender Mon Aug 10 09:00:05 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA06286 for ; Mon, 10 Aug 1998 09:00:05 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01042; Mon, 10 Aug 1998 08:59:44 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 7 Aug 1998 05:30:55 GMT From: jeffery@cs.utsa.edu (Clinton Jeffery) Message-Id: <6qe3ef$kr8$1@ringer.cs.utsa.edu> Organization: The University of Texas at San Antonio Sender: icon-group-request@optima.CS.Arizona.EDU References: <35C9CEBC.4C1B@wi.net> Reply-To: jeffery@cs.utsa.edu Subject: Re: Learning Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 553 J W Tatay (jwtatay@wi.net) wrote: : If anyone has links to pages about learning icon please reply. See John Shipman's tutorial (www.nmt.edu/tcc/help/lang/icon/) and Dave Hanson's introduction (www.cs.arizona.edu/icon/intro.htm) Note that these webpages are also provided with Windows Icon in Windows Help format; Windows Icon is at ftp://ringer.cs.utsa.edu/pub/icon/nt/binaries/winicon.zip -- Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Mon Aug 10 09:00:16 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA06289 for ; Mon, 10 Aug 1998 09:00:16 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01050; Mon, 10 Aug 1998 08:59:55 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Mon, 10 Aug 1998 11:34:28 -0400 From: Steve Holden Message-Id: <35CF1303.E048B09E@bellatlantic.net> Organization: Bell Atlantic Internet Solutions Sender: icon-group-request@optima.CS.Arizona.EDU Reply-To: sholden@bellatlantic.net Subject: Help wanted with SPARC linux implementation Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 628 If there's anyone involved with the Icon language still reading this list (;-) I'd be glad of some help with a port to SPARC linux. I've got the basic complilation done, and can "make Samples", but "make Tests" shows up some pretty serious errors with the floating-point arithmetic -- not an area I would have expected trouble. It's probably to do with the dumb way I've patched the Intel Linux implementation. I am NOT a SPARC assembly language programmer... For the record, I'm running on a SPARCstation LX under Red Hat Linux 4.2 (with 5.1 on the way soon, if that is likely to help). regards Steve Holden Holden Web From icon-group-sender Mon Aug 10 08:59:53 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA06204 for ; Mon, 10 Aug 1998 08:59:52 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01020; Mon, 10 Aug 1998 08:59:31 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Thu, 06 Aug 1998 10:41:48 -0500 From: J W Tatay Message-Id: <35C9CEBC.4C1B@wi.net> Organization: Inc.Net http://www.inc.net Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Learning Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 122 Hello. If anyone has links to pages about learning icon please reply. Thank You. August 8 1998 CE 10 37 00 CDT EST From icon-group-sender Wed Aug 12 12:27:29 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA18912 for ; Wed, 12 Aug 1998 12:27:29 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03728; Wed, 12 Aug 1998 12:27:08 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Wed, 12 Aug 1998 08:26:19 -0400 From: Steve Holden Message-Id: <35D189EA.10AA320A@bellatlantic.net> Organization: Bell Atlantic Internet Solutions Sender: icon-group-request@optima.CS.Arizona.EDU Reply-To: sholden@bellatlantic.net Subject: SPARC linux arithmetic error Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1297 This is a multi-part message in MIME format. --------------AD5DCC7A639DF857AED33B1B Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Would someone with access to a sun_* implementation let me know if they see an error running a standard test program. I am comparing the output of the "numeric" test and see problems with the modulo operator: Running numeric Checking numeric 59,60c59,60 < 36 % -7 ----> 6 < -36 % -7 ----> -6 --- > 36 % -7 ----> 1 > -36 % -7 ----> -1 Any suggestions gratefully received. I would be especially interested in hearing from other SPARC Linux users - not a major market for Red Hat just yet, I suspect :-) regards Steve --------------AD5DCC7A639DF857AED33B1B Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Steve Holden Content-Disposition: attachment; filename="vcard.vcf" begin: vcard fn: Steve Holden n: Holden;Steve org: Holden Web adr: 10908 Justin Knoll Road;;;Oakton;VA;22124-1006;USA email;internet: sholden@bellatlantic.net x-mozilla-cpt: ;0 x-mozilla-html: FALSE version: 2.1 end: vcard --------------AD5DCC7A639DF857AED33B1B-- From icon-group-sender Thu Aug 20 08:32:54 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id IAA07359 for ; Thu, 20 Aug 1998 08:32:54 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA08139; Thu, 20 Aug 1998 08:32:31 -0700 Message-Id: <199808200556.FAA26562@out1.ibm.net> X-Sender: usinet.laturk@pop5.ibm.net X-Mailer: QUALCOMM Windows Eudora Pro Version 4.0 Date: Thu, 20 Aug 1998 00:50:38 +0700 To: icon-group@optima.CS.Arizona.EDU From: "Dr. Louis A. Turk" Subject: Graphics Book and getch() and Word Processor Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1461 The day before yesterday my copy of Graphics Programming In Icon arrived. The reason I ordered this book is because I have a command line Icon concordance program that writes to screen lines of text containing a chosen word; this program needed to use a different font so as to be able to put more characters on a line. I am happy to report that converting my program to Icon windows so it could do that only took a few hours including the time spent in reading the book, once I had it. It is a very interesting, easy to understand book. The CD ROM that came with the book is a great source of tools and help. I was able to install MS Windows Icon in just a few minutes. Wi is easy to use, and on line help (language reference, etc.) is immediately available. I did experience one problem: getch() did not compile under Icon windows. Is there a reason for this? I changed getch() to read() for a quick fix, but that requires a carriage return. Also, I am wondering if anyone has written a word processor in Icon? Icon seems to be perfect for such a project. I have a few specialized functions I would like to add to a word processor for my own personal use, but I am afraid that I don't have the knowledge or time to create a word processor from scratch. Or would even that be fast and easy in Icon, with perhaps a little help from the experts on this list? Any advice, directions, or comments would be appreciated. Thanks, Louis Turk From icon-group-sender Fri Aug 21 16:24:42 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id QAA09140 for ; Fri, 21 Aug 1998 16:24:42 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA12580; Fri, 21 Aug 1998 16:24:19 -0700 Date: Fri, 21 Aug 1998 10:01:16 -0500 (CDT) From: Ray Pereda X-Sender: rpereda@pandora To: "Dr. Louis A. Turk" Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Graphics Book and getch() and Word Processor In-Reply-To: <199808200556.FAA26562@out1.ibm.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 674 On Thu, 20 Aug 1998, Dr. Louis A. Turk wrote: > Also, I am wondering if anyone has written a word processor in Icon? Icon > seems to be perfect for such a project. I have a few specialized functions > I would like to add to a word processor for my own personal use, but I am > afraid that I don't have the knowledge or time to create a word processor > from scratch. Or would even that be fast and easy in Icon, with perhaps a > little help from the experts on this list? Any advice, directions, or > comments would be appreciated. I remember seeing a word processor written by Bob Alexander. I can't find it right now though. Check out the Icon web page. -ray From icon-group-sender Fri Aug 21 16:24:54 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id QAA09171 for ; Fri, 21 Aug 1998 16:24:53 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA12654; Fri, 21 Aug 1998 16:24:31 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Fri, 21 Aug 1998 16:17:32 BST From: Bob Ardler Message-Id: Organization: ArgoNet, but does not reflect its views Sender: icon-group-request@optima.CS.Arizona.EDU Reply-To: Bob Ardler Subject: Acorn Icon: anyone alive out there? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 543 Acorn-specific documentation? Giovanni Lo Conti has done a port to ACORN-ARCHIMEDES of Icon v9.3 which works well on the v8 programs I've tried. It comes with the usual U. of Arizona general documents but I can't find anything Acorn-specific. Anyone know? Anyone tried Wimp programming in Icon? -- __ __ __ __ __ __ ___ _____________________________________________ |__| R G O N E | / | | Bob | /...Internet access for all Acorn RISC machines ___________________________/ ardler@argonet.co.uk From icon-group-sender Mon Aug 24 09:08:44 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id JAA03330 for ; Mon, 24 Aug 1998 09:08:44 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA14216; Mon, 24 Aug 1998 09:08:20 -0700 Message-Id: <2.2.32.19980822053809.003390d8@pop5.ibm.net> X-Sender: usinet.laturk@pop5.ibm.net (Unverified) X-Mailer: Windows Eudora Pro Version 2.2 (32) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Sat, 22 Aug 1998 00:38:09 -0500 To: icon-group@optima.CS.Arizona.EDU From: "Dr. Louis A. Turk" Subject: Why doen't this work? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1859 Can anybody tell me why this code only removes CR/LF's every other paragraph that contains them? Why does it skip a paragraph? Louis Obviously, there will be more to this program, once I get past this problem. ############################################################################ ############# # # HTML TO Nota Bene 4.5 FILTER # Ver. 1.0 Aug. # Programmer: Louis A. Turk # # USE: Coverts HTML to Note Bene using two passes. FIRST PASS: # 1. Removes the CR/LF's between

and

# 2. Removes the CR/LF's between
    and
and also removes right indention. # SECOND PASS: # 3. Replaces all HTML code with Nota Bene code. # ############################################################################ ############## link graphics procedure main(arg) WOpen("size=1005,850") infile := arg[1] outfile := arg[2] tempfile := "temp3.txt" in := open(infile,"r") | stop("Can't open file: ",in) out := open(outfile,"w") | stop("Can't open file: ",out) tmp := open(tempfile,"c") | stop("Can't open file: ",tmp) #### FIRST PASS: REMOVE EXCESS CR/LF's ###################################### while line := read(in) do { if find(line,"

") then { # Beginning of defective code WWrites(line," ") writes(tmp,line," ") until find(line := read(in),"

") do { WWrites(line," ") writes(tmp,line," ") } WWrite(line) write(tmp,line) } else if find(line,"
    ") then { WWrites(line," ") writes(tmp,line," ") until find(line := read(in),"
") do { WWrites(line," ") writes(tmp,line," ") } WWrite(line) write(tmp,line) } # End of defective code else { WWrite(line) write(tmp,line) } } ##### SECOND PASS: ####################################### Event() end From icon-group-sender Mon Aug 24 09:08:17 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id JAA03321 for ; Mon, 24 Aug 1998 09:08:17 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13229; Mon, 24 Aug 1998 09:07:54 -0700 Message-Id: <35DE42C1.CFE616E2@ix.netcom.com> Date: Sat, 22 Aug 1998 00:02:09 -0400 From: Phillip Lee Thomas Reply-To: thomaspl@acm.org X-Mailer: Mozilla 4.05 [en] (Win95; U) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Graphics Book and getch() and Word Processor References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Content-Transfer-Encoding: 7bit Status: RO Content-Length: 538 Ray Pereda wrote: > On Thu, 20 Aug 1998, Dr. Louis A. Turk wrote: > > > Also, I am wondering if anyone has written a word processor in Icon? Icon > > seems to be perfect for such a project. I have a few specialized functions Other than the windows version in the Icon Programming Library, I wrote an experimental word processor. The code is in the one of the last two ICEBOL conference volumes. It was designed for use with structured data (e.g., poems) and was tuned to the natural language which, in my case was Malay. Phillip From icon-group-sender Mon Aug 24 09:09:08 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id JAA03355 for ; Mon, 24 Aug 1998 09:09:07 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA14276; Mon, 24 Aug 1998 09:08:44 -0700 Message-Id: <35DFEDF3.1E73@cauchy.demon.co.uk> Date: Sun, 23 Aug 1998 11:24:51 +0100 From: Steve Harborne Organization: Science is only a theory X-Mailer: Mozilla 3.01Gold (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Release Notes for Icon Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Content-Transfer-Encoding: 7bit Status: RO Content-Length: 517 I am a large user of Icon and have a large number of C-extensions and I have being converting from one version of the language to another. I rely very much on the low-level functionality you provide. I wondered if there were any detailed release notes that quantified all the low-level changes to the language at each release. Most of the changes have no effect on user functionality but do have an effect at the developer level. Regards Steve Harborne --------------------------------- Science is only a theory From icon-group-sender Tue Aug 25 08:21:48 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id IAA16983 for ; Tue, 25 Aug 1998 08:21:48 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA15430; Tue, 25 Aug 1998 08:21:24 -0700 Message-Id: <35E20EF3.6DAEA82A@ix.netcom.com> Date: Mon, 24 Aug 1998 21:10:12 -0400 From: Phillip Lee Thomas Reply-To: thomaspl@acm.org X-Mailer: Mozilla 4.05 [en] (Win95; U) Mime-Version: 1.0 To: "Dr. Louis A. Turk" , icon-group@optima.CS.Arizona.EDU Subject: Re: Why doen't this work? References: <2.2.32.19980822053809.003390d8@pop5.ibm.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Content-Transfer-Encoding: 7bit Status: RO Content-Length: 3736 I'd have to see how this works against a piece of text, but you have a problem in the first few lines if a single line has the shape:

some text

as you write this line out and then read in further lines until you find one ending in

. Looking at this rather briefly, I would think you would produce a number of lines glued together as "

some text

some more text and some more and

something that meets condition 2

". Secondly, HTML glues the whole thing together for parsing purposes so it is quite possible that in a single input line you could get several "

...

" sequences. I suggest that you read the whole document in with a single reads() if this doesn't blow your memory. Then use map(line,"\n"," ") to convert new lines to spaces, and finally do a string scan along the line, chopping off pieces as you go: megaline ? { while line :=tab(find("

")) do { line ||:= tab(find("

") +4) write(out, line) } # while in

...

} # while scan You'd have to fiddle a bit with this but it's close to being right. Sound possible? Phillip Thomas Dr. Louis A. Turk wrote: > Can anybody tell me why this code only removes CR/LF's every other paragraph > that contains them? Why > does it skip a paragraph? > > Louis > > Obviously, there will be more to this program, once I get past this problem. > > ############################################################################ > ############# > # > # HTML TO Nota Bene 4.5 FILTER > # Ver. 1.0 Aug. > # Programmer: Louis A. Turk > # > # USE: Coverts HTML to Note Bene using two passes. FIRST PASS: > # 1. Removes the CR/LF's between

and

> # 2. Removes the CR/LF's between
    and
and also removes right > indention. > # SECOND PASS: > # 3. Replaces all HTML code with Nota Bene code. > # > ############################################################################ > ############## > > link graphics > > procedure main(arg) > > WOpen("size=1005,850") > > infile := arg[1] > outfile := arg[2] > tempfile := "temp3.txt" > > in := open(infile,"r") | stop("Can't open file: ",in) > out := open(outfile,"w") | stop("Can't open file: ",out) > tmp := open(tempfile,"c") | stop("Can't open file: ",tmp) > > #### FIRST PASS: REMOVE EXCESS CR/LF's > ###################################### > > while line := read(in) do { > if find(line,"

") then { # Beginning of > defective code > WWrites(line," ") > writes(tmp,line," ") > until find(line := read(in),"

") do { > WWrites(line," ") > writes(tmp,line," ") > } > WWrite(line) > write(tmp,line) > } > else if find(line,"
    ") then { > WWrites(line," ") > writes(tmp,line," ") > until find(line := read(in),"
") do { > WWrites(line," ") > writes(tmp,line," ") > } > WWrite(line) > write(tmp,line) > } # End of defective > code > else { > WWrite(line) > write(tmp,line) > } > > } > ##### SECOND PASS: ####################################### > Event() > end From icon-group-sender Tue Aug 25 16:22:31 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id QAA16662 for ; Tue, 25 Aug 1998 16:22:31 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA16002; Tue, 25 Aug 1998 16:22:07 -0700 Message-Id: <35E322BE.6889D8C@charlie.cns.iit.edu> Date: Tue, 25 Aug 1998 15:46:54 -0500 From: "Thomas W. Christopher" Organization: Illinois Institute of Technology X-Mailer: Mozilla 4.05 [en] (WinNT; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Icon Programming Language Hanbook available on line Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Content-Transfer-Encoding: 7bit Status: RO Content-Length: 641 I have placed my Icon Programming Language Handbook on-line in .PDF format for personal use. (That is, you may run of single copies for individual use; no mass production without permission please.) You can get it from my company web site: http://www.toc-press.com/freesoftware.htm This is a Beta edition. Please report all errors to me. (Make it easy on me: include the page number where you found the bug.) Thanks for your help. -- Thomas W. Christopher -- tc@charlie.cns.iit.edu , tc@toc-press.com Principal, Tools of Computing LLC. -- http://www.toc-press.com Associate Prof., Illinois Inst. of Tech. -- http://www.iit.edu/~tc From icon-group-sender Fri Aug 28 13:11:48 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id NAA02870 for ; Fri, 28 Aug 1998 13:11:47 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA19641; Fri, 28 Aug 1998 13:11:22 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Fri, 28 Aug 1998 16:59:49 BST From: Bob Ardler Message-Id: Organization: ArgoNet, but does not reflect its views Sender: icon-group-request@optima.CS.Arizona.EDU Reply-To: Bob Ardler Subject: A hood fan is guard to mind. Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2161 As long as nobody reads this newsgroup, I might as well ask somnolent iconians whether the following program, for generating polyspoonerisms, can be shortened by icon clever stuff. The nested "every"s seem reminiscent of lesser languages:- procedure main() L := ["g","m","h","f"] every h:=1 to 4 do { every i:=1 to 4 do { every j:=1 to 4 do { every k:=1 to 4 do { write(fit(h,i,j,k)) }}}} end global L,h,i,j,k procedure fit(a,b,c,d) if a=b|a=c|a=d|b=c|b=d|c=d then fail return "A "||L[a]||"ood "||L[b]||"an is "||L[c]||"ard to "||L[d]||"ind." end Of the generated spoonerisms, only the following, with suitably amended spelling, appear to be viable:- A good man is hard to find. A mood fan is guard to hind. A good man is fard to hind. A hood man is guard to find. A good fan is marred to hind. A hood fan is guard to mind. A good fan is hard to mind. A food man is guard to hind. Malheureusement, ca ne marche point en francais:- Un bon homme est difficile a trouver. Un bon homme est tifficile a drouver. Un bon domme est hifficile a trouver. Un bon domme est tifficile a hrouver. Un bon tomme est hifficile a drouver. Un bon tomme est difficile a hrouver. Un hon bomme est difficile a trouver. Un hon bomme est tifficile a drouver. Un hon domme est bifficile a trouver. Un hon domme est tifficile a brouver. Un hon tomme est bifficile a drouver. Un hon tomme est difficile a brouver. Un don bomme est hifficile a trouver. Un don bomme est tifficile a hrouver. Un don homme est bifficile a trouver. Un don homme est tifficile a brouver. Un don tomme est bifficile a hrouver. Un don tomme est hifficile a brouver. Un ton bomme est hifficile a drouver. Un ton bomme est difficile a hrouver. Un ton homme est bifficile a drouver. Un ton homme est difficile a brouver. Un ton domme est bifficile a hrouver. Un ton domme est hifficile a brouver. Dormez bien, mes amis, Bob. -- __ __ __ __ __ __ ___ _____________________________________________ |__| R G O N E | / | | Bob | /...Internet access for all Acorn RISC machines ___________________________/ ardler@argonet.co.uk From icon-group-sender Fri Aug 28 13:10:42 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id NAA02753 for ; Fri, 28 Aug 1998 13:10:42 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA19576; Fri, 28 Aug 1998 13:10:17 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Fri, 28 Aug 1998 16:13:32 GMT From: gcavazos@yahoo.com Message-Id: <6s6kvc$lrd$1@nnrp1.dejanews.com> Organization: Deja News - The Leader in Internet Discussion Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Club created for Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 406 I have created a club at Yahoo, so people can go leave posts, chat with persons interested in Icon, also, you can post links, etc. The address is: http://clubs.yahoo.com/clubs/iconprogramminglanguage I hope everyone enjoys this forum... Regards Gustavo... -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum From icon-group-sender Fri Aug 28 13:11:54 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id NAA02894 for ; Fri, 28 Aug 1998 13:11:54 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA19675; Fri, 28 Aug 1998 13:11:30 -0700 Date: Fri, 28 Aug 1998 10:40:49 -0700 From: Gregg Townsend Message-Id: <9808281740.AA29523@hawk.CS.Arizona.EDU> To: icon-group Subject: Announcing Version 2 of Jcon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 810 We are pleased to announce the availability of Version 2 of Jcon. Jcon is a new Java-based implementation of the Icon programming language. The Jcon translator, written in Icon, generates Java class files that execute in conjunction with a run-time system written in Java. Version 2 of Jcon is an essentially complete implementation of Icon, including graphics and large integers. A few minor features are missing -- mostly things like chdir() that cannot be done in Java. The performance of Version 2 is considerably improved over Version 1, although it still isn't as fast as the standard Icon interpreter. For more information, or to download Jcon, go to our web page: http://www.cs.arizona.edu/icon/jcon/ -- Gregg Townsend, The University of Arizona Todd Proebsting, Microsoft Research From icon-group-sender Fri Aug 28 13:12:14 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id NAA02925 for ; Fri, 28 Aug 1998 13:12:14 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA19771; Fri, 28 Aug 1998 13:11:49 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 28 Aug 1998 13:58:54 -0400 From: clayton@jazz.cc.gatech.edu (R. Clayton) Message-Id: Organization: College of Computing, Georgia Tech Sender: icon-group-request@optima.CS.Arizona.EDU Subject: A prooner spogram. Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1313 ja cat t.icn procedure main() every p := perms(set(["g","m","h","f"])) do write("A ", p[1], "ood ", p[2], "an is ", p[3], "ard to ", p[4], "ind.") end # main procedure perms(letters) if *letters = 0 then suspend "" else every l := !letters do every suspend l || perms(delete(copy(letters), l)) end # perms ja icont t.icn Translating: t.icn: main perms No errors Linking: ja ./t A hood man is gard to find. A hood man is fard to gind. A hood gan is mard to find. A hood gan is fard to mind. A hood fan is mard to gind. A hood fan is gard to mind. A mood han is gard to find. A mood han is fard to gind. A mood gan is hard to find. A mood gan is fard to hind. A mood fan is hard to gind. A mood fan is gard to hind. A good han is mard to find. A good han is fard to mind. A good man is hard to find. A good man is fard to hind. A good fan is hard to mind. A good fan is mard to hind. A food han is mard to gind. A food han is gard to mind. A food man is hard to gind. A food man is gard to hind. A food gan is hard to mind. A food gan is mard to hind. ja Why I wrote this program in five minutes instead of one minute: I deleted l from letters itself instead of from a copy of letters. From icon-group-sender Mon Aug 31 09:29:15 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id JAA00967 for ; Mon, 31 Aug 1998 09:29:15 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21360; Mon, 31 Aug 1998 09:28:50 -0700 Message-Id: <35E814C9.A0E6FEBC@charlie.cns.iit.edu> Date: Sat, 29 Aug 1998 09:48:41 -0500 From: "Thomas W. Christopher" Organization: Illinois Institute of Technology X-Mailer: Mozilla 4.06 [en] (WinNT; I) Mime-Version: 1.0 To: "icon-group@CS.Arizona.EDU" Subject: Spoonerisms Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Content-Transfer-Encoding: 7bit Status: RO Content-Length: 614 Bob Ardler, Your spoonerism program can be obfuscated a bit as follows: procedure main() L := ["g","m","h","f"] every h:=1 to 4 & i:=1 to 4 & j:=1 to 4 & k:=1 to 4 do { write(fit(h,i,j,k)) } end global L procedure fit(a,b,c,d) if a=(b|c|d)|b=(c|d)|c=d then fail return "A "||L[a]||"ood "||L[b]||"an is "||L[c]||"ard to "||L[d]||"ind." end Although Clayton's solution is the best so far. -- Thomas W. Christopher -- tc@charlie.cns.iit.edu , tc@toc-press.com Principal, Tools of Computing LLC. -- http://www.toc-press.com Associate Prof., Illinois Inst. of Tech. -- http://www.iit.edu/~tc From icon-group-sender Mon Aug 31 09:28:25 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id JAA00752 for ; Mon, 31 Aug 1998 09:28:25 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21311; Mon, 31 Aug 1998 09:28:00 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Fri, 28 Aug 1998 21:36:12 -0400 From: Jules Gilbert Message-Id: <35E75B0B.142E9658@aasp.net> Organization: Synbolic Mechanics Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Icon, OS/2, and interfacing C code Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 693 Hello: I use Icon under OS/2 and I am interested in interfacing some Icon code to a C program. I don't have the (obsolete) CSET/2 compiler, nor the Visual Age stuff. Instead, I use EMX/GCC and various other commercial products. So, is this possible? Will my application live? Hello? Icon is a really great language, too. Is their anyone interested in building an Icon to MAINTAINABLE C source code converter with me. I once built (and still have) a Snobol to C source code converter, designed to translate the Snobol source generated via the Rebus product into C source, again MAINTAINABLE C. Thank you, Please respond to both this group and me. I am jules@aasp.net Thank you! From icon-group-sender Mon Aug 31 09:29:09 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id JAA00909 for ; Mon, 31 Aug 1998 09:29:08 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21342; Mon, 31 Aug 1998 09:28:43 -0700 From: gep2@computek.net Date: Sat, 29 Aug 1998 01:50:56 -0500 Message-Id: <199808290650.BAA28892@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: A hood fan is guard to mind. To: icon-group@optima.CS.Arizona.EDU In-Reply-To: X-Mailer: SPRY Mail Version: 04.00.06.17 Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Content-Transfer-Encoding: 7bit Status: RO Content-Length: 2742 > can [this program] be shortened by icon clever stuff. The nested "every"s seem reminiscent of lesser languages:- Indeed! > procedure main() L := ["g","m","h","f"] every h:=1 to 4 do { every i:=1 to 4 do { every j:=1 to 4 do { every k:=1 to 4 do { write(fit(h,i,j,k)) }}}} end global L,h,i,j,k procedure fit(a,b,c,d) if a=b|a=c|a=d|b=c|b=d|c=d then fail return "A "||L[a]||"ood "||L[b]||"an is "||L[c]||"ard to "||L[d]||"ind." end How about something more like: procedure main() L := ['g','m','h','f'] every write(fit(!L,!L,!L,!L)) end global L procedure fit(a,b,c,d) if *(a ++ b ++ c ++ d) < 4 then fail return "A "|| a ||"ood "|| b ||"an is "|| c ||"ard to "|| d ||"ind." end Note that L is now a list of character sets rather than character strings! This should reduce the number of conversions necessary. It also reduces the number of character set to string conversions required until the final return statement where everything's concatenated into a final string to return. The question is whether the character set union (and size) operation takes less time (or more) than the equals tests used in the original program. (It's certainly more Icon-like to use the character set union and size). Also, why convert all the time between subscript numbers and the corresponding characters, as the original did? Icon iterates just great across strings. In general, character sets are one of the most sadly neglected features of Icon... a wonderful feature that deserves to be used more. You might also want to reduce the list, calling and parameter passing overhead and move the whole thing into the main procedure, more like: procedure main() L = 'gmhf' every *((a := !L) ++ (b := !L) ++ (c := !L) ++ (d := !L)) = 4 do write("A "|| a ||"ood "|| b ||"an is "|| c ||"ard to "|| d ||"ind.") end You might even want to take advantage of this kind of structure to use four separate character set constants in the character set concatenation, to eliminate in advance those words which you know won't be legal words... such as: procedure main() every *((a := 'gmhf') ++ (b := 'mf') ++ (c := 'gh') ++ (d := 'mhf')) = 4 do write("A "|| a ||"ood "|| b ||"an is "|| c ||"ard to "|| d ||"ind.") end It's probably possible to use character set differences to extend this principle and use the difference set for subsequent generations (if you use the same set for all four iterations), which would eliminate the need for the test for 4 different characters in the resulting set. But that might go beyond elegance and just get obscure. :-) Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Mon Aug 31 09:27:50 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id JAA00692 for ; Mon, 31 Aug 1998 09:27:49 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21268; Mon, 31 Aug 1998 09:27:24 -0700 Date: Fri, 28 Aug 1998 20:54:19 -0400 From: Jules Gilbert Subject: V9 and OS/2 To: icon-group@arizona.edu Message-Id: <35E7513A.87455022@aasp.net> Organization: Synbolic Mechanics Mime-Version: 1.0 X-Mailer: Mozilla 4.04b1 [en] (OS/2; I) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Content-Transfer-Encoding: 7bit Status: RO Content-Length: 357 I have an application for which I would like very much to use Icon. My environment is OS/2 and v9 of Icon. 1) I want to tie a fairly simple C program to Icon. 2) If possible, I would like to generate .gif files, also. By the way, many people who use OS/2 are sad to see your organization stop supporting OS/2 based Icon. Sincerely, Jules Gilbert From icon-group-sender Mon Aug 31 09:29:37 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id JAA00986 for ; Mon, 31 Aug 1998 09:29:36 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21386; Mon, 31 Aug 1998 09:29:11 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Sat, 29 Aug 1998 22:59:13 BST From: Bob Ardler Message-Id: Organization: ArgoNet, but does not reflect its views Sender: icon-group-request@optima.CS.Arizona.EDU References: Reply-To: Bob Ardler Subject: Re: A prooner spogram. Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 714 R. Clayton: > procedure perms(letters) > if *letters = 0 then > suspend "" > else > every l := !letters do > every suspend l || perms(delete(copy(letters), l)) > end # perms Help! suspend, copy, pling, zero set size, implicit function value. It will lake me mery vuch tonger than your five minutes writing time to prasp your grogram. However, it's just the sort of thiconic inking I beed to be nattered with. Thany manks. Bob Ardler. -- __ __ __ __ __ __ ___ _____________________________________________ |__| R G O N E | / | | Bob | /...Internet access for all Acorn RISC machines ___________________________/ ardler@argonet.co.uk From icon-group-sender Mon Aug 31 09:29:53 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id JAA01014 for ; Mon, 31 Aug 1998 09:29:52 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21433; Mon, 31 Aug 1998 09:29:27 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Sat, 29 Aug 1998 22:43:11 BST From: Bob Ardler Message-Id: Organization: ArgoNet, but does not reflect its views Sender: icon-group-request@optima.CS.Arizona.EDU References: , <6s6r1e$qa7$1@shell14.ba.best.com> Reply-To: Bob Ardler Subject: Re: A hood fan is guard to mind. Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 710 Grateful for Hamim Mohamed's program and mailing-list recommendation: have found what may be the mailing list and have (I hope) subscribed to it. His: if *cset(a||b||c||d) = 4 is very pleasant. The: every write(fit(!chars, !chars, !chars, !chars)) is exactly the sort of thing (proper Icon as opposed to Icon being a better Algol) that I can only do by trial and accident and was hoping (but not expecting) to see. Instructive. Cheers indeed! Bob Ardler. -- __ __ __ __ __ __ ___ _____________________________________________ |__| R G O N E | / | | Bob | /...Internet access for all Acorn RISC machines ___________________________/ ardler@argonet.co.uk From icon-group-sender Mon Aug 31 09:30:05 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id JAA01077 for ; Mon, 31 Aug 1998 09:30:03 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21426; Mon, 31 Aug 1998 09:29:37 -0700 Date: Sun, 30 Aug 1998 14:54:38 -0300 (ADT) From: Larry Bezeau X-Sender: bezeau@sol.sun.csd.unb.ca Reply-To: Larry Bezeau To: icon-group@optima.CS.Arizona.EDU Subject: Integers in Posix-compliant icon Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 682 In writing a procedure to change a date in most any form to a standard form, I encountered some strange behavior by Posix compliant icon on a Unix platform. This is illustrated by the following short program. cat integers.icn procedure main(A) write() every (arg := !A) do { if integer(arg) then write(" ",arg," is the integer ",integer(arg),".") else write(" ",arg," is not an integer.") write() } end ./integers 3rd 23rd 3rd is not an integer. 23rd is the integer 13. In my opinion, neither of these is an integer. Is this a bug or am I missing something? Larry Bezeau@UNB.Ca From icon-group-sender Mon Aug 31 09:30:21 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id JAA01105 for ; Mon, 31 Aug 1998 09:30:21 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21456; Mon, 31 Aug 1998 09:29:56 -0700 Message-Id: <35E9AA94.7A5F5147@charlie.cns.iit.edu> Date: Sun, 30 Aug 1998 14:40:04 -0500 From: "Thomas W. Christopher" Organization: Illinois Institute of Technology X-Mailer: Mozilla 4.06 [en] (WinNT; I) Mime-Version: 1.0 To: "icon-group@CS.Arizona.EDU" Subject: LL(1) and LL(k) parser generators and educational compiler available Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Content-Transfer-Encoding: 7bit Status: RO Content-Length: 866 I have placed on the web a couple of parser generators and an example compiler for your use. All are written in Icon. They are available at: http://www.toc-press.com/freesoftware.htm The parser generators are: TCLL1 - an LL(1) parser generator. It includes panic-mode error repair. TCLLk - an LL(k) parser generator (technically, "strong LL(k)"). I have been using it in classes and it appears to work, but complete tests are not complete yet. It appears to be comparable to LALR(1). EULER - an EULER compiler written in Icon using TCLL1. Illinois Institute of Technology uses these for their undergraduate Programming Languages and Translators course. -- Thomas W. Christopher -- tc@charlie.cns.iit.edu , tc@toc-press.com Principal, Tools of Computing LLC. -- http://www.toc-press.com Associate Prof., Illinois Inst. of Tech. -- http://www.iit.edu/~tc From icon-group-sender Mon Aug 31 09:30:28 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id JAA01114 for ; Mon, 31 Aug 1998 09:30:28 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21473; Mon, 31 Aug 1998 09:30:03 -0700 Date: Mon, 31 Aug 1998 09:05:25 -0700 From: kwalker@sfo.harbinger.com (Ken Walker) Message-Id: <199808311605.JAA20565@varda.premenos.com> To: icon-group@optima.CS.Arizona.EDU Subject: Re: A hood fan is guard to mind. Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: +9a2kKmLIC6wRuNurqTDbA== Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Content-Transfer-Encoding: 7bit Status: RO Content-Length: 1542 How about a version of polyspoonerisms that uses recursive generators. It allows the sentence to be arbitrarily long by changing only data and not the number of nested "every" expressions. procedure main() local fillers, firstChar, remainingChars # # The sentence is broken into three categories: # parts not participating in the substitution # the initial characters of the words involved in substitution # the tail of the words involved in substitution # fillers := ["A ", " ", " is ", " to ", "."] firstChar := ["g", "m", "h", "f"] remainingChars := ["ood", "an", "ard", "ind"] polyspoonerism(fillers, firstChar, remainingChars, "") end procedure polyspoonerism( fillers, # words before each participating word firstChar, # first characters to use in substitutions remainingChars, # words (w/out 1st char) that are participating sentence) # sentence so far local indx if *remainingChars = 0 then { write(sentence, fillers[1] | "") return } # # Use each of the remaining first characters # every indx := 1 to *firstChar do { # # Add the next set of parts to the sentence then call # the function recursively. # polyspoonerism(fillers[2:0], firstChar[1:indx] ||| firstChar[indx+1:0], remainingChars[2:0], sentence || fillers[1] || firstChar[indx] || remainingChars[1]) } end Ken Walker, kenneth.walker@sfo.harbinger.com Harbinger Coporation, Concord, Ca. 94520 From icon-group-sender Mon Aug 31 09:30:37 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id JAA01124 for ; Mon, 31 Aug 1998 09:30:36 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA20694; Mon, 31 Aug 1998 09:30:10 -0700 Date: Mon, 31 Aug 1998 09:11:59 -0700 From: kwalker@sfo.harbinger.com (Ken Walker) Message-Id: <199808311611.JAA20585@varda.premenos.com> To: icon-group@optima.CS.Arizona.EDU Subject: Re: A hood fan is guard to mind. Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: 0iWoS3eDDqPo4J69Q7wyKA== Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Content-Transfer-Encoding: 7bit Status: RO Content-Length: 1524 I apologize. The version of the program I sent out did not have a procedure that generated results, so it was not a recursive generator. Here is a version that is. procedure main() local fillers, firstChar, remainingChars # # The sentence is broken into three categories: # parts not participating in the substitution # the initial characters of the words involved in substitution # the tail of the words involved in substitution # fillers := ["A ", " ", " is ", " to ", "."] firstChar := ["g", "m", "h", "f"] remainingChars := ["ood", "an", "ard", "ind"] every write(polyspoonerism(fillers, firstChar, remainingChars, "")) end procedure polyspoonerism( fillers, # words before each participating word firstChar, # first characters to use in substitutions remainingChars, # words (w/out 1st char) that are participating sentence) # sentence so far local indx if *remainingChars = 0 then return sentence || (fillers[1] | "") # # Use each of the remaining first characters # every indx := 1 to *firstChar do { # # Add the next set of parts to the sentence then call # the function recursively. # suspend polyspoonerism(fillers[2:0], firstChar[1:indx] ||| firstChar[indx+1:0], remainingChars[2:0], sentence || fillers[1] || firstChar[indx] || remainingChars[1]) } end Ken Walker, kenneth.walker@sfo.harbinger.com Harbinger Coporation, Concord, Ca. 94520 From icon-group-sender Mon Aug 31 09:30:47 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id JAA01134 for ; Mon, 31 Aug 1998 09:30:45 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA20152; Mon, 31 Aug 1998 09:30:17 -0700 Date: Mon, 31 Aug 1998 09:23:41 -0700 From: kwalker@sfo.harbinger.com (Ken Walker) Message-Id: <199808311623.JAA20603@varda.premenos.com> To: icon-group@optima.CS.Arizona.EDU Subject: Re: A hood fan is guard to mind. Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: 5qDOZPLcfV6WSo1n3qDQDQ== Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Content-Transfer-Encoding: 7bit Status: RO Content-Length: 1450 And here's a solution that does not involve passing "sentence" down the call chain. procedure main() local fillers, firstChar, remainingChars # # The sentence is broken into three categories: # parts not participating in the substitution # the initial characters of the words involved in substitution # the tail of the words involved in substitution # fillers := ["A ", " ", " is ", " to ", "."] firstChar := ["g", "m", "h", "f"] remainingChars := ["ood", "an", "ard", "ind"] every write(polyspoonerism(fillers, firstChar, remainingChars)) end procedure polyspoonerism( fillers, # words before each participating word firstChar, # first characters to use in substitutions remainingChars) # words (w/out 1st char) that are participating local indx if *remainingChars = 0 then return fillers[1] | "" # # Use each of the remaining first characters # every indx := 1 to *firstChar do { # # Construct the first part of the sentence then make a # recursive call to construct the rest. # suspend fillers[1] || firstChar[indx] || remainingChars[1] || polyspoonerism(fillers[2:0], firstChar[1:indx] ||| firstChar[indx+1:0], remainingChars[2:0]) } end This is finally starting to look reasonably elegant and Iconish. Ken Walker, kenneth.walker@sfo.harbinger.com Harbinger Coporation, Concord, Ca. 94520 From icon-group-sender Mon Aug 31 12:22:25 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id MAA08634 for ; Mon, 31 Aug 1998 12:22:24 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21839; Mon, 31 Aug 1998 12:22:00 -0700 Message-Id: <4FD6422BE942D111908D00805F3158DF0757B531@RED-MSG-52> From: Todd Proebsting To: icon-group@optima.CS.Arizona.EDU Subject: RE: A hood fan is guard to mind. Date: Mon, 31 Aug 1998 10:19:34 -0700 X-Mailer: Internet Mail Service (5.5.2232.9) Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 219 Somebody might find the following interesting. On a slow day. procedure main() local L, t L := "gmhf" every t := !L || !L || !L || !L & *cset(t)=4 do write(map("A good man is hard to find", L, t)) end From icon-group-sender Mon Aug 31 12:22:17 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id MAA08631 for ; Mon, 31 Aug 1998 12:22:16 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21841; Mon, 31 Aug 1998 12:21:52 -0700 Date: Mon, 31 Aug 1998 09:54:27 -0700 From: swampler@noao.edu (Steve Wampler) Subject: Re: Integers in Posix-compliant icon To: bezeau@unb.ca Cc: icon-group@optima.CS.Arizona.EDU Message-Id: In-Reply-To: Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 706 Larry - Icon accepts integers expressed in 'radix' notation. For example, integers represented in binary are 2r1010, 2r111, etc. Icon handles any base up to base 36, so 23rd is the base 23 number 'd'. 3rd is not an integer because 'd' is not a legal digit in base 3. Note that hexidecimal numbers are represented as 16rFF, 16r1af9, etc. In general the digits allowed in integers in base N are the first N characters of the string "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" (ok, so upper- or lowercase letters work...). -- Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)] The gods that smiled at your birth are now laughing openly. (Fortune Cookie) From icon-group-sender Tue Sep 1 08:26:55 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id IAA24338 for ; Tue, 1 Sep 1998 08:26:55 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22303; Tue, 1 Sep 1998 08:26:30 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 1 Sep 1998 00:45:00 GMT From: sobotka@axess.com (Henry Sobotka) Message-Id: <6sfg2c$m9e$1@news2.tor.accglobal.net> Organization: ICAN.Net Customer Sender: icon-group-request@optima.CS.Arizona.EDU References: <35E75B0B.142E9658@aasp.net> Subject: Re: Icon, OS/2, and interfacing C code Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 996 In article <35E75B0B.142E9658@aasp.net>, jules@aasp.net says... > >Hello: > >I use Icon under OS/2 and I am interested in interfacing some Icon code >to a C program. > >I don't have the (obsolete) CSET/2 compiler, nor the Visual Age stuff. > >Instead, I use EMX/GCC and various other commercial products. > >So, is this possible? Will my application live? Hello? Yes. I built an older Icon 9 with emx+gcc last fall, then this spring merged the changes with the (then?) latest sources. Unfortunately, the emx+gcc binaries create a very stiff (reboot) zombie on exit which I've wanted to get rid of before making the update available. If you're interested in building it, I'd be happy to provide you with a copy of my code; another pair of eyes might be able to spot the bug more easily. Also, now that I'm far more at ease using the VisualAge compiler than back then, I want to try an icc build in the hoping of producing at least one clean set of binaries for OS/2 Icon users. Henr From icon-group-sender Tue Sep 1 08:27:05 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id IAA24346 for ; Tue, 1 Sep 1998 08:27:05 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22934; Tue, 1 Sep 1998 08:26:39 -0700 Date: Tue, 1 Sep 1998 09:54:19 -0300 (ADT) From: Larry Bezeau X-Sender: bezeau@sol.sun.csd.unb.ca To: Icon list Subject: Re: Integers in Posix-compliant Icon Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 590 Many thanks to Steve Wampler and R. Clayton for reminding me of the radix notion for Icon integers and for explaining why "3rd" is not an integer while "23rd" is. I have since re-read the relevant sections in Griswold and Griswold. In retrospect, I should have suspected something like this since any attempt to convert normal integers followed by the other two ordinal suffixes (in English) to integers always failed. In my program, I now search for and remove all ordinal suffixes very early in the analysis process. Larry Bezeau@UNB.Ca From icon-group-sender Tue Sep 1 12:40:11 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id MAA08404 for ; Tue, 1 Sep 1998 12:40:04 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22417; Tue, 1 Sep 1998 12:39:39 -0700 From: abs@reba.csd.sgi.com (Alan Saichek) Message-Id: <199809011555.PAA07853@reba.csd.sgi.com> Subject: Jcon port to Windows: MKS Korn shell in Msoft NT Add-On Pack To: icon-group@baskerville.CS.Arizona.EDU Date: Tue, 1 Sep 1998 08:55:33 -0700 (PDT) X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Mime-Autoconverted: from 8bit to quoted-printable by rock.csd.sgi.com id IAA06035 Content-Transfer-Encoding: 8bit X-Mime-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id IAA25888 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Content-Transfer-Encoding: 8bit Status: RO Content-Length: 1780 On Jcon portability, an immediate (but costly?) solution for Windows is available: http://www.cs.arizona.edu/icon/jcon/doc/intro.htm mentions: "The jcont script that directs compilation and linking is a 400-line Korn shell script. While this works well for Unix, it is the single largest impediment to a non-Unix port. We believe that writing a replacement program would be the easiest route to a Windows or Macintosh port." On the Windows front, a solution is available now from MKS for all Windows platforms, and a Microsoft solution for Windows NT is/will be available, per the May Microsoft press release: http://www.microsoft.com/presspass/press/1998/may98/ntunixpr.htm "LAS VEGAS - May 6, 1998 Microsoft Corp. today announced development of the Microsoft. Windows NT. Services for UNIX Add-On Pack ... is scheduled to deliver a beta version of the Windows NT Services for UNIX Add-On Pack this summer for both Intel and Alpha platforms. Common scripting across platforms. Windows NT Services for UNIX will also allow users to run many existing UNIX scripts on Windows NT-based systems. As part of these scripting capabilities, Microsoft has licensed from Mortice Kern Systems Inc. (MKS) more than 25 UNIX scripting commands and its leading KornShell, which gives users the ability to automate common processes and administrative tasks across both Windows NT and UNIX platforms. MKS is a leading provider of Windows NT scripting and migration tools and software configuration management (SCM) products." http://www.mks.com Enjoy, Alan -- Alan B. Saichek abs@csd.sgi.com Member Technical Staff - Engineering (650) 933-2507 Worldwide Customer Service, Service Tools R&D From icon-group-sender Wed Sep 2 13:20:43 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id NAA10101 for ; Wed, 2 Sep 1998 13:20:43 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA24624; Wed, 2 Sep 1998 13:20:17 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Wed, 02 Sep 1998 13:58:50 GMT From: cwills@bix.com Message-Id: <6sjius$i4v$1@nnrp1.dejanews.com> Organization: Deja News - The Leader in Internet Discussion Sender: icon-group-request@optima.CS.Arizona.EDU References: <35E75B0B.142E9658@aasp.net>, <6sfg2c$m9e$1@news2.tor.accglobal.net> Subject: Re: Icon, OS/2, and interfacing C code Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 717 In article <6sfg2c$m9e$1@news2.tor.accglobal.net>, sobotka@axess.com (Henry Sobotka) wrote: > > Also, now that I'm far more at ease using the VisualAge compiler than back > then, I want to try an icc build in the hoping of producing at least one clean > set of binaries for OS/2 Icon users. > > Henr > I'm just about to send in a 9.3.1 version of Icon for OS/2. I have the compiles done, and just need to "package" it up. I've included external functions, and dynamic loading as well. Note that this is not the graphical version, just the line mode. Cheyenne Wills -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum