From icon-group-sender Wed Jul 5 08:05:23 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA24721 for icon-group-addresses; Wed, 5 Jul 2000 08:05:15 -0700 (MST) Message-Id: <200007051505.IAA24721@baskerville.CS.Arizona.EDU> From: "Mark Evans" To: Subject: A better GUI for the next generation Date: Mon, 3 Jul 2000 14:29:17 -0500 X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2506 Dear Iconeers, The Visual Interface Builder (VIB) has never been more than a toy. This note is a public encouragement to the Icon and Unicon development teams to drop the current VIB and consider another approach. The inspiration for this idea is the awesome wxPython. http://www.wxPython.org http://www.Python.org Python is an open-source interpretive script language with roots in Modula-3 and borrowings from Icon, Lisp, and C++ (plus a byte-code execution model like Java). Many consider it the best interpreted language and it has a wide following. It is running some real-world web pages for example. It is object-oriented and scalable. Now the "wx" in wxPython comes from the wxWindows cross-platform C++ GUI library. So "wxPython" is not a variant of Python, which is standardized; it is a set of Python-language wrapper classes for the wxWindows C++ library. In effect it marries the best of both worlds. You get the ease of Python with the efficiency of C++ for GUI development. The wxPython library is a set of Python classes that essentially mirror the underlying C++ classes in wxWindows. You must run the wxPython demo to understand the power and ease of this GUI tool. The demo offers a list of GUI displays with corresponding wxPython code available in a separate tab frame. One of the most impressive demos is a million-cell spreadsheet. In many respects wxPython is a lot like Visual Basic in its ease of use, but without the language problems. It must be said that wxPython lacks a GUI editor per se. However Python can build stand-alone GUI executables on any platform. (There is a second cross-platform GUI suite for Python, but wxPython is light years ahead of it.) The proposal then is a set of Unicon "wrapper" classes in the spirit of wxPython. Other people in the open-source world have already done the C++ GUI development work. Given the limited resources of the Unicon team, I would suggest leveraging this work and not extending the poor old VIB. Incidentally it would be nice if Unicon adopted the open source model more completely. Over at the Python site, I can get daily builds of the current development version, and its issues are openly discussed by Pythoneers. This is true open-source. The Icon/Unicon model is open source but not open source development. There are just a few people working on the language in their spare time, and that is why it takes so long. Still I look forward to the release of Unicon! Best regards, Mark Evans From icon-group-sender Wed Jul 5 08:06:03 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA24756 for icon-group-addresses; Wed, 5 Jul 2000 08:05:52 -0700 (MST) Message-Id: <200007051505.IAA24756@baskerville.CS.Arizona.EDU> X-Priority: 3 (Normal) Date: Mon, 03 Jul 2000 23:28:51 +0200 (CEST) From: Guido Milanese To: icon-group@optima.CS.Arizona.EDU Subject: RE: setting environment variables Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 866 A simple question, I hope. I am writing, as exercise, a little database program. The program scans data from input file and I would like data to be output in a (graphic) window this way: Field1 Dat1 Field2 Dat2 ... ... Fieldn Datn User must be able to modify Dat(1:n), therefore I have chosen TextDialog. However, the problem is that I find no way to allow data entry of more than one line, which is very inconvenient if data is very long. I also tried to chop data separating portions with a newline char, but this was totally wrong... Any suggestion, please? Many thanks, Guido ------------------------------------------- E-Mail: Guido Milanese Homepage: http://fly.to/arsantiqua 03-Jul-00 - XFMail on Linux + + + + + + NON NOBIS DOMINE + + + + + + ------------------------------------------- From icon-group-sender Wed Jul 5 08:06:28 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA24792 for icon-group-addresses; Wed, 5 Jul 2000 08:06:14 -0700 (MST) Message-Id: <200007051506.IAA24792@baskerville.CS.Arizona.EDU> Date: Mon, 03 Jul 2000 21:56:47 -0400 From: David Gamey To: icon-group@optima.CS.Arizona.EDU Subject: Icon and Palm? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 153 Has anyone ported Icon (any release) to the Palm? I recall reading a few years ago of an old release being run on some kind of PDA. Thanks, David From icon-group-sender Wed Jul 5 09:47:32 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA27523 for icon-group-addresses; Wed, 5 Jul 2000 09:47:16 -0700 (MST) Message-Id: <200007051647.JAA27523@baskerville.CS.Arizona.EDU> Date: Wed, 5 Jul 2000 09:40:57 -0700 (PDT) From: Shamim Mohamed To: "Mark Evans" Cc: Subject: Re: A better GUI for the next generation Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1035 Mark Evans writes: > Dear Iconeers, The Visual Interface Builder (VIB) has never been more > than a toy. This note is a public encouragement to the Icon and Unicon > development teams to drop the current VIB and consider another approach. [...] > Incidentally it would be nice if Unicon adopted the open source model > more completely. Over at the Python site, I can get daily builds of the > current development version, and its issues are openly discussed by > Pythoneers. This is true open-source. The Icon/Unicon model is open > source but not open source development. There are just a few people > working on the language in their spare time, and that is why it takes so > long. Hmmm... sounds to me like you're volunteering. Wonderful! The "daily build" model makes sense when many developers are actively working on the system. In our case, there are just a few people (as you said) - but not because we want to keep secrets. If you can help out, why don't you drop Clint a line? -s From icon-group-sender Wed Jul 5 09:48:10 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA27563 for icon-group-addresses; Wed, 5 Jul 2000 09:47:56 -0700 (MST) Message-Id: <200007051647.JAA27563@baskerville.CS.Arizona.EDU> From: gep2@terabites.com Date: Wed, 05 Jul 2000 11:57:46 -0500 Subject: Re: Error messages To: trollet@skynet.be, icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1734 > This may not be related to Icon at all (although I feel that Icon, ProLog, Simula and Beta are 'close cousins :) - but I have been fooling around with the idea of writing a parser in ProLog - I started out with something close to the grammar for 8086 assembly. Why? Because the syntax is simple, so syntax errors wont contain much information as to what the error actually is, but the semantics possibilities are enormous compared to, say, Pascal. Now, this is where I think it might be relevant: Wouldn't some kind of knowledge base help in producing more meaningful error messages? I have been through Icon enough to write small programs in it, and I had the same impression: The error messages really only say: "Error" - and you have to find the rest out for yourself. The case here about the [] could be added to the knowledgebase, so the next time, the error would be "I told myself I wouldn't use [] here!" :-) > Any thoughts? Should I drop the idea of using an AI language to build an assembler? (I actually wanted to use Beta) Well, you could probably write the assembler to run on a Turing machine, too. That doesn't mean it's the best tool for the job. For something that is so line-oriented as assembler language is, I'd think that either Icon or SNOBOL/SPITBOL would be relatively ideal tools for writing your assembler. Although you COULD probably write it in Prolog, I have to wonder if the benefits of making that choice are enough to justify the hassle. Gordon Peterson http://web2.airmail.net/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: the day the Conservatives demonstrated their scorn for their fraudulent sham of representative government. Voters, remember it! From icon-group-sender Thu Jul 6 07:35:43 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA02281 for icon-group-addresses; Thu, 6 Jul 2000 07:34:07 -0700 (MST) Message-Id: <200007061434.HAA02281@baskerville.CS.Arizona.EDU> To: "Mark Evans" Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: A better GUI for the next generation Date: Wed, 05 Jul 2000 17:39:47 -0700 From: Clinton L Jeffery Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 752 Mark Evans recently suggested that we develop better GUI tools. If the suggestion was for Icon, it should say Icon not Unicon, otherwise you confuse (and maybe irritate) some people. From the Icon standpoint, but not speaking for the Icon project, I would say your request for better GUI tools is valid, and you are welcome to develop and distribute such tools. I used to sponsor student projects to improve VIB, but have given up on it. Since Mark suggests new GUI "wrapper" classes for Unicon, I will post a longer reply to the message to the Unicon list and hopefully we can have a discussion of it there. Unicon stuff is accessed via http://icon.cs.unlv.edu; the mailing list is up but not archived yet. Regards, Clint, jeffery@cs.unlv.edu From icon-group-sender Thu Jul 6 08:35:22 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA03576 for icon-group-addresses; Thu, 6 Jul 2000 08:35:05 -0700 (MST) Message-Id: <200007061535.IAA03576@baskerville.CS.Arizona.EDU> From: "Mark Evans" To: Cc: "Clinton L Jeffery" Subject: RE: A better GUI for the next generation Date: Thu, 6 Jul 2000 10:04:43 -0500 X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2823 No irritation intended. The situation is intrinsically confusing which is why I used the term "next generation." Between AZ and NV there have been several sprouts (Icon, Idol, Godiva, Unicon, Jcon, Iconc) plus sounds to the effect that Icon qua Icon is now frozen in time, and the future is Unicon. The wrapper concept applies equally to either Icon or Unicon. If Icon qua Icon has any sort of future, then I formally recommend the wrapper concept for it as well. Anyone wishing to cross-post my notes to Unicon is welcome to do so. Since Unicon is not even released yet (for Windows, the major platform) and Clint told me the traffic is still light over there, I felt the Icon list a more appropriate place to post. I would certainly appreciate any etiquette FAQs that either AZ or NV teams would like to manufacture and post. What exactly *is* the future of Icon after all? From what I understand, the only active development is taking place under the Unicon banner. To answer S. Mohamed's points, I might well volunteer if the development were more transparent. The lack of transparency keeps Icon/Unicon/whatever in the minor leagues and limits the volunteer base. Icon has been around at least as long as Python's 10 years. There are plenty of open-source teams doing this sort of thing, e.g. SourceForge. The number of Python support resources and web sites is truly astounding. So the suggestion stands, that open-source development should go all the way and follow the model of similar endeavors. That does not mean that control is relinquished but it means a team can form around the effort and the world can know what they are doing at all times. Python for example has formal mechanisms for improvement proposals and standing releases of last-final plus current-alpha software builds and a source code repository. Mark -----Original Message----- From: Clinton L Jeffery [mailto:jeffery@bo.Egr.UNLV.EDU] Sent: Wednesday, July 05, 2000 7:40 PM To: Mark Evans Cc: icon-group@cs.arizona.edu Subject: Re: A better GUI for the next generation Mark Evans recently suggested that we develop better GUI tools. If the suggestion was for Icon, it should say Icon not Unicon, otherwise you confuse (and maybe irritate) some people. From the Icon standpoint, but not speaking for the Icon project, I would say your request for better GUI tools is valid, and you are welcome to develop and distribute such tools. I used to sponsor student projects to improve VIB, but have given up on it. Since Mark suggests new GUI "wrapper" classes for Unicon, I will post a longer reply to the message to the Unicon list and hopefully we can have a discussion of it there. Unicon stuff is accessed via http://icon.cs.unlv.edu; the mailing list is up but not archived yet. Regards, Clint, jeffery@cs.unlv.edu From icon-group-sender Fri Jul 7 07:44:18 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA11378 for icon-group-addresses; Fri, 7 Jul 2000 07:42:22 -0700 (MST) Message-Id: <200007071442.HAA11378@baskerville.CS.Arizona.EDU> Date: Fri, 7 Jul 2000 14:43:26 +1200 (NZST) From: "Richard A. O'Keefe" To: gep2@terabites.com, icon-group@optima.CS.Arizona.EDU, trollet@skynet.be Subject: Re: Error messages Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 762 Gordon Peterson wrote (in extremely long lines): > Although you COULD probably write [an assembler] in Prolog, > I have to wonder if the benefits of making that choice are > enough to justify the hassle. I just _have_ to ask: WHICH hassle? Let's face it, analysing the input hasn't been the hard part of assembler writing for decades. Writing the output is the tricky part. The real hassle is finding out what the wretched output is supposed to look like. For UNIX (maybe Windows too; I've never used Cygwin) anyone wanting to write a new kind of assembler would be mad not to re-use as much of the GNU binutils as practical. By all means put a smart new front end on an assembler, but let someone else deal with the *real* hassle. From icon-group-sender Fri Jul 7 08:45:23 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA12521 for icon-group-addresses; Fri, 7 Jul 2000 08:45:08 -0700 (MST) Message-Id: <200007071545.IAA12521@baskerville.CS.Arizona.EDU> From: Atle X-Newsgroups: comp.lang.icon Subject: Re: Error messages Date: Fri, 07 Jul 2000 11:12:29 -0100 X-Trace: news0.skynet.be 962960788 28207 194.78.239.13 (7 Jul 2000 09:06:28 GMT) X-Complaints-To: abuse@skynet.be X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 690 > For something that is so line-oriented as assembler language is, I'd think that either Icon or >SNOBOL/SPITBOL would be relatively ideal tools for writing your assembler. Although you COULD >probably write it in Prolog, I have to wonder if the benefits of making that choice are enough to >justify the hassle. Well, it wasn't really the low-level routines for IO or code generation I though about, but the part where the assembler/compiler decides what to do - and that is something ProLog should be good at - ant 'decide what to do' in most cases is either pass it on stop with error message so deciding what err message to put out, should be be a ProLog problem, right? Atle From icon-group-sender Fri Jul 7 12:31:12 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA18301 for icon-group-addresses; Fri, 7 Jul 2000 12:30:52 -0700 (MST) Message-Id: <200007071930.MAA18301@baskerville.CS.Arizona.EDU> From: Atle X-Newsgroups: comp.lang.icon Subject: Re: Error messages Date: Fri, 07 Jul 2000 18:16:05 -0100 X-Trace: news0.skynet.be 962986201 3807 195.238.7.245 (7 Jul 2000 16:10:01 GMT) X-Complaints-To: abuse@skynet.be X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 959 "Richard A. O'Keefe" wrote: > > For UNIX (maybe Windows too; I've never used Cygwin) anyone wanting to write > a new kind of assembler would be mad not to re-use as much of the GNU binutils > as practical. By all means put a smart new front end on an assembler, but > let someone else deal with the *real* hassle. I think this is where things come together: Different languages for different parts of an application. Icon would have its place here for analyzing the input - maybe as far as to storing tokens in a tokenarray. Maybe an assembler was a bad example - but still: Wouldn't ProLog be ideal for making decisions? And then there is another matter: The instructions must be provided to the processor (Pentium) in the optimal sequence, making sure the pipelines are full at all times (as far as possible). Even the GNU tools haven't fully kept up here, since this is a big job, and, in my mind, C is not the ideal tool for this job. ????? Atle From icon-group-sender Fri Jul 7 14:18:23 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id OAA20851 for icon-group-addresses; Fri, 7 Jul 2000 14:16:41 -0700 (MST) Message-Id: <200007072116.OAA20851@baskerville.CS.Arizona.EDU> From: gep2@terabites.com Date: Fri, 07 Jul 2000 16:18:50 -0500 Subject: Re: Error messages To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3091 >Gordon Peterson wrote (in extremely long lines): Sorry if you don't like those... I've got the choice of not breaking lines, or of breaking them manually, or of breaking them automatically at (say) 80 columns. Whichever I choose seems to have at least SOME nasty artifacts, and someone bitches. I think I'm going to just set it back for force a break at 80 columns and let it go at that. >> Although you COULD probably write [an assembler] in Prolog, > I have to wonder if the benefits of making that choice are > enough to justify the hassle. > I just _have_ to ask: WHICH hassle? I've written a **lot** of such stuff (admittedly in SNOBOL/SPITBOL rather than Icon, but the principle is certainly similar). I don't think you have anything like the same capabilities and ease of programming in Prolog that you have in S*BOL or in Icon. Now it could be that you don't program in S*BOL or Icon the way I do, or that maybe you'd just rather do it (for whatever perverse reason) in Prolog. Hey, whatever floats your own personal boat... > Let's face it, analysing the input hasn't been the hard part of assembler writing for decades. Analyzing the input is a tiny part of the area where S*BOL or Icon shine. It's the other areas surrounding the project where the real benefits show up. The script compiler I wrote for the French Social Security Administration was written in a day and a half, and produced the most beautifully complete and detailed listings (cross references, formatted symbol tables, error summaries, and even a listing table of contents) you ever saw. It would have taken at least six months to write the same thing in C/C++, and maybe not a whole lot less to have written it in Prolog. > Writing the output is the tricky part. The real hassle is finding out what the wretched output is supposed to look like. I claim that THAT is only part of the hassle too. But hey, as I said, I've got better things to do than to go through a detailed point-by-point argument with you if you really want to do it in Prolog (or for that matter if you want to write it to run on a Turing-machine emulator). It's your time and your money. And you'll have to live the resulting product when you're done with it. Since I'm reasonably sure that *I* will never have to use it, it matters really not one whit to me. :-) > For UNIX (maybe Windows too; I've never used Cygwin) anyone wanting to write a new kind of assembler would be mad not to re-use as much of the GNU binutils as practical. By all means put a smart new front end on an assembler, but let someone else deal with the *real* hassle. Well, I guess it depends on whether you want an assembler that works like everyone else's or not. (Buf if you're happy with existing ones, why write a new one at all?) Gordon Peterson http://web2.airmail.net/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: the day the Conservatives demonstrated their scorn for their fraudulent sham of representative government. Voters, remember it! From icon-group-sender Fri Jul 7 14:21:52 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id OAA21021 for icon-group-addresses; Fri, 7 Jul 2000 14:21:44 -0700 (MST) Message-Id: <200007072121.OAA21021@baskerville.CS.Arizona.EDU> From: gep2@terabites.com Date: Fri, 07 Jul 2000 16:28:44 -0500 Subject: Re: Error messages To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2450 > I think this is where things come together: Different languages for different parts of an application. Maybe you should build a vehicle which is simultaneously a boat, an airplane, a car and a submarine, too. That way you can meld those disparate parts into a cohesive (cough!) whole, too. ;-) > Icon would have its place here for analyzing the input - maybe as far as to storing tokens in a tokenarray. To suggest that Icon's appeal for writing an assembler is limited only to the initial syntactical parsing of tokens is pretty ludicrous. > Maybe an assembler was a bad example - but still: Wouldn't ProLog be ideal for making decisions? No, not if those decisions are relatively simple... that's like using atomic weapons to kill mosquitos. Icon's goal-directed evaluation can be a wonderful tool for analyzing various possible instruction sequences and rating them based on size, performance, and other criteria. Icon also makes it hugely simpler to create all manner of statistics and summaries and other information (and present it nicely) regarding the program being processed, too. > And then there is another matter: The instructions must be provided to the processor (Pentium) in the optimal sequence, making sure the pipelines are full at all times (as far as possible). That was more of an issue in the days when there was one overwhelmingly dominant microprocessor out there. With AMD, Cyrix, and others out there (even several quite different-internally designs from Intel) it is largely impractical to optimize for a specific microprocessor's internal architecture (unless you're doing an embedded app for a specific KNOWN CPU architecture, such as a TI DSP or something). And if you were GOING to optimize for just one processor, I'd think it would make more sense to do it for an AMD processor, since I believe that with recent stupid moves by Intel, I think you're going to see a lot of market share slip out of Intel's hands and into those of AMD. > Even the GNU tools haven't fully kept up here, since this is a big job, and, in my mind, C is not the ideal tool for this job. C isn't ideal for most anything that isn't really low level. Gordon Peterson http://web2.airmail.net/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: the day the Conservatives demonstrated their scorn for their fraudulent sham of representative government. Voters, remember it! From icon-group-sender Mon Jul 10 07:46:06 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA19920 for icon-group-addresses; Mon, 10 Jul 2000 07:44:44 -0700 (MST) Message-Id: <200007101444.HAA19920@baskerville.CS.Arizona.EDU> Date: Fri, 07 Jul 2000 20:50:58 -0700 From: Steve Wampler X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Subject: Friday puzzle... Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 4363 This is a multi-part message in MIME format. --------------F23570175734CDBF613A10C4 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Every so often I've posed a programming problem here for Iconites to work on. Here's another one, but this time I'm providing an initial solution and the challenge is to find a faster solution (the solution attached here is pretty slow...) My son David asked me today a question about genetics: "If blood type O is a recessive gene, then why does it dominate in the population?" (~46% of the population is either O positive or O negative). Well, I don't have an answer, so attached is a program to simulate a population w.r.t a genetic trait (in this case, blood type). The program is patterned (uh, loosely) after a real population - there are humans, couples, births, and deaths, after a fashion. Interestingly enough, starting with a population that is ~25% O (the program combines positive and negative into the types), the percentage is around 22% after 116 generations (which is as far as the program has gotten while I'm typing this). Anyway, can you find a faster way to simulate the population across generations? I'd also appreciate a correct answer to David's question that both he and I can understand! --- Steve Wampler {sbw@tapestry.tucson.az.us} The gods that smiled upon your birth are laughing now. -- fortune cookie --------------F23570175734CDBF613A10C4 Content-Type: text/plain; charset=us-ascii; name="blood.icn" Content-Disposition: inline; filename="blood.icn" Content-Transfer-Encoding: 7bit # # Simulate the gene pool w.r.t. blood types # global btypes # Genetic trait is blood type record human(gene1, gene2) # A human has two blood type genes record couple(p1, p2) # Takes two to tango procedure main(args) # introduce some randomess from one run to the next write("Random seed: ",randSeed := &clock) &random := map("HhMmSs","Hh:Mm:Ss", randSeed) btypes := "ON" # simplify things "O" and "Not O" nHumans := 10000 # small population pool := createGenePool(nHumans) analyzePool(pool) every generation := 1 to 1000 do { # run for a lot of generations pool := alterPool(pool) if (generation % 1) == 0 then { # display every so often write("Generation ",generation) analyzePool(pool, "\t") } } end # # Create the initial population # procedure createGenePool(size) pool := set() every 1 to size do insert(pool, newHuman()) return pool end # # Create a new human, about 1 in 4 will be O blood type # procedure newHuman() static initOdds initial initOdds := repl("O",50) || repl("N",50) return human(?initOdds, ?initOdds) # random genes end # # See how the population is doing # procedure analyzePool(pool, prefix) /prefix := "" nO := nN := 0 every person := !pool do { if (person.gene1 == "O") & (person.gene2 == "O") then nO +:= 1 else nN +:= 1 } write(prefix, "Pool Size is: ",*pool) write(prefix, "\tNumber O type: ",nO) write(prefix, "\tNumber not O type: ",nN) write(prefix, "\t% O type: ",real(nO)/*pool) write() end # # Put the population through a generation # procedure alterPool(pool) static childProb # help in selecting number of children initial childProb := [0,0,1,1,1,2,2,2,3,3,4] newPool := set() parents := [] every put(parents, marryOff(pool)) # wow, everyone marries! # create the next generation # every pair := !parents do { insert(newPool, pair.p1) insert(newPool, pair.p2) every 1 to ?childProb do { # children get a gene from each parent person := human(?(pair.p1), ?(pair.p2)) insert(newPool, person) } } # now kill off enough to keep the population growth small * deaths := integer(*newPool * 0.46) every 1 to deaths do { delete(newPool, ?newPool) } return newPool end # Marry pairs of humans off (ok, so apparently the sex of each parent # isn't important - must be New Hampshire?) # procedure marryOff(pool) while *pool > 1 do { delete(pool, p1 := ?pool) delete(pool, p2 := ?pool) suspend couple(p1, p2) } end --------------F23570175734CDBF613A10C4-- From icon-group-sender Mon Jul 10 08:00:10 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA20182 for icon-group-addresses; Mon, 10 Jul 2000 07:59:59 -0700 (MST) Message-Id: <200007101459.HAA20182@baskerville.CS.Arizona.EDU> Date: Fri, 07 Jul 2000 20:56:06 -0700 From: Steve Wampler X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Subject: More on Friday puzzle Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 271 I forgot - I'd also appreciate critiques on whether or not the approach used in the sample solution has *any* basis in genetic reality! Thanks. --- Steve Wampler {sbw@tapestry.tucson.az.us} The gods that smiled upon your birth are laughing now. -- fortune cookie From icon-group-sender Mon Jul 10 08:01:18 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA20341 for icon-group-addresses; Mon, 10 Jul 2000 08:01:11 -0700 (MST) Message-Id: <200007101501.IAA20341@baskerville.CS.Arizona.EDU> From: Atle X-Newsgroups: comp.lang.icon Subject: Re: Error messages Date: Sat, 08 Jul 2000 15:18:30 -0100 X-Trace: news0.skynet.be 963061936 2886 194.78.236.183 (8 Jul 2000 13:12:16 GMT) X-Complaints-To: abuse@skynet.be X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1938 gep2@terabites.com wrote: > > > I think this is where things come together: Different languages for different > parts of an application. > > Maybe you should build a vehicle which is simultaneously a boat, an airplane, a > car and a submarine, too. That way you can meld those disparate parts into a > cohesive (cough!) whole, too. ;-) I don't understand: What is the relevance? How is using different tools (Icon,ProLog,C, etc. - or hammer, wrench, screwdriver, etc) to build something related to building things that are many things at the same time? > > To suggest that Icon's appeal for writing an assembler is limited only to the > initial syntactical parsing of tokens is pretty ludicrous. If someone would suggest something like that, I would have to agree ... > > No, not if those decisions are relatively simple... that's like using atomic > weapons to kill mosquitos. We don't use atomic weapons to kill anything ... we build things, and a part of that is to consider different tools. > > Icon's goal-directed evaluation can be a wonderful tool for analyzing various > possible instruction sequences and rating them based on size, performance, and > other criteria. Icon also makes it hugely simpler to create all manner of > statistics and summaries and other information (and present it nicely) regarding > the program being processed, too. Suddenly a fresh breath of common sense. Than you! > > something). And if you were GOING to optimize for just one processor, I'd think > it would make more sense to do it for an AMD processor, since I believe that > with recent stupid moves by Intel, I think you're going to see a lot of market > share slip out of Intel's hands and into those of AMD. First the decision should be made whether to optimize, and find good tools for that. Deciding what processor to optimize for - that will be done automatically: Whatever processor is available to me. > Stay focused! Atle From icon-group-sender Mon Jul 10 08:02:48 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA20447 for icon-group-addresses; Mon, 10 Jul 2000 08:02:40 -0700 (MST) Message-Id: <200007101502.IAA20447@baskerville.CS.Arizona.EDU> Date: Mon, 10 Jul 2000 16:51:56 +1200 (NZST) From: "Richard A. O'Keefe" To: gep2@terabites.com, icon-group@optima.CS.Arizona.EDU Subject: Re: Error messages Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 4073 I wrote: > I just _have_ to ask: WHICH hassle? Gordon Peterson wrote: I've written a **lot** of such stuff (admittedly in SNOBOL/SPITBOL rather than Icon, but the principle is certainly similar). I don't think you have anything like the same capabilities and ease of programming in Prolog that you have in S*BOL or in Icon. I've been a SNOBOL user off and on since the mid-70s. I still use SNOBOL on UNIX, quite happily. One of the first things I did when I met Prolog was to figure out the equivalents in Prolog. It used to surprise people when I pointed out that there was prior art for "!" in SNOBOL's FENCE. The thing is that SNOBOL gives you *almost* but not quite the same power and convenience for parsing text as Prolog does, but there it stops. As an anthropologist pointed out to me in the mid-70s when I was trying to persaude everyone to use SNOBOL, "if it can't parse anything but strings, what's the big deal?" Icon is a step backwards for parsing strings, but a big step forward for matching other kinds of data structures. But even Icon has a long way to go to match the ease of programming in Prolog. Now it could be that you don't program in S*BOL or Icon the way I do, or that maybe you'd just rather do it (for whatever perverse reason) in Prolog. Hey, whatever floats your own personal boat... You don't have to be perverse to prefer Prolog. You just have to like being able to use labelled trees as data structures and the ease of pattern matching on them. Seriously, the two big differences between Icon and Prolog here are - Icon has assignment statements, Prolog doesn't. - Icon looks a lot like C, Prolog doesn't. It's the other areas surrounding the project where the real benefits show up. Which areas, exactly? That's really what this thread is about. Generating binary output as such isn't a problem in Icon _or_ Prolog. I've identified "figuring out what the output structure is" as a problem. The script compiler I wrote for the French Social Security Administration was written in a day and a half, and produced the most beautifully complete and detailed listings (cross references, formatted symbol tables, error summaries, and even a listing table of contents) you ever saw. It would have taken at least six months to write the same thing in C/C++, and maybe not a whole lot less to have written it in Prolog. Can you give any *reason* why it would have been hard in Prolog? > Writing the output is the tricky part. The real hassle is finding out what the wretched output is supposed to look like. I claim that THAT is only part of the hassle too. My point is that it is a *major* hassle, given the state of the documentation, and that it is a *language-independent* hassle. But hey, as I said, I've got better things to do than to go through a detailed point-by-point argument with you if you really want to do it in Prolog This is an Icon mailing list, and "what language features help or hinder for this kind of task" is *exactly* what this thread is about. Surely you have better things to do than hurling around unjustified (and unjustifiable) insults against other programming languages. Shouldn't explaining *how* Icon helped you so much be one of them? > For UNIX (maybe Windows too; I've never used Cygwin) anyone wanting to write a new kind of assembler would be mad not to re-use as much of the GNU binutils as practical. By all means put a smart new front end on an assembler, but let someone else deal with the *real* hassle. Well, I guess it depends on whether you want an assembler that works like everyone else's or not. (Buf if you're happy with existing ones, why write a new one at all?) This is a rather strange comment. The original question came from someone who wanted to do a new kind of analysis of the input. Nothing was said about wanting to produce incompatible binary object files. If it is to be useful, presumably that person *does* want an assembler whose *output* conforms to the same interface requirements as everyone else's. From icon-group-sender Mon Jul 10 08:03:12 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA20479 for icon-group-addresses; Mon, 10 Jul 2000 08:02:58 -0700 (MST) Message-Id: <200007101502.IAA20479@baskerville.CS.Arizona.EDU> Date: Mon, 10 Jul 2000 16:57:02 +1200 (NZST) From: "Richard A. O'Keefe" To: gep2@terabites.com, icon-group@optima.CS.Arizona.EDU Subject: Re: Error messages Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 941 > And then there is another matter: The instructions must be provided to the processor (Pentium) in the optimal sequence, making sure the pipelines are full at all times (as far as possible). That was more of an issue in the days when there was one overwhelmingly dominant microprocessor out there. But there is a role for processor-model-specific scheduling. This is where an assembler-source to assembler-source front end in a compact high level form, relatively easy to plug new model-specific information into, could really pay off. It's not really practical for someone to write 10 different highly-tuned versions of a piece of assembly code, but it _might_ be practical for them to write one clean generic piece and let the front end adapt it. It would even be practical, in such a system, to plug in advice that is specific to the file being assembled. Just think of the variation there is in graphics support opcodes. From icon-group-sender Mon Jul 10 13:31:34 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA04115 for icon-group-addresses; Mon, 10 Jul 2000 13:31:03 -0700 (MST) Message-Id: <200007102031.NAA04115@baskerville.CS.Arizona.EDU> To: gep2@terabites.com, icon-group@optima.CS.Arizona.EDU, "Richard A. O'Keefe" From: "Alexandre E. Kopilovitch" Date: Mon, 10 Jul 2000 20:22:36 +0400 (MSD) Subject: Re: Error messages Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1574 "Richard A. O'Keefe" wrote: >Seriously, the two big differences between Icon and Prolog here are > - Icon has assignment statements, Prolog doesn't. > - Icon looks a lot like C, Prolog doesn't. > > It's the other areas surrounding the project where the real > benefits show up. Icon vs. Prolog: 1. Notation matters. Suppose that you have to show your Icon program to another person that have no slightest idea about the Icon and Snobol. Surely you will have serious difficulties trying to explain Icon syntax to a novice. At the same time, in a similar situation with a Prolog program you will feel yourself much better (if you were restricting yourself to the "pure Prolog", i.e. if you did not use "clever" built-in predicates). 2. Lie backfires. The Prolog predicates generally aren't the predicates in the mathematical sense -- in fact, they produce not simply sets, but the ordered sets, and a Prolog program often depends heavily on that ordering. On the contrary, Icon use the proper name - the generators. So, Prolog tries to hide the true nature of its major entity, while Icon exhibits it in its full power. 3. Conclusion. If your program deals mostly with a "static" structures, i.e. unordered sets, then Prolog has evident advantages, especially for reviewing and maintenance. If your program is heavily "dynamic", i.e. deals with the ordered sets, then Icon may have significant advantages, especially if the complicated ordering are needed. Alexander Kopilovitch aek@vib.usr.pu.ru Saint-Petersburg Russia From icon-group-sender Mon Jul 10 16:23:54 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA09634 for icon-group-addresses; Mon, 10 Jul 2000 16:23:26 -0700 (MST) Message-Id: <200007102323.QAA09634@baskerville.CS.Arizona.EDU> Date: Mon, 10 Jul 2000 18:29:48 -0400 (EDT) From: Taybin Rutkin To: icon-group@optima.CS.Arizona.EDU Subject: Re: Error messages Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 870 On Mon, 10 Jul 2000, Alexandre E. Kopilovitch wrote: > "Richard A. O'Keefe" wrote: > 1. Notation matters. > > Suppose that you have to show your Icon program to another person that have > no slightest idea about the Icon and Snobol. Surely you will have serious I think that the paradigm shift from procedural to logical is made easier with Icon. The syntax is (and here I'm assuming that you mean operaters and keywords and their respective order) much more familiar than prolog. I found prolog to be this bizarre alien creature. It was really out of my world. If by syntax you mean the operators, then the learning curve is slightly lower than, say, PERL. Well, maybe not that high. But there are many many operators. Taybin Rutkin -- trutkin@black.clarku.edu Creativity can only be anarchic, capitalist, Darwinian -- Umberto Eco From icon-group-sender Wed Jul 12 16:28:16 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA26521 for icon-group-addresses; Wed, 12 Jul 2000 16:26:12 -0700 (MST) Message-Id: <200007122326.QAA26521@baskerville.CS.Arizona.EDU> From: "F.G. van DORP" X-Newsgroups: comp.lang.icon Subject: Re: Error messages X-Newsreader: Forte Agent 1.7/32.534 Date: Wed, 12 Jul 2000 20:00:41 GMT X-Complaints-To: abuse@chello.nl X-Trace: flipper 963432041 212.187.67.243 (Wed, 12 Jul 2000 22:00:41 MET DST) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2695 On 10 Jul 2000 19:25:27 -0400, Taybin Rutkin wrote: >On Mon, 10 Jul 2000, Alexandre E. Kopilovitch wrote: > >> "Richard A. O'Keefe" wrote: > >> 1. Notation matters. >> >> Suppose that you have to show your Icon program to another person that have >> no slightest idea about the Icon and Snobol. Surely you will have serious > >I think that the paradigm shift from procedural to logical is made easier >with Icon. The syntax is (and here I'm assuming that you mean operaters >and keywords and their respective order) much more familiar than >prolog. I found prolog to be this bizarre alien creature. It was really >out of my world... > >Taybin Rutkin -- trutkin@black.clarku.edu Actually Prolog is much more similar to Icon than one would suspect: PROLOG pred1(P1,P2,P3,R1) :- pred2(P1,P2,R2), pred3(P3,R2,R1). ICON procedure pred1(P1,P2,P3) return (R2:=pred2(P1,P2) & R1:=pred3(P3,R2)) end This Icon return-expression is a backtracking context and known as "mutual evaluation" or a "compound conjunction" (and *NOT* a "compound expression" as I erroneously wrote in one of my previous postings. Quite the contrary: such expressions, seperated from each other by semicolons (sometimes implicated, see manual), will not get resumed if the next in line fails. So the semicolon acts as a "fence" to backtracking). The difference between Icon and Prolog lies in the nature of the procedure/predicate parameters (the P's; R's are the return values). In Icon these must have a value other than the default NULL value or else an error message will be generated. In Prolog a parameter variable can have a value when passed or not, the so-called "logical variable". An example: addlist(List1,List2,Newlist) If List1 and List2 have values when addlist is called, Newlist returns the sum of List1 and List2. When called with Newlist and either List1 or List2 with values, addlist returns the difference list. When called with only Newlist valued, addlist can generate (through backtracking) all sublist pairs of Newlist. There are functional languages with the power of the logical variable, implemented through a mechanism called "narrowing" (similar to Prolog's unification). One such language is CURRY http://www.informatik.uni-kiel.de/~curry/ I doubt if this behavior could be coded in Icon, or even added to its implementation, should one wish to do so. Another way is to add a Prolog engine to your program with an interface to your Icon code, as mr.LaPalme (lapalme@IRO.UMontreal.CA) managed to do a while back (see Icon archives). ===================================================== From icon-group-sender Fri Jul 14 12:39:50 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA04760 for icon-group-addresses; Fri, 14 Jul 2000 12:36:40 -0700 (MST) Message-Id: <200007141936.MAA04760@baskerville.CS.Arizona.EDU> Date: Fri, 14 Jul 2000 11:59:11 -0500 From: Albert Wagner X-Accept-Language: en To: Icon Subject: Installation on RH6.1 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1336 I have just attempted to install Icon9.3.2 for Unix (unix.tgz) on a Redhat6.1 system. "make Status name=intel_linux" gave no errors; "make X-Configure name=intel_linux" gave the following: : : gcc -Wl,-E -ldl -o iconx xcnv.o xdata.o xdef.o xerrmsg.o xextcall.o xfconv.o xfload.o xfmath.o xfmisc.o xfmonitr.o xfscan.o xfstr.o xfstranl.o xfstruct.o xfsys.o xfwindow.o ximain.o ximisc.o xinit.o xinterp.o xinvoke.o xkeyword.o xlmisc.o xoarith.o xoasgn.o xocat.o xocomp.o xomisc.o xoref.o xoset.o xovalue.o xralc.o xrcoexpr.o xrcomp.o xrdebug.o xrlocal.o xrlrgint.o xrmemmgt.o xrmisc.o xrstruct.o xrsys.o xrwinrsc.o xrgfxsys.o xrwinsys.o xrwindow.o xfxtra.o ../common/long.o ../common/time.o ../common/save.o ../common/rswitch.o ../common/redirerr.o ../common/xwindow.o ../common/alloc.o -L../../bin -lXpm -L/usr/X11/lib -lX11 -lm /usr/bin/ld: cannot open -lX11: No such file or directory collect2: ld returned 1 exit status make[3]: *** [iconx] Error 1 make[3]: Leaving directory `/root/pkg/lang/icon/src/runtime' make[2]: *** [interp_all] Error 2 make[2]: Leaving directory `/root/pkg/lang/icon/src/runtime' make[1]: *** [Icon-icont] Error 2 make[1]: Leaving directory `/root/pkg/lang/icon' make: *** [Icon] Error 2 I don't know enough about make files to know how to fix this. Any help greatly appreciated. -- Small is Beautiful From icon-group-sender Mon Jul 17 08:04:25 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA11409 for icon-group-addresses; Mon, 17 Jul 2000 08:03:05 -0700 (MST) Message-Id: <200007171503.IAA11409@baskerville.CS.Arizona.EDU> X-Newsgroups: comp.lang.icon Subject: Re: Installation on RH6.1 From: tkb@tkb.mpl.com (T. Kurt Bond) Date: 15 Jul 2000 15:31:24 -0400 X-Newsreader: Gnus v5.7/Emacs 20.4 X-Original-NNTP-Posting-Host: 198.77.4.83 X-Trace: 15 Jul 2000 15:31:47 -0400, 198.77.4.83 X-Original-NNTP-Posting-Host: 198.77.1.4 To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1534 Albert Wagner writes: > I have just attempted to install Icon9.3.2 for Unix (unix.tgz) on a > Redhat6.1 system. "make Status name=intel_linux" gave no errors; "make > X-Configure name=intel_linux" gave the following: > : > : > gcc -Wl,-E -ldl -o iconx xcnv.o xdata.o xdef.o xerrmsg.o xextcall.o > xfconv.o xfload.o xfmath.o xfmisc.o xfmonitr.o xfscan.o xfstr.o > xfstranl.o xfstruct.o xfsys.o xfwindow.o ximain.o ximisc.o xinit.o > xinterp.o xinvoke.o xkeyword.o xlmisc.o > xoarith.o xoasgn.o xocat.o xocomp.o xomisc.o xoref.o xoset.o xovalue.o > xralc.o xrcoexpr.o xrcomp.o xrdebug.o xrlocal.o xrlrgint.o xrmemmgt.o > xrmisc.o xrstruct.o xrsys.o xrwinrsc.o xrgfxsys.o xrwinsys.o xrwindow.o > xfxtra.o ../common/long.o ../common/time.o ../common/save.o > ../common/rswitch.o ../common/redirerr.o ../common/xwindow.o > ../common/alloc.o -L../../bin -lXpm -L/usr/X11/lib -lX11 -lm > /usr/bin/ld: cannot open -lX11: No such file or directory > collect2: ld returned 1 exit status > make[3]: *** [iconx] Error 1 > make[3]: Leaving directory `/root/pkg/lang/icon/src/runtime' > make[2]: *** [interp_all] Error 2 > make[2]: Leaving directory `/root/pkg/lang/icon/src/runtime' > make[1]: *** [Icon-icont] Error 2 > make[1]: Leaving directory `/root/pkg/lang/icon' > make: *** [Icon] Error 2 > > I don't know enough about make files to know how to fix this. Any help > greatly appreciated. Look for /usr/X11/lib in the Makefiles and change it to /usr/X11R6/lib. -- T. Kurt Bond, tkb somewhere near tkb.mpl.com From icon-group-sender Mon Jul 17 08:14:59 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA11751 for icon-group-addresses; Mon, 17 Jul 2000 08:14:47 -0700 (MST) Message-Id: <200007171514.IAA11751@baskerville.CS.Arizona.EDU> From: Albert Wagner X-Newsgroups: comp.lang.icon Subject: Re: Installation on RH6.1 Date: Sun, 16 Jul 2000 13:19:27 -0500 X-Complaints-To: newsabuse@supernews.com X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1675 Thanks, Kurt. That worked. "T. Kurt Bond" wrote: > > Albert Wagner writes: > > > I have just attempted to install Icon9.3.2 for Unix (unix.tgz) on a > > Redhat6.1 system. "make Status name=intel_linux" gave no errors; "make > > X-Configure name=intel_linux" gave the following: > > : > > : > > gcc -Wl,-E -ldl -o iconx xcnv.o xdata.o xdef.o xerrmsg.o xextcall.o > > xfconv.o xfload.o xfmath.o xfmisc.o xfmonitr.o xfscan.o xfstr.o > > xfstranl.o xfstruct.o xfsys.o xfwindow.o ximain.o ximisc.o xinit.o > > xinterp.o xinvoke.o xkeyword.o xlmisc.o > > xoarith.o xoasgn.o xocat.o xocomp.o xomisc.o xoref.o xoset.o xovalue.o > > xralc.o xrcoexpr.o xrcomp.o xrdebug.o xrlocal.o xrlrgint.o xrmemmgt.o > > xrmisc.o xrstruct.o xrsys.o xrwinrsc.o xrgfxsys.o xrwinsys.o xrwindow.o > > xfxtra.o ../common/long.o ../common/time.o ../common/save.o > > ../common/rswitch.o ../common/redirerr.o ../common/xwindow.o > > ../common/alloc.o -L../../bin -lXpm -L/usr/X11/lib -lX11 -lm > > /usr/bin/ld: cannot open -lX11: No such file or directory > > collect2: ld returned 1 exit status > > make[3]: *** [iconx] Error 1 > > make[3]: Leaving directory `/root/pkg/lang/icon/src/runtime' > > make[2]: *** [interp_all] Error 2 > > make[2]: Leaving directory `/root/pkg/lang/icon/src/runtime' > > make[1]: *** [Icon-icont] Error 2 > > make[1]: Leaving directory `/root/pkg/lang/icon' > > make: *** [Icon] Error 2 > > > > I don't know enough about make files to know how to fix this. Any help > > greatly appreciated. > > Look for /usr/X11/lib in the Makefiles and change it to /usr/X11R6/lib. > > -- > T. Kurt Bond, tkb somewhere near tkb.mpl.com -- Small is Beautiful From icon-group-sender Wed Jul 19 13:01:13 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA08404 for icon-group-addresses; Wed, 19 Jul 2000 12:59:03 -0700 (MST) Message-Id: <200007191959.MAA08404@baskerville.CS.Arizona.EDU> X-Sender: glastafari@pop.ntlworld.com (Unverified) Date: Wed, 19 Jul 2000 18:49:37 +0000 To: icon-group@optima.CS.Arizona.EDU From: Philip Newton Subject: help needed in ProIcon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 133 Dear Sir/Madam, Do you know the precise explanation of the "parse stack overflow" error? Yours sincerely, Dr Philip Newton From icon-group-sender Fri Jul 21 13:19:35 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA05061 for icon-group-addresses; Fri, 21 Jul 2000 13:17:40 -0700 (MST) Message-Id: <200007212017.NAA05061@baskerville.CS.Arizona.EDU> Date: Fri, 21 Jul 2000 11:01:33 -0500 From: "Charles Hethcoat" To: Subject: Unicon for NT Content-Disposition: inline X-Guinevere: 1.0.13 ; Oceaneering Int'l X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id JAA27370 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 494 I downloaded the Unicon package from UNLV and found that the Windows version requires MS nmake to build. I don't have nmake. As I understand it, nmake comes only with some expensive MS development tools, effectively making Unicon nonfree. True or not? Please tell me that this situation is only temporary, and that the release version of NT Unicon will be as free as the Unix version is (and as the Windows versions of Icon are). Am I missing something here? Thanks. Charles Hethcoat From icon-group-sender Fri Jul 21 17:20:44 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA11557 for icon-group-addresses; Fri, 21 Jul 2000 17:20:16 -0700 (MST) Message-Id: <200007220020.RAA11557@baskerville.CS.Arizona.EDU> To: "Charles Hethcoat" Cc: icon-group@optima.CS.Arizona.EDU, unicon-group@cs.unlv.edu Subject: Re: Unicon for NT Date: Fri, 21 Jul 2000 16:09:27 -0700 From: Clinton L Jeffery Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 746 Charles Hethcoat recently asked whether Unicon for NT requires Microsoft's commercial nmake program, and whether Unicon for NT is somehow less "free" than Icon for NT or Unicon for Unix. The answer is: the *source* distribution you downloaded at the moment has only one NT configuration, which is for Visual C++. A binary distribution for NT is in preparation, so yes Charles, the situation is temporary. Also, I would love to see (and will assist anyone who wants to work on) new NT configurations for other C compilers, especially free and semi-free C compilers (e.g. gcc, lcc). Cheers, Clint And now my mantra :-): if its about Unicon, route the discussion to unicon-group@cs.unlv.edu; if its about Icon more generally, use icon-group. From icon-group-sender Sun Jul 23 10:50:54 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id KAA06086 for icon-group-addresses; Sun, 23 Jul 2000 10:49:53 -0700 (MST) Message-Id: <200007231749.KAA06086@baskerville.CS.Arizona.EDU> From: "mco" X-Newsgroups: comp.lang.icon Subject: Re: Unicon for NT X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700 Date: Fri, 21 Jul 2000 22:57:45 -0400 X-Complaints-To: abuse@globetrotter.net X-Trace: news.globetrotter.net 964234719 142.169.163.84 (Fri, 21 Jul 2000 22:58:39 EDT) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 944 Charles, warning: bad english ahead I read on another news-group that ms/nmake is available free for download. But, :-), i dont remember which one ! So i will search it and send/post a link. I guess, as it is free, i may also send it to you by email. What compiler and make are you using ? Trying to help. Marc, cotemark@globetrotter.net Charles Hethcoat wrote in message <200007212017.NAA05061@baskerville.CS.Arizona.EDU>... >I downloaded the Unicon package from UNLV and found that the Windows version requires MS nmake to build. I don't have nmake. As I understand it, nmake comes only with some expensive MS development tools, effectively making Unicon nonfree. True or not? > >Please tell me that this situation is only temporary, and that the release version of NT Unicon will be as free as the Unix version is (and as the Windows versions of Icon are). > >Am I missing something here? Thanks. > >Charles Hethcoat > > > From icon-group-sender Sun Jul 23 10:51:26 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id KAA06195 for icon-group-addresses; Sun, 23 Jul 2000 10:51:10 -0700 (MST) Message-Id: <200007231751.KAA06195@baskerville.CS.Arizona.EDU> From: "Todd Nathan" X-Newsgroups: comp.lang.icon Subject: Icon for MacOSX Date: Sun, 23 Jul 2000 05:30:06 -0500 X-Trace: news.sdf 964360474 27911 216.173.110.132 (23 Jul 2000 13:54:34 GMT) X-Complaints-To: news@news.sdf X-Newsreader: Microsoft Outlook Express Macintosh Edition - 4.5 (0410) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 234 Hi, Is anyone working on ICON for Mac OS X? If not, is there a need/desire for such a port? Also, is there a working with bridges to native windows for NeXT/OPENSTEP (yes I know this would be old, but does it exist)? Thanks. \t From icon-group-sender Mon Jul 24 07:50:54 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA05120 for icon-group-addresses; Mon, 24 Jul 2000 07:50:07 -0700 (MST) Message-Id: <200007241450.HAA05120@baskerville.CS.Arizona.EDU> From: "Todd Nathan" X-Newsgroups: comp.lang.icon Subject: deep write()? Date: Sun, 23 Jul 2000 21:26:35 -0500 X-Trace: news.sdf 964417861 30542 216.173.110.132 (24 Jul 2000 05:51:01 GMT) X-Complaints-To: news@news.sdf X-Newsreader: Microsoft Outlook Express Macintosh Edition - 4.5 (0410) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 473 Is there a deep write method. Just come came across what I suspect there to be a weakness inherent in the function write(). No knowing how to do repeated recursive diggin, how would someone write a deep write... The following fails. procedure main () car1 := ["buick", "skylark", 1978, 2450] car2 := ["bmw", "535is", 1987, 3000] inventory := [car1, car2] write (inventory) end I would like to see the 'write (inventory)' work as a deep write.... Thanks, \t From icon-group-sender Mon Jul 24 07:52:55 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA05257 for icon-group-addresses; Mon, 24 Jul 2000 07:52:44 -0700 (MST) Message-Id: <200007241452.HAA05257@baskerville.CS.Arizona.EDU> From: "Marc Côté" X-Newsgroups: comp.lang.icon Subject: Unicon and nmake, Unicon port to LCC Win32 X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700 Date: Mon, 24 Jul 2000 02:08:25 -0400 X-Complaints-To: abuse@globetrotter.net X-Trace: news.globetrotter.net 964418966 142.169.162.100 (Mon, 24 Jul 2000 02:09:26 EDT) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1892 Hi, At http://sources.redhat.com/ml/cygwin/1999-05/msg00737.html I found: Microsoft has very nicely made available nmake15.exe, which is the NT3.5 vc++ 2.0 version of nmake. You can retrieve this from either ftp://ftp.microsoft.com/Softlib/MSLFILES/NMAKE15.EXE or ftp://unix.hensa.ac.uk/mirrors/ftp.microsoft.com/Softlib/MSLFILES/NMAKE15.EX E About porting Unicon: I found the idea fun, interesting an challenging. So i downloaded Unicon and LCC Win32. I have an NT 4.0 (SP 4) workstation. I use MSVC 5.0 (SP 3). My version of MDAC was very old, so i installed a more recent one. [ Note: one of the pdf has a bad crc and gdbm.h is read-only. ] I then tried to build Unicon with MSVC5.0, rtt.exe display usage info ( no real test ) mwiconx.exe can't read interpreter file header wiconx.exe crash wicont.exe display usage information ( no more test ). and there are no other exe in the bin dir. I then tried to compile with LCC Win32, Wow, now the real fun begun. The lcc-make program is not very happy with the !include directives So, i decided to continue with nmake. I had to produce a new set of makefiles for lcc. I had also to modify some of the sources files to make them compile. For now i have: src\preproc\ compile ok, pp.exe seems ok src\common, compile ok src\icont does not compile src\iconc does not compile src\wincap does not compile ( lcc gives errors when msvc give warnings ) i am lookin for wincap32. src\rtt compile, produce an exe which do not crash but not ok... I am hooked, i cant stop, i must see the end of this.... When i will have a complete set of makefiles, i will come back, with some answers and some questions. This means that the configurations files for LCC Win32 are on their way ! For sure, i'll see the end of it ! Cheers. Marc Côté. From icon-group-sender Mon Jul 24 07:53:33 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA05323 for icon-group-addresses; Mon, 24 Jul 2000 07:53:18 -0700 (MST) Message-Id: <200007241453.HAA05323@baskerville.CS.Arizona.EDU> From: "Todd Nathan" X-Newsgroups: comp.lang.icon Subject: Q: about cset and set writing Date: Mon, 24 Jul 2000 03:06:24 -0500 X-Trace: news.sdf 964438249 31493 216.173.110.132 (24 Jul 2000 11:30:49 GMT) X-Complaints-To: news@news.sdf X-Newsreader: Microsoft Outlook Express Macintosh Edition - 4.5 (0410) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 148 Seems that a cset is printable by 'write()', which makes sense. How does one go about writing a normal set, is there a way to do this easily? \t From icon-group-sender Mon Jul 24 09:03:31 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA07299 for icon-group-addresses; Mon, 24 Jul 2000 09:03:07 -0700 (MST) Message-Id: <200007241603.JAA07299@baskerville.CS.Arizona.EDU> Date: Mon, 24 Jul 2000 08:26:37 -0700 From: Steve Wampler X-Accept-Language: en To: Todd Nathan , icon-group Subject: Re: Q: about cset and set writing Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 529 Todd Nathan wrote: > > Seems that a cset is printable by 'write()', which makes > sense. How does one go about writing a normal set, is > there a way to do this easily? > > \t Since sets in Icon can contain themselves, you've got the same problem as with the "deep write" question. If you *know* you don't have self-referential sets, then you can add a clause to the "deepImage()" procedure in my last message to handle sets as well as lists. -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Mon Jul 24 09:06:18 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA07432 for icon-group-addresses; Mon, 24 Jul 2000 09:06:10 -0700 (MST) Message-Id: <200007241606.JAA07432@baskerville.CS.Arizona.EDU> Date: Mon, 24 Jul 2000 08:36:08 -0700 From: Steve Wampler X-Accept-Language: en To: icon-group Subject: Fixing my own error... Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 341 I misspoke in the response to "deep write" - "write()" does not call "image()" on arguments that cannot be converted to type "string" - it produces a runtime error instead. Sorry for the confusion! (the "deepWrite()" method given still works as advertised) -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Mon Jul 24 09:07:26 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA07485 for icon-group-addresses; Mon, 24 Jul 2000 09:07:17 -0700 (MST) Message-Id: <200007241607.JAA07485@baskerville.CS.Arizona.EDU> Date: Mon, 24 Jul 2000 08:24:06 -0700 From: Steve Wampler X-Accept-Language: en To: Todd Nathan , icon-group Subject: Re: deep write()? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2276 Todd Nathan wrote: > > Is there a deep write method. > > Just come came across what I suspect there to be a weakness > inherent in the function write(). No knowing how to do repeated > recursive diggin, how would someone write a deep write... > > The following fails. > > procedure main () > > car1 := ["buick", "skylark", 1978, 2450] > car2 := ["bmw", "535is", 1987, 3000] > > inventory := [car1, car2] > > write (inventory) > > end When write() encounters an argument that can't be converted to type string, it uses the image() function to display it. What you're really asking for is a "deep" image() function. Because Icon structures can contain *anything* including references to themselves, a deep image is non-trivial, though possible. Consider, for example, what the output should be if the above line: inventory := [car1, car2] were followed by put(inventory, inventory) (perfectly legal code, if meaningless in this context...) What should the deep image (and hence write()) produce? A general purpose deep image has got to be able to handle the above. It's probably simpler to write a special-purpose one yourself if you are *absolutely* certain your structures are not cyclic graphs. > I would like to see the 'write (inventory)' work as a deep > write.... Well, here's one to deep write a list, assuming the list is acyclic. (Handling a cyclic structure is left as an exercise... :) procedure deepWrite(args[]) outfile := &output every arg := !args do { case type(arg) of { "file": outfile := arg default: writes(outfile, deepImage(arg)) } } write(outfile) end procedure deepImage(arg) local resultString if string(arg) then return string(arg) case type(arg) of { "list": { resultString := "[" every resultString ||:= deepImage(!arg) || "," resultString[-1] := "]" # change last , to ] return resultString } default: return image(arg) # cop out on other structures } end Note that this code *depends* on any list passed to deepImage as being acyclic - it *won't* work on cyclic structures! -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Mon Jul 24 11:35:24 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id LAA11894 for icon-group-addresses; Mon, 24 Jul 2000 11:33:13 -0700 (MST) Message-Id: <200007241833.LAA11894@baskerville.CS.Arizona.EDU> Date: Mon, 24 Jul 2000 09:16:10 -0700 (MST) From: Gregg Townsend To: icon-group@optima.CS.Arizona.EDU, todd@palomablanca.net Subject: Re: Icon for MacOSX Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 774 From: "Todd Nathan" Is anyone working on ICON for Mac OS X? If not, is there a need/desire for such a port? As far as I know, nobody is actively working on a Mac port of any sort. There are occasional queries and expressions of desire. Also, is there a working with bridges to native windows for NeXT/OPENSTEP (yes I know this would be old, but does it exist)? That's a platform for which I've never heard any interest expressed. There was an Icon port to the original NeXT cube, without graphics. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Mon Jul 24 11:36:42 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id LAA12054 for icon-group-addresses; Mon, 24 Jul 2000 11:36:34 -0700 (MST) Message-Id: <200007241836.LAA12054@baskerville.CS.Arizona.EDU> Date: Mon, 24 Jul 2000 10:48:44 -0700 From: Steve Wampler X-Accept-Language: en To: icon-group Subject: deepImage that handles empty lists... Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 689 I just noticed that deepImage() doesn't handle empty lists correctly. Here's a fixed version... procedure deepImage(arg) local resultString if string(arg) then return string(arg) case type(arg) of { "list": { resultString := "[" every resultString ||:= deepImage(!arg) || "," if (resultString[-1] == ",") then { resultString[-1] := "" } resultString ||:= "]" return resultString } default: return image(arg) # cop out on other structures } end -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Tue Jul 25 12:45:21 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA11202 for icon-group-addresses; Tue, 25 Jul 2000 12:43:49 -0700 (MST) Message-Id: <200007251943.MAA11202@baskerville.CS.Arizona.EDU> Date: Tue, 25 Jul 2000 10:51:38 -0400 From: "Steve Graham" To: Subject: Another puzzle Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id HAA17436 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 567 Folks: Here's a puzzle which seems an ideal challenge for Icon: Make your way from WISH to HOPE in seven steps, changing one letter at a time to form the interim words. WISH _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ HOPE Steve Graham --------------------------------------------------------------------------------------- Steve Graham Senior Programmer/Analyst LabCorp Phone: (972) 437-5255, ext 5224 Fax: (972) 454-1050 Mail: grahams@labcorp.com --------------------------------------------------------------------------------------- From icon-group-sender Tue Jul 25 12:49:42 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA11353 for icon-group-addresses; Tue, 25 Jul 2000 12:49:34 -0700 (MST) Message-Id: <200007251949.MAA11353@baskerville.CS.Arizona.EDU> From: Kim Scarborough X-Newsgroups: comp.lang.icon Subject: radcon.icn? Date: Tue, 25 Jul 2000 13:53:56 -0500 X-Trace: news.enteract.com 964551219 33866 216.80.78.55 (25 Jul 2000 18:53:39 GMT) X-Complaints-To: abuse@enteract.com X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 272 I am attempting to compile a very old icon program that needs the radcon.icn library. I've found references to it, but I can't find the actual file for the life of me. Anyone know where I can track it down, or could anyone possibly post it? I doubt it's more than 20K... From icon-group-sender Tue Jul 25 16:29:17 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA12309 for icon-group-addresses; Tue, 25 Jul 2000 16:28:11 -0700 (MST) Message-Id: <200007252328.QAA12309@baskerville.CS.Arizona.EDU> From: Brian.C.Monsell@ccmail.census.gov X-Lotus-FromDomain: BOC To: Kim Scarborough cc: icon-group@optima.CS.Arizona.EDU Date: Tue, 25 Jul 2000 15:55:52 -0400 Subject: Re: radcon.icn? Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2388 --0__=6EbkAH6jHWDlbXHYJhsRknMZEuepo5i0d0fcfkgpnLViWK9UlCyGWM5D Content-type: text/plain; charset=us-ascii Content-Disposition: inline Here is the module... (See attached file: Radcon.icn) --0__=6EbkAH6jHWDlbXHYJhsRknMZEuepo5i0d0fcfkgpnLViWK9UlCyGWM5D Content-type: application/octet-stream; name="Radcon.icn" Content-Disposition: attachment; filename="Radcon.icn" Content-Transfer-Encoding: base64 IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIw0KIw0KIwlOYW1lOglyYWRjb24uaWNuDQojDQojCVRpdGxlOglS YWRpeCBjb252ZXJzaW9uDQojDQojCUF1dGhvcjoJUmFscGggRS4gR3Jpc3dvbGQNCiMNCiMJRGF0 ZToJSnVuZSAxMCwgMTk4OA0KIw0KIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIw0KIyAgDQojICBUaGUgZm9s bG93aW5nIHByb2NlZHVyZXMgY29udmVydCBudW1iZXJzIGZyb20gb25lIHJhZGl4IHRvDQojICBh bm90aGVyLiBUaGUgbGV0dGVycyBmcm9tIGEgdG8geiBhcmUgdXNlZCBmb3IgYGBkaWdpdHMnJyBn cmVhdGVyDQojICB0aGFuIDkuIEFsbCB0aGUgY29udmVyc2lvbiBwcm9jZWR1cmVzIGZhaWwgaWYg dGhlIGNvbnZlcnNpb24gY2FuLQ0KIyAgbm90IGJlIG1hZGUuDQojICANCiMgICAgICAgZXhiYXNl MTAoaSxqKSAgY29udmVydCBiYXNlLTEwIGludGVnZXIgaSB0byBiYXNlIGoNCiMgIA0KIyAgICAg ICBpbmJhc2UxMChzLGkpICBjb252ZXJ0IGJhc2UtaSBpbnRlZ2VyIHMgdG8gYmFzZSAxMA0KIyAg DQojICAgICAgIHJhZGNvbihzLGksaikgIGNvbnZlcnQgYmFzZS1pIGludGVnZXIgcyB0byBiYXNl IGoNCiMgIA0KIyAgTGltaXRhdGlvbjoNCiMNCiMgICAgIFRoZSBtYXhpbXVtIGJhc2UgYWxsb3dl ZCBpcyAzNi4NCiMgIA0KIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIw0KDQpwcm9jZWR1cmUgZXhiYXNlMTAo aSxqKQ0KICAgc3RhdGljIGRpZ2l0cw0KICAgbG9jYWwgcywgZCwgc2lnbg0KICAgaW5pdGlhbCBk aWdpdHMgOj0gJmRpZ2l0cyB8fCAmbGNhc2UNCiAgIGlmIGkgPSAwIHRoZW4gcmV0dXJuIDANCiAg IGlmIGkgPCAwIHRoZW4gew0KICAgICAgc2lnbiA6PSAiLSINCiAgICAgIGkgOj0gLWkNCiAgICAg IH0NCiAgIGVsc2Ugc2lnbiA6PSAiIg0KICAgcyA6PSAiIg0KICAgd2hpbGUgaSA+IDAgZG8gew0K ICAgICAgZCA6PSBpICUgag0KICAgICAgaWYgZCA+IDkgdGhlbiBkIDo9IGRpZ2l0c1tkICsgMV0N CiAgICAgIHMgOj0gZCB8fCBzDQogICAgICBpIC86PSBqDQogICAgICB9DQogICByZXR1cm4gc2ln biB8fCBzDQplbmQNCg0KcHJvY2VkdXJlIGluYmFzZTEwKHMsaSkNCiAgIGlmIHNbMV0gPT0gIi0i IHRoZW4gcmV0dXJuICItIiB8fCBpbnRlZ2VyKGkgfHwgInIiIHx8IHNbMjowXSkNCiAgIGVsc2Ug cmV0dXJuIGludGVnZXIoaSB8fCAiciIgfHwgcykNCmVuZA0KDQpwcm9jZWR1cmUgcmFkY29uKHMs aSxqKQ0KICAgcmV0dXJuIGV4YmFzZTEwKGluYmFzZTEwKHMsaSksaikNCmVuZA0K --0__=6EbkAH6jHWDlbXHYJhsRknMZEuepo5i0d0fcfkgpnLViWK9UlCyGWM5D-- From icon-group-sender Wed Jul 26 08:05:24 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA06748 for icon-group-addresses; Wed, 26 Jul 2000 08:04:54 -0700 (MST) Message-Id: <200007261504.IAA06748@baskerville.CS.Arizona.EDU> From: Bob Ardler To: icon-group@optima.CS.Arizona.EDU Date: Wed, 26 Jul 2000 11:58:40 +0100 Subject: Alternative representation of reals User-Agent: Pluto/2.02b (RISC-OS/3.60) Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 970 In Jun'00 Kostas Oikonomou twice posted enquiries about comparison of reals. No response and nor is this, but maybe of interest:- In a hobbyists' magazine Gavin Wraith explains that because the fixed-length (exponent,mantissa) representation of reals can accumulate rounding errors; and because memory size and understanding of garbage-collection and heap management now permit it, variable-length representations have been sought. He commends the "latest and most promising" real number format from Abbas Edalat and P.J.Potts at Imperial College, described in http://theory.doc.ic.ac.uk:80/~ae/ and http://theory.doc.ic.ac.uk:80/~pjp "Prototype implementations in Haskell, Miranda, C++ and Java are now available." The representation will enable comparison as well as other real arithmetic - not as in Knuth. There is a fairly readable detailing (in Miranda) at http://theory.doc.ic.ac.uk/~pjp/thesis.m -- Bob Ardler, ardler@argonet.co.uk From icon-group-sender Mon Jul 31 08:23:52 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA03027 for icon-group-addresses; Mon, 31 Jul 2000 08:20:30 -0700 (MST) Message-Id: <200007311520.IAA03027@baskerville.CS.Arizona.EDU> Date: Sat, 29 Jul 2000 16:24:51 -0700 (MST) From: Gregg Townsend To: icon-group Subject: Version 9.3.3 of Icon Program Library available Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1068 Version 9.3.3 of the Icon program library is now available in source and compiled form from: http://www.cs.arizona.edu/icon/ipl93.htm The corresponding on-line documentation can be viewed at: http://www.cs.arizona.edu/icon/library/ipl.htm This program library update reflects all the changes that have accumulated since the release of version 9.3.2 in July, 1999, and includes several new programs and procedures. Among these are the USGS map viewer and associated procedures described in the last issue of the Icon newsletter: http://www.cs.arizona.edu/icon/inl/inl60/inl60.htm#USGS The map viewer has its own web page and can be downloaded separately: http://www.cs.arizona.edu/icon/oddsends/dlgvu/ No corresponding update is planned for the Icon translator and runtime system. Version 9.3.2 remains the current version. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Fri Aug 18 16:51:15 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA00578 for icon-group-addresses; Fri, 18 Aug 2000 16:48:14 -0700 (MST) Message-Id: <200008182348.QAA00578@baskerville.CS.Arizona.EDU> From: "Ian Trudel" To: "Icon Project Group" Subject: [Icon][WinNT] external C functions. Date: Fri, 18 Aug 2000 16:35:49 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 522 Hello everyone, has anyone worked with external C functions using Icon's callout()/loadfunc() ? I'm just searching for some Icon/C examples. Of course, I have been on Icon's website but the exemples are kinda *NIX based and I've figured out icall.h wasn't enough (at least, not under NT). I'm currently using Icon Version 9.3.1 with Microsoft Visual C++ 6.0 with lastest Service Pack under Microsoft Windows NT 4.0 Workstation, Service Pack 6a high encryption. Thanks, Ian Trudel mailto:ian.trudel@tr.cgocable.ca From icon-group-sender Mon Aug 21 16:29:07 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA13124 for icon-group-addresses; Mon, 21 Aug 2000 16:27:58 -0700 (MST) Message-Id: <200008212327.QAA13124@baskerville.CS.Arizona.EDU> Date: Mon, 21 Aug 2000 14:53:35 -0700 (MST) From: Gregg Townsend To: ian.trudel@tr.cgocable.ca, icon-group@optima.CS.Arizona.EDU Subject: Re: [Icon][WinNT] external C functions. Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 829 > From: "Ian Trudel" > Date: Fri, 18 Aug 2000 16:35:49 -0400 > has anyone worked with external C functions using Icon's > callout()/loadfunc() ? I'm just searching for some Icon/C examples. Of > course, I have been on Icon's website but the exemples are kinda *NIX based > and I've figured out icall.h wasn't enough (at least, not under NT). I don't believe that loadfunc() is implemented in the Windows port of Icon. The callout() approach is awfully cumbersome -- it involves editing the source of Icon and rebuilding the system -- but it may be your only option. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Tue Aug 22 07:39:52 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA13214 for icon-group-addresses; Tue, 22 Aug 2000 07:39:32 -0700 (MST) Message-Id: <200008221439.HAA13214@baskerville.CS.Arizona.EDU> Delivered-To: fixup-icon-group@CS.arizona.edu@fixme Date: Mon, 21 Aug 2000 20:12:46 -0600 From: Cheyenne Wills X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Subject: Re: [Icon][WinNT] external C functions. Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 6815 This is a multi-part message in MIME format. --------------30657AAB585C0267D4C3A50B Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Well.. here is some code that I hacked a long time ago to implement dynamically loaded functions for OS/2. You might be able to hack at it to work under WinNT. Basically your code was loaded into a DLL and the Icon runtime could call out to it.. Anyway... enjoy... ---[fload.r]--- --------------30657AAB585C0267D4C3A50B Content-Type: text/plain; charset=us-ascii; name="fload.r" Content-Disposition: inline; filename="fload.r" Content-Transfer-Encoding: 7bit /* * File: fload.r * Contents: loadfunc. * * This file contains loadfunc(), the dynamic loading function for * Unix systems having the interface. * * from Icon: * p := loadfunc(filename, funcname) * p(arg1, arg2, ...) * * in C: * int func(int argc, dptr argv) * return -1 for failure, 0 for success, >0 for error * argc is number of true args not including argv[0] * argv[0] is for return value; others are true args */ #ifdef LoadFunc #ifndef RTLD_LAZY /* normally from */ #define RTLD_LAZY 1 #endif /* RTLD_LAZY */ #ifdef FreeBSD /* Sorry, no dlerror() on FreeBSD. Fake it. */ char *dlerror(void) { int no; if (0 == dlctl(NULL, DL_GETERRNO, &no)) return(strerror(no)); else return(NULL); } #endif /* __FreeBSD__ */ #if COMPILER int glue Params(( int argc, dptr dargv, dptr rslt, continuation succ_count)); #else int glue Params(( int argc, dptr dargv) ); #endif /* COMPILER */ #if OS2 int makefunc Params((dptr d, char *name, void *funcptr)); #else int makefunc Params((dptr d, char *name, int (*func)() )); #endif /* OS2 */ "loadfunc(filename,funcname) - load C function dynamically." function{0,1} loadfunc(filename,funcname) if !cnv:C_string(filename) then runerr(103, filename) if !cnv:C_string(funcname) then runerr(103, funcname) abstract { return proc } body { #if OS2 unsigned long modhandle; int rc; #passthru int (* _System funcaddr)(int argc, dptr dargv); rc = _loadmod(filename,&modhandle); if (rc) { runerr(216); } rc = DosQueryProcAddr( modhandle, 0, funcname, &funcaddr ); if (rc) { _freemod(modhandle); runerr(216); } if (!makefunc(&result, funcname, (void *)funcaddr ) ) { _freemod(modhandle); runerr(305); } return result; } #else /* OS2 */ int (*func)(); static char *curfile; static void *handle; char errbuf[1000]; /* * Get a library handle, reusing it over successive calls. */ if (!handle || !curfile || strcmp(filename, curfile) != 0) { if (curfile) free((pointer)curfile); /* free the old file name */ curfile = salloc(filename); /* save the new name */ handle = dlopen(filename, RTLD_LAZY); /* get the handle */ } /* * Load the function. Diagnose both library and function errors here. */ if (handle) func = (int (*)())dlsym(handle, funcname); if (!handle || !func) { fprintf(stderr, "\nloadfunc(\"%s\",\"%s\"): %s\n", filename, funcname, dlerror()); runerr(216); } /* * Build and return a proc descriptor. */ if (!makefunc(&result, funcname, func)) runerr(305); return result; } #endif /* OS2 */ end /* * makefunc(d, name, func) -- make function descriptor in d. * * Returns 0 if memory could not be allocated. */ int makefunc(d, name, func) dptr d; char *name; #if OS2 void *func; #else int (*func)(); #endif /* OS2 */ { struct b_proc *blk; blk = (struct b_proc *)malloc(sizeof(struct b_proc)); if (!blk) return 0; blk->title = T_Proc; blk->blksize = sizeof(struct b_proc); #if COMPILER blk->ccode = glue; /* set code addr to glue routine */ #else /* COMPILER */ blk->entryp.ccode = glue; /* set code addr to glue routine */ #endif /* COMPILER */ blk->nparam = -1; /* varargs flag */ blk->ndynam = -1; /* treat as built-in function */ blk->nstatic = 0; blk->fstatic = 0; blk->pname.dword = strlen(name); blk->pname.vword.sptr = salloc(name); blk->lnames[0].dword = 0; blk->lnames[0].vword.sptr = (char *)func; /* save func addr in lnames[0] vword */ d->dword = D_Proc; /* build proc descriptor */ d->vword.bptr = (union block *)blk; return 1; } /* * This glue routine is called when a loaded function is invoked. * It digs the actual C code address out of the proc block, and calls that. */ #if COMPILER int glue(argc, dargv, rslt, succ_cont) int argc; dptr dargv; dptr rslt; continuation succ_cont; { int i, status, (*func)(); struct b_proc *blk; struct descrip r; tended struct descrip p; dargv--; /* reset pointer to proc entry */ for (i = 0; i <= argc; i++) deref(&dargv[i], &dargv[i]); /* dereference args including proc */ blk = (struct b_proc *)dargv[0].vword.bptr; /* proc block address */ func = (int (*)())blk->lnames[0].vword.sptr; /* entry point address */ p = dargv[0]; /* save proc for traceback */ dargv[0] = nulldesc; /* set default return value */ status = (*func)(argc, dargv); /* call func */ if (status == 0) { *rslt = dargv[0]; Return; /* success */ } if (status < 0) Fail; /* failure */ r = dargv[0]; /* save result value */ dargv[0] = p; /* restore proc for traceback */ if (is:null(r)) RunErr(status, NULL); /* error, no value */ RunErr(status, &r); /* error, with value */ } #else /* COMPILER */ int glue(argc, dargv) int argc; dptr dargv; { int status; #if OS2 #passthru int (* _System func)(int argc, dptr dargv); void *funcptr; #else int (*func)(); #endif /* OS2 */ struct b_proc *blk; struct descrip r; tended struct descrip p; blk = (struct b_proc *)dargv[0].vword.bptr; /* proc block address */ #if OS2 funcptr = (void *)blk->lnames[0].vword.sptr; /* entry point address */ func = funcptr; #else func = (int (*)())blk->lnames[0].vword.sptr; /* entry point address */ #endif p = dargv[0]; /* save proc for traceback */ dargv[0] = nulldesc; /* set default return value */ status = (*func)(argc, dargv); /* call func */ if (status == 0) Return; /* success */ if (status < 0) Fail; /* failure */ r = dargv[0]; /* save result value */ dargv[0] = p; /* restore proc for traceback */ if (is:null(r)) RunErr(status, NULL); /* error, no value */ RunErr(status, &r); /* error, with value */ } #endif /* COMPILER */ #else /* LoadFunc */ static char junk; /* avoid empty module */ #endif /* LoadFunc */ --------------30657AAB585C0267D4C3A50B-- From icon-group-sender Tue Aug 29 07:47:34 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA05105 for icon-group-addresses; Tue, 29 Aug 2000 07:44:28 -0700 (MST) Message-Id: <200008291444.HAA05105@baskerville.CS.Arizona.EDU> X-Priority: 3 (Normal) Date: Tue, 29 Aug 2000 11:22:21 +0200 (CEST) From: Guido Milanese To: icon-group@optima.CS.Arizona.EDU Subject: Help: menus Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 4536 This message is in MIME format --_=XFMail.1.4.0.Linux:000829112221:1385=_ Content-Type: text/plain; charset=iso-8859-1 Dear Experts, I am sorry to ask a question on a topic extensively covered in the manuals, but I'm afraid I missed something essential. I have recently written a program to search textbases. The program works already quite well from command line -- as soon as it will be finished and tested, I'll make it available in the public domain. Personally, I prefer to work from command line, both in Windows and Linux, but some friends, who are likely to use the program, ask for a GUI. OK. Tried it with VIB. I easily built a window with 3 menus: _____________________ | | | File | Search | Help | _____|________|______| I know it is rather obvious... but how on earth should I use the code produced by VIB? I append it as attach file, so that I won't bother those who do not want to answer my question. The only change I did was to add a "case" instruction in one of the menus, just to test it with a simple output on terminal, but nothing happens. Obviously I should do... soething else, but I do not know what! I am confident in a kind answer from some expert, or even from normal users... Thanks in advance, Guido (from Italy) --_=XFMail.1.4.0.Linux:000829112221:1385=_ Content-Disposition: attachment; filename="try.icn" Content-Description: try.icn Content-Type: application/octet-stream; name=try.icn; SizeOnDisk=2198 Content-Transfer-Encoding: base64 IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIwojCiMJRmlsZTogICAgIHRyeS5pY24KIwojCVN1YmplY3Q6ICBQ cm9ncmFtIHRvIC4uLgojCiMJQXV0aG9yOiAgIAojCiMJRGF0ZTogICAgIEF1Z3VzdCAyOSwgMjAw MAojCiMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMKIwojCiMKIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIwojCiMgIFJl cXVpcmVzOgojCiMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMKIwojICBMaW5rczogdnNldHVwCiMKIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIwoKIyAgVGhpcyB2aWIgaW50ZXJmYWNlIHNwZWNpZmljYXRpb24gaXMgYSB3 b3JraW5nIHByb2dyYW0gdGhhdCByZXNwb25kcwojICB0byB2aWRnZXQgZXZlbnRzIGJ5IHByaW50 aW5nIG1lc3NhZ2VzLiAgVXNlIGEgdGV4dCBlZGl0b3IgdG8gcmVwbGFjZQojICB0aGlzIHNrZWxl dGFsIHByb2dyYW0gd2l0aCB5b3VyIG93biBjb2RlLiAgUmV0YWluIHRoZSB2aWIgc2VjdGlvbiBh dAojICB0aGUgZW5kIGFuZCB1c2UgdmliIHRvIG1ha2UgYW55IGNoYW5nZXMgdG8gdGhlIGludGVy ZmFjZS4KCmxpbmsgdnNldHVwCgpwcm9jZWR1cmUgbWFpbihhcmdzKQogICBsb2NhbCB2aWRnZXRz LCByb290LCBwYXVzZWQKCiAgIChXT3BlbiAhIHVpX2F0dHMoKSkgfCBzdG9wKCJjYW4ndCBvcGVu IHdpbmRvdyIpCiAgIHZpZGdldHMgOj0gdWkoKQkJCQkjIHNldCB1cCB2aWRnZXRzCiAgIHJvb3Qg Oj0gdmlkZ2V0c1sicm9vdCJdCgogICBwYXVzZWQgOj0gMQkJCQkJIyBmbGFnIG5vIHdvcmsgdG8g ZG8KICAgcmVwZWF0IHsKICAgICAgIyBoYW5kbGUgYW55IGV2ZW50cyB0aGF0IGFyZSBhdmFpbGFi bGUsIG9yCiAgICAgICMgd2FpdCBmb3IgZXZlbnRzIGlmIHRoZXJlIGlzIG5vIG90aGVyIHdvcmsg dG8gZG8KICAgICAgd2hpbGUgKCpQZW5kaW5nKCkgPiAwKSB8IFxwYXVzZWQgZG8gewogICAgICAg ICBQcm9jZXNzRXZlbnQocm9vdCwgUXVpdENoZWNrKQogICAgICAgICB9CiAgICAgICMgaWYgPHBh dXNlZD4gaXMgc2V0IG51bGwsIGNvZGUgY2FuIGJlIGFkZGVkIGhlcmUKICAgICAgIyB0byBwZXJm b3JtIHVzZWZ1bCB3b3JrIGJldHdlZW4gY2hlY2tzIGZvciBpbnB1dAogICAgICB9CmVuZAoKcHJv Y2VkdXJlIG1lbnVfY2IxKHZpZGdldCwgdmFsdWUpCiAgIHJldHVybgplbmQKCnByb2NlZHVyZSBt ZW51X2NiMih2aWRnZXQsIHZhbHVlKQogICByZXR1cm4KZW5kCgpwcm9jZWR1cmUgbWVudV9jYjMo dmlkZ2V0LCB2YWx1ZSkKICAgY2FzZSB2YWx1ZSBvZiB7IkluZGV4IiAgIDogICB3cml0ZSgiSXRl bSAxIikKICAgICAgICAgICAgICAgICAgIkFib3V0IiAgIDogICB3cml0ZSgiSXRlbSAyIikKICAg ICAgICAgICAgICAgICAgIkNvbnRhY3QiIDogICB3cml0ZSgiSXRlbSAzIikKICAgICAgICAgICAg ICAgICB9CiAgIHJldHVybgplbmQKCiM9PT08PHZpYjpiZWdpbj4+PT09CW1vZGlmeSB1c2luZyB2 aWI7IGRvIG5vdCByZW1vdmUgdGhpcyBtYXJrZXIgbGluZQpwcm9jZWR1cmUgdWlfYXR0cygpCiAg IHJldHVybiBbInNpemU9MTM2LDI3NiIsICJiZz1wYWxlIGdyYXkiXQplbmQKCnByb2NlZHVyZSB1 aSh3aW4sIGNiaykKcmV0dXJuIHZzZXR1cCh3aW4sIGNiaywKICAgWyI6U2l6ZXI6OjowLDAsMTM2 LDI3NjoiLF0sCiAgIFsibWVudTE6TWVudTpwdWxsOjowLDAsMzYsMjE6RmlsZSIsbWVudV9jYjEs CiAgICAgIFsiT3BlbiIsIlJlbW92ZSJdXSwKICAgWyJtZW51MjpNZW51OnB1bGw6OjM1LDAsNTAs MjE6U2VhcmNoIixtZW51X2NiMiwKICAgICAgWyJCcm93c2UiLCJGaW5kIiwiT3B0aW9ucyJdXSwK ICAgWyJtZW51MzpNZW51OnB1bGw6Ojg1LDAsMzYsMjE6SGVscCIsbWVudV9jYjMsCiAgICAgIFsi SW5kZXgiLCJBYm91dCIsIkNvbnRhY3QiXV0sCiAgICkKZW5kCiM9PT08PHZpYjplbmQ+Pj09PQll bmQgb2Ygc2VjdGlvbiBtYWludGFpbmVkIGJ5IHZpYgo= --_=XFMail.1.4.0.Linux:000829112221:1385=_-- End of MIME message From icon-group-sender Tue Aug 29 12:33:46 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA13916 for icon-group-addresses; Tue, 29 Aug 2000 12:33:24 -0700 (MST) Message-Id: <200008291933.MAA13916@baskerville.CS.Arizona.EDU> X-Priority: 3 (Normal) Date: Tue, 29 Aug 2000 18:38:42 +0200 (CEST) From: Guido Milanese To: icon-group@optima.CS.Arizona.EDU Subject: RE: Help: menus Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 465 Dear all, this morning I sent a message asking help about menus. I think I have solved the problem, but let me say that the Icon graphics manual is a bit difficult to understand about how to use menus! Thanks to you all, G. ------------------------------------------- E-Mail: Guido Milanese Homepage: http://fly.to/arsantiqua 29-Aug-00 - XFMail on Linux + + + + + + NON NOBIS DOMINE + + + + + + ------------------------------------------- From icon-group-sender Thu Aug 31 09:08:20 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA16238 for icon-group-addresses; Thu, 31 Aug 2000 09:06:38 -0700 (MST) Message-Id: <200008311606.JAA16238@baskerville.CS.Arizona.EDU> From: "Frank J. Lhota" X-Newsgroups: comp.lang.icon Subject: SlickEdit Macros for Icon X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly X-Complaints-To: support@usenetserver.com Date: Thu, 31 Aug 2000 11:37:04 -0400 To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 218 Does anyone know of a SlickEdit macro package for Icon language sensitive editing? If so, please share its location with this group. If I cannot find one without too much hassle, I'll write my own and post it here. From icon-group-sender Mon Sep 4 13:31:19 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA02634 for icon-group-addresses; Mon, 4 Sep 2000 13:30:48 -0700 (MST) Message-Id: <200009042030.NAA02634@baskerville.CS.Arizona.EDU> From: Leonard X-Newsgroups: comp.lang.icon Subject: newbie questions Date: Sat, 02 Sep 2000 05:13:38 -0600 X-Orig-Message-ID: Abuse-Reports-To: abuse at airmail.net to report improper postings NNTP-Proxy-Relay: library2.airnews.net NNTP-Posting-Time: Sat Sep 2 06:13:15 2000 X-Newsreader: Forte Agent 1.8/32.548 To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 719 Hello; I have some experience programming in Fortran, but would now like to do some windows gui programming in a more modern language. >From what I have read, I like Icon's strings processing features, as well as the fact that the size of strings / lists do not have to be specified when writing a program. now... Can an Icon program be compiled into a stand-alone executable, to be used on computers without Icon installed? If so... How much memory overhead does the Icon interpreter have? How does the program execution speed compare to a similar program written in C++ or Java? Are there files system functions to check for the existence of, copy, move and rename specified files / folders? Thanks Leonard From icon-group-sender Mon Sep 4 13:44:10 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA02942 for icon-group-addresses; Mon, 4 Sep 2000 13:43:57 -0700 (MST) Message-Id: <200009042043.NAA02942@baskerville.CS.Arizona.EDU> From: Guido Milanese X-Newsgroups: comp.lang.icon Subject: Graphics: TextList problem Date: Sat, 02 Sep 2000 21:44:25 +0200 X-Accept-Language: it, en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1507 I noticed that the participants to this discussion group are all almost all at "high level"... and therefore I always hesitate before asking simple questions. However, I take the libery to post a simple question on graphics. I would like to use the TextList instruction to display the contents of a file or of long variables. I used VIB and I obtain this code, slightly edited: #===<>=== modify using vib; do not remove this marker line procedure ui_atts() return ["size=600,401", "bg=pale gray"] end procedure ui(win, cbk) return vsetup(win, cbk, [":Sizer:::0,0,600,400:",], ["list:List:r::116,89,400,50:",list_cb], ) end #===<>=== end of section maintained by vib The callback procedure (but is it necessary?) is procedure list_cb(vidget, value) return end and I setup windows this way: VSetItems(vidgets["list"], ["a", "b", "c", "d"]) But if I substitute this test list with real data, I see that output terminates at each newline char: I read a file in untranslated mode, save input as a variable (e.g. testvar), and write as such: VSetItems(vidgets["list"], [testvar]) but output stops after the first newline (I tested the output in a "normal" window and it's all OK). How can I do? Thanks! Guido (Italy) ------------------------------------------------------ Guido Milanese Vocal Ensemble "Ars Antiqua" gmilanese@mclink.it http://fly.to/arsantiqua Salita del Passero 11 I-16126 Genova GE, Italy * Sed nomini tuo da gloriam * From icon-group-sender Mon Sep 4 13:44:52 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA02996 for icon-group-addresses; Mon, 4 Sep 2000 13:44:43 -0700 (MST) Message-Id: <200009042044.NAA02996@baskerville.CS.Arizona.EDU> From: Cherniavsky Beni X-Newsgroups: comp.lang.icon Subject: Icon-based shell? Date: Sun, 03 Sep 2000 20:02:54 GMT X-Article-Creation-Date: Sun Sep 03 20:02:54 2000 GMT X-Http-User-Agent: Mozilla/4.05 [en] (WinNT; I) X-Http-Proxy: 1.0 x64.deja.com:80 (Squid/1.1.22) for client 143.185.1.11 X-MyDeja-Info: XMYDJUIDscben To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 472 I've been long thinking that iterators could be very handy when doing quick jobs, whick is what you do at the shell (unless it's command.com, in which case you don't). DUEL, which is a C-like interpreter inspired by Icon and integrated into GDB, proves that it can be good in interactive use. Does anybody know of or have ideas about a shell that would have iterators? -- Cherniavsky Beni Sent via Deja.com http://www.deja.com/ Before you buy. From icon-group-sender Tue Sep 5 08:08:44 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA25783 for icon-group-addresses; Tue, 5 Sep 2000 08:08:25 -0700 (MST) Message-Id: <200009051508.IAA25783@baskerville.CS.Arizona.EDU> Date: Tue, 5 Sep 2000 17:38:56 +1100 (EST) From: Rohan McLeod To: Leonard cc: icon-group@optima.CS.Arizona.EDU Subject: Re: newbie questions Content-ID: Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 4634 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --231439950-658434473-968135323=:6463 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: Leonard; since you don't seem to be getting much attention from the resident guru's and the list doesn't seem to have enormous traffic;I thought I might share my understandings on some of the matters you have raised....the blind leading the blind! On Sat, 2 Sep 2000, Leonard wrote: > Hello; > I have some experience programming in Fortran, but would now like to do > some windows gui programming in a more modern language. > The executables that come "out" of Icon are for a command line interface; you would seem to need something called "VIB " if you want gui. > >From what I have read, I like Icon's strings processing features, as > well as the fact that the size of strings / lists do not have to be > specified when writing a program. now... > > Can an Icon program be compiled into a stand-alone executable, to be > used on computers without Icon installed? In the past (say prior to ver 8.7 see the attachment) there were two ways of producing an executable: 1/via the Icon compiler "iconc" (see Ipd191.doc)."iconc" would convert the source code to the language "C" which could then be compiled to to an executable via a suitable "C" compiler(either manually or by a command line switch.)Whether this intermediate step was for cross- platform accessibility or to avoid having to write a "*.icn->*.exe" compiler or both... I don't know. Anyway iconc is now no longer supported.(see attachment) 2/via an attached interpreter which means that your smallest program is about 300k(compare Icon9\bin\noname.exe 310kb with Icon\bin\noname.icn 1kb) ps One of the reasons I am still a novice Icon programmer is because it has no direct "*.icn->*.exe" compiler! > > If so... > > How much memory overhead does the Icon interpreter have? > > How does the program execution speed compare to a similar program > written in C++ or Java? > Checkout http://www.idiom.com/free-compilers > Are there files system functions to check for the existence of, copy, > move and rename specified files / folders? > > > Thanks > Leonard > --231439950-658434473-968135323=:6463 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="iconc90.wri" Content-ID: Content-Description: Content-Transfer-Encoding: BASE64 Li4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u Li4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLihwYXN0ZSkNDQozLl9fRGlmZmVy ZW5jZXNfaW5fTGFuZ3VhZ2VfRmVhdHVyZXMNDQoNDQogICBUaGUgY29tcGls ZXIgaXMgZGVzaWduZWQgdG8gYmUgY29tcGF0aWJsZSB3aXRoIHRoZSBpbnRl cnByZXRlcg0NCmZvciBWZXJzaW9uIDguNyBvZiBJY29uLiBUaGlzIGdvYWwg Y2Fubm90IGJlIGNvbXBsZXRlbHkgcmVhbGl6ZWQNDQpiZWNhdXNlIHNldmVy YWwgZmVhdHVyZXMgb2YgdGhlIGxhbmd1YWdlIG1ha2Ugb3B0aW1pemF0aW9u cyBkaWYtDQ0KZmljdWx0LiBUaG9zZSBmZWF0dXJlcyB0aGF0IGNhdXNlIHBy b2JsZW1zIGFuZCBhcmUgbm90IGNvbnNpZGVyZWQNDQplc3NlbnRpYWwgdG8g dGhlIGxhbmd1YWdlIGhhdmUgZWl0aGVyIGJlZW4gcmVtb3ZlZCBvciBtYWRl IGF2YWlsLQ0NCmFibGUgb25seSB0aHJvdWdoIGNvbXBpbGVyIG9wdGlvbnMu DQ0KDQ0KICAgRGVidWdnaW5nLCBzdHJpbmcgaW52b2NhdGlvbiwgbGlua2lu ZyBjb2RlIGZyb20gb3RoZXIgSWNvbg0NCnByb2dyYW1zLCBhbmQgZXh0ZXJu YWwgZnVuY3Rpb25zIGFyZSBoYW5kbGVkIHNvbWV3aGF0IGRpZmZlcmVudGx5 DQ0KDQ0KDQ0KDQ0KSVBEMTkxYSAgICAgICAgICAgICAgICAgICAgICAgLSA0 IC0gICAgICAgICAgICAgICAgICBKdWx5IDQsIDE5OTINDQoNDQouLi4uLi4u Li4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u Li4uLi4uLi4uLi4uLi4uLi4uLihwYXN0ZSkNDQoNDQpGcm9tIC0gVGh1IEp1 biAwMSAxMjo0Nzo0NSAyMDAwDQ0Kcm9oYW5AbWljb20uYXNuLmF1DQ0KU3Vi amVjdDogUmU6IHNpbGx5IHF1ZXN0aW9uIGFib3V0IGljb25jDQ0KDQ0KICAg IHdoYXQgc3lzdGVtcyBpcyBhbiBJY29uIGNvbXBpbGVyIGF2YWlsYWJsZSBm b3IgYW5kDQ0KICAgIHdoZXJlIChVUkw/KSBjYW4gSSBmaW5kIGJpbmFyaWVz ID8NDQoNDQpCZWNhdXNlIG9mIGxpbWl0ZWQgcmVzb3VyY2VzLCB3ZSBubyBs b25nZXIgc3VwcG9ydCB0aGUgY29tcGlsZXIgb3IgcHJvZHVjZQ0NCmJpbmFy aWVzIGZvciBpdC4gIE1vc3QgcGVvcGxlIGZvdW5kIHRoYXQgdXNpbmcgdGhl IGNvbXBpbGVyIHdhc24ndCB3b3J0aA0NCnRoZSBleHRyYSBjb21wbGlhdGlv biB0aW1lIG9yIHRoZSBoYXNzbGVzIGludm9sdmVkLg0NCg0NCiAgIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0NCiAgIEdyZWdnIFRvd25zZW5k ICAgICAgICAgU3RhZmYgU2NpZW50aXN0ICAgICAgVGhlIFVuaXZlcnNpdHkg b2YgQXJpem9uYQ0NCiAgIGdtdEBjcy5hcml6b25hLmVkdSAgICAgQ29tcHV0 ZXIgU2NpZW5jZSAgICAgVHVjc29uLCBBcml6b25hLCBVU0ENDQo= --231439950-658434473-968135323=:6463-- From icon-group-sender Tue Sep 5 16:22:43 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA20637 for icon-group-addresses; Tue, 5 Sep 2000 16:20:40 -0700 (MST) Message-Id: <200009052320.QAA20637@baskerville.CS.Arizona.EDU> X-Priority: 3 (Normal) Date: Tue, 05 Sep 2000 23:46:50 +0200 (CEST) From: Guido Milanese To: icon-group@baskerville.CS.Arizona.EDU Subject: About a previous question Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 755 I posted a message some days ago on the Usenet group, but I got no answer at all. The problem was: I wanted to use the TextList instruction to display the contents of a file or of long strings containing newlines; I noticed that the output was broken just after the fist newline char (all OK using a standard WWrites() instruction). Now I think I found a good solution: if the problem is of interest to any of you, please drop me a line and I'll be glad to discuss the procedure I have designed. Best regards, G. ------------------------------------------- E-Mail: Guido Milanese Homepage: http://fly.to/arsantiqua 04-Sep-00 - XFMail on Linux + + + + + + NON NOBIS DOMINE + + + + + + ------------------------------------------- From icon-group-sender Wed Sep 20 13:42:33 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA16646 for icon-group-addresses; Wed, 20 Sep 2000 13:39:44 -0700 (MST) Message-Id: <200009202039.NAA16646@baskerville.CS.Arizona.EDU> From: symbiot@my-deja.com X-Newsgroups: comp.lang.icon Subject: Runtime environment for Icon Date: Wed, 20 Sep 2000 15:22:39 GMT X-Article-Creation-Date: Wed Sep 20 15:22:39 2000 GMT X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt) X-Http-Proxy: 1.0 SRVPROXY, 1.0 x53.deja.com:80 (Squid/1.1.22) for client 208.51.185.226 X-MyDeja-Info: XMYDJUIDsymbiot To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 625 Greetings: A little while ago (on the order of years), I came across a source for a freeware runtime and debugging environment for ICON. I thought I had saved the url, but can't seem to find it. I've preformed some search engine inquiries and have not found it either. All I recall is that it was NOT the Univ of AZ Icon site. Does anyone know where such a utility is available (for Win 98 and NT)? Your assistance is greatly appreciated!! Thanx! -- "Wife who put husband in doghouse, soon find him in cathouse." -- Wisdom of the Tao Sent via Deja.com http://www.deja.com/ Before you buy. From icon-group-sender Wed Sep 20 13:45:15 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA16804 for icon-group-addresses; Wed, 20 Sep 2000 13:43:31 -0700 (MST) Message-Id: <200009202043.NAA16804@baskerville.CS.Arizona.EDU> X-Sender: glastafari@pop.ntlworld.com Date: Wed, 20 Sep 2000 16:51:36 +0100 To: Icon Group From: Suzdal Subject: parse stack overflow Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 400 Being totally new to Icon (using Mac version 2.0.5), please don't all laugh in derision at this question: I keep getting a "parse stack overflow" error when I try to compile my program (perhaps because I've got a lot of conditional/comparison lines). Perhaps I should increase the "Parse tree space," but I can't get it above 65535. Any help would be welcome. -Suzdal suzdal@altavista.net From icon-group-sender Thu Sep 21 12:29:24 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA20110 for icon-group-addresses; Thu, 21 Sep 2000 12:27:37 -0700 (MST) Message-Id: <200009211927.MAA20110@baskerville.CS.Arizona.EDU> From: Atle X-Newsgroups: comp.lang.icon Subject: Re: parse stack overflow Date: Thu, 21 Sep 2000 18:15:45 +0200 X-Trace: news0.skynet.be 969552316 4866 195.238.29.187 (21 Sep 2000 16:05:16 GMT) X-Complaints-To: abuse@skynet.be X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 668 Suzdal wrote: > > Being totally new to Icon (using Mac version 2.0.5), please don't all > laugh in derision at this question: I keep getting a "parse stack > overflow" error when I try to compile my program (perhaps because > I've got a lot of conditional/comparison lines). Perhaps I should > increase the "Parse tree space," but I can't get it above 65535. Any > help would be welcome. I'm a newbie like yourself, the rest seem to be experts. There are two compilers, and only the one requiring a runtime seems to be actively supported. Icon does not say much about syntax errors, so there may be a missing semicolon out there. This may not help much ... Atle From icon-group-sender Fri Sep 22 12:44:51 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA27049 for icon-group-addresses; Fri, 22 Sep 2000 12:43:38 -0700 (MST) Message-Id: <200009221943.MAA27049@baskerville.CS.Arizona.EDU> Date: Fri, 22 Sep 2000 09:44:57 -0500 From: "Charles Hethcoat" To: Subject: Re: parse stack overflow Content-Disposition: inline X-Guinevere: 1.0.13 ; Oceaneering Int'l X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id HAA17719 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 788 >>> Suzdal 00-09-20 10:51:36 AM >>> wrote: > I keep getting a "parse stack overflow" error when I try to compile my program (perhaps because I've got a lot of conditional/comparison lines). My first reaction is that I would like to see the program. If it is reasonably sized, perhaps you could post it to the group? Maybe there is another way to code your problem that would be less stack-expensive. > Perhaps I should increase the "Parse tree space," but I can't get it above 65535. I don't know much about the Mac. Do you mean to imply that you _should_ be able to get it above that level, or is this a hard limit of some sort? If the latter is true, then recoding the program may be your only option. Charles Hethcoat Oceaneering Space Systems From icon-group-sender Fri Sep 22 16:43:16 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA03787 for icon-group-addresses; Fri, 22 Sep 2000 16:42:51 -0700 (MST) Message-Id: <200009222342.QAA03787@baskerville.CS.Arizona.EDU> To: "Charles Hethcoat" Cc: icon-group@optima.CS.Arizona.EDU, suzdal@altavista.net Subject: Re: parse stack overflow Date: Fri, 22 Sep 2000 14:54:41 -0700 From: Clinton L Jeffery Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 945 Recently suzdal@altavista.net wrote of parse stack overflows in his big program. I will take a crack at providing a better answer than I have heard so far. Very old versions of Icont have a number of static limits built-in to them that could be raised, within certain bounds, using command-line options. If the command-line options can't be raised high enough for your large program, the best options are to (a) move to a newer version of Icon, or (b) break your program into more, smaller procedures. There are sometimes other extreme measures that can be taken, but if either (a) or (b) works for you they are your best option. The static compiler limits were gone by Icon Version 9, and maybe gone by Icon Version 8, someone else could say for sure on that. Suzdal, I would be surprised if there is not a newer version of Mac Icon available to you than what you are currently using. Cheers, and good luck! Clint jeffery@cs.unlv.edu From icon-group-sender Mon Sep 25 08:14:05 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA09393 for icon-group-addresses; Mon, 25 Sep 2000 08:12:25 -0700 (MST) Message-Id: <200009251512.IAA09393@baskerville.CS.Arizona.EDU> From: rohan@micom.asn.au Date: Mon, 25 Sep 2000 12:55:38 +1100 (EST) To: Leonard cc: icon-group@optima.CS.Arizona.EDU Subject: newbie questions Content-ID: Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3533 Leonard; since you don't seem to be getting much attention from the resident guru's and the list doesn't seem to have enormous traffic;I thought I might share my understandings on some of the matters you have raised....the blind leading the blind! Who knows it may even stimulate a responce On Sat, 2 Sep 2000, Leonard wrote: > Hello; > I have some experience programming in Fortran, but would now like to do > some windows gui programming in a more modern language. > The executables that come "out" of Icon are for a command line interface; you would seem to need something called "VIB " if you want gui. > >From what I have read, I like Icon's strings processing features, as > well as the fact that the size of strings / lists do not have to be > specified when writing a program. now... > [A> Can an Icon program be compiled into a stand-alone executable, to be > used on computers without Icon installed? In the past (say prior to ver 8.7 see insert (1)below) there were two ways of producing an executable: 1/via the Icon compiler "iconc" (see Ipd191.doc)."iconc" would convert the source code to the language "C" which could then be compiled to to an executable via a suitable "C" compiler(either manually or by a command line switch.)Whether this intermediate step was for cross- platform accessibility or to avoid having to write a "*.icn->*.exe" compiler or both... I don't know. Anyway iconc is now no longer supported.(see insert (2)below) 2/via an attached interpreter which means that your smallest program is about 300k(compare Icon9\bin\noname.exe 310kb with Icon\bin\noname.icn 1kb) ps One of the reasons I am still a novice Icon programmer is because it has no direct "*.icn->*.exe" compiler! ..........................................................insert (1) >From - Thu Jun 01 12:47:45 2000 rohan@micom.asn.au Subject: Re: silly question about iconc what systems is an Icon compiler available for and where (URL?) can I find binaries ? Because of limited resources, we no longer support the compiler or produce binaries for it. Most people found that using the compiler wasn't worth the extra compliation time or the hassles involved. Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA ..........................................................insert (1) ..........................................................insert (2) 3.__Differences_in_Language_Features The compiler is designed to be compatible with the interpreter for Version 8.7 of Icon. This goal cannot be completely realized because several features of the language make optimizations dif- ficult. Those features that cause problems and are not considered essential to the language have either been removed or made avail- able only through compiler options. Debugging, string invocation, linking code from other Icon programs, and external functions are handled somewhat differently IPD191a - 4 - July 4, 1992 ..........................................................insert (2) > > If so... > > How much memory overhead does the Icon interpreter have? > > How does the program execution speed compare to a similar program > written in C++ or Java? > Checkout http://www.idiom.com/free-compilers > Are there files system functions to check for the existence of, copy, > move and rename specified files / folders? > > > Thanks > Leonard > From icon-group-sender Tue Sep 26 08:17:21 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA20174 for icon-group-addresses; Tue, 26 Sep 2000 08:15:52 -0700 (MST) Message-Id: <200009261515.IAA20174@baskerville.CS.Arizona.EDU> From: suzdal@altavista.net (Suzdal) X-Newsgroups: comp.lang.icon Subject: Re: parse stack overflow Date: Tue, 26 Sep 2000 09:07:35 +0100 X-Complaints-To: abuse@ntlworld.com X-Trace: news2-win.server.ntlworld.com 969955673 62.255.10.27 (Tue, 26 Sep 2000 09:07:53 BST) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 810 In article <200009222342.QAA03787@baskerville.CS.Arizona.EDU>, Clinton L Jeffery wrote: > Recently suzdal@altavista.net wrote of parse stack overflows in his big > program. I will take a crack at providing a better answer than I have > heard so far. ... >Suzdal, I would be surprised if there is not a newer version of > Mac Icon available to you than what you are currently using. > > Cheers, and good luck! > > Clint jeffery@cs.unlv.edu I think you could be right, my program is not elegantly written enough! (Though, having said that, you'd think it could cope better.) Thanks for the comments - I'd love to know if there *is* a newer Mac version than mine available (I have v. 2.0.5), and if so, how to obtain it. This might handle this problem, conceivably. Suzdal From icon-group-sender Mon Oct 2 21:31:31 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id VAA18088 for icon-group-addresses; Mon, 2 Oct 2000 21:29:57 -0700 (MST) Message-Id: <200010030429.VAA18088@baskerville.CS.Arizona.EDU> From: ddevilliers@lando.co.za (D De Villiers) X-Newsgroups: comp.lang.icon Subject: Icon for Palm ? Date: Sat, 30 Sep 2000 10:05:26 GMT X-Trace: ctb-nnrp2.saix.net 970308544 1889 155.239.129.23 (30 Sep 2000 10:09:04 GMT) X-Complaints-To: abuse@saix.net X-Newsreader: Forte Free Agent 1.11/32.235 To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 573 Does anyone know if a Icon for Palm compiler exist, for developing PalmOS applications with Icon ? if not is anyone interested in developing such a compiler. Lennie De Villiers ICQ# 57008830 E-mail: ddevilliers@lando.co.za Moderator: news:comp.sources.delphi Lennie's Weekly Delphi Tips: http://www.sandbrooksoftware.com/DPSC/Tips/Lennie/LennieTips.htm Lennie's Delphi Mailinglist: http://www.egroups.com/group/ddevilliers_delphi/ Borland Kylix (Delphi-for-Linux) Project Website & FAQ http://www.borland.com/kylix/ http://www.borland.com/kylix/faqs.html From icon-group-sender Mon Oct 2 21:32:39 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id VAA18173 for icon-group-addresses; Mon, 2 Oct 2000 21:32:31 -0700 (MST) Message-Id: <200010030432.VAA18173@baskerville.CS.Arizona.EDU> From: rohan@micom.asn.au Date: Mon, 2 Oct 2000 18:50:42 +1100 (EST) To: Icon programming language mail list cc: Rohan Mcleod Subject: Is icon very very quiet or..? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 103 Is icon very quiet or has the mailing list software cast me out for having a cheap and flaky server? From icon-group-sender Tue Oct 3 07:44:20 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA29436 for icon-group-addresses; Tue, 3 Oct 2000 07:43:30 -0700 (MST) Message-Id: <200010031443.HAA29436@baskerville.CS.Arizona.EDU> From: Atle X-Newsgroups: comp.lang.icon Subject: Re: Is icon very very quiet or..? Date: Tue, 03 Oct 2000 08:26:03 +0200 X-Trace: news0.skynet.be 970553626 18319 194.78.236.143 (3 Oct 2000 06:13:46 GMT) X-Complaints-To: abuse@skynet.be X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 279 rohan@micom.asn.au wrote: > > Is icon very quiet or has the mailing list > software cast me out for having a cheap and flaky > server? I is very quiet. That may be good or bad. If it is good, it means nobody has any trouble with it. -- Best wishes, Atle users.skynet.be/atle From icon-group-sender Tue Oct 3 07:45:18 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA29514 for icon-group-addresses; Tue, 3 Oct 2000 07:45:08 -0700 (MST) Message-Id: <200010031445.HAA29514@baskerville.CS.Arizona.EDU> From: rohan@micom.asn.au Date: Tue, 3 Oct 2000 18:28:21 +1100 (EST) To: D De Villiers cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Icon for Palm ? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1196 Has an Icon compiler for any processor under any OS ever existed? I would dearly like to be contradicted but my impression is that all that ever existed was a "*.icn->*.C" translator.Even this seems to be no longer supported.Evidently current users of Icon are content to distribute code as source plus appended interpreter. I would imagine writing a real compiler (*.icn->*.exe) in Icon and then compiling the compiler via the interpreter would be a considerable project;not even considering the complexities of multiple platforms! On Sat, 30 Sep 2000, D De Villiers wrote: > > Does anyone know if a Icon for Palm compiler exist, for developing PalmOS > applications with Icon ? if not is anyone interested in developing such a > compiler. > > Lennie De Villiers > > ICQ# 57008830 > > E-mail: ddevilliers@lando.co.za > Moderator: news:comp.sources.delphi > > Lennie's Weekly Delphi Tips: > http://www.sandbrooksoftware.com/DPSC/Tips/Lennie/LennieTips.htm > > Lennie's Delphi Mailinglist: > http://www.egroups.com/group/ddevilliers_delphi/ > > Borland Kylix (Delphi-for-Linux) Project Website & FAQ > http://www.borland.com/kylix/ > http://www.borland.com/kylix/faqs.html > > From icon-group-sender Tue Oct 3 12:35:05 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA09584 for icon-group-addresses; Tue, 3 Oct 2000 12:34:17 -0700 (MST) Message-Id: <200010031934.MAA09584@baskerville.CS.Arizona.EDU> From: "Jay Hammond" To: icon-group@optima.CS.Arizona.EDU Date: Tue, 3 Oct 2000 17:16:05 +0000 Subject: Re: Icon for Palm ? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1814 On 30 Sep 00, at 10:05, D De Villiers wrote: via icon-group@optima.CS.Arizona.EDU > > Does anyone know if a Icon for Palm compiler exist, for developing > PalmOS applications with Icon ? if not is anyone interested in > developing such a compiler. > > Lennie De Villiers If Icon is important enough to you, consider the Agenda platform They are taking pre-shipment orders orders now. This is a Hong- Kong based company that has decided that the underlying OS is Linux. I understand that there is a developers kit for it (so you get less/no hassle about developing for the reduced window size/resolution compared to a desktop). I also believe you can run ICON on Linux. Initial Agenda models will have 8Mb Ram fitted & up to 8 Mb flash memory for backup). Is this sufficient for Icon under linux? I know that Dos icon v8 (no window support) ran in 2Mb (on a 386 ;-)) The notion of icon on my palmtop certainly got my saliva going, so any comments please. rohan@micom.asn.au distinguishes between "compiler" and "interpreter", and I have been talking about the icon _interpreter_ so far. I'd be delighted to have any icon tool on a palmtop. Maybe I'd even like python on it. I have not considered Jcon (yes that's a J for Java) which would thrive with a hardware java engine platform, but is currently very bulky, so not for a palmtop (yet). The "compile v interpret" issue reminded me of Java platforms and then of Jcon. Anyone want a URL for this linux based "Agenda" Palmtop? (not to be confused with the AgendA from the now defunct Microwriter Ltd ( I still have one and love its chording keyboard)) regards Jay Jay Hammond, Email j.hammond@qmw.ac.uk Arts Computing Unit Queen Mary & Westfield College, Mile End Rd, London E1 4NS Phone +44 20 7882 3209 From icon-group-sender Tue Oct 3 16:52:03 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA17480 for icon-group-addresses; Tue, 3 Oct 2000 16:50:10 -0700 (MST) Message-Id: <200010032350.QAA17480@baskerville.CS.Arizona.EDU> To: rohan@micom.asn.au Cc: D De Villiers , icon-group@optima.CS.Arizona.EDU Subject: Re: Icon for Palm ? Date: Tue, 03 Oct 2000 14:47:35 -0700 From: Clinton L Jeffery Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1453 rohan> Has an Icon compiler for any processor under any OS ever existed? Although you may make a big distinction in your head between a compiler that generates native machine code directly, and a compiler that generates C code that compiles to native machine code, this distinction is artificial. A native code "compiler" by your definition would typically still generate a machine-independent intermediate code from which it would do native code instruction selection; so what if C is the intermediate code? If you want something better than the Icon (-> C) compiler, you want either a faster compiler, faster or smaller generated code, or perhaps a compiler that has no bugs. All desirable traits, and none of which are precluded by using a C compiler as one's "native code generator". As has been noted from time to time, for a very high level language like Icon, much of the time is spent in the runtime system routines, so a native code compiler does not offer as big an advantage over a virtual machine as it does for a low level language like C, Pascal, or Java. But that doesn't mean everyone on this list would not love to have a superoptimized Icon compiler for their work. :-) I am looking for someone to port Ken Walker's Icon compiler to MS Windows, using a freely available C compiler such as gcc or lcc as its code generator. If anyone wants to work on this I'd be glad to provide technical assistance. Clint jeffery@cs.unlv.edu From icon-group-sender Wed Oct 4 07:57:00 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA04608 for icon-group-addresses; Wed, 4 Oct 2000 07:54:33 -0700 (MST) Message-Id: <200010041454.HAA04608@baskerville.CS.Arizona.EDU> From: Atle X-Newsgroups: comp.lang.icon Subject: Re: Icon for Palm ? Date: Wed, 04 Oct 2000 02:24:15 +0200 X-Trace: news0.skynet.be 970618310 14972 195.238.7.67 (4 Oct 2000 00:11:50 GMT) X-Complaints-To: abuse@skynet.be X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 503 Jay Hammond wrote: > > I also believe you can run ICON on Linux. Initial Agenda models will > have 8Mb Ram fitted & up to 8 Mb flash memory for backup). Is this > sufficient for Icon under linux? I know that Dos icon v8 (no window > support) ran in 2Mb (on a 386 ;-)) I am running Icon on Linux with no problem on a 10Mb Amstrad, but I do't think it is necessary with that much RAM. I have 10Mb to be able to run X (!!) - so Icon should be happy with 4-8Mb. Best wishes, Atle users.skynet.be/atle From icon-group-sender Wed Oct 4 07:58:13 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA04729 for icon-group-addresses; Wed, 4 Oct 2000 07:57:56 -0700 (MST) Message-Id: <200010041457.HAA04729@baskerville.CS.Arizona.EDU> Date: Wed, 04 Oct 2000 19:47:21 +1000 From: rohan X-Accept-Language: en To: Clinton L Jeffery CC: D De Villiers , icon-group@optima.CS.Arizona.EDU Subject: Re: Icon for Palm ? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1049 > > Clinton L Jeffery wrote: > > > . > ...............................................................................................snip > > If you want > something better than the Icon (-> C) compiler, you want either a faster > compiler, faster or smaller generated code, or perhaps a compiler that has > no bugs. All desirable traits, and none of which are precluded by using > a C compiler as one's "native code generator". ...................................................................................................snip Clint jeffery@cs.unlv.edu I would be quite happy to do development in an interpreted environment but somehow the source-code + interpreter appended is not appealing.One of the reasons I am interested in Icon is to get away from C; another is the "look" of the code (all lower case cf. Oberon,C++). One of the things about C which I'm trying to avoid (I may still go back) is the memory leakage.My worry is that by translating code back to C and then compiling I will be reintroducing the defects of C. > From icon-group-sender Wed Oct 4 16:06:35 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA22325 for icon-group-addresses; Wed, 4 Oct 2000 16:06:09 -0700 (MST) Message-Id: <200010042306.QAA22325@baskerville.CS.Arizona.EDU> Date: Wed, 04 Oct 2000 11:08:13 -0400 From: "Steve Graham" To: , Subject: Re: Icon for Palm ? Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id IAA05125 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 720 >>> "Jay Hammond" 10/03/00 12:16PM >>> On 30 Sep 00, at 10:05, D De Villiers wrote: via icon-group@optima.CS.Arizona.EDU [snip] Anyone want a URL for this linux based "Agenda" Palmtop? I would! [snip] Jay Hammond, Email j.hammond@qmw.ac.uk Arts Computing Unit Queen Mary & Westfield College, Mile End Rd, London E1 4NS Phone +44 20 7882 3209 Steve --------------------------------------------------------------------------------------- Steve Graham Senior Programmer/Analyst LabCorp Phone: (972) 437-5255, ext 5224 Fax: (972) 454-1050 Mail: grahams@labcorp.com --------------------------------------------------------------------------------------- From icon-group-sender Wed Oct 4 16:10:08 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA22483 for icon-group-addresses; Wed, 4 Oct 2000 16:09:57 -0700 (MST) Message-Id: <200010042309.QAA22483@baskerville.CS.Arizona.EDU> Date: Wed, 04 Oct 2000 08:46:41 -0700 From: Steve Wampler X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Subject: Re: Icon for Palm ? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1421 rohan wrote: > > > > > Clinton L Jeffery wrote: > > I would be quite happy to do development in an interpreted environment but > somehow the source-code + interpreter appended is not appealing.One of > the reasons I am interested in Icon is to get away from C; another is the > "look" of the code (all lower case cf. Oberon,C++). > One of the things about C which I'm trying to avoid (I may still go back) is > the memory leakage.My worry is that by translating code back to C and then > compiling I will be reintroducing the defects of C. But you wouldn't be using C (the Icon compiler would). I would expect the Icon compiler to produce high-quality C code. Back when the compiler existed I used it regularly with no ill effects. In fact, it was easy to completely ignore the fact that the translation to machine code passed through C on its journey. Keep in mind that icont, iconx, and the entire run-time system are coded in C as it is. While C has weaknesses as a language, I suspect most 'defects' are the result of careless use - high-quality C code certainly exists and the quality of Icon is an example of this. Put another way, any weaknesses in C as an intermediate language are overwhelmed by the alternatives. I would certainly trust generated C code more than I would directly generated assembler or machine code... -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Thu Oct 5 17:03:59 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA07068 for icon-group-addresses; Thu, 5 Oct 2000 17:02:35 -0700 (MST) Message-Id: <200010060002.RAA07068@baskerville.CS.Arizona.EDU> From: "Jay Hammond" To: icon-group@optima.CS.Arizona.EDU Date: Thu, 5 Oct 2000 21:25:54 +0100 Subject: PDA that might run Icon under Linux Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1528 I was asked to post links to a linux handheld I mentioned called Agenda. It will I hope run Icon - it has a command line interface as well as a graphical one. So I take the liberty of posting. It seems many handhelds COULD run Linux, but are not usually shipped that way. There are lots of projects running already, & I can't judge how far they have got. There should be links later. I found an article via ZDNET by Rick Lehrbaum of LinuxDevices.com (rick@linuxdevices.com) dated August 15, 2000 9:38 AM ET http://www.linuxdevices.com/articles/AT4992223978.html a similar shorter article is at http://www.linuxdevices.com/news/NS5929563761.html Here's a precis; The "Agenda" is by a company called Agenda, it's Hong Kong parent company is Kessel International Holdings. Different Models called VR3, VR5 . VR3 available "Fall" cost >= $149 according to options. Key technology is the NEC VR4818 system-on-chip processor The VR3's operating system is nearly 100% based on activities of The Linux VR Project http://www.linuxdevices.com/links/LK4481036844.html Hardware, software & physical specs given in the article. A Vr3 is pictured in the article The company has a website. http://www.agendacomputing.com Other links at the end of the article; http://www.linuxdevices.com/links/LK4481036844.html The Linux VR project: Linux on the NEC VR series processors http://www.linuxdevices.com/links/LK4338659220.html NEC VR4181 system-on-chip with built-in LCD controller Jay Hammond homemade@free-online.co.uk From icon-group-sender Mon Oct 9 08:16:44 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA00555 for icon-group-addresses; Mon, 9 Oct 2000 08:14:35 -0700 (MST) Message-Id: <200010091514.IAA00555@baskerville.CS.Arizona.EDU> Date: Sat, 7 Oct 2000 08:16:35 -0700 From: Steve Wampler To: David Feustel Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Suspend Question Content-Disposition: inline User-Agent: Mutt/1.1.9i Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2019 On Sat, Oct 07, 2000 at 09:32:59AM -0500, David Feustel wrote: > I haven't been able to find an answer to these 2 questions > in any of the Icon/Unicon documentation that I have. > Can someone enlighten me please? > > How is a procedure that uses suspend to return a result > invoked so as to continue from the point of suspension? > > How is that procedure 'reset' so that the next value returned > by the procedure is the first value generated? I assume you're asking how these operations are implemented and so "Magic" won't suffice... Warning, the following explanation ignores the ugly details: A suspended procedure hasn't gone away - it's stack frame and surrounding context is still on the execution stack. If you picture the execution stack as containing context information then a procedure call adds an evaluation frame to some context (e.g. x := a + f(b) has the stack (growing to the right: x a b at the point of the call of f. Expressions inside f add to this context, so the stack looks something like: x a b X Y Z where X Y Z are 'local' context in f. When f suspends it hides its local context (which includes the current PC) So if the suspend is "suspend c", the stack looks like x a b X Y Z PC x a c Note that the information needed to resume f is all there on the stack, so if backtracking goes back into f, the stack is quickly reset to x a b X Y Z and the PC can be reset in f to continue at the point of suspension. If the goal of the expression evaluation is met, then the entire context is removed from the stack, including that part of the context that was 'hidden' by the suspend of f. This is efficient because it turns out that the amount of context that needs to be copied (the 'x a c' above) is typically surprisingly small, thanks to the bounded expressions in Icon. As to 'resetting to start over', there is nothing that needs to be done this is just another call of the function. -- -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Mon Oct 9 08:19:41 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA00719 for icon-group-addresses; Mon, 9 Oct 2000 08:19:32 -0700 (MST) Message-Id: <200010091519.IAA00719@baskerville.CS.Arizona.EDU> From: eddie@holyrood.ed.ac.uk (Eddie Corns) X-Newsgroups: comp.lang.icon Subject: Re: PDA that might run Icon under Linux Date: 9 Oct 2000 10:44:21 GMT X-Trace: scotsman.ed.ac.uk 971088261 16069 129.215.16.14 (9 Oct 2000 10:44:21 GMT) X-Complaints-To: usenet@scotsman.ed.ac.uk X-Newsreader: NN version 6.5.0 #2 (NOV) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 178 Not sure if anyone's mentioned this yet but handhelds.org has pointers to several PDAs that are Linux and hence Icon compatible. The IPaq looks particularly promising. Eddie From icon-group-sender Wed Oct 11 13:15:41 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA04365 for icon-group-addresses; Wed, 11 Oct 2000 12:53:41 -0700 (MST) Message-Id: <200010111953.MAA04365@baskerville.CS.Arizona.EDU> From: gea@earthling.net (Antonella) X-Newsgroups: comp.lang.icon Subject: can icon do this? Date: Wed, 11 Oct 2000 17:59:12 +0100 X-Complaints-To: abuse@ntlworld.com X-Trace: news6-win.server.ntlworld.com 971283701 62.255.4.197 (Wed, 11 Oct 2000 18:01:41 BST) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 160 What code inspects one input text file, checks each line for occurrences of a string, and if found replaces that string in an otherwise identical output file? From icon-group-sender Wed Oct 11 14:45:00 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id OAA08274 for icon-group-addresses; Wed, 11 Oct 2000 14:42:08 -0700 (MST) Message-Id: <200010112142.OAA08274@baskerville.CS.Arizona.EDU> From: Steve Wampler X-Newsgroups: comp.lang.icon Subject: Re: can icon do this? Date: Wed, 11 Oct 2000 10:47:11 -0700 X-Trace: noao.edu 971286434 35547 140.252.38.6 (11 Oct 2000 17:47:14 GMT) X-Complaints-To: abuse@noao.edu To: Antonella X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 656 Antonella wrote: > > What code inspects one input text file, checks each line for occurrences > of a string, and if found replaces that string in an otherwise identical > output file? Sure, this is possible to do in Icon, but if the output file really starts out identical to the input file, it's a *lot* easier to read the input file, modify the internal copy and then write it out as the new output file. Is that acceptable? Otherwise, you have to be careful if the length of the target and replacement strings differ - this introduces a spot of ugliness in the code. -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Wed Oct 11 14:45:48 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id OAA08433 for icon-group-addresses; Wed, 11 Oct 2000 14:45:38 -0700 (MST) Message-Id: <200010112145.OAA08433@baskerville.CS.Arizona.EDU> From: Steve Wampler X-Newsgroups: comp.lang.icon Subject: Re: can icon do this? Date: Wed, 11 Oct 2000 14:04:26 -0700 X-Trace: noao.edu 971298269 51656 140.252.38.6 (11 Oct 2000 21:04:29 GMT) X-Complaints-To: abuse@noao.edu To: Antonella X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2569 Antonella wrote: > > What code inspects one input text file, checks each line for occurrences > of a string, and if found replaces that string in an otherwise identical > output file? There are several parts to this (based on information in a later posting from Antonella): (a) given s1, s2, and target, produce source so that every occurrence of s1 in target has been replaced by s2 (b) handle multiple pairs of s1,s2 (c) figure out how to specify these multiple pairs on the command line. One solution to (a) is: procedure mapString(sText, tText, inLine) outLine := "" inLine ? { while outLine ||:= (tab(find(sText)) || tText) do { move(*sText) } outLine ||:= tab(0) } return outLine end (b) is tricky, but one easy to implement approach is to use a table mapping each s1 into its matching s2. Assuming such a table exists, then (a) can be used to help solve (b) as in: procedure mapStrings(sMap, inLine) outLine := inLine every s1 := key(sMap) do { outLine := mapString(s1, sMap[s1], outLine) } return outLine end Now the table has to be built. It's easiest to combine this with parsing the command-line arguments. If the commandline contains arguments of the form s1=s2, then (c) is: procedure buildMap(args) sMap := table() every args := !args do { s1 := s2 := "" arg ? { s1 := tab(upto("=")) | next move(1) s2 := tab(0) } if *s1 = 0 then stop("Cannot use null string as a source string") sMap[s1] := s2 } return sMap end Putting it altogether is a main procedure that reads from standard input and writes to standard output: procedure main(args) if *args = 0 then stop("Usage: mapFile string1=string2 ...") sMap := buildMap(args) every write(mapStrings(sMap, !&input)) end If this code is in mapFile.icn and is translated into mapFile, then an example call would be: mapFile string=fling arg=barge newFile.icn A potentially more elegant approach (since this one requires multiple passes over each input lines) is to write a varient of find() that accepts a set of strings to find and generates the positions of those strings in increasing order). Anyone up for it? Would it be faster, slower, or about the same as this approach? -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Thu Oct 12 16:43:08 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9CNfE621843 for icon-group-addresses; Thu, 12 Oct 2000 16:41:14 -0700 (MST) Message-Id: <200010122341.e9CNfE621843@baskerville.CS.Arizona.EDU> From: gea@earthling.net (Antonella) X-Newsgroups: comp.lang.icon Subject: Re: can icon do this? Date: Thu, 12 Oct 2000 20:42:38 +0100 X-Complaints-To: abuse@ntlworld.com X-Trace: news2-win.server.ntlworld.com 971379910 62.255.8.197 (Thu, 12 Oct 2000 20:45:10 BST) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 53 Just wanted to say that the code is perfect, Steve! From icon-group-sender Wed Oct 18 13:03:39 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9IK19g15362 for icon-group-addresses; Wed, 18 Oct 2000 13:01:09 -0700 (MST) Message-Id: <200010182001.e9IK19g15362@baskerville.CS.Arizona.EDU> X-Lotus-FromDomain: BOC From: Brian.C.Monsell@census.gov To: icon-group@optima.CS.Arizona.EDU Date: Wed, 18 Oct 2000 12:34:02 -0400 Subject: Icon .def file for OxEdit? Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 152 Has someone out there created an OxEdit definitions file for the Icon programming language? If so, please send same to brian.c.monsell@census.gov From icon-group-sender Wed Oct 18 13:17:00 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9IKFDB15925 for icon-group-addresses; Wed, 18 Oct 2000 13:15:13 -0700 (MST) Message-Id: <200010182015.e9IKFDB15925@baskerville.CS.Arizona.EDU> From: symbiot@my-deja.com X-Newsgroups: comp.lang.icon Subject: How to print a sorted list? Date: Wed, 18 Oct 2000 19:43:21 GMT X-Article-Creation-Date: Wed Oct 18 19:43:21 2000 GMT X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt) X-Http-Proxy: 1.0 SRVPROXY, 1.0 x67.deja.com:80 (Squid/1.1.22) for client 208.51.185.226 X-MyDeja-Info: XMYDJUIDsymbiot To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 727 Greetings: I've run into a qundry that I'm sure must be easy to solve...but I'm still stymied. I have created a table... values := table(0) Processed it and added values to it. Then I sorted it.... sortedvals := sort(values,2) Now I'd like to print sortedvals.....and get errors. I've tried every sort of permutation of "write" that I can think of. I know that "sortedvals" is supposed a list of lists each containing the key and associated value from the table "values". So how do I get it out of the computer?? Help is appreciated. Thanx! -- "Wife who put husband in doghouse, soon find him in cathouse." -- Wisdom of the Tao Sent via Deja.com http://www.deja.com/ Before you buy. From icon-group-sender Wed Oct 18 16:27:45 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9INRMd22154 for icon-group-addresses; Wed, 18 Oct 2000 16:27:22 -0700 (MST) Message-Id: <200010182327.e9INRMd22154@baskerville.CS.Arizona.EDU> Date: Wed, 18 Oct 2000 16:42:23 -0500 From: "Charles Hethcoat" To: Subject: Pipes in Icon Content-Disposition: inline X-Guinevere: 1.0.13 ; Oceaneering Int'l X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id e9ILgWv18771 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1520 I am having a little problem with Icon on Linux. I would like to invoke a program /usr/bin/xyz from within an Icon program and use pipes to communicate with it. I would send the command strings to xyz with a write(), and then read the results with a read(). It is important to understand that both the read() and the write() are called from within a single program. I tried some code that looked something like this (assume xyz is already running): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... # to_xyz is the write pipe to /usr/bin/xyz # fr_xyz is the read pipe from /usr/bin/xyz # Read lines from standard input, send them to xyz. # Then read xyz's response and print it to standard output. while line_in := read() do { write(to_xyz, line_in) # Make sure buffer is flushed, then: while line_out := read(fr_xyz) do write(line_out) } ... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The problem is, Icon's pipe facility won't permit setting up the pipes. The syntax is fr_xyz := open("/usr/bin/xyz", "pr") # read pipe to_xyz := open("/usr/bin/xyz", "pw") # write pipe This implies that each open() can open only a single, unidirectional pipe to a fresh instance of /usr/bin/xyz. And that is true. When I did this, I got two separate instances of xyz, each running a separate pipe. So the question is, is there any way to accomplish this entirely within Icon? I'm sure I could with C, or with a bash script. Thanks. Charles Hethcoat Oceaneering Space Systems, Inc. From icon-group-sender Thu Oct 19 08:18:41 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9JFGGE01173 for icon-group-addresses; Thu, 19 Oct 2000 08:16:16 -0700 (MST) Message-Id: <200010191516.e9JFGGE01173@baskerville.CS.Arizona.EDU> Date: Wed, 18 Oct 2000 16:49:29 -0700 (PDT) From: Shamim Mohamed To: "Charles Hethcoat" Cc: Subject: Re: Pipes in Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 459 > This implies that each open() can open only a single, unidirectional > pipe to a fresh instance of /usr/bin/xyz. And that is true. When I > did this, I got two separate instances of xyz, each running a > separate pipe. True. If you want a bi-directional connection to a process, you need a pair of pipes. This is easy to do in Unicon with filepair() - the equivalent of the socketpair(2) system call - but I don't think it can be done in Icon. -s From icon-group-sender Thu Oct 19 08:22:36 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9JFMNm01322 for icon-group-addresses; Thu, 19 Oct 2000 08:22:23 -0700 (MST) Message-Id: <200010191522.e9JFMNm01322@baskerville.CS.Arizona.EDU> From: jasmin shah X-Accept-Language: en X-Newsgroups: comp.lang.icon Subject: Re: parse stack overflow Date: Thu, 19 Oct 2000 00:27:35 GMT X-Complaints-To: abuse@home.net X-Trace: news1.mntp1.il.home.com 971915255 24.12.135.27 (Wed, 18 Oct 2000 17:27:35 PDT) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 590 I need help creating a lexical analysis............and i like to know where and how to start its have to be in icon and really confused. jasmin_shah@hotmail.com Suzdal wrote: > Being totally new to Icon (using Mac version 2.0.5), please don't all > laugh in derision at this question: I keep getting a "parse stack > overflow" error when I try to compile my program (perhaps because > I've got a lot of conditional/comparison lines). Perhaps I should > increase the "Parse tree space," but I can't get it above 65535. Any > help would be welcome. > > -Suzdal > > suzdal@altavista.net From icon-group-sender Thu Oct 19 08:23:01 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9JFMlg01349 for icon-group-addresses; Thu, 19 Oct 2000 08:22:47 -0700 (MST) Message-Id: <200010191522.e9JFMlg01349@baskerville.CS.Arizona.EDU> Date: Wed, 18 Oct 2000 21:10:22 -0400 (EDT) From: Taybin Rutkin To: Charles Hethcoat cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Pipes in Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1006 On Wed, 18 Oct 2000, Charles Hethcoat wrote: > I would like to invoke a program /usr/bin/xyz from within an Icon program and use pipes to communicate with it. I would send the command strings to xyz with a write(), and then read the results with a read(). It is important to understand that both the read() and the write() are called from within a single program. What you're doing is creating a file at /usr/bin/xyz that is a pipe. You're lucky this isn't overwriting the existing program. What you need to do is create a temporary, mutually agreed upon file. So what I would do is something like this: tempr = open(".xyz_read", pr) tempw = open(".xyz_write", pw) execute("xyz -read_pipe .xyz_read -write_pipe .xyz_write") Of course, you would put whatever you need in the command line. And it might need to be run in the background. But I believe that is the basic technique. Taybin Rutkin -- trutkin@black.clarku.edu Creativity can only be anarchic, capitalist, Darwinian -- Umberto Eco From icon-group-sender Thu Oct 19 12:26:14 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9JJPgF08184 for icon-group-addresses; Thu, 19 Oct 2000 12:25:42 -0700 (MST) Message-Id: <200010191925.e9JJPgF08184@baskerville.CS.Arizona.EDU> Date: Thu, 19 Oct 2000 10:46:06 -0500 From: "Charles Hethcoat" To: Subject: Pipes in Icon: Thanks to all. Content-Disposition: inline X-Guinevere: 1.0.13 ; Oceaneering Int'l X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id e9JGDCv02795 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 373 Hello, everyone. You've certainly given me some homework to do. Since I have done most of my Icon work on Win NT, I had momentarily forgotten the option of Unicon. When I get it working, whether it be with Unicon, popen(), or anything else, I'll post the result as a model to the group. I think it will be interesting. Thanks to all who replied. Charles Hethcoat From icon-group-sender Thu Oct 19 12:27:01 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9JJQew08222 for icon-group-addresses; Thu, 19 Oct 2000 12:26:40 -0700 (MST) Message-Id: <200010191926.e9JJQew08222@baskerville.CS.Arizona.EDU> From: Steve Wampler X-Newsgroups: comp.lang.icon Subject: Re: How to print a sorted list? Date: Thu, 19 Oct 2000 11:53:02 -0700 X-Trace: noao.edu 971981584 38035 140.252.38.6 (19 Oct 2000 18:53:04 GMT) X-Complaints-To: abuse@noao.edu To: symbiot@my-deja.com X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1081 symbiot@my-deja.com wrote: > > Greetings: > > I've run into a qundry that I'm sure must be easy to solve...but I'm > still stymied. > > I have created a table... > > values := table(0) > > Processed it and added values to it. > > Then I sorted it.... > > sortedvals := sort(values,2) > > Now I'd like to print sortedvals.....and get errors. > > I've tried every sort of permutation of "write" that I can think of. > > I know that "sortedvals" is supposed a list of lists each containing > the key and associated value from the table "values". > > So how do I get it out of the computer?? > One way is: every pair := !sortedvals do { write(pair[1]," --> ", pair[2]) } You have to step through elements of structured values because only values coercable to strings can be written, so if either pair[1] or pair[2] isn't coercible to a string, even the above will fail. For a failsafe, if ugly, print, try: write(image(pair[1]), " --> ", image(pair[2])) instead. -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Thu Oct 19 15:51:56 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9JMpXJ14175 for icon-group-addresses; Thu, 19 Oct 2000 15:51:33 -0700 (MST) Message-Id: <200010192251.e9JMpXJ14175@baskerville.CS.Arizona.EDU> Date: Thu, 19 Oct 2000 14:51:32 -0700 (MST) From: Gregg Townsend To: icon-group Subject: Re: Pipes in Icon Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1378 > From: "Charles Hethcoat" > > I would like to invoke a program /usr/bin/xyz from within an Icon program > and use pipes to communicate with it. I would send the command strings > to xyz with a write(), and then read the results with a read()... > > So the question is, is there any way to accomplish this entirely within > Icon? I'm sure I could with C, or with a bash script. I contend that buffering problems make this infeasible from either C or Icon. Most I/O libraries don't write anything to a pipe until they've filled a buffer, and the most likely consequence would be a deadlock, with each program waiting for the other to send more data. > From: Taybin Rutkin > > ...What you're doing is creating a file at /usr/bin/xyz that is a pipe. No, this is a misunderstanding of how Icon's open(..., "p") works. It opens a pipe to a process; it doesn't create a named pipe. That does suggest a possibile approach: You could create a named pipe (using system("mkfifo /tmp/mypipe") or whatever) for a second channel to the spawned process. But I still would predict deadlock. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Fri Oct 20 08:00:39 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9KExrO13833 for icon-group-addresses; Fri, 20 Oct 2000 07:59:54 -0700 (MST) Message-Id: <200010201459.e9KExrO13833@baskerville.CS.Arizona.EDU> Date: Fri, 20 Oct 2000 09:20:59 -0400 (EDT) From: Taybin Rutkin To: Gregg Townsend cc: icon-group@cs.arizona.edu Subject: Re: Pipes in Icon Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 621 On Thu, 19 Oct 2000, Gregg Townsend wrote: > > From: Taybin Rutkin > > > > ...What you're doing is creating a file at /usr/bin/xyz that is a pipe. > > No, this is a misunderstanding of how Icon's open(..., "p") works. It > opens a pipe to a process; it doesn't create a named pipe. That does Yeah, I realized I misunderstood the semantics after I reread that chapter. I think the semantics are too different from the semantics for opening files. Thus my confusion. Taybin Rutkin -- trutkin@black.clarku.edu Creativity can only be anarchic, capitalist, Darwinian -- Umberto Eco From icon-group-sender Mon Oct 23 08:17:23 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9NFCxh18286 for icon-group-addresses; Mon, 23 Oct 2000 08:13:00 -0700 (MST) Message-Id: <200010231513.e9NFCxh18286@baskerville.CS.Arizona.EDU> From: symbiot@my-deja.com X-Newsgroups: comp.lang.icon Subject: How to "declare" a string? Date: Sat, 21 Oct 2000 19:42:20 GMT X-Article-Creation-Date: Sat Oct 21 19:42:20 2000 GMT X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) X-Http-Proxy: 1.0 x73.deja.com:80 (Squid/1.1.22) for client 209.217.195.15 X-MyDeja-Info: XMYDJUIDsymbiot To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 976 Greetings: Another question that "should" be simple....but I can't seem to figure it out. I have the statement.... UPPER[index] := &ucase[find(data[index],&lcase)] ....which is giving an error: Traceback: main() {(variable = &null)[1]} from line 8 in noname.icn best I can tell, it is choking because UPPER has not been "declared". But I can't find anywhere how to "declare" a string. In fact, all the references I find talk about how ICON doesn't NEED "declarations" in the traditional sense of a programming language. Soooo...uhhh....??? As a secondary question, this is part of a program to converst a string to all uppercase. Right now I'm doing in a WHILE...DO loop. But something tells me there's amcuh more efficient way to do it (with EVERY perhaps?) Any suggestions? Thanks!! -- "Wife who put husband in doghouse, soon find him in cathouse." -- Wisdom of the Tao Sent via Deja.com http://www.deja.com/ Before you buy. From icon-group-sender Mon Oct 23 08:17:58 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9NFHa318406 for icon-group-addresses; Mon, 23 Oct 2000 08:17:36 -0700 (MST) Message-Id: <200010231517.e9NFHa318406@baskerville.CS.Arizona.EDU> From: Cheyenne Wills X-Accept-Language: en X-Newsgroups: comp.lang.icon Subject: Re: How to "declare" a string? Date: Sun, 22 Oct 2000 15:28:41 -0600 X-Trace: news.uswest.net 972250031 63.227.115.85 (Sun, 22 Oct 2000 16:27:11 CDT) To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1144 > traditional sense of a programming language. Soooo...uhhh....??? > > As a secondary question, this is part of a program to converst a string > to all uppercase. Right now I'm doing in a WHILE...DO loop. But > something tells me there's amcuh more efficient way to do it (with EVERY > perhaps?) Any suggestions? data := "Some MiXed CaSed Data" newdata := map(data,&lcase,&ucase) --> newdata now contains "SOME MIXED CASED DATA" The map function searches in the first parameter every instance of each character in the second parameter and replaces that character with a character from the third parameter that is in the same "position" as the character in the 2nd... I hope that sounded clear... Here is an example: # 12345 12345 map("some data","aeiou","!@#$%") -> "s$m# d!t!" The above does the following mapping a -> ! e -> @ i -> # o -> $ u -> % You can also use map to rearrange data # mm/dd/yyyy yyyy/mm/dd mm/dd/yyyy map("123456789A","789A612345","10/21/2000") Will transform a date in the format of mm/dd/yyyy into yyyy/mm/dd. It uses the third parameter as the "input" Cheyenne From icon-group-sender Mon Oct 23 08:18:31 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9NFIKH18444 for icon-group-addresses; Mon, 23 Oct 2000 08:18:20 -0700 (MST) Message-Id: <200010231518.e9NFIKH18444@baskerville.CS.Arizona.EDU> From: Atle X-Newsgroups: comp.lang.icon Subject: Re: How to "declare" a string? Date: Mon, 23 Oct 2000 14:39:37 +0200 X-Trace: news0.skynet.be 972303850 19771 194.78.236.176 (23 Oct 2000 12:24:10 GMT) X-Complaints-To: abuse@skynet.be X-Accept-Language: en To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 742 symbiot@my-deja.com wrote: > > best I can tell, it is choking because UPPER has not been "declared". I am a *total* newbie, but I may have an answer to this one (Icon programmer please correct this if wrong) Icon will extract as much information from your statements as possible. so, if you initialize a variable like this: i := 0 it will not need an i : INTEGER to figure it out, it knows that 0 is an integer, and will declare i implicitely. the same with a string: s := "" will implicitely declare s to be string type. If in the start of your program, you set UPPER := "" you might solve an 'undeclared' reference ... PS! Please have this checked. It is just a suggestion. ENDPS! -- Best wishes, Atle users.skynet.be/atle From icon-group-sender Mon Oct 23 12:24:29 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9NJNtE26724 for icon-group-addresses; Mon, 23 Oct 2000 12:23:55 -0700 (MST) Message-Id: <200010231923.e9NJNtE26724@baskerville.CS.Arizona.EDU> Delivered-To: fixup-icon-group@CS.Arizona.EDU@fixme From: Cheyenne Wills To: icon-group@cs.arizona.edu Subject: Re: How to "declare" a string? Date: Mon, 23 Oct 2000 10:59:15 +0100 (MDT) X-Mailerorigin: http://www.fsai.fh-trier.de/~schmitzj/Xclasses/XCmail/ Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1196 Icon handles datatyping differently then languages such as C, or Java. Icon will try to convert the datatype to the apporiate type needed by the current operation. For example: some_number := 1234 a_string = "this is a string" new_number := some_number + 5 # -> 1239 new_string := a_string || "." # -> "this is a string." another_string := "4" || "2" # -> "42" some_fun := another_string + 3 # -> 45 more_fun := a_string || some_number # -> "this is a string1234" Also one does not need to "declare" variables before using them. They all have a default value of &null. What this means is that as long as the first time the variable is used in a expression it is either "recieving a value" or it is tested for null. For example: procedure main() repeat { if /count then count := 5 # First checks to see of varable is null if count > 10 then break count := count + 2 } end This can be rewritten as: procedure main() repeat { /count := 5 (10 >= count) +:= 2 } end The above relies on two features of Icon, one the behavior of failure within expressions and the fact that an expression can return (produce) a "variable" Cheyenne From icon-group-sender Mon Oct 23 12:34:15 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9NJXou27055 for icon-group-addresses; Mon, 23 Oct 2000 12:33:50 -0700 (MST) Message-Id: <200010231933.e9NJXou27055@baskerville.CS.Arizona.EDU> From: Parvinder Kaur X-Newsgroups: comp.lang.icon Subject: Icon beginner Date: Mon, 23 Oct 2000 11:56:42 -0700 X-Trace: mark.ucdavis.edu 972327406 622 169.237.5.136 (23 Oct 2000 18:56:46 GMT) X-Complaints-To: usenet@ucdavis.edu To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 335 Hi, I'm just learning icon and I'm stumped with a particular problem. I'm suppose to delete all occurrences of a space from a sentence, i.e. "Hi there" should become "Hithere". Any ideas of how I should approach this problem. I tried using the built-in delete proc. but it wasn't working. I'd appreciate any help, thanks! -Cos From icon-group-sender Mon Oct 23 16:56:18 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9NNtnY04985 for icon-group-addresses; Mon, 23 Oct 2000 16:55:49 -0700 (MST) Message-Id: <200010232355.e9NNtnY04985@baskerville.CS.Arizona.EDU> From: Chris.D.Tenaglia@jci.com Subject: Re: Icon beginner To: kaurp@cs.ucdavis.edu Cc: icon-group@cs.arizona.edu Date: Mon, 23 Oct 2000 14:59:49 -0500 X-MIMETrack: Serialize by Router on jwimkrs1.na.jci.com/NA/Johnson_Controls(Release 5.0.4 |June 8, 2000) at 10/23/2000 03:20:17 PM Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 642 I like simple things like... procedure despace(str) new := "" every byte := !string do if byte ~== " " then new ||:= byte return new end Chris Tenaglia, tech analyst, jci kaurp@cs.ucdavis.edu on 10/23/2000 01:56:42 PM To: icon-group@CS.Arizona.EDU cc: bcc: Subject: Icon beginner Hi, I'm just learning icon and I'm stumped with a particular problem. I'm suppose to delete all occurrences of a space from a sentence, i.e. "Hi there" should become "Hithere". Any ideas of how I should approach this problem. I tried using the built-in delete proc. but it wasn't working. I'd appreciate any help, thanks! -Cos From icon-group-sender Mon Oct 23 16:57:49 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9NNvZj05024 for icon-group-addresses; Mon, 23 Oct 2000 16:57:35 -0700 (MST) Message-Id: <200010232357.e9NNvZj05024@baskerville.CS.Arizona.EDU> Delivered-To: fixup-icon-group@CS.Arizona.EDU@fixme From: Cheyenne Wills To: icon-group@cs.arizona.edu Subject: Re: How to "declare" a string? Date: Mon, 23 Oct 2000 14:35:06 +0100 (MDT) X-Mailerorigin: http://www.fsai.fh-trier.de/~schmitzj/Xclasses/XCmail/ Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 224 Woops... finger check... The loop will not terminate in my "rewritten" example.. So.. procedure main() repeat { /count := 5 ((10 >= count) +:= 2) | break } end Sorry 'bout that folks Cheyenne From icon-group-sender Mon Oct 23 16:58:14 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9NNw0X05043 for icon-group-addresses; Mon, 23 Oct 2000 16:58:00 -0700 (MST) Message-Id: <200010232358.e9NNw0X05043@baskerville.CS.Arizona.EDU> Date: Mon, 23 Oct 2000 16:20:42 -0500 From: "Charles Hethcoat" To: "Parvinder Kaur" Cc: Subject: Re: Icon beginner Content-Disposition: inline X-Guinevere: 1.0.13 ; Oceaneering Int'l X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id e9NLJw300124 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 866 Not the only way, or the best way, but it works: procedure main() wsp := ' ' # a whitespace cset s_in := "Pretty little maids all in a row." s_out := "" s_in ? { while s_out ||:= tab(upto(wsp)) do tab(many(wsp)) s_out ||:= tab(0) } write(s_in, "\n-->", s_out) exit() end It should give: Pretty little maids all in a row. -->Prettylittlemaidsallinarow. You can also change the cset to recognize tabs and such: wsp := ' \t' Charles Hethcoat >>> Parvinder Kaur 00-10-23 1:56:42 PM >>> Hi, I'm just learning icon and I'm stumped with a particular problem. I'm suppose to delete all occurrences of a space from a sentence, i.e. "Hi there" should become "Hithere". Any ideas of how I should approach this problem. I tried using the built-in delete proc. but it wasn't working. I'd appreciate any help, thanks! -Cos From icon-group-sender Tue Oct 24 08:17:21 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9OFFtT14377 for icon-group-addresses; Tue, 24 Oct 2000 08:15:55 -0700 (MST) Message-Id: <200010241515.e9OFFtT14377@baskerville.CS.Arizona.EDU> From: Nevin Liber Subject: Re: Icon beginner To: icon-group@cs.arizona.edu Date: Mon, 23 Oct 2000 18:30:48 -0700 (PDT) Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 516 Chris.D.Tenaglia@jci.com proudly exclaims: > I like simple things like... > procedure despace(str) > new := "" > every byte := !string do if byte ~== " " then new ||:= byte > return new > end Another way I thought of doing it is like: procedure despace(s) s := string(s) | runerr(103, s) while s[upto(' ', s)] := "" return s end but this method would require a bit more explanation (which I am leaving up to the reader for now). -- Nevin ":-)" Liber (773) 961-2479 From icon-group-sender Tue Oct 24 08:18:24 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9OFI8B14452 for icon-group-addresses; Tue, 24 Oct 2000 08:18:08 -0700 (MST) Message-Id: <200010241518.e9OFI8B14452@baskerville.CS.Arizona.EDU> From: "Jay Hammond" To: icon-group@cs.arizona.edu Date: Tue, 24 Oct 2000 10:49:48 +0000 Subject: re: simple - can't index a string X-Confirm-Reading-To: J.Hammond@qmw.ac.uk X-pmrqc: 1 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 3066 > Greetings: > > Another question that "should" be simple....but I can't seem to figure > it out. > > I have the statement.... > > UPPER[index] := &ucase[find(data[index],&lcase)] > > ....which is giving an error: > > Traceback: > main() > {(variable = &null)[1]} from line 8 in noname.icn > > best I can tell, it is choking because UPPER has not been "declared". > But I can't find anywhere how to "declare" a string. In fact, all the > references I find talk about how ICON doesn't NEED "declarations" in the > traditional sense of a programming language. Soooo...uhhh....??? Perhaps I have a solution to the first part; First off, the bald solution: Don't declare the string to have type "string", just create a suitable string. and some words of explanation; If I may approach this problem from the side, by thinking about what is going wrong, suppose the INDEX to UPPER was 5 (I know your error message said it evaluated to 1) then you'd be looking at the thing at position 5 in UPPER. Any programming language will have a hard time locating position 5 in a string that does not exist. You have said that UPPER does not exist yet. At best, you could expect a request to index into UPPER to "default" to creating a string of ... err what would it be? Ascii nulls, Blanks, something long enough to resolve your reference, and return the relevant part of your default string. - so in my example you'd get the 5th blank (or whatever) along. In my opinion, it is more use to you as a programmer to be told There's no such string as UPPER, so it's getting you nowhere to look at position 5 in it. You don't have to declare UPPER before you use it, and the type, when you do use it, will be figured out for you. I propose UPPER := "a suitable string for your purpose" I have had a similar problem; I have tried while (......) do { i +:= 1 .... } and wondered why I get errors incrementing i It turns out that i had no value earlier, and unlike Snobol, that absence of a value does not convert to a numeric zero. I have to write i := 0 before the loop construct, (or whatever starting value my loop needs) You can't increment nothing, but you can increment from zero. You can't index into a string that's not there. Don't declare the string, create it! I think, if you request an index that is off the end of a string, you just get a graceful fail, that might let you backtrack or resume. so animal := "cat" # I just got Icon to make me a string if animal[5] then write("cat o' nine tails") else write("manx") should always write "manx" (non-brits; there is a pun here cat o' nine tails is an whip with 9 thongs (naval, historical) a manx cat is one from the isle of man, a breed with no tail to speak of ) [snipped 2ndary question already answered better than I could] all the best, Jay Jay Hammond, Email j.hammond@qmw.ac.uk Arts Computing Unit Queen Mary & Westfield College, Mile End Rd, London E1 4NS Phone +44 20 7882 3209 From icon-group-sender Tue Oct 24 12:41:05 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9OJdIL22579 for icon-group-addresses; Tue, 24 Oct 2000 12:39:18 -0700 (MST) Message-Id: <200010241939.e9OJdIL22579@baskerville.CS.Arizona.EDU> From: Parvinder Kaur X-Newsgroups: comp.lang.icon Subject: counting lines Date: Tue, 24 Oct 2000 09:10:12 -0700 X-Trace: mark.ucdavis.edu 972403814 26892 169.237.5.128 (24 Oct 2000 16:10:14 GMT) X-Complaints-To: usenet@ucdavis.edu To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 404 Hi, I have another problem that I could use help figuring out. I'm suppose to count the number of lines in a text. The lines should be stored in a table as the key and it's associated value is the number of times it occurred within the text. i.e. Hi there How are you Hi there will look like this Hi there 2 How are you 1 Any help or suggestions will be greatly appreciated. Thanks, Cos :) From icon-group-sender Tue Oct 24 13:25:33 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9OKPJD24283 for icon-group-addresses; Tue, 24 Oct 2000 13:25:20 -0700 (MST) Message-Id: <200010242025.e9OKPJD24283@baskerville.CS.Arizona.EDU> From: symbiot@my-deja.com X-Newsgroups: comp.lang.icon Subject: Re: How to "declare" a string? Date: Tue, 24 Oct 2000 18:05:48 GMT To: cheyenne_wills@qwest.net X-Article-Creation-Date: Tue Oct 24 18:05:48 2000 GMT X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt) X-Http-Proxy: 1.0 SRVPROXY, 1.0 x63.deja.com:80 (Squid/1.1.22) for client 208.51.185.226 X-MyDeja-Info: XMYDJUIDsymbiot To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1562 Neat function! Thanks for the suggestion. Any ideas about the the first question? In article <39F35C09.4A9C93A1@qwest.net>, Cheyenne Wills wrote: > > > traditional sense of a programming language. Soooo...uhhh....??? > > > > As a secondary question, this is part of a program to converst a string > > to all uppercase. Right now I'm doing in a WHILE...DO loop. But > > something tells me there's amcuh more efficient way to do it (with EVERY > > perhaps?) Any suggestions? > > data := "Some MiXed CaSed Data" > newdata := map(data,&lcase,&ucase) > > --> newdata now contains "SOME MIXED CASED DATA" > > The map function searches in the first parameter every instance of each > character in the second parameter and replaces that character with a > character from the third parameter that is in the same "position" as the > character in the 2nd... > > I hope that sounded clear... > > Here is an example: > > # 12345 12345 > map("some data","aeiou","!@#$%") -> "s$m# d!t!" > > The above does the following mapping > > a -> ! > e -> @ > i -> # > o -> $ > u -> % > > You can also use map to rearrange data > # mm/dd/yyyy yyyy/mm/dd mm/dd/yyyy > map("123456789A","789A612345","10/21/2000") > > Will transform a date in the format of mm/dd/yyyy into yyyy/mm/dd. It > uses the third parameter as the "input" > > Cheyenne > -- "Wife who put husband in doghouse, soon find him in cathouse." -- Wisdom of the Tao Sent via Deja.com http://www.deja.com/ Before you buy. From icon-group-sender Tue Oct 24 13:26:56 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9OKQmx24336 for icon-group-addresses; Tue, 24 Oct 2000 13:26:48 -0700 (MST) Message-Id: <200010242026.e9OKQmx24336@baskerville.CS.Arizona.EDU> From: symbiot@my-deja.com X-Newsgroups: comp.lang.icon Subject: Re: How to "declare" a string? Date: Tue, 24 Oct 2000 18:03:48 GMT To: trollet@skynet.be X-Article-Creation-Date: Tue Oct 24 18:03:48 2000 GMT X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt) X-Http-Proxy: 1.0 SRVPROXY, 1.0 x61.deja.com:80 (Squid/1.1.22) for client 208.51.185.226 X-MyDeja-Info: XMYDJUIDsymbiot To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1711 Hi, Thanks for your response. I based my program on the same assumption you made concerning how ICON scan variables and assigns type according to usage (and even converts on the fly). But in the statement I listed, it seemed to barf because I was requiring it to create an indexed string. The line was, essentially, data[index] := .....results of some string operation.... I even tried intially data with data := " " But that created a variable that was one cell in size. So when the abouve statement got to "index := 2", it barfed because the variable data wasn't large enough. So again I'm back to the quesiton, "How to 'declare' a string variable?" In article <39F43189.BBF358BC@skynet.be>, Atle wrote: > symbiot@my-deja.com wrote: > > > > > best I can tell, it is choking because UPPER has not been "declared". > I am a *total* newbie, but I may have an answer to this one > (Icon programmer please correct this if wrong) > Icon will extract as much information from your statements as possible. > > so, if you initialize a variable like this: > > i := 0 > > it will not need an > > i : INTEGER to figure it out, it knows that 0 is an integer, and will declare i implicitely. > > the same with a string: > > s := "" > > will implicitely declare s to be string type. > > If in the start of your program, you set > > UPPER := "" > > you might solve an 'undeclared' reference ... > > PS! > Please have this checked. It is just a suggestion. > ENDPS! > > -- > Best wishes, Atle > > users.skynet.be/atle > -- "Wife who put husband in doghouse, soon find him in cathouse." -- Wisdom of the Tao Sent via Deja.com http://www.deja.com/ Before you buy. From icon-group-sender Tue Oct 24 13:27:21 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9OKRDH24369 for icon-group-addresses; Tue, 24 Oct 2000 13:27:13 -0700 (MST) Message-Id: <200010242027.e9OKRDH24369@baskerville.CS.Arizona.EDU> From: Parvinder Kaur X-Newsgroups: comp.lang.icon Subject: writing a subset of Prolog Date: Tue, 24 Oct 2000 13:10:54 -0700 X-Trace: mark.ucdavis.edu 972418256 8189 169.237.5.128 (24 Oct 2000 20:10:56 GMT) X-Complaints-To: usenet@ucdavis.edu To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 770 Hi, I am writing a subset of Prolog with Icon for a project. I'm stumped at a particular problem (mostly due to my unfamiliarity with the Icon language). The problem is the parse the following type of input: book(king) and color(white,blue). As "book(king)" is parsed "book" should be stored as a key value in a table and it's values should be composed of a list of lists- the arguments (for book it would be king, for color the arguments would be white and blue). It would resemble something like this: db[book] := [[king]] and db[color] := [[white] [blue]] The table is indexed by the predicate and the table entry for a predicate is a list of defined facts. Does anyone have any ideas or suggetions on how to approach this problem. I'd appreciate any help. -C From icon-group-sender Tue Oct 24 16:45:38 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9ONjNY23055 for icon-group-addresses; Tue, 24 Oct 2000 16:45:23 -0700 (MST) Message-Id: <200010242345.e9ONjNY23055@baskerville.CS.Arizona.EDU> Date: Tue, 24 Oct 2000 13:39:57 -0700 From: Steve Wampler X-Accept-Language: en To: Parvinder Kaur CC: icon-group@cs.arizona.edu Subject: Re: counting lines Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 920 Parvinder Kaur wrote: > > Hi, > I have another problem that I could use help figuring out. I'm > suppose to count the number of lines in a text. The lines should be > stored in a table as the key and it's associated value is the number of > times it occurred within the text. i.e. > Hi there > How are you > Hi there > will look like this > Hi there 2 > How are you 1 > Any help or suggestions will be greatly appreciated. > Thanks, > Cos :) Since this is beginning to look like homework assignments, I'm not going to give code here. Instead - read about Icon tables in the Icon book or in the on-line tutorial - this is a problem that can solved in surprisingly few lines of Icon code. (Hint: The Icon tables, by there very nature, provide almost everything you need, once you figure out what the default value should be.) -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Tue Oct 24 16:46:41 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9ONkWg25699 for icon-group-addresses; Tue, 24 Oct 2000 16:46:32 -0700 (MST) Message-Id: <200010242346.e9ONkWg25699@baskerville.CS.Arizona.EDU> Date: Tue, 24 Oct 2000 15:48:41 -0500 From: "Charles Hethcoat" To: Subject: Re: counting lines Content-Disposition: inline X-Guinevere: 1.0.13 ; Oceaneering Int'l X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id e9OKm7324919 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1617 >>> Parvinder Kaur 00-10-24 11:10:12 AM >>> wrote: Hi, I have another problem that I could use help figuring out. I'm suppose to count the number of lines in a text. The lines should be stored in a table as the key and it's associated value is the number of times it occurred within the text. i.e. Hi there How are you Hi there will look like this Hi there 2 How are you 1 Any help or suggestions will be greatly appreciated. Thanks, Cos :) >>> Oh, what fun! Here is my solution, coded for clarity, I hope: procedure main() t := table(0) while line := read() do { t[line] +:= 1 } every line := key(t) do write(line, " ", t[line]) exit() end which, on reading Hi there How are you Hi there writes How are you 1 Hi there 2 However, on reading Hi there How are you Hi there writes 1 How are you 1 Hi there 2 In other words, watch out for the empty line that might be found at the end! By the way, the two supposedly identical lines in your sample data were not. One of them had a trailing blank at the end! I had to edit it to get your intended result. Charles Hethcoat >>> Parvinder Kaur 00-10-24 11:10:12 AM >>> Hi, I have another problem that I could use help figuring out. I'm suppose to count the number of lines in a text. The lines should be stored in a table as the key and it's associated value is the number of times it occurred within the text. i.e. Hi there How are you Hi there will look like this Hi there 2 How are you 1 Any help or suggestions will be greatly appreciated. Thanks, Cos :) From icon-group-sender Tue Oct 24 16:47:28 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9ONlLP25739 for icon-group-addresses; Tue, 24 Oct 2000 16:47:21 -0700 (MST) Message-Id: <200010242347.e9ONlLP25739@baskerville.CS.Arizona.EDU> Date: Tue, 24 Oct 2000 13:59:26 -0700 From: Steve Wampler X-Accept-Language: en To: symbiot@my-deja.com, icon-group Subject: Re: How to "declare" a string? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2048 symbiot@my-deja.com wrote: > > Hi, > > Thanks for your response. > > I based my program on the same assumption you made concerning how ICON > scan variables and assigns type according to usage (and even converts > on the fly). > > But in the statement I listed, it seemed to barf because I was > requiring it to create an indexed string. > > The line was, essentially, > > data[index] := .....results of some string operation.... > > I even tried intially data with > > data := " " > > But that created a variable that was one cell in size. So when the > abouve statement got to "index := 2", it barfed because the variable > data wasn't large enough. > > So again I'm back to the quesiton, "How to 'declare' a string variable?" > There's probably some confusion over terminology here. There is no such thing as a "string variable" in Icon (or an "integer variable", nor any other "typed" variable. Any variable in Icon can hold a value of any type. Think of a variable as a bucket that you can place anything in. Initially it's empty, so trying to subscript it generates an error because there nothing there to subscript it. Similarly, when you put the (1-character long) string " " into it, subscripting failed when you tried to go past the end of the string. You could, of course, put a much larger string into the variable. There are any number of ways to do so, for example: data := repl(" ",4096) would put a string of 4,096 blanks into data. However, that's probably not the best way to make use of Icon, it leads to thinking in terms of the variables instead of the values themselves, and generally results in more complicated code than is necessary. You might try and rethink how you're approaching the problem and think more in terms of what you want the resulting value to look like and how you might transform the input value into that result. Several people have made some good suggestions on how you might proceed in this way. -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Tue Oct 24 16:47:52 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9ONlh625768 for icon-group-addresses; Tue, 24 Oct 2000 16:47:44 -0700 (MST) Message-Id: <200010242347.e9ONlh625768@baskerville.CS.Arizona.EDU> Date: Tue, 24 Oct 2000 16:10:26 -0500 From: "Charles Hethcoat" To: Subject: Re: How to "declare" a string? Content-Disposition: inline X-Guinevere: 1.0.13 ; Oceaneering Int'l X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id e9OLA0325855 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1418 >>> 00-10-24 1:03:48 PM >>> wrote: > So again I'm back to the quesiton, "How to 'declare' a string variable?" I don't know if this will help answer the question, which I am admittedly quite confused about. However, a few smart tests can take you far. Try this: procedure main() s1 := "This is a string" write(s1) # s2[2] := s1 # write(s2) s3 := "Oh, no, Mr. Bill! " s4 := s3 || s1 write(s4) s3[2] := s1 write(s3) exit() end You get: This is a string Oh, no, Mr. Bill! This is a string OThis is a string, no, Mr. Bill! Now remove the comments and watch it die. Why? I'm not a guru on the innards of Icon parsing, but my guess is that the line s2[2] := s1 is ambiguous. s2 could be a string OR a table. Either one would be syntactically correct. So what's a parser to do? Later on, s3 is already a string, so there is no question. So, to "declare" a string s, first use it as a string. s := "" should be sufficient. Modify the program again: procedure main() s1 := "This is a string" write(s1) # s2[2] := s1 # write(s2) s3 := "Oh, no, Mr. Bill! " s4 := s3 || s1 write(s4) s3[2] := s1 write(s3) s5 := "" # new s5 := s1 # new write(s5) # new exit() end you get This is a string Oh, no, Mr. Bill! This is a string OThis is a string, no, Mr. Bill! This is a string Does this help? If not, copy it and continue working with it. Charles Hethcoat From icon-group-sender Tue Oct 24 16:48:11 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9ONm2s25796 for icon-group-addresses; Tue, 24 Oct 2000 16:48:02 -0700 (MST) Message-Id: <200010242348.e9ONm2s25796@baskerville.CS.Arizona.EDU> Date: Tue, 24 Oct 2000 16:21:35 -0500 From: "Charles Hethcoat" To: Subject: Re: writing a subset of Prolog Content-Disposition: inline X-Guinevere: 1.0.13 ; Oceaneering Int'l X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id e9OLOY326145 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 649 >>> Parvinder Kaur 00-10-24 3:10:54 PM >>> wrote: > I am writing a subset of Prolog with Icon for a project. I'm stumped at a particular problem ... In general, the data in a table can be any scalar or structured type: integer, real, record, list, list of records, etc. I use tables of lists frequently. They look somewhat like this: t := table() t["Ford"] := [1968, "Blue", 142.6] write(t["Ford"][3]) So, t is a table, t["Ford"] is a list, and t["Ford"][3] is a floating point number. This is a very flexible and adaptable approach. It is my preferred way to build directed graphs, for example. Charles Hethcoat From icon-group-sender Tue Oct 24 16:48:38 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9ONmNO25823 for icon-group-addresses; Tue, 24 Oct 2000 16:48:23 -0700 (MST) Message-Id: <200010242348.e9ONmNO25823@baskerville.CS.Arizona.EDU> From: Nevin Liber Subject: Re: How to "declare" a string? To: icon-group@cs.arizona.edu Date: Tue, 24 Oct 2000 14:33:42 -0700 (PDT) Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 361 > But in the statement I listed, it seemed to barf because I was > requiring it to create an indexed string. I think what you are looking for is, in Icon parlance, a table of strings. The following declaration should give you what you want: data := table("") Read up on tables for more info. -- Nevin ":-)" Liber (773) 961-2479 From icon-group-sender Wed Oct 25 07:48:36 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9PElbT08852 for icon-group-addresses; Wed, 25 Oct 2000 07:47:37 -0700 (MST) Message-Id: <200010251447.e9PElbT08852@baskerville.CS.Arizona.EDU> Delivered-To: fixup-icon-group@CS.Arizona.EDU@fixme Date: Tue, 24 Oct 2000 18:23:38 -0600 From: Cheyenne Wills X-Accept-Language: en To: icon-group@cs.arizona.edu Subject: Re: How to "declare" a string? (and forget how to do it :) Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 835 Yesterday I posted a "solution" then posted a fix to that solution and even that was wrong (thanks to those who pointed it out) The original "fixed" code looked like: procedure main() repeat { /count := 5 ((10 >= count) +:= 2)| break } end is wrong. I had gotten my wires crossed with which operators produce values versus those that produce variables. The relationship operators ( =, <=, >=, etc.) produce values, while operators such as ( /, \, op:=, etc.) produce variables. So.. here is the final (hopefully) example.. procedure main() repeat { /count := 5 (count := (10 >= count) + 2) | break } end Of course this is obscured code and could be written alot "cleaner" Again sorry about the brain check. (and that should teach me to post "untested" code ) Cheyenne From icon-group-sender Wed Oct 25 08:08:53 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9PF8eP09361 for icon-group-addresses; Wed, 25 Oct 2000 08:08:40 -0700 (MST) Message-Id: <200010251508.e9PF8eP09361@baskerville.CS.Arizona.EDU> Date: Tue, 24 Oct 2000 17:30:29 -0700 (PDT) From: Shamim Mohamed To: "Charles Hethcoat" Cc: Subject: Re: How to "declare" a string? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1427 Charles Hethcoat replies to someone's question: > > > So again I'm back to the quesiton, "How to 'declare' a string variable?" > > I don't know if this will help answer the question, which I am > admittedly quite confused about. However, a few smart tests can take > you far. Actually, an attentive reading of Griswold and Griswold will help more than running tests; that way you don't have to try to figure out what the language is doing, the book tells you exactly what's happening. > ... my guess is that the line > > s2[2] := s1 > > is ambiguous. s2 could be a string OR a table. Either one would be > syntactically correct. I fear you are getting too hung up on syntax. When icont sees s2[2], it generates instructions for the interpreter iconx: "apply the subscript operator to the value stored in the variable s2 with the index 2". And what value is stored in s2 when execution reaches that line? The null value &null, which cannot accept a subscript operation. Ergo runtime error. Remember, icont does not do the type-checking, iconx does. (Values that the subscript operator [] can be applied to are: strings, csets, lists, tables, ...) To the original writer: don't think too much about types of variables. That is an artifact of languages like C or Pascal. Think about values having types, variables are just pigeonholes for these typed values. A variable can hold a value of any type. -s From icon-group-sender Wed Oct 25 08:09:28 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9PF9Ka09393 for icon-group-addresses; Wed, 25 Oct 2000 08:09:20 -0700 (MST) Message-Id: <200010251509.e9PF9Ka09393@baskerville.CS.Arizona.EDU> Delivered-To: fixup-icon-group@CS.Arizona.EDU@fixme Date: Tue, 24 Oct 2000 18:15:10 -0600 From: Cheyenne Wills X-Accept-Language: en To: icon-group@cs.arizona.edu Subject: Re: How to "declare" a string? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 786 symbiot@my-deja.com wrote: > > Hi, > > Thanks for your response. > > I based my program on the same assumption you made concerning how ICON > scan variables and assigns type according to usage (and even converts > on the fly). > > But in the statement I listed, it seemed to barf because I was > requiring it to create an indexed string. > > The line was, essentially, > > data[index] := .....results of some string operation.... > > I even tried intially data with > > data := " " > I think that you are looking for a list of strings... SO... data := [] # An empty list while line := read() do { put(data,map(line)) } every i := 1 to *data do { write(data[i]) } In this case you have to "declare" the array. You do the same for sets and tables. Cheyenne From icon-group-sender Wed Oct 25 08:09:54 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9PF9kc09413 for icon-group-addresses; Wed, 25 Oct 2000 08:09:46 -0700 (MST) Message-Id: <200010251509.e9PF9kc09413@baskerville.CS.Arizona.EDU> Date: Tue, 24 Oct 2000 21:23:19 -0400 From: David Gamey X-Accept-Language: en To: icon-group@cs.arizona.edu CC: Chris.D.Tenaglia@jci.com Subject: Re: Icon beginner Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1745 Chris.D.Tenaglia@jci.com wrote: > > I like simple things like... > > procedure despace(str) > new := "" > every byte := !string do if byte ~== " " then new ||:= byte Ooops, this typo "!string" instead of "!str" won't work. I'd expect to see a type error here since string is a builtin function. > return new > end > There's always 'strip' in the Icon programming library, see http://www.cs.arizona.edu/icon/library/src/procs/strip.icn But if you insist on doing it yourself try a slightly terser version of Chris's code: procedure despace(str) new := "" every new ||:= ( " " ~== !str ) return new end In the above, every generates each character in str. Then if the ~== succeeds, the ~== operator returns its' right argument for the concatenation. Chris's example is probably easier for someone new to Icon to decipher. After writing Icon for a while I find the second is clearer and more straightforward. You could with minor changes make this work like strip. However, it wouldn't likely be as elegant or as fast. An interesting difference in the use of every .vs. while (and the integration of control structures with string scanning). > Chris Tenaglia, tech analyst, jci > > kaurp@cs.ucdavis.edu on 10/23/2000 01:56:42 PM > > To: icon-group@CS.Arizona.EDU > cc: > bcc: > > Subject: Icon beginner > > Hi, > I'm just learning icon and I'm stumped with a particular problem. I'm > suppose to delete all occurrences of a space from a sentence, i.e. "Hi > there" should become "Hithere". Any ideas of how I should approach this > problem. I tried using the built-in delete proc. but it wasn't working. delete works with structures (e.g. sets) > I'd appreciate any help, thanks! > -Cos David Gamey From icon-group-sender Wed Oct 25 12:24:13 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9PJNkm08714 for icon-group-addresses; Wed, 25 Oct 2000 12:23:46 -0700 (MST) Message-Id: <200010251923.e9PJNkm08714@baskerville.CS.Arizona.EDU> From: symbiot@my-deja.com X-Newsgroups: comp.lang.icon Subject: Yet another Newbie question.... Date: Wed, 25 Oct 2000 16:18:08 GMT X-Article-Creation-Date: Wed Oct 25 16:18:08 2000 GMT X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt) X-Http-Proxy: 1.0 SRVPROXY, 1.0 x65.deja.com:80 (Squid/1.1.22) for client 208.51.185.226 X-MyDeja-Info: XMYDJUIDsymbiot To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 736 Hi, And thanks in advance to all who have been helping me thru this learning curve of getting started in ICON. My present problem is trying to write a rountine that counts only letters in text and skips blanks, numbers, punctuation, etc. I tried.... if member(&letters,line[index]) then totalcount +:= 1 ...but for some unexplicable reason, it barfed on the very first character with set or table expected. Offending value &letters Isn't &letters a cset? You can use it in other "set" functions....can't you? What am I missing? Assistance appreciated! -- "Wife who put husband in doghouse, soon find him in cathouse." -- Wisdom of the Tao Sent via Deja.com http://www.deja.com/ Before you buy. From icon-group-sender Wed Oct 25 16:27:32 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9PNQH309083 for icon-group-addresses; Wed, 25 Oct 2000 16:26:17 -0700 (MST) Message-Id: <200010252326.e9PNQH309083@baskerville.CS.Arizona.EDU> Date: Wed, 25 Oct 2000 12:53:08 -0700 (PDT) From: Shamim Mohamed To: symbiot@my-deja.com Cc: icon-group@cs.arizona.edu Subject: Re: Yet another Newbie question.... Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 602 > Hi, And thanks in advance to all who have been helping me thru this > learning curve of getting started in ICON. > My present problem is trying to write a rountine that counts only > letters in text and skips blanks, numbers, punctuation, etc. Homework? You really need a book on Icon. If you don't want to buy the text, download and read Tom Christopher's free on-line book. There's a link to it from the U of A Icon web page http://www.cs.arizona.edu/icon/. String scanning is the most natural way of doing this. What does this code do? line ? while tab(upto(&letters)) do move(1) -s From icon-group-sender Thu Oct 26 07:59:42 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9QEvkf22309 for icon-group-addresses; Thu, 26 Oct 2000 07:57:46 -0700 (MST) Message-Id: <200010261457.e9QEvkf22309@baskerville.CS.Arizona.EDU> From: Bob Ardler To: icon-group@cs.arizona.edu Date: Thu, 26 Oct 2000 12:32:54 +0100 Subject: Re: Yet another Newbie question.... User-Agent: Pluto/2.02b (RISC-OS/3.60) Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1540 Shamim Mohamed : > symbiot@my-deja.com : > > if member(&letters,line[index]) then totalcount +:= 1 > > barfed with > > set or table expected. > > Offending value &letters > > Isn't &letters a cset? You can use it in other "set" functions, > > can't you? What am I missing? > Homework? You really need a book on Icon. If you don't want to buy > the text, download and read Tom Christopher's free on-line book. > There's a link to it from the U of A Icon web page > http://www.cs.arizona.edu/icon/. > String scanning is the most natural way of doing this. What does > this code do? > line ? while tab(upto(&letters)) do move(1) Intimidates? Sends you screaming come back awk, come back perl, all is forgiven? Shamin is right in every respect; yet, as a permanent beginner I fell to the earth twitching and frothing at that "natural" line. Neither Griswold & Griswold nor Christopher (both excellent and friendly) always help, say, a student coming from a conventional language who wants to write a conventional 'if' statement and expects to find a simple analogue for the predicates s/he's used to. G&G (The Icon Programming Language, see www.peer-to-peer.com) does point out that member(X,x) requires X to be a set or table, and a cset isn't a set. Both books also list the operations on csets (union ++, intersection **, difference -- and complement ~), but I don't know where or whether they explain that you have to make your own cset analogue for member() using any() or not-empty intersection or whatever. From icon-group-sender Thu Oct 26 12:48:13 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9QJlX701049 for icon-group-addresses; Thu, 26 Oct 2000 12:47:33 -0700 (MST) Message-Id: <200010261947.e9QJlX701049@baskerville.CS.Arizona.EDU> Date: Thu, 26 Oct 2000 09:00:05 -0700 From: Steve Wampler X-Accept-Language: en To: Bob Ardler CC: icon-group@cs.arizona.edu Subject: Re: Yet another Newbie question.... Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2754 Bob Ardler wrote: > > Shamin is right in every respect; yet, as a permanent beginner I fell > to the earth twitching and frothing at that "natural" line. Neither > Griswold & Griswold nor Christopher (both excellent and friendly) > always help, say, a student coming from a conventional language who > wants to write a conventional 'if' statement and expects to find a > simple analogue for the predicates s/he's used to. Yes, but... This reminds of the (computer nerd) semi-joke "I can write FORTRAN in any language". Advanced languages like Icon (and Smalltalk and Prolog and ...) are not "conventional". Instead, they provide ways to approach problem solutions by thinking differently - which only works if you do think "differently". By forcing these languages to match a conventional model you are losing most of the advantages that the language offers. In that case, why bother with learning the language? Many (these days, perhaps most) students are seeing Icon as part of a "Programming Languages" course. The primary purpose of such a course is not to learn the different ways semicolons are treated or the different symbols used to denote assignment. The main reason for looking at different languages is to understand how a language can shape how you approach solving a problem. Some languages actually make it easy to think about problems more "naturally" (note that this isn't the same a "conventionally" and may, in fact, vary with the problem domain). For grins sometime, ask an algebra class how to express the concept that "X must be between 0 and 15, inclusive". Then ask a group of students at the end of a course on C (or Java, or any of the conventional languages). You could also ask a group of set theorists for another way to express the same concept. If you ask the same question of a group of students who have just learned Icon, it would be a good thing if they did not give the same answer as the C students. [It would be a *great* thing if they were then able to explain *why* Icon lets you express it the same way you're likely to see it written in "Math" and why C, Java, etc. *don't* let you express it that way.] > G&G (The Icon Programming Language, see www.peer-to-peer.com) does > point out that member(X,x) requires X to be a set or table, and a > cset isn't a set. Both books also list the operations on csets (union > ++, intersection **, difference -- and complement ~), but I don't > know where or whether they explain that you have to make your own > cset analogue for member() using any() or not-empty intersection or > whatever. This is very true. In fact, I'd like to see member(), etc, also work with csets. -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Thu Oct 26 12:49:26 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9QJnGO01100 for icon-group-addresses; Thu, 26 Oct 2000 12:49:16 -0700 (MST) Message-Id: <200010261949.e9QJnGO01100@baskerville.CS.Arizona.EDU> Date: Thu, 26 Oct 2000 10:05:24 -0700 (PDT) From: Shamim Mohamed To: Bob Ardler Cc: icon-group@cs.arizona.edu Subject: Re: Yet another Newbie question.... Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1291 >> line ? while tab(upto(&letters)) do move(1) > Intimidates? Sends you screaming come back awk, come back perl, all > is forgiven? No! Don't go back to the dark side! The ? operator sets up a string scanning environment - a string and position in it. upto(cset) returns the next position (starting from the current position) that a member of the cset occurs; and tab(i) sets the position to i. So tab(upto(&letters)) moves the position to the next occurrence of a letter. move(i) advances the position by i; so move(1) skips over the occurrence of the letter just found. tab() is absolute, move() is relative. (tab() and move() also return the piece of the string they just skipped over.) upto() will fail if it found no more occurrences in the string that are in the cset; so the while loop makes the whole thing go and terminate correctly. There are numerous examples in the books that are in the Icon idiom. Here's a very common way to find all the words in a line: line ? while tab(upto(&letters)) do { word := tab(many(&letters)) ... do something interesting with the word.... } many() is the converse of upto(); it returns the position of the end of the substring with characters from the cset. The books explain all this much better than I can! -s From icon-group-sender Thu Oct 26 17:00:02 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9QNxQN07434 for icon-group-addresses; Thu, 26 Oct 2000 16:59:26 -0700 (MST) Message-Id: <200010262359.e9QNxQN07434@baskerville.CS.Arizona.EDU> Date: Thu, 26 Oct 2000 18:23:18 -0400 (EDT) From: Taybin Rutkin To: icon-group@cs.arizona.edu Subject: Re: Yet another Newbie question.... Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 580 On Wed, 25 Oct 2000, Shamim Mohamed wrote: > line ? while tab(upto(&letters)) do move(1) So could you then do something like every line ? while tab(upto(&letters)) do move(1) do write("not letter") ??? I bet you can. Personally, I've found the best way to learn Icon is to make a small test program experimenting with the line in question. The best part is that even if it didn't do what you expected it to do. It probably did something interesting. Taybin Rutkin -- trutkin@black.clarku.edu Creativity can only be anarchic, capitalist, Darwinian -- Umberto Eco From icon-group-sender Fri Oct 27 08:00:36 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9RExmi19487 for icon-group-addresses; Fri, 27 Oct 2000 07:59:48 -0700 (MST) Message-Id: <200010271459.e9RExmi19487@baskerville.CS.Arizona.EDU> Date: Fri, 27 Oct 2000 03:04:55 -0200 From: Eduardo Nahum Ochs To: icon-group@cs.arizona.edu Subject: Re: Yet another Newbie question.... Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 3729 > This reminds of the (computer nerd) semi-joke "I can write FORTRAN > in any language". Advanced languages like Icon (and Smalltalk and > Prolog and ...) are not "conventional". Instead, they provide ways > to approach problem solutions by thinking differently - which only > works if you do think "differently". By forcing these languages to > match a conventional model you are losing most of the advantages > that the language offers. In that case, why bother with learning the > language? Right, but it is often convenient to first learn how to translate some techniques of the languages you already know into the new language -- for example basic debugging tools, to let you check which values the variables are getting, to make a program stop when reaching a point for the nth time, etc... I think that it is much easier to start coding with a bad style and learn continuously from reading good code than to pretend that your mind got entirely blank and then try to learn a new programming language as if you were suddenly reborn in another planet - possibly a planet where some of the knowledge comes in the form of mantras like "a class is like a car, a subclass is like a car window..." Please, no two programming languages are completely orthogonal to each other, and Icon is still made of its syntax plus the icode interpreter (let's think it low-level: interp.r) plus its primitive operations and functions... Ok, sorry -- I'm not being ironic, it's just that something occurred to me that I haven't thought before -- now I recognize that there are people who get bad programming habits and who would never even think about getting rid of them -- and worse yet, these are exactly the "excellent programmers" that can write working 100000-line programs (these programs that are ugly and unmaintainable, but the market doesn't care). So, who are we talking about when we say "In that case, why bother with learning the language"? These people? CS students that will only use something other than Perl when really forced to? I confess that almost all professional programmers that I knew personally (obs: I live in Brazil) are on the same equivalence class as the old dogs to whom it is impossible to teach new tricks... As for me, I'm studying maths, all my attempts to program professionally always failed miserably, and for five years I used Icon for almost every one-shot program that I had to do -- and it is scaring how we can program really complex things in a just few minutes with Icon when we have enough experience. My $0.02 on what we can do to help saving (:-) those people is just to make a certain simple piece of code standard. I used to include a file called "zinc.icn" from all my programs, and zinc.icn defined a function w and a constant NO such that "w(( expr )|NO)" was always equivalent to "expr", except maybe for some subtle differences on backtracking behavior that I never checked. But if "expr" failed then "w(( expr )|NO)" would print "failed" and fail, and if "expr" didn't fail then "w(( expr )|NO)" would print the full representation of "expr" using a recursive function, and return the value of "expr". I can post my code for "w", but it is somewhat ugly and needs some cleaning. I also had a trivial wrapper (for Linux) that when called as "icone expr" executed $include "zinc.icn" procedure main(args) w(( expr )|NO) end and I can try to resurrect it; I know that I would have rolled on the floor with joy if someone had shown me these tricks before I had to write them myself, but I don't know if other people would be interested. More on all this later; questions and flames are welcome. Cheers for now, Eduardo Ochs http://angg.twu.net/ edrx@inx.com.br From icon-group-sender Fri Oct 27 08:22:34 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9RFMNB20153 for icon-group-addresses; Fri, 27 Oct 2000 08:22:23 -0700 (MST) Message-Id: <200010271522.e9RFMNB20153@baskerville.CS.Arizona.EDU> X-Sender: whm@mail.mse.com Date: Fri, 27 Oct 2000 01:44:04 -0700 To: icon-group@cs.arizona.edu From: "William H. Mitchell" Subject: Re: Yet another Newbie question.... Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2366 This approach comes up from time to time on this list, but for the scanning-challenged a lot of text parsing can be done with a procedure that breaks apart strings at delimeters. Lots of folks have written such a thing. The one I wrote is called split, perhaps after the p*rl analog -- I forget. A clipping about split from some lecture notes I wrote on Icon follows below. Note that the pairs of lines beginning with "][" are interaction with an Icon expression evaluator. ----------- The procedure split(s, delims) returns a list consisting of the portions of the string s delimited by characters in delims: ][ split("just a test here ", ' '); r := L1:["just","a","test","here"] (list) ][ split("...1..3..45,78,,9 10 ", '., '); r := L1:["1","3","45","78","9","10"] (list) Consider a file whose lines consist of zero or more integers separated by white space: 5 10 0 100 50 200 1 2 3 4 5 6 7 8 9 10 A program to sum the numbers in such a file: link split procedure main() sum := 0 while line := read() do { nums := split(line, ' \t') every num := !nums do sum +:= num } write("The sum is ", sum) end If split has a third argument that is non-null, both delimited and delimiting pieces of the string are produced: ][ split("520-621-6613", '-', 1); r := L1:["520","-","621","-","6613"] (list) A sequence of splits: s := "a.b x.y p.q"; L1 := split(s, ' '); L2 := split(L1[2], '.'); ---------- Here's the source for split: # # split(s, delimiters, keepall) splits the string s into consecutive substrings # that do/do not consist of characters in the cset delimiters, producing a # list of strings. If keepall is null, strings consisting delimiters are not # included in the result list. # # If not specified, delimeters defaults to blank and tab, which essentially # "tokenizes" non-whitespace: # # words := split(read()) # # Author: William H. Mitchell (whm@mse.com) c. 1996 # procedure split(s, dlms, keepall) local w, ws, addproc, nullproc ws := [] /dlms := " \t" addproc := put if \keepall then otherproc := put else otherproc := 1 if dlms := (any(dlms, s[1]) & ~dlms) then otherproc :=: addproc s ? while w := tab(many(dlms := ~dlms)) do { addproc(ws, w) otherproc :=: addproc } return ws end From icon-group-sender Fri Oct 27 12:29:56 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9RJTS526754 for icon-group-addresses; Fri, 27 Oct 2000 12:29:28 -0700 (MST) Message-Id: <200010271929.e9RJTS526754@baskerville.CS.Arizona.EDU> X-Sender: whm@mail.mse.com Date: Fri, 27 Oct 2000 01:57:58 -0700 To: icon-group@cs.arizona.edu From: "William H. Mitchell" Subject: Sweating over scanning? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 907 Regarding this: > >> line ? while tab(upto(&letters)) do move(1) > > > Intimidates? Sends you screaming come back awk, come back perl, all > > is forgiven? One thing that I think helps to understand scanning is to realize that the scanning facility consists of just a handful of elements. According to my notes, here they are: Procedures for changing &pos: move(n) relative adjustment; string result tab(n) absolute adjustment; string result Procedures often used in conjunction with tab(n): upto(c) generates positions of characters in c many(c) produces position after run of characters in c find(s) generates positions of s match(s) produces position after s, if s is next any(c) produces position after a character in c Other procedures: pos(n) tests if &pos is equivalent to n bal(s, c1, c2, c3) similar to upto(c), but used for working with "balanced" strings. From icon-group-sender Fri Oct 27 12:31:05 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9RJUsJ26852 for icon-group-addresses; Fri, 27 Oct 2000 12:30:54 -0700 (MST) Message-Id: <200010271930.e9RJUsJ26852@baskerville.CS.Arizona.EDU> From: Bob Ardler To: icon-group@cs.arizona.edu Date: Fri, 27 Oct 2000 15:48:23 +0100 Subject: Re: Yet another Newbie question.... User-Agent: Pluto/2.02b (RISC-OS/3.60) Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2509 Steve Wampler : > This reminds me of "I can write FORTRAN in any language". Algol, actually. > By forcing these languages to match a conventional model... Forcing? Surely Icon was deliberately given a familiar procedural look to make it easier to learn and use? > ...you are losing most of the advantages that the language offers. > In that case, why bother with learning the language? It's good to see you raising this pedagogic issue: 'teach one thing at a time' versus 'sense the spirit, experience the epiphany, grab the gestalt' - Wordsworth's boing or pling (One impulse from a vernal wood [boinggg!!!] May teach you more of man, Of moral evil and of good, Than all the sages can). I think it's ok to teach or learn one thing at a time, building confidence, trying 1 new harder thing each day until the boing comes. Especially if there's a homework deadline. The alternative is grovelling to sensei while he slaps you across the gob and says where's your ki or align your sakai tanden to objects and classes, getting pissed and giving up, while sensei says no talent good riddance. > ...Some languages actually make it easy to think about problems > more "naturally" (note that this isn't the same as "conventionally" > and may, in fact, vary with the problem domain). Very true. True of Icon, whose design also has pedagogic merits, with a familiar look for an easy start and many enticing features. Still, its one-liners make learning hard because the flow of control is elusive. Shamin's: >> line ? while tab(upto(&letters)) do move(1) took him paragraphs to elucidate (he modestly added "The books explain all this much better than I can!", but in fact he explained very well and maybe should contribute a chapter on the scan expression). I still think some sort of labelled graph showing control flow for 1-liners involving scan, generators, coexpressions etc would be useful to teachers and some users. > ...ask an algebra class to express "X must be between 0 and 15, > inclusive". Then ask a group of students at the end of a course on > C (or Java, or any conventional language). Also a group of set > theorists. Give the set theorists a ...same of a group of students who have just learned Icon... Good experiment. Can't see how you could make a Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9RNN7r04740 for icon-group-addresses; Fri, 27 Oct 2000 16:23:07 -0700 (MST) Message-Id: <200010272323.e9RNN7r04740@baskerville.CS.Arizona.EDU> From: symbiot@my-deja.com X-Newsgroups: comp.lang.icon Subject: Re: Icon beginner Date: Fri, 27 Oct 2000 19:18:19 GMT To: kaurp@cs.ucdavis.edu X-Article-Creation-Date: Fri Oct 27 19:18:19 2000 GMT X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt) X-Http-Proxy: 1.0 SRVPROXY, 1.0 x53.deja.com:80 (Squid/1.1.22) for client 208.51.185.226 X-MyDeja-Info: XMYDJUIDsymbiot To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1124 >From one newbie to another..... Just a a first crack, I'd suggest looking at the upto(c) function. "c" needs to be a cset. I'm guessing something like.... blank := ' ' every sentence ? tab(upto(blank)) .....which, I think, will tab you over to each blank in the sentence. Now, somewhere in there you need to dump the output into a another string. Anyway, I think that's on the right track. I'd be interested in the responses any of the "expert" have given you. Cheers! In article , Parvinder Kaur wrote: > Hi, > I'm just learning icon and I'm stumped with a particular problem. I'm > suppose to delete all occurrences of a space from a sentence, i.e. "Hi > there" should become "Hithere". Any ideas of how I should approach this > problem. I tried using the built-in delete proc. but it wasn't working. > I'd appreciate any help, thanks! > -Cos > > -- "Wife who put husband in doghouse, soon find him in cathouse." -- Wisdom of the Tao Sent via Deja.com http://www.deja.com/ Before you buy. From icon-group-sender Mon Oct 30 08:30:09 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9UFSAZ25668 for icon-group-addresses; Mon, 30 Oct 2000 08:28:10 -0700 (MST) Message-Id: <200010301528.e9UFSAZ25668@baskerville.CS.Arizona.EDU> Delivered-To: fixup-icon-group@CS.Arizona.EDU@fixme Date: Fri, 27 Oct 2000 19:19:53 -0600 From: Cheyenne Wills X-Accept-Language: en To: icon-group@cs.arizona.edu Subject: Re: Sweating over scanning? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 814 "William H. Mitchell" wrote > > Procedures for changing &pos: > > move(n) relative adjustment; string result > tab(n) absolute adjustment; string result > And the result of move and tab is to return a string from the "subject". The string returned is the string that was "passed" over doing the move or the tab. > Procedures often used in conjunction with tab(n): > > upto(c) generates positions of characters in c > many(c) produces position after run of characters in c > find(s) generates positions of s > match(s) produces position after s, if s is next > any(c) produces position after a character in c And the result of the above is a number The Icon book has a good chapter on string scanning and how to write your own string scanning functions Cheyenne From icon-group-sender Mon Oct 30 08:30:39 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9UFUVF25774 for icon-group-addresses; Mon, 30 Oct 2000 08:30:31 -0700 (MST) Message-Id: <200010301530.e9UFUVF25774@baskerville.CS.Arizona.EDU> From: Atle X-Newsgroups: comp.lang.icon Subject: Re: Yet another Newbie question.... Date: Sat, 28 Oct 2000 18:03:26 +0200 X-Trace: news1.skynet.be 972748035 14352 195.238.29.161 (28 Oct 2000 15:47:15 GMT) X-Complaints-To: abuse@skynet.be X-Accept-Language: en To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1073 symbiot@my-deja.com wrote: > Hi, > > And thanks in advance to all who have been helping me thru this > learning curve of getting started in ICON. > > My present problem is trying to write a rountine that counts only > letters in text and skips blanks, numbers, punctuation, etc. > > I tried.... > > if member(&letters,line[index]) then totalcount +:= 1 > > ...but for some unexplicable reason, it barfed on the very first > character with > > set or table expected. > Offending value &letters > > Isn't &letters a cset? You can use it in other "set" functions....can't > you? What am I missing? > > Assistance appreciated! I see you haven't been getting much feedback on this, so I will try again. Unfortunately, as you see, I am no more bewandered in Icon than yourself, on the contrary, I am now working with Beta. But when initializing, isn't is important to distinguish between ' and " - one is a cset the other a string? I have no idea if this gets you anywhere, but since there doesn't seem to be many pros out there to help either of us right now ... BW, Atle From icon-group-sender Mon Oct 30 08:30:56 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9UFUlB25794 for icon-group-addresses; Mon, 30 Oct 2000 08:30:47 -0700 (MST) Message-Id: <200010301530.e9UFUlB25794@baskerville.CS.Arizona.EDU> Date: Sun, 29 Oct 2000 22:41:25 +1100 From: "P.A.Caleala" X-Accept-Language: en X-Newsgroups: comp.lang.icon Subject: ms-dos extensions ? X-Trace: 29 Oct 2000 22:31:52 +1100, ppp201148.its.rmit.edu.au To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 287 Hello I found in one icon program a reference to some ms-dos extensions. One of the functions INT86(... was used to access the disk I could not find anything in the documentation which comes with icon am i wrong ? Could you tell me, please, where can i find these ms-dos extensions ? From icon-group-sender Mon Oct 30 08:31:13 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9UFV3b25818 for icon-group-addresses; Mon, 30 Oct 2000 08:31:03 -0700 (MST) Message-Id: <200010301531.e9UFV3b25818@baskerville.CS.Arizona.EDU> From: "Steve Waldo" X-Newsgroups: comp.lang.icon Subject: Re: ms-dos extensions ? Date: Sun, 29 Oct 2000 07:13:11 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Trace: 972825168 gemini.bitstream.net 28256 216.243.158.49 X-Complaints-To: abuse@bitstream.net To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 886 The dos functions would have to be compiled into your version of icon. To find out if your copy has them use every write(&features) One of the items in the list would be "MS-DOS extensions". The newest version of icon for dos does not include this feature. You could try the older copies. http://www.cs.arizona.edu/icon/ftp/binaries/msdos/ I'm not sure where you would find documentation for the Int86() function, but it calls the int86x() function, which was supplied with many dos C compilers back in the ancient days when dos C compilers were still available. --Steve "P.A.Caleala" wrote Hello I found in one icon program a reference to some ms-dos extensions. One of the functions INT86(... was used to access the disk I could not find anything in the documentation which comes with icon am i wrong ? Could you tell me, please, where can i find these ms-dos extensions ? From icon-group-sender Mon Oct 30 13:09:44 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9UK93H06032 for icon-group-addresses; Mon, 30 Oct 2000 13:09:03 -0700 (MST) Message-Id: <200010302009.e9UK93H06032@baskerville.CS.Arizona.EDU> From: Chris.D.Tenaglia@jci.com Subject: Re: Yet another Newbie question... To: icon-group@cs.arizona.edu Date: Mon, 30 Oct 2000 10:14:43 -0600 X-MIMETrack: Serialize by Router on jwimkrs1.na.jci.com/NA/Johnson_Controls(Release 5.0.4 |June 8, 2000) at 10/30/2000 10:22:38 AM Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 465 Letter Counting count := 0 others := &cset -- &letters every line := !file do every byte := !line do any(others,byte) | (count +:=1) write(count) There is a different between sets and csets. csets are a collection of unique characters sets are a collection of unique things, such as strings, bytes, lists, numbers, or whatever. csets augment the string scanning and parsing. sets are used at a higher level to augment algorhythms. Chris Tenaglia, From icon-group-sender Mon Oct 30 13:11:36 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9UKBR606127 for icon-group-addresses; Mon, 30 Oct 2000 13:11:27 -0700 (MST) Message-Id: <200010302011.e9UKBR606127@baskerville.CS.Arizona.EDU> Date: Mon, 30 Oct 2000 09:24:12 -0700 From: Steve Wampler X-Accept-Language: en To: Atle CC: icon-group@cs.arizona.edu Subject: Re: Yet another Newbie question.... Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2278 Atle wrote: > > symbiot@my-deja.com wrote: > > > Hi, > > > > And thanks in advance to all who have been helping me thru this > > learning curve of getting started in ICON. > > > > My present problem is trying to write a rountine that counts only > > letters in text and skips blanks, numbers, punctuation, etc. > > > > I tried.... > > > > if member(&letters,line[index]) then totalcount +:= 1 > > > > ...but for some unexplicable reason, it barfed on the very first > > character with > > > > set or table expected. > > Offending value &letters > > > > Isn't &letters a cset? You can use it in other "set" functions....can't > > you? What am I missing? > > > > Assistance appreciated! > I have no idea if this gets you anywhere, but since there doesn't seem to be many pros out there to help either of us right now ... Hmmm, I saw several replies, but perhaps they weren't as clear as they could be: member(s, e) requires that s be either an Icon set or an Icon table. A cset is neither, hence the error (maybe member should also accept a cset as a first argument, as it does in Unicon, but it doesn't). A simple way to see if a character is contained in a cset is to use set intersection and see if the intersection contains anything, as in: if *(cset1 ** "a") > 0 then write("a is in ",cset1) else write("a is not in ",cset1) Note that this can be used to efficiently check to see an any of several characters are in the cset *simultaneously*, as in: if *(cset1 ** string1) > 0 then write(string1," has characters found in ",cset1) else write(string1," has no characters from ",cset1) In general, the set operations ++, **, and -- can be used very effectively with csets. As a final example, consider the problem of finding all the characters in string string1 that do *not* appear in cset cset1: write("The characters in ",string1," not found in ",cset1," are '",string1--cset1,"'") Does this help? The original problem isn't related to the differences between strings and csets (since Icon will coerce one to the other as needed), but with assuming that an Icon cset can be used anywhere an Icon set can be used. -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Mon Oct 30 13:11:56 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9UKBjS06146 for icon-group-addresses; Mon, 30 Oct 2000 13:11:45 -0700 (MST) Message-Id: <200010302011.e9UKBjS06146@baskerville.CS.Arizona.EDU> From: symbiot@my-deja.com X-Newsgroups: comp.lang.icon Subject: Re: Yet another Newbie question.... Date: Mon, 30 Oct 2000 19:04:09 GMT To: trollet@skynet.be X-Article-Creation-Date: Mon Oct 30 19:04:09 2000 GMT X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt) X-Http-Proxy: 1.0 SRVPROXY, 1.0 x64.deja.com:80 (Squid/1.1.22) for client 208.51.185.226 X-MyDeja-Info: XMYDJUIDsymbiot To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1854 Hi, And thanks for your response. Actually, I have gotten quite a few response in private e:mail. That seems to be the norm in this newsgroup (and thanks to all who have replied). Personally, I think open responses to the newgroup would benefit a wider range of "newbies". If nothing else, it would facilitate being able to perform a Deja search and find answers. Anyway, that's my 2¢ worth..... Stay tuned for my next installment of "Questions from the Newbie"!! In article <39FAF8CE.BB915D84@skynet.be>, Atle wrote: > symbiot@my-deja.com wrote: > > > Hi, > > > > And thanks in advance to all who have been helping me thru this > > learning curve of getting started in ICON. > > > > My present problem is trying to write a rountine that counts only > > letters in text and skips blanks, numbers, punctuation, etc. > > > > I tried.... > > > > if member(&letters,line[index]) then totalcount +:= 1 > > > > ...but for some unexplicable reason, it barfed on the very first > > character with > > > > set or table expected. > > Offending value &letters > > > > Isn't &letters a cset? You can use it in other "set" functions....can't > > you? What am I missing? > > > > Assistance appreciated! > > I see you haven't been getting much feedback on this, so I will try again. > Unfortunately, as you see, I am no more bewandered in Icon than yourself, on the contrary, I am now working with Beta. > But when initializing, isn't is important to distinguish between ' and " - one is a cset the other a string? > > I have no idea if this gets you anywhere, but since there doesn't seem to be many pros out there to help either of us right now ... > > BW, Atle > > -- "Wife who put husband in doghouse, soon find him in cathouse." -- Wisdom of the Tao Sent via Deja.com http://www.deja.com/ Before you buy. From icon-group-sender Mon Oct 30 13:12:42 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9UKCYJ06208 for icon-group-addresses; Mon, 30 Oct 2000 13:12:34 -0700 (MST) Message-Id: <200010302012.e9UKCYJ06208@baskerville.CS.Arizona.EDU> From: symbiot@my-deja.com X-Newsgroups: comp.lang.icon Subject: How would the experts handle this...?? Date: Mon, 30 Oct 2000 19:13:49 GMT X-Article-Creation-Date: Mon Oct 30 19:13:49 2000 GMT X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt) X-Http-Proxy: 1.0 SRVPROXY, 1.0 x67.deja.com:80 (Squid/1.1.22) for client 208.51.185.226 X-MyDeja-Info: XMYDJUIDsymbiot To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2223 Greetings! And welcome to my latest edition of "Questions from the Newbie" The situation is this: I wish to scan thru a file and determine how letters "connect" with one another. By that I mean that for every letter of the alphabet, I would like to compile two lists: one containing all the letters which apper to the right of the given letter, and another for all those appearing to the left. Exmaple: For the line.... "Cable television programming is...." The output would might look something like: A: left- Cr right- bm B: left- a right- l . . . I: left- vsm(blank) right- sns etc etc etc Here's how I have tackled the problem: while line := read(data) do { index := 0 while index <= *line do { if not(line[index+1] == " ") then { centerchar := line[index+1] leftchar[centerchar] := leftchar[centerchar] || line[index] rightchar[centerchar] := rightchar[centerchar] || line[index +2] } #if not.... index +:= 1 # do it again }# end (while index <= *line) }# end (while line := read(data)) #generate output write(output,"LETTERS ORGANIZED BY CENTER CHARACTER FOR FILE ",filename) index := 0 while index <= 52 do { if ((*leftchar[&letters[index]] > 1) | (*rightchar[&letters[index]] > 1)) then { write(output,leftchar[&letters[index]]) write(output,&letters[index]) write(output,rightchar[&letters[index]]) } # end if write(output," ") #add blank line to output for clarity index +:= 1 } # end while index ----- Thus far, I have been roundly criticized by icon afficiandos for my use of explicit indexing. It seems to me an intuitive way to handle the problems I've faced and makes the program "readable" to the layman. But, be that as it may, I'm curious as to how those "in the know" would handle this problem in a more "icon-esque" fashion. Your suggestions are greatly appreciated. Thanx!! -- "Credibility depends on two semiconflicting rules. First, the system must be complicated enough to seem scientific. And second, the results must match, more or less, people's nonscientific prejudices." Nicholas Thompson Washington Monthly 14 Sep 00 Sent via Deja.com http://www.deja.com/ Before you buy. From icon-group-sender Mon Oct 30 16:26:53 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9UNQWH14118 for icon-group-addresses; Mon, 30 Oct 2000 16:26:32 -0700 (MST) Message-Id: <200010302326.e9UNQWH14118@baskerville.CS.Arizona.EDU> Date: Mon, 30 Oct 2000 20:49:57 +0000 (GMT) From: Hugh Sasse Staff Elec Eng X-Sender: hgs@neelix To: symbiot@my-deja.com cc: Icon Group Subject: Re: How would the experts handle this...?? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1989 You wanted replies to be public, so... On Mon, 30 Oct 2000 symbiot@my-deja.com wrote: > I wish to scan thru a file and determine how letters "connect" with one > Exmaple: [...] > Here's how I have tackled the problem: > > while line := read(data) do > { > index := 0 > while index <= *line do > { Why are you doing all this work? There is every to do this for you. > > if not(line[index+1] == " ") then > { There is no else clause, so the test succeeds or fails. Look at & to get the leverage off this feature > > centerchar := line[index+1] > > leftchar[centerchar] := leftchar[centerchar] || line[index] > rightchar[centerchar] := rightchar[centerchar] || line[index +2] > > } #if not.... You won't need that > > index +:= 1 or this > # do it again > }# end (while index <= *line) > > }# end (while line := read(data)) or this. > the same applies to the output. [output section trimmed] > > ----- > Thus far, I have been roundly criticized by icon afficiandos for my use > of explicit indexing. It seems to me an intuitive way to handle the Not so intuitive when you have to make sure you increment, etc. The intuitive way is *not* to count the elements till you reach the end. That is a roundabout way of saying process EVERY element in turn. Icon already understands "every". It is not idiomatic Icon. It gets the job done, but so does driving in first gear. :-) > problems I've faced and makes the program "readable" to the layman. Generally, the layman should not be reading your code. :-) You should assume some fluency. If the point is subtle, write it clearly, but if it is a language feature, then just use it. Yes, one can go overboard the other way. One can do that in any language. > > But, be that as it may, I'm curious as to how those "in the know" would > handle this problem in a more "icon-esque" fashion. > > Your suggestions are greatly appreciated. > > Thanx!! > HTH Hugh hgs@dmu.ac.uk From icon-group-sender Mon Oct 30 16:27:22 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9UNRBu14167 for icon-group-addresses; Mon, 30 Oct 2000 16:27:12 -0700 (MST) Message-Id: <200010302327.e9UNRBu14167@baskerville.CS.Arizona.EDU> Date: Mon, 30 Oct 2000 14:31:48 -0700 From: Steve Wampler X-Accept-Language: en To: symbiot@my-deja.com CC: icon-group@cs.arizona.edu Subject: Re: How would the experts handle this...?? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 3009 symbiot@my-deja.com wrote: > > Greetings! And welcome to my latest edition of "Questions from the > Newbie" > > The situation is this: > > I wish to scan thru a file and determine how letters "connect" with one > another. By that I mean that for every letter of the alphabet, I would > like to compile two lists: one containing all the letters which apper > to the right of the given letter, and another for all those appearing > to the left. ... > Thus far, I have been roundly criticized by icon afficiandos for my use > of explicit indexing. It seems to me an intuitive way to handle the > problems I've faced and makes the program "readable" to the layman. "layman"? As in someone who doesn't program? I'd claim that *any* solution is unreadable in that case! If you mean someone who knows C and not Icon, that may be right, but if that's your goal, then perhaps C would be a better choice to start with? > But, be that as it may, I'm curious as to how those "in the know" would > handle this problem in a more "icon-esque" fashion. Well, I took a few liberties: (1) I assume the output could just as well show lowercase versions of the letters for the "middle" letter instead of uppercase versions. (2) and I assume you really mean "letters" and not "characters" (your solution also records non-letter characters on the left or right) (3) and you don't want duplicated letters (your solution allows duplicated letters, but I didn't read that as a requirement in the problem statement) (4) and, that the output should be formatted as shown in your example (your code outputs it differently). (5) the file name is given as a command line argument and all files named on the command line should be processed and letter-pairs accumulated across all the files (not file-by-file, which can be done by running the program separately on each file). Any of those is easy to change Here's a solution: global leftSides, rightSides # # Accumulate letter-pair information for all lines of all files listed on # the command line. # procedure main(args) leftSides := table('') rightSides := table('') every buildPairs(!open(!args)) showResults() end procedure buildPairs(s) lChar := mChar := '' every rChar := !s do { # only remember pairs where left (or right) is a letter # leftSides[map(mChar)] ++:= (&letters ** lChar) rightSides[map(mChar)] ++:= (&letters ** rChar) # shift characters to the left... # # (aside: this also works!: rChar :=: mChar :=: lChar) # lChar := mChar mChar := rChar } end procedure showResults() every c := !&lcase do { # Could add test here to only print output that has left or right side write(c,":\tleft- ",leftSides[c]) write( "\tright- ",rightSides[c]) } end -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Tue Oct 31 08:51:18 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9VFlGd29386 for icon-group-addresses; Tue, 31 Oct 2000 08:47:16 -0700 (MST) Message-Id: <200010311547.e9VFlGd29386@baskerville.CS.Arizona.EDU> From: Nevin Liber Subject: Re: How would the experts handle this...?? To: symbiot@my-deja.com Date: Mon, 30 Oct 2000 15:36:44 -0800 (PST) Cc: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1539 symbiot@my-deja.com wrote: > I wish to scan thru a file and determine how letters "connect" with one > another. By that I mean that for every letter of the alphabet, I would > like to compile two lists: one containing all the letters which apper > to the right of the given letter, and another for all those appearing > to the left. My first pass (I'm doing it only on one string; a little more work is needed to have this work on a whole file, sort the output, etc.) would be something like: procedure Connect(s) local TLeft local TRight local sRight local sMiddle local sLeft TLeft := table('') TRight := table('') s ? { sRight := move(1) while sMiddle := \sRight do { sRight := move(1) | &null TLeft[sMiddle] ++:= \sLeft TRight[sMiddle] ++:= \sRight sLeft := sMiddle } } write(image(s)) write("Left") every sMiddle := key(TLeft) do write(image(sMiddle), "\t", image(TLeft[sMiddle])) write() write("Right") every sMiddle := key(TRight) do write(image(sMiddle), "\t", image(TRight[sMiddle])) end > "Cable television programming is...." My output would be: "Cable television programming is..." Left "s" 'i' " " 'egn' "p" ' ' "e" 'lt' "m" 'am' "b" 'a' "r" 'gp' "g" 'no' "o" 'ir' "l" 'be' "t" ' ' "a" 'Cr' "i" ' msv' "." '.s' "n" 'io' "v" 'e' Right "C" 'a' "s" '.i' " " 'ipt' "p" 'r' "e" ' lv' "m" 'im' "b" 'l' "r" 'ao' "g" ' r' "o" 'gn' "l" 'e' "t" 'e' "a" 'bm' "i" 'nos' "." '.' "n" ' g' "v" 'i' -- Nevin ":-)" Liber (773) 961-2479 From icon-group-sender Tue Oct 31 09:25:55 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9VGN4U00515 for icon-group-addresses; Tue, 31 Oct 2000 09:23:04 -0700 (MST) Message-Id: <200010311623.e9VGN4U00515@baskerville.CS.Arizona.EDU> Date: Tue, 31 Oct 2000 09:12:29 -0600 From: "Charles Hethcoat" To: Subject: Re: How would the experts handle this...?? Content-Disposition: inline X-Guinevere: 1.0.13 ; Oceaneering Int'l X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id e9VFBw328403 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1981 >>> 00-10-30 1:13:49 PM >>> wrote: > But, be that as it may, I'm curious as to how those "in the know" would handle this problem in a more "icon-esque" fashion. Not that I claim Olympian status or anything, but here is my 30-minute implementation of my understanding of your problem statement (a number of questions were left unspecified). I did use a sentinel character '@' as a 27th letter, which could be criticized as not a fully ascii-clean solution, but then I also assumed only letters count, and that 'A' is equivalent to 'a', so there is no possibility of a collision in this case. You do get extra output including this "letter" and its neighbors. The output style is my own invention. The center letter in parentheses. On its left are its left neighbors, and on the right are its right neighbors. I could sort by center letter, but I was getting tired and was ready for a beer. ----------------------------------8<----------------------------------------8<-------------------------------------------- # connect - what letters connect? procedure main() l := table('') r := table('') nonletter := &ascii -- &lcase -- '@' every line := !&input | "@@" do every c := map(!line) do { if any(nonletter, c) then next pred2 := \pred | '@' pred := \this | '@' this := c l[pred] ++:= pred2 r[pred] ++:= this } every i := key(l) do { every writes(!l[i] | "(" | i | ")" | !r[i]) write() } exit(0) end ----------------------------------8<----------------------------------------8<-------------------------------------------- When run on the first paragraph above, you get this: ei(c)il eimnruy(s)imoptw u(@)@ t(h)aei mrs(p)eilr bdhilmprtuvw(e)acdfilmnrst efisuy(m)beopsy bnoqty(u)@emnrst gmo(b)elu eopu(r)aeops n(g)bo gimnrsty(o)bflnrtuy is(w)ei en(d)ei abceilop(l)aely aefnostuy(t)aehiotu @(@)n ehilnrt(a)ilntv acdefhpstwy(i)aceflmnosw f(q)u flmno(y)imostu eio(f)imqty @aeiou(n)adgostuy a(v)e Charles Hethcoat From icon-group-sender Tue Oct 31 09:28:56 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9VGQ7B00597 for icon-group-addresses; Tue, 31 Oct 2000 09:26:07 -0700 (MST) Message-Id: <200010311626.e9VGQ7B00597@baskerville.CS.Arizona.EDU> Date: Tue, 31 Oct 2000 09:15:33 -0600 From: "Charles Hethcoat" To: Subject: Re: How would the experts handle this...?? Content-Disposition: inline X-Guinevere: 1.0.13 ; Oceaneering Int'l X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id e9VFEp328428 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 397 >>> 00-10-30 1:13:49 PM >>> wrote: > But, be that as it may, I'm curious as to how those "in the know" would handle this problem in a more "icon-esque" fashion. P. S. In my previous submission on this topic, I edited the first paragraph subsequent to generating the results, so they do not correspond. Here is a counterproblem: Reconstruct my original first paragraph! From icon-group-sender Tue Oct 31 16:32:06 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9VNT7u23929 for icon-group-addresses; Tue, 31 Oct 2000 16:29:07 -0700 (MST) Message-Id: <200010312329.e9VNT7u23929@baskerville.CS.Arizona.EDU> From: Chris.D.Tenaglia@jci.com Subject: favorites To: icon-group@cs.arizona.edu Date: Tue, 31 Oct 2000 16:29:28 -0600 X-MIMETrack: Serialize by Router on jwimkrs1.na.jci.com/NA/Johnson_Controls(Release 5.0.4 |June 8, 2000) at 10/31/2000 04:37:23 PM Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2361 Since this list is getting more active here are some of my favorite procedures. The IPL is full of goodies. Some below may be there, but recently I have been doing more with the web and CGI, and it's great to build software when you have a giant software chip library and are fairly familiar with it. Just a couple includes, a main() and you're done. The procedures below I use extensively, every day and they sure help. Chris Tenaglia, tech analyst, jci # # 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 # # prompt for an input string # procedure input(prompt) writes(prompt) return read() end # # parse a cgi query string into a table # procedure cgiparse(text) parts := parse(text,'&') lookup:= table("n/a") every part := !parts do { var := parse(part,'=')[1] val := map(parse(part,'=')[2],"+"," ") | "" lookup[unurl(var)] := map(unurl(val),"\r"," ") } return lookup end # # error handler if program called wrong # procedure error() write("content-type: text/html") write("") write("") write("BAD CALL") write("") write("
\n\n\n")
  write("PROGRAM CALLED INCORRECTLY")
  write("\n\n\n
") write("") stop("") 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 := pull(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 From icon-group-sender Wed Nov 1 13:29:23 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA1KQNk17061 for icon-group-addresses; Wed, 1 Nov 2000 13:26:23 -0700 (MST) Message-Id: <200011012026.eA1KQNk17061@baskerville.CS.Arizona.EDU> Date: Wed, 01 Nov 2000 11:30:53 -0600 From: "Charles Hethcoat" To: Subject: favorites 2 Content-Disposition: inline X-Guinevere: 1.0.13 ; Oceaneering Int'l X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id eA1HUH311489 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1873 In the spirit of the times, and in view of the apparent arrival of a lot of newcomers to Icon, let me also submit a fave of mine. I write a lot of rather simple batch-oriented stuff (read a line, operate on the line, write something, repeat). A comment convention is just as useful with such data as with any programming language. Your data files can now be self-documenting without interfering with the program that needs to understand their formatting. Here is a routine that implements a simple comment convention just like Icon's, so that every program I write is consistent in that respect. It is simple stuff, but I have come to rely on its presence in my library. Here it is, with a simple main() to drive it, and some test data for it. To test it, just enter the command nocomm nocomm.out THE PROGRAM (save as nocomm.icn): procedure main() while line := nocomm(&input) do write(line) exit(0) end # nocomm - implement a basic comment convention procedure nocomm(f) static line while line := read(f) do { line ? { ws() if ="#" | pos(0) then next return trim(tab(upto('#') | 0)) } } fail end # ws - skip white space (blanks and tabs) procedure ws() tab(many(' \t')) end INPUT (save as nocomm.in): This file shows how nocomm() implements a comment convention. The following is a blank line. It should be gone. nocomm() removes blank lines. This line contains a comment. # It's too darn hot. The next line is a comment. # Slooooowly I turned, step by step. The next line is also a comment. # hello. This is the last line. OUTPUT (nocomm.out): This file shows how nocomm() implements a comment convention. The following is a blank line. It should be gone. nocomm() removes blank lines. This line contains a comment. The next line is a comment. The next line is also a comment. This is the last line. From icon-group-sender Wed Nov 1 13:31:13 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA1KTjf17206 for icon-group-addresses; Wed, 1 Nov 2000 13:29:45 -0700 (MST) Message-Id: <200011012029.eA1KTjf17206@baskerville.CS.Arizona.EDU> Date: Wed, 01 Nov 2000 13:59:58 -0600 From: Carl Sturtivant X-Accept-Language: en To: Icon Group Subject: Re: How would the experts handle this...?? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 786 Here's how I'd do this: procedure main() port := table(''); starboard := table('') while line := read() do { reverse(line) ? while port[move(1)] ++:= move(1) do move(-1) line ? while starboard[move(1)] ++:= move(1) do move(-1) } every ch := !&cset do { pchars := port[ch]; schars := starboard[ch] if *(pchars ++ schars) > 0 then write(image(ch), ":\t", image(pchars), ", ", image(schars)) } end Carl Sturtivant symbiot@my-deja.com wrote: > I wish to scan thru a file and determine how letters "connect" with one > another. By that I mean that for every letter of the alphabet, I would > like to compile two lists: one containing all the letters which apper > to the right of the given letter, and another for all those appearing > to the left. From icon-group-sender Thu Nov 2 07:58:06 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA2Etn608361 for icon-group-addresses; Thu, 2 Nov 2000 07:55:49 -0700 (MST) Message-Id: <200011021455.eA2Etn608361@baskerville.CS.Arizona.EDU> From: "Ian Trudel" To: , Subject: CGI Programming (was: favorites) Date: Wed, 1 Nov 2000 20:29:08 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 3359 Speaking of this, we're doing a lot of CGI programming using Icon at Mecenia Organization. I've been updating cgi.icn and we will probably release a new updated version soon, having some bug fixes and support for cookies, custom header/footer/stylesheet and so forth. We will probably update http://ringer.cs.utsa.edu/research/icon/cgi.html (if Clinton Jefferey and Jonathan Vallejo don't mind) as well. If you have code snipet you'd like to add, just drop me an email. regards, ian ---------------------------------------------------------------- *squeak* *squeak* said the little mouse while eating a java hog. Ian Trudel, mailto:ian.trudel@tr.cgocable.ca ----- Original Message ----- From: To: Sent: Tuesday, October 31, 2000 5:29 PM Subject: favorites > Since this list is getting more active here are some of my favorite > procedures. > The IPL is full of goodies. Some below may be there, but recently I have > been > doing more with the web and CGI, and it's great to build software when you > have > a giant software chip library and are fairly familiar with it. Just a > couple includes, > a main() and you're done. The procedures below I use extensively, every day > and they sure help. > > Chris Tenaglia, tech analyst, jci > > > # > # 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 > > # > # prompt for an input string > # > procedure input(prompt) > writes(prompt) > return read() > end > > # > # parse a cgi query string into a table > # > procedure cgiparse(text) > parts := parse(text,'&') > lookup:= table("n/a") > every part := !parts do > { > var := parse(part,'=')[1] > val := map(parse(part,'=')[2],"+"," ") | "" > lookup[unurl(var)] := map(unurl(val),"\r"," ") > } > return lookup > end > > # > # error handler if program called wrong > # > procedure error() > write("content-type: text/html") > write("") > write("") > write("BAD CALL") > write("") > write("
\n\n\n")
>   write("PROGRAM CALLED INCORRECTLY")
>   write("\n\n\n
") > write("") > stop("") > 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 := pull(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 > > > From icon-group-sender Thu Nov 2 08:00:31 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA2Ex8k08411 for icon-group-addresses; Thu, 2 Nov 2000 07:59:08 -0700 (MST) Message-Id: <200011021459.eA2Ex8k08411@baskerville.CS.Arizona.EDU> From: jasmin shah X-Accept-Language: en X-Newsgroups: comp.lang.icon Subject: Re: How to "declare" a string? Date: Thu, 02 Nov 2000 03:37:06 GMT X-Complaints-To: abuse@home.net X-Trace: news1.mntp1.il.home.com 973136226 24.12.135.27 (Wed, 01 Nov 2000 19:37:06 PST) To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 188 hey guys whats up, fellow programmer needs help.im trying to create a ssimulation garbage collector and a lexical analsis ................i need help.................anyone has done it From icon-group-sender Thu Nov 2 08:03:02 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA2F1bo08597 for icon-group-addresses; Thu, 2 Nov 2000 08:01:37 -0700 (MST) Message-Id: <200011021501.eA2F1bo08597@baskerville.CS.Arizona.EDU> Date: Thu, 02 Nov 2000 05:52:01 -0600 From: gep2@terabites.com Subject: How would the experts handle this...?? To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1637 > I wish to scan thru a file and determine how letters "connect" with one another. Turns out that in fact this is a VERY interesting issue... character adjacency is a key to a great many very interesting algorithms. > By that I mean that for every letter of the alphabet, I would like to compile two lists: one containing all the letters which apper to the right of the given letter, and another for all those appearing to the left. > Exmaple: For the line.... > "Cable television programming is...." > The output would might look something like: > A: left- Cr > right- bm > B: left- a > right- l One issue is immediately apparent here (to me)... and that is that in the one case, it seems you're ignoring case issues (the A) and respecting them (the C). Is that intentional? You need to decide which it's going to be, and be consistent each time. > Thus far, I have been roundly criticized by icon afficiandos for my use of explicit indexing. It seems to me an intuitive way to handle the problems I've faced and makes the program "readable" to the layman. I would join the list of those who are criticizing. :-) The whole point of Icon is to eliminate this kind of error-prone "knit-one-purl-two" style of C-type or BASIC-type programming. Obviously, though, the solution ought to be a lot shorter and a lot higher level when coded for Icon. :-) Gordon Peterson http://personal.terabites.com/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: the day the Conservatives demonstrated their scorn for their fraudulent sham of representative government. Voters, remember it! From icon-group-sender Thu Nov 2 08:04:51 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA2F3TQ08654 for icon-group-addresses; Thu, 2 Nov 2000 08:03:29 -0700 (MST) Message-Id: <200011021503.eA2F3TQ08654@baskerville.CS.Arizona.EDU> Date: Thu, 02 Nov 2000 08:43:43 -0600 From: "Charles Hethcoat" To: Subject: Re: How would the experts handle this...?? Content-Disposition: inline X-Guinevere: 1.0.13 ; Oceaneering Int'l X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id eA2Eh7308122 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 650 Well, it should be clear that there is more than one way to skin a cat. However, all the submissions I've looked at clearly show some things. (1) Everyone used two tables, a left and a right, to accumulate the results. (2) It looks like proper use of Icon's builtin tools (strings, sets, tables, and lists) greatly shortens a program's source code. It would be interesting to benchmark some of the different approaches to this problem on execution speed as well as on readability. By that I am thinking of how well the source code expresses the problem statement. Charles Hethcoat P. S. No cats were harmed in the making of this e-mail. From icon-group-sender Fri Nov 3 07:43:22 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA3Eg3A27420 for icon-group-addresses; Fri, 3 Nov 2000 07:42:03 -0700 (MST) Message-Id: <200011031442.eA3Eg3A27420@baskerville.CS.Arizona.EDU> Date: Thu, 02 Nov 2000 19:49:30 -0600 From: gep2@terabites.com Subject: Re: How to "declare" a string? To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1970 >> best I can tell, it is choking because UPPER has not been "declared". > I am a *total* newbie, but I may have an answer to this one (Icon programmer please correct this if wrong) Icon will extract as much information from your statements as possible. > so, if you initialize a variable like this: > i := 0 > it will not need an > i : INTEGER to figure it out, it knows that 0 is an integer, and will declare i implicitely. Not really. There is no "declaring" that i IS an integer (in any lasting sense!). In fact i is simply a variable and it can contain an integer at one moment, a string the next and a real at some later time. There is no durable typing of any user-defined variables in Icon. That said, Icon *does* keep careful track of what type each variable contains at any given instant, so that it can be converted as necessary for whatever operation might require that. > the same with a string: > s := "" > will implicitely declare s to be string type. Again, it merely tells Icon that *now* the variable s happens to contain a string. You can subsequently execute: s := "435" + 27.2 + 6 + '12' (adding a string, a real, an integer and a character set variable) and the result will be that the variable s will now contain a real. > If in the start of your program, you set > UPPER := "" > you might solve an 'undeclared' reference ... No. All variables default (in the absence of a prior declaration to the contrary in some specific situations like the unassigned elements of tables where I think you can specify a different default) to be a null string. Since that is the default value, assigning it a (redundant) null string as the value won't change anything. Gordon Peterson http://personal.terabites.com/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: the day the Conservatives demonstrated their scorn for their fraudulent sham of representative government. Voters, remember it! From icon-group-sender Fri Nov 3 12:32:40 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA3JWTQ05835 for icon-group-addresses; Fri, 3 Nov 2000 12:32:29 -0700 (MST) Message-Id: <200011031932.eA3JWTQ05835@baskerville.CS.Arizona.EDU> X-Sender: whm@mail.mse.com Date: Fri, 03 Nov 2000 10:49:53 -0700 To: icon-group@cs.arizona.edu From: "William H. Mitchell" Subject: Re: How to "declare" a string? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 739 At 07:49 PM 11/2/00 -0600, Gordon Peterson wrote: > >No. All variables default (in the absence of a prior declaration to the >contrary in some specific situations like the unassigned elements of tables >where I think you can specify a different default) to be a null string. Since >that is the default value, assigning it a (redundant) null string as the value >won't change anything. One minor correction here: uninitialized variables have the null value (&null), not the null string (""). Referencing table keys for which no value has been stored produces the null value unless the table was created with a default initial value. Example: t := table() x := t["a"] # x gets &null t := table(1) x := t["a"] # x gets 1 From icon-group-sender Mon Nov 6 12:23:23 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA6JLxE12728 for icon-group-addresses; Mon, 6 Nov 2000 12:21:59 -0700 (MST) Message-Id: <200011061921.eA6JLxE12728@baskerville.CS.Arizona.EDU> From: "Frank J. Lhota" X-Newsgroups: comp.lang.icon Subject: Why Perl? Date: Mon, 6 Nov 2000 13:44:07 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Trace: reader3.news.uu.net 973536322 23109 63.79.83.67 To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 443 I have used Icon for over a decade. Recently, I went through the Perl tutorial. For the most part, I am amazed that Perl has become the dominant language for text processing. About the only area where Perl could be considered to Icon is in report generation, and even this advantage could be obtained in Icon with the appropriate library. Why, then, has Perl become so popular while Icon remains (relatively) obscure? From icon-group-sender Mon Nov 6 17:36:20 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA70ZxM22299 for icon-group-addresses; Mon, 6 Nov 2000 17:35:59 -0700 (MST) Message-Id: <200011070035.eA70ZxM22299@baskerville.CS.Arizona.EDU> From: Art Eschenlauer To: "'icon-group@CS.Arizona.EDU '" Subject: RE: Why Perl? Date: Mon, 6 Nov 2000 14:54:33 -0600 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1241 I presume that it is because people can do what they need to do with Perl and don't need to resort to the power of Icon. Do you think that the availability and routine application of objects by Perl users (versus what I have seen to be infrequent mention of Idol) might account for some of the obscurity, i.e., people may judge Perl to be an object-oriented scripting language (like Python) and may (mistakenly) judge Icon to be a non-object-oriented, compiled language? In other words, do you think that they see Icon as being obsolete? Do you think that the fact that O'Reilly is a champion of Perl and has no publications on Icon may contribute to Icon's "obscurity"? -----Original Message----- From: Frank J. Lhota To: icon-group@CS.Arizona.EDU Sent: 11/6/00 12:44 PM Subject: Why Perl? I have used Icon for over a decade. Recently, I went through the Perl tutorial. For the most part, I am amazed that Perl has become the dominant language for text processing. About the only area where Perl could be considered to Icon is in report generation, and even this advantage could be obtained in Icon with the appropriate library. Why, then, has Perl become so popular while Icon remains (relatively) obscure? From icon-group-sender Mon Nov 6 17:38:10 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA70c8Y22363 for icon-group-addresses; Mon, 6 Nov 2000 17:38:08 -0700 (MST) Message-Id: <200011070038.eA70c8Y22363@baskerville.CS.Arizona.EDU> From: "John Sampson" To: Subject: Stemmer algorithms Date: Mon, 6 Nov 2000 22:02:24 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 136 Hello - Has anyone translated the Porter stemmer algorithm to Icon, or written a stemmer algorithm in Icon? Regards _John Sampson_ From icon-group-sender Tue Nov 7 08:12:23 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA7FBes03987 for icon-group-addresses; Tue, 7 Nov 2000 08:11:40 -0700 (MST) Message-Id: <200011071511.eA7FBes03987@baskerville.CS.Arizona.EDU> Date: Mon, 06 Nov 2000 23:17:22 -0600 From: gep2@terabites.com Subject: Why Perl? To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1698 > I have used Icon for over a decade. Recently, I went through the Perl tutorial. For the most part, I am amazed that Perl has become the dominant language for text processing. Absolutely! I admit to using SNOBOL4/SPITBOL in preference to Icon (just find it easier!) but I generally explain to my colleagues that "Perl isn't a poor man's SNOBOL... it's a destitute-man-living-in-a-cardboard-box-in-a-vacant-lot-man's SNOBOL. :-) > About the only area where Perl could be considered to Icon is in report generation, and even this advantage could be obtained in Icon with the appropriate library. Sure! The other area, perhaps, is the built-in features to support various Internet-type functions. Again, nothing that a good library wouldn't fix. And of course, 32-bit compiled SPITBOL will run rings around Perl, for applications where the speed is important. > Why, then, has Perl become so popular while Icon remains (relatively) obscure? I think a lot of it is simply ignorance that there's something better. After a while these 'bad solutions' sort of take on a momentum and a life of their own, and it's like pulling teeth to get rid of them. Part of the problem is that a lot of teachers at the University level teach (and mention) Perl and not Icon or S*BOL, with the result that people just assume that Perl is 'the' solution to use for such things. <---- End Forwarded Message ----> Gordon Peterson http://personal.terabites.com/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: the day the Conservatives demonstrated their scorn for their fraudulent sham of representative government. Voters, remember it! From icon-group-sender Tue Nov 7 08:12:44 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA7FCgs04013 for icon-group-addresses; Tue, 7 Nov 2000 08:12:42 -0700 (MST) Message-Id: <200011071512.eA7FCgs04013@baskerville.CS.Arizona.EDU> X-Sender: whm@mail.mse.com Date: Tue, 07 Nov 2000 03:16:10 -0700 To: icon-group@cs.arizona.edu From: "William H. Mitchell" Subject: Re: Why Perl? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1870 At 01:44 PM 11/6/00 -0500, you wrote: > >I have used Icon for over a decade. Recently, I went through the Perl >tutorial. For the most part, I am amazed that Perl has become the dominant >language for text processing. About the only area where Perl could be >considered to Icon is in report generation, and even this advantage could be >obtained in Icon with the appropriate library. Why, then, has Perl become so >popular while Icon remains (relatively) obscure? This is a question that I've pondered quite a bit. I believe that system administrators served as a primary vector of transmission for Perl. I think that Icon works just fine for the average programmer but, as of several years ago, Icon didn't offer any leverage at all for programming relating to system administration -- things like the UNIX stat(2) call just weren't there. I was an SA at that time and my solution was to simply write C functions to do what I needed in Icon, but that wasn't a practical solution for most people. I was also involved with the Icon Project at the time and although I saw that Icon needed additions to make SA programming practical, I didn't think that the potential audience -- being maybe 1-5% system administrators -- justified heavy SA support and I didn't strongly advocate such additions. I believe that Perl gained users in the following way. An application programmer, perhaps working in C, encountered some sort of ancillary problem that needed a quick solution in the form of a program but that program wasn't practical to write in C. System administrators often field general questions from their community of users and when asked about tools for quick programming solutions, an administrator familiar with Perl was likely to suggest it. If problems arose with using Perl, the SA could likely help. Voila! -- another Perl user. Any other theories? From icon-group-sender Tue Nov 7 08:13:06 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA7FCwg04032 for icon-group-addresses; Tue, 7 Nov 2000 08:12:59 -0700 (MST) Message-Id: <200011071512.eA7FCwg04032@baskerville.CS.Arizona.EDU> From: Atle X-Newsgroups: comp.lang.icon Subject: Re: Why Perl? Date: Tue, 07 Nov 2000 12:50:35 +0100 X-Trace: news0.skynet.be 973593210 10551 194.78.236.151 (7 Nov 2000 10:33:30 GMT) X-Complaints-To: abuse@skynet.be X-Accept-Language: en To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1134 "Frank J. Lhota" wrote: > > I have used Icon for over a decade. Recently, I went through the Perl > tutorial. For the most part, I am amazed that Perl has become the dominant > language for text processing. About the only area where Perl could be > considered to Icon is in report generation, and even this advantage could be > obtained in Icon with the appropriate library. Why, then, has Perl become so > popular while Icon remains (relatively) obscure? I am not sure, but it could be that it looks like a shell script. Icon is something you have to learn, but Perl 'looks familiar'. When the truth becomes obvious: Perl has a higher threshold than Icon, it is too late. Good news: Icon is (probably) taught at the local university here. I stumbled across a lot of second hand Icon manuals at the university bookshop. Bad news: I would not have known Icon existed otherwise. Programming languages like Icon and Beta must be given some publicity ... people choose Java and Perl because they don't know that there are better alternatives. This is what I think ... I have no idea if it is close to the truth. Best wishes, Atle From icon-group-sender Tue Nov 7 08:13:25 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA7FDJ204061 for icon-group-addresses; Tue, 7 Nov 2000 08:13:19 -0700 (MST) Message-Id: <200011071513.eA7FDJ204061@baskerville.CS.Arizona.EDU> From: Chris.D.Tenaglia@jci.com Subject: Why Perl? To: icon-group@cs.arizona.edu Date: Tue, 7 Nov 2000 08:54:05 -0600 X-MIMETrack: Serialize by Router on jwimkrs1.na.jci.com/NA/Johnson_Controls(Release 5.0.4 |June 8, 2000) at 11/07/2000 09:08:02 AM Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1411 I think it was written by someone who didn't know that icon was available. They reinvented a bumpy retread wheel that still got from point A to point B. After that, the rest has "marketing" and "evangelism". Yes, O'Reily helps a lot. When you get Freeware Internet suites and Web Server software on CDs, PERL is always there. Having a web page and ftp site are useful, but not as effective for mass distribution and indoctrination as a million CDs. Once they print "hello"; they're hooked. ;-) And once the sys admins make it their corporate standard, icon is like a 3rd party. And then training companies teach PERL but not icon, just reinforces the glum situation. Chris Tenaglia, technical analyst, Johnson Controls ---------------------- Forwarded by Chris D Tenaglia/CORP/Johnson_Controls on 11/07/2000 08:45 AM --------------------------- NOSPAM.frank@binartek.com on 11/06/2000 12:44:07 PM To: icon-group@CS.Arizona.EDU cc: bcc: Subject: Why Perl? I have used Icon for over a decade. Recently, I went through the Perl tutorial. For the most part, I am amazed that Perl has become the dominant language for text processing. About the only area where Perl could be considered to Icon is in report generation, and even this advantage could be obtained in Icon with the appropriate library. Why, then, has Perl become so popular while Icon remains (relatively) obscure? From icon-group-sender Tue Nov 7 12:31:08 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA7JTns10937 for icon-group-addresses; Tue, 7 Nov 2000 12:29:49 -0700 (MST) Message-Id: <200011071929.eA7JTns10937@baskerville.CS.Arizona.EDU> Date: Tue, 07 Nov 2000 09:46:54 -0700 From: OpMan X-Accept-Language: en To: icon-group@cs.arizona.edu Subject: Re: Why Perl? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 3504 Greetings, As a "lurker" on this list for quite a while now I've read some very interesting posts, including this "Perl vs. Icon" thread... As a ISP sysadmin for the last 7 years I can give you my own "slant". I think Perl "got a leg up" on Icon. They are both powerful languages but Perl simply got more exposure early on. Sure, O'Reilly helped out and many sysadmins, including myself, are O'Reilly readers. Let's face it, say the acronym "cgi" and most folks think "Perl". Not Icon, Python or any number of other useful languages... But friends, the future is uncertain. Look at the case of Sendmail and Qmail. Sendmail had been established for years as an email MTA. O'Reilly has published 2 editions on Sendmail as well and, at least in the UNI* world, Sendmail held sway. Then this upstart MUA, Qmail, arrives on the scene and starts making converts and believers of even the most loyal of Sendmail admins. Why? Well, my opinion is that Sendmail got too complex, too full of "features" and too easy to compromise from a system security point of view. I converted my email system to Qmail as soon as I read through the docs (just text files included with the distribution, no "man" pages at all!) and found Qmail would solve my "realworld problems". I could realize a time savings as well... (read: get my personal life back) So who can say? I'm seeing JSP and PHP replacing Perl even now in some areas. Another language, REBOL, being developed by Carl Sassenrath of Amiga fame, is showing great promise as well. REBOL tries to solve a number of issues in communicating information across the 'net. We'll see... Perhaps an O'Reilly Icon book and some useful "real world" applications (read: "Internet oriented and make my life simpler") might convert more to the "Icon faithful" as well. And O'Reilly hasn't even published a book on Qmail yet.... :^) Operations Manager North Rim Communications "The more the words, the less the meaning, and how does that profit anyone?" Ecclesiates 6:1 Chris.D.Tenaglia@jci.com wrote: > > I think it was written by someone who didn't know that icon was available. > They reinvented a bumpy retread wheel that still got from point A to point > B. > After that, the rest has "marketing" and "evangelism". Yes, O'Reily helps a > lot. When you get Freeware Internet suites and Web Server software on > CDs, PERL is always there. Having a web page and ftp site are useful, but > not as effective for mass distribution and indoctrination as a million CDs. > Once they print "hello"; they're hooked. ;-) And once the sys admins make > it their corporate standard, icon is like a 3rd party. And then training > companies > teach PERL but not icon, just reinforces the glum situation. > Chris Tenaglia, technical analyst, Johnson Controls > ---------------------- Forwarded by Chris D Tenaglia/CORP/Johnson_Controls > on 11/07/2000 08:45 AM --------------------------- > > NOSPAM.frank@binartek.com on 11/06/2000 12:44:07 PM > > To: icon-group@CS.Arizona.EDU > cc: > bcc: > > Subject: Why Perl? > > I have used Icon for over a decade. Recently, I went through the Perl > tutorial. For the most part, I am amazed that Perl has become the dominant > language for text processing. About the only area where Perl could be > considered to Icon is in report generation, and even this advantage could > be > obtained in Icon with the appropriate library. Why, then, has Perl become > so > popular while Icon remains (relatively) obscure? 1 From icon-group-sender Tue Nov 7 12:32:37 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA7JWZw11028 for icon-group-addresses; Tue, 7 Nov 2000 12:32:35 -0700 (MST) Message-Id: <200011071932.eA7JWZw11028@baskerville.CS.Arizona.EDU> Date: Tue, 7 Nov 2000 16:38:45 +0000 (GMT) From: Hugh Sasse Staff Elec Eng X-Sender: hgs@atlanta To: Icon Group Subject: Re: Why Perl? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1661 Things that make Perl attractive include: * Many commands look like unix commands (grep, sed, awk all rolled together). This produces a feel of familiarity. Things broadly do what you expect. * It has improved the regular expressions available in those commands * Access to many system level features (stat, sockets...) * Wide portability must be somewhere in the list. * Actively developed. That is why it took off before Perl5. Things that count against Icon: * Goal directed execution with backtracking is "hard" to understand. Disagree? OK, why hasn't Prolog taken off like other languages? This is also not a "normal" execution model for shells, either, so there is more learning to do. * Development on Icon has basically stopped. Unicon is another matter, but I'm not on that list, yet. * Poor access to file system. * Execution model seems odd -- not compiled to native code, not interpreted-then-run like Perl, nor like Python "picks up the compiled form if newer than source". Getting the libraries and executables in the right place was counter-intutuitive when I setup Icon. * Too high level? This may be strange, but for daily tasks Icon's power doesn't seem to fit. It would be great for doing things with directory trees, but it dons't have stat. Of course, the arguments run the other way as well: things wrong with Perl, right with Icon, but that is not the question. I wish Perl had string scanning, because sometimes regexps are not the way to go. Now, if the above is factually wrong, I'l accept correction, but that I have these perceptions says something in itself. Hugh hgs@dmu.ac.uk From icon-group-sender Wed Nov 8 08:49:24 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA8Fmws00884 for icon-group-addresses; Wed, 8 Nov 2000 08:48:58 -0700 (MST) Message-Id: <200011081548.eA8Fmws00884@baskerville.CS.Arizona.EDU> From: =?ISO-8859-1?Q?Rafa=B3?= Maciej Sulejman To: icon-group@cs.arizona.edu Subject: Re: Why Perl? Date: Wed, 8 Nov 2000 03:38:10 +0100 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2695 On wto, 07 lis 2000, you wrote: Is Perl really a satan's invention?!?! I don't think so... It's better to Perl than to VB (if you can't S4). Icon isn't even a real Perls opponent in this fight... It's rather a fight between VBS and Perl... What _YOU_ have done for spreading Icon/S4 more widely? The power of Perl is in Perl's community, not in language itself. Sure - there are some freeware (or even open sourced) I/S4 products, why there are only 9 (!) sites when I try to search "Snobol4" using Google.com? Many years ago I found a DOS Snobol4 version (Catspaw's one) in shareware store. Few years ago I downloaded Phil Budne's Snobol4 sources... Good stuff, but without any real end-user documentation. There is of course Mark Emmers excellent tutorial for Vanilla Snobol, but it covers merely 75% (YMMV) of the language functionality. Finally - remember - Linux isn't a "niche OS"anymore. I know - fighting the "industry" standards is hard (see M$) but is worth doing. > Things that make Perl real attractive include: > > * Many commands look like unix commands (grep, sed, awk all rolled > together). This produces a feel of familiarity. Things broadly do > what you expect. Sure! > * It has improved the regular expressions available in those commands Sure! > * Access to many system level features (stat, sockets...) Sure! > * Wide portability must be somewhere in the list. The portability of S4 is even wider :) I can "port" it on a single floppy (both Unix and DOS version. > * Actively developed. It's _really_ true. > Things that count against Icon: > > * Development on Icon has basically stopped. Unicon is another matter, > but I'm not on that list, yet. You can always try OmniMark ;) > * Poor access to file system. Damn right! > * Execution model seems odd -- not compiled to native code, not > interpreted-then-run like Perl, nor like Python "picks up the compiled > form if newer than source". Getting the libraries and executables > in the right place was counter-intutuitive when I setup Icon. > > * Too high level? This may be strange, but for daily tasks Icon's power > doesn't seem to fit. It would be great for doing things with directory > trees, but it dons't have stat. > > Of course, the arguments run the other way as well: things wrong with > Perl, right with Icon, but that is not the question. I wish Perl had > string scanning, because sometimes regexps are not the way to go. > > Now, if the above is factually wrong, I'l accept correction, but that I > have these perceptions says something in itself. Now I'm wearing my asbestos.... ;) -- --Rafal Sulejman --Gdansk, PL From icon-group-sender Wed Nov 8 12:43:23 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA8Jgcs08024 for icon-group-addresses; Wed, 8 Nov 2000 12:42:38 -0700 (MST) Message-Id: <200011081942.eA8Jgcs08024@baskerville.CS.Arizona.EDU> Date: Wed, 8 Nov 2000 16:09:11 +0000 (GMT) From: Hugh Sasse Staff Elec Eng X-Sender: hgs@atlanta To: =?ISO-8859-1?Q?Rafa=B3?= Maciej Sulejman cc: icon-group@cs.arizona.edu Subject: Re: Why Perl? X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by baskerville.CS.Arizona.EDU id eA8GAW301606 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 347 On Wed, 8 Nov 2000, [ISO-8859-1] Rafa³ Maciej Sulejman wrote: > On wto, 07 lis 2000, you wrote: > > Is Perl really a satan's invention?!?! I don't think so... It's Nor me. > > What _YOU_ have done for spreading Icon/S4 more widely? Given you responded to my posting: is this question to me or to the person who asked originally? > Hugh From icon-group-sender Fri Nov 10 07:51:39 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eAAEoQA27840 for icon-group-addresses; Fri, 10 Nov 2000 07:50:26 -0700 (MST) Message-Id: <200011101450.eAAEoQA27840@baskerville.CS.Arizona.EDU> From: "Frank J. Lhota" X-Newsgroups: comp.lang.icon Subject: Icon Analyst Online? Date: Thu, 9 Nov 2000 16:29:15 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Trace: reader3.news.uu.net 973805443 12589 63.79.83.67 To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 829 As all subscribers to the Icon Analyst must be aware of now, the Analyst is entering its last year of publication. One can easily understand why the Icon Project has thrown in the towel. Publishing a paper newletter is a daunting, time consuming task, even if you have a small circulation. With its current subscriber base, it would be hard to justify devoting project resources to the Analyst. As an alternative, why not turn the Analyst into a web page? This is the direction that Windows magazine has taken. At this point, we can safely assume that all Icon Analysts have access to the web. The web page would require less printing, no postage, and would not have to updated on a regular schedule. I, for one, would really appreciate an Icon Analyst web page. Would you be interested in supporting / reading such a page? From icon-group-sender Fri Nov 10 07:51:51 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eAAEplA27863 for icon-group-addresses; Fri, 10 Nov 2000 07:51:47 -0700 (MST) Message-Id: <200011101451.eAAEplA27863@baskerville.CS.Arizona.EDU> From: Atle X-Newsgroups: comp.lang.icon Subject: Re: Icon Analyst Online? Date: Fri, 10 Nov 2000 12:42:05 +0100 X-Trace: news1.skynet.be 973851876 693 195.238.7.153 (10 Nov 2000 10:24:36 GMT) X-Complaints-To: abuse@skynet.be X-Accept-Language: en To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 319 "Frank J. Lhota" wrote: > I, for one, would really appreciate an Icon Analyst web page. Would you be > interested in supporting / reading such a page? Yes. Icon is leading a life in the shadows that it does *absolutely not* deserve. I am no Icon expert (I use Beta for the moment) but intend to take it up later. From icon-group-sender Mon Nov 20 12:26:37 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eAKJPKQ00857 for icon-group-addresses; Mon, 20 Nov 2000 12:25:20 -0700 (MST) Message-Id: <200011201925.eAKJPKQ00857@baskerville.CS.Arizona.EDU> Date: Sat, 18 Nov 2000 02:13:53 -0500 From: Joseph J Klemmer X-Accept-Language: en X-Newsgroups: comp.lang.icon Subject: Re: Icon Analyst Online? Cache-Post-Path: pizza.crosslink.net!unknown@206.246.125.83 X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) X-Trace: dingus.crosslink.net 974531632 11753 206.246.124.14 To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 591 "Frank J. Lhota" wrote: > > As all subscribers to the Icon Analyst must be aware of now, the Analyst is > entering its last year of publication. [...] > I, for one, would really appreciate an Icon Analyst web page. Would you be > interested in supporting / reading such a page? Very much so. It's been a couple of years since I've used icon but I want to get back into it. A good web info site would be great. --- The most exciting phrase to hear in science, the one that heralds new discoveries, is not "Eureka!" (I found it!) but "That's funny ..." -- Isaac Asimov From icon-group-sender Mon Nov 20 12:35:51 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eAKJZms01244 for icon-group-addresses; Mon, 20 Nov 2000 12:35:48 -0700 (MST) Message-Id: <200011201935.eAKJZms01244@baskerville.CS.Arizona.EDU> Date: Sat, 18 Nov 2000 11:21:01 -0500 From: David Gamey X-Accept-Language: en To: icon-group@cs.arizona.edu Subject: Re: Icon Analyst Online? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1113 This is an interesting idea. Could this not also allow a second life? With a web format new material could be moderated and organized into threads. With wider subscription base it might find new contributors. David Gamey "Frank J. Lhota" wrote: > > As all subscribers to the Icon Analyst must be aware of now, the Analyst is > entering its last year of publication. One can easily understand why the > Icon Project has thrown in the towel. Publishing a paper newletter is a > daunting, time consuming task, even if you have a small circulation. With > its current subscriber base, it would be hard to justify devoting project > resources to the Analyst. > > As an alternative, why not turn the Analyst into a web page? This is the > direction that Windows magazine has taken. At this point, we can safely > assume that all Icon Analysts have access to the web. The web page would > require less printing, no postage, and would not have to updated on a > regular schedule. > > I, for one, would really appreciate an Icon Analyst web page. Would you be > interested in supporting / reading such a page? From icon-group-sender Tue Nov 21 08:09:39 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eALF87Y22544 for icon-group-addresses; Tue, 21 Nov 2000 08:08:07 -0700 (MST) Message-Id: <200011211508.eALF87Y22544@baskerville.CS.Arizona.EDU> From: Tomasz Wojtowicz X-Newsgroups: comp.lang.icon Subject: Any vidgets documentation ? Date: Tue, 21 Nov 2000 13:35:45 +0100 X-Trace: galaxy.uci.agh.edu.pl 974794866 20113 192.168.14.34 (21 Nov 2000 08:21:06 GMT) X-Complaints-To: usenet@uci.agh.edu.pl User-Agent: KNode/0.3.2 To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 302 Please, help ;) I need pretty detailed icon vib vidgets documentation, ex. how to change states for any vidget, how to build and code more complex visual interfaces, examples will be welcome ;). Tomasz Wojtowicz ps. this poor 22 page pdf about building visual interfaces in icon is NOT ENOUGH From icon-group-sender Tue Nov 21 16:58:50 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eALNwUU22008 for icon-group-addresses; Tue, 21 Nov 2000 16:58:30 -0700 (MST) Message-Id: <200011212358.eALNwUU22008@baskerville.CS.Arizona.EDU> From: "Ian Trudel" To: "Tomasz Wojtowicz" , Subject: Re: Any vidgets documentation ? Date: Tue, 21 Nov 2000 14:22:38 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 923 ----- Original Message ----- From: "Tomasz Wojtowicz" To: Sent: Tuesday, November 21, 2000 7:35 AM Subject: Any vidgets documentation ? > Please, help ;) > I need pretty detailed icon vib vidgets documentation, ex. how to change > states for any vidget, how to build and code more complex visual > interfaces, examples will be welcome ;). > > Tomasz Wojtowicz > > ps. this poor 22 page pdf about building visual interfaces in icon is NOT > ENOUGH > Hi Tomasz, I haven't found anything else either. For my part, I've dug intot VIB source code to know how to use it. It'd be pretty nice to have a complete reference, but it's prolly a major work. back to work, see ya ;:P Ian ---------------------------------------------------------------- *squeak* *squeak* said the little mouse while eating a java hog. Ian Trudel, mailto:ian.trudel@tr.cgocable.ca From icon-group-sender Wed Nov 22 13:03:56 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eAMK2LQ04543 for icon-group-addresses; Wed, 22 Nov 2000 13:02:21 -0700 (MST) Message-Id: <200011222002.eAMK2LQ04543@baskerville.CS.Arizona.EDU> Date: Wed, 22 Nov 2000 09:52:15 -0700 (MST) From: Gregg Townsend To: icon-group Subject: Re: Any vidgets documentation ? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 684 > From: "Tomasz Wojtowicz" > > I need pretty detailed icon vib vidgets documentation, ex. how to change > states for any vidget, how to build and code more complex visual > interfaces, examples will be welcome ;). The most extensive coverage of interfaces and dialogs (several chapters worth) is in the book _Graphics_Programming_in_Icon_. See: http://www.cs.arizona.edu/icon/gb/ (Disclaimer: I'm one of the authors.) --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Fri Nov 24 14:28:08 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eAOLQwA02701 for icon-group-addresses; Fri, 24 Nov 2000 14:26:59 -0700 (MST) Message-Id: <200011242126.eAOLQwA02701@baskerville.CS.Arizona.EDU> From: Tomasz Wojtowicz X-Newsgroups: comp.lang.icon Subject: Xfig Palette Generator Date: 24 Nov 2000 08:50:22 GMT X-Trace: galaxy.uci.agh.edu.pl 975055822 24209 149.156.98.60 (24 Nov 2000 08:50:22 GMT) X-Complaints-To: usenet@uci.agh.edu.pl User-Agent: tin/1.4.1-19991201 ("Polish") (UNIX) (SunOS/5.6 (sun4m)) To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 730 Hi again, i'm pretty newbie to icon, but i found it can be pretty useful for prototyping apps. I use Xgif often, and it makes me a little inconvienient , when i must declare all colors i want to use (which are not in standard palette). And so I decided to write a little app with GUI front-end, which will generate a custom palette basing on set/list of color points chosen by user ( gradients between points ). You can download an early version of this app (not generating to file yet, so it is a real beta.beta.beta one ;)) from here: http://ernie.icslab.agh.edu.pl/~tomaswoj And tell me what You think about it ;). As it's still in early developing phase, Your suggestions are welcome ;). -- io/fuse From icon-group-sender Mon Nov 27 12:57:15 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eARJrtY01794 for icon-group-addresses; Mon, 27 Nov 2000 12:53:55 -0700 (MST) Message-Id: <200011271953.eARJrtY01794@baskerville.CS.Arizona.EDU> X-Lotus-FromDomain: NSWCDD_NDEPT From: amartin@nswc.navy.mil To: icon-group@cs.arizona.edu Date: Mon, 27 Nov 2000 12:44:25 -0500 Subject: NLP Tools in ICON Content-Disposition: inline Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 186 Dear all, Has anyone implemented any Natural Language Processing tools in ICON, e.g., a stemmer. a tagger, etc.? Thanks! Regards, Angel Angel R. Martinez amartin@nswc.navy.mil From icon-group-sender Mon Nov 27 16:48:49 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eARNmeE09656 for icon-group-addresses; Mon, 27 Nov 2000 16:48:40 -0700 (MST) Message-Id: <200011272348.eARNmeE09656@baskerville.CS.Arizona.EDU> From: "John Sampson" To: Subject: Re: NLP Tools in ICON Date: Mon, 27 Nov 2000 22:15:11 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1328 Hello - I asked in the Icon group mailing list about the Porter stemming algorithm but as there was no response I wrote a very rough one of my own. The Porter stemming algorithm is available on the Web in C, Perl and Java codings. For my purposes (medical terms) I have not been very impressed with its performance, at least in my implementation, but I am probably asking it to do things it was not meant for. I have also been looking for stem dictionaries and the like, to no avail. Possibly there are such things at prices suitable for corporate expense accounts. I have been taking some interest in Snobol. It seems the company making the SPITBOL implementation can ask a four-figure price for it, a fact which intrigues me, when the more sophisticated language Icon is free. It makes me think that must be where the action is, rather than with Icon. However, there is not much going on in the Snobol mailing list either. Regards _John Sampson_ ----- Original Message ----- From: To: Sent: Monday, November 27, 2000 5:44 PM Subject: NLP Tools in ICON > > > Dear all, > > Has anyone implemented any Natural Language Processing tools in ICON, e.g., a stemmer. a tagger, etc.? > > Thanks! > > Regards, > > Angel > > Angel R. Martinez > amartin@nswc.navy.mil > > > > From icon-group-sender Tue Nov 28 07:56:52 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eASEuAs12554 for icon-group-addresses; Tue, 28 Nov 2000 07:56:10 -0700 (MST) Message-Id: <200011281456.eASEuAs12554@baskerville.CS.Arizona.EDU> Date: Mon, 27 Nov 2000 22:45:07 -0600 From: gep2@terabites.com Subject: Re: NLP Tools in ICON To: jsampson@indexes.u-net.com, icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 4121 > I asked in the Icon group mailing list about the Porter stemming algorithm but as there was no response I wrote a very rough one of my own. The Porter stemming algorithm is available on the Web in C, Perl and Java codings. For my purposes (medical terms) I have not been very impressed with its performance, at least in my implementation, but I am probably asking it to do things it was not meant for. In general, I don't think either SNOBOL4 or Icon are necessarily the languages of choice if you have *REALLY* hard-core, full-bore number crunching that you have to do. (If programming time is the bigger issue, then it's possible they STILL are). > I have been taking some interest in Snobol. It seems the company making the SPITBOL implementation can ask a four-figure price for it, a fact which intrigues me, when the more sophisticated language Icon is free. True about the SPITBOL pricing, but the four-figure prices are really only if you're going to get the mainframe or Unix server versions. If you're planning to use it (like most of us) on a PC running under some flavor of either Windows or OS/2, it's priced rather along the lines of other commercial compilers (and MUCH less than, say, IBM's PL/1). The latest price for SPITBOL386 that I've seen on the Catspaw Web page (http://www.snobol4.com) is $295. Which, yeah, isn't being given away but OTOH if you really use the product very much (and I use it CONSTANTLY) you ought to save enough time on **one** programming project (quite possibly even on ONE PROGRAM) to make that cost back, and probably several times over. > ...It makes me think that must be where the action is, rather than with Icon. However, there is not much going on in the Snobol mailing list either. I think that BOTH lists are largely inhabited by people who are busier "doing" than just "talking about doing", and therefore spend much of their time there in "lurk mode". When interesting topics turn up (which does happen from time to time) you can get quite an amazing flurry of activity indeed. :-) Basically this is a tool which just simply WORKS, so there really isn't much need to have a place to conduct a continual bitchfest or anything. My own personal most recent project (and I actually used a combination of SPITBOL386 and SNOBOL4+ for it) was developing programs to read and recover data and source programs from a seriously garbled 1Gb hard drive... garbled badly enough that the partition sector, boot sector, FAT and root directory were essentially gone. I essentially had to write a SNOBOL4+ loadable function to retrieve data at the raw sector level (and I wrote that in assembly language... something I've done very little of in the last few years!), and a couple of SNOBOL4+ programs to read and create binary disk image files (which can then be read subsequently without constant and annoying error retry delays), along with the ability to merge image files from several passes (since a lot of these read errors, curiously, end up being transient). Next I wrote various SPITBOL programs to pattern match within the binary image files to identify sectors containing line-oriented text, non-delimited ASCII data (in this case, usually FoxPro database sectors), FoxPro database headers, etc, and then within the probable database sectors recovered to match data records of various crucial types. (It's fairly rare for me to write programs for clients which crunch for literally a day or more solid...). Although I own copies of both SNOBOL4+ and SPITBOL386 (and Icon too of course, although I admit I use S*BOL *far* more than I actually use Icon), and I certainly enjoy the exhilarating speed of SPITBOL, I do write even new programs using both compilers depending on the job I'm doing. SNOBOL4+ is still an excellent product, and it's freeware. Gordon Peterson http://personal.terabites.com/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: the day the Conservatives demonstrated their scorn for their fraudulent sham of representative government. Voters, remember it! From icon-group-sender Tue Nov 28 13:38:37 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eASKbbc12810 for icon-group-addresses; Tue, 28 Nov 2000 13:37:37 -0700 (MST) Message-Id: <200011282037.eASKbbc12810@baskerville.CS.Arizona.EDU> Date: Tue, 28 Nov 2000 14:15:02 -0500 From: "Steve Graham" To: , , Subject: Re: NLP Tools in ICON Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id eASJD1310434 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 4443 Gordon, I have used Icon, but never S*BOL and in Icon I still consider myself a beginner although I've used it off and on for years. Could you give us some ideas and/or examples of the differences and superiorities of S*BOL over Icon? Thanks. Steve Graham === >>> 11/27/00 10:45PM >>> > I asked in the Icon group mailing list about the Porter stemming algorithm but as there was no response I wrote a very rough one of my own. The Porter stemming algorithm is available on the Web in C, Perl and Java codings. For my purposes (medical terms) I have not been very impressed with its performance, at least in my implementation, but I am probably asking it to do things it was not meant for. In general, I don't think either SNOBOL4 or Icon are necessarily the languages of choice if you have *REALLY* hard-core, full-bore number crunching that you have to do. (If programming time is the bigger issue, then it's possible they STILL are). > I have been taking some interest in Snobol. It seems the company making the SPITBOL implementation can ask a four-figure price for it, a fact which intrigues me, when the more sophisticated language Icon is free. True about the SPITBOL pricing, but the four-figure prices are really only if you're going to get the mainframe or Unix server versions. If you're planning to use it (like most of us) on a PC running under some flavor of either Windows or OS/2, it's priced rather along the lines of other commercial compilers (and MUCH less than, say, IBM's PL/1). The latest price for SPITBOL386 that I've seen on the Catspaw Web page (http://www.snobol4.com) is $295. Which, yeah, isn't being given away but OTOH if you really use the product very much (and I use it CONSTANTLY) you ought to save enough time on **one** programming project (quite possibly even on ONE PROGRAM) to make that cost back, and probably several times over. > ...It makes me think that must be where the action is, rather than with Icon. However, there is not much going on in the Snobol mailing list either. I think that BOTH lists are largely inhabited by people who are busier "doing" than just "talking about doing", and therefore spend much of their time there in "lurk mode". When interesting topics turn up (which does happen from time to time) you can get quite an amazing flurry of activity indeed. :-) Basically this is a tool which just simply WORKS, so there really isn't much need to have a place to conduct a continual bitchfest or anything. My own personal most recent project (and I actually used a combination of SPITBOL386 and SNOBOL4+ for it) was developing programs to read and recover data and source programs from a seriously garbled 1Gb hard drive... garbled badly enough that the partition sector, boot sector, FAT and root directory were essentially gone. I essentially had to write a SNOBOL4+ loadable function to retrieve data at the raw sector level (and I wrote that in assembly language... something I've done very little of in the last few years!), and a couple of SNOBOL4+ programs to read and create binary disk image files (which can then be read subsequently without constant and annoying error retry delays), along with the ability to merge image files from several passes (since a lot of these read errors, curiously, end up being transient). Next I wrote various SPITBOL programs to pattern match within the binary image files to identify sectors containing line-oriented text, non-delimited ASCII data (in this case, usually FoxPro database sectors), FoxPro database headers, etc, and then within the probable database sectors recovered to match data records of various crucial types. (It's fairly rare for me to write programs for clients which crunch for literally a day or more solid...). Although I own copies of both SNOBOL4+ and SPITBOL386 (and Icon too of course, although I admit I use S*BOL *far* more than I actually use Icon), and I certainly enjoy the exhilarating speed of SPITBOL, I do write even new programs using both compilers depending on the job I'm doing. SNOBOL4+ is still an excellent product, and it's freeware. Gordon Peterson http://personal.terabites.com/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: the day the Conservatives demonstrated their scorn for their fraudulent sham of representative government. Voters, remember it! From icon-group-sender Tue Nov 28 13:38:55 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eASKcpI12856 for icon-group-addresses; Tue, 28 Nov 2000 13:38:52 -0700 (MST) Message-Id: <200011282038.eASKcpI12856@baskerville.CS.Arizona.EDU> From: jasmin shah X-Accept-Language: en X-Newsgroups: comp.lang.icon Subject: garbage collector Date: Tue, 28 Nov 2000 19:36:12 GMT X-Complaints-To: abuse@home.net X-Trace: news1.mntp1.il.home.com 975440172 24.12.135.27 (Tue, 28 Nov 2000 11:36:12 PST) To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 88 anyone know or has a copy of garbage collector in icon or scheme.......... thanks From icon-group-sender Fri Dec 1 08:16:41 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eB1FDlk07208 for icon-group-addresses; Fri, 1 Dec 2000 08:13:47 -0700 (MST) Message-Id: <200012011513.eB1FDlk07208@baskerville.CS.Arizona.EDU> From: "Frank J. Lhota" X-Newsgroups: comp.lang.icon Subject: JCON under Win32 Date: Thu, 30 Nov 2000 09:58:57 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Trace: reader0.news.uu.net 975596418 2853 63.79.83.67 To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 252 I've had problems trying to get JCON (the Java version of Icon) to work under NT. The implementation was geared towards the Unix-like operating systems, so have been using the Cygwin tools for this work. Has anyone gotten JCON to work under Win32? From icon-group-sender Mon Dec 4 08:19:07 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eB4FGeA14727 for icon-group-addresses; Mon, 4 Dec 2000 08:16:40 -0700 (MST) Message-Id: <200012041516.eB4FGeA14727@baskerville.CS.Arizona.EDU> From: Tomasz Wojtowicz X-Newsgroups: comp.lang.icon Subject: Xfig PalGen v.0.05 ready ;) Date: 4 Dec 2000 09:09:41 GMT X-Trace: galaxy.uci.agh.edu.pl 975920981 18417 149.156.98.60 (4 Dec 2000 09:09:41 GMT) X-Complaints-To: usenet@uci.agh.edu.pl User-Agent: tin/1.4.1-19991201 ("Polish") (UNIX) (SunOS/5.6 (sun4m)) To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 720 Hi Boys'n'Girls Xfig PalGen v.0.05 ready. What we have here this time ? Check it out at: http://ernie.icslab.agh.edu.pl/~tomaswoj First and most important: it finally saves to .fig file ;) So if You want your great grayscale palette, You got it in only few mouse clicks ;). Second and also important: now You can manipulate with colors order, move selected color up/down. Edit, update, delete, and so on,... Things to do: - presets, - saving palettes PalGen native file, - INPUT ERROR CHECKING - wow, this is important and will take some time - some help - and optionally file browser to convienient loading/saving Your ideas and suggestions are welcome, remember, that is only prototype ;). -- io/fuse From icon-group-sender Tue Dec 12 10:28:23 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eBCHRDg17165 for icon-group-addresses; Tue, 12 Dec 2000 10:27:13 -0700 (MST) Message-Id: <200012121727.eBCHRDg17165@baskerville.CS.Arizona.EDU> From: Serge HAROUTUNIAN X-Accept-Language: en X-Newsgroups: comp.lang.icon Subject: How to upCase characters ? Date: Tue, 12 Dec 2000 10:54:28 GMT X-Complaints-To: abuse@proxad.net X-Trace: nnrp1.proxad.net 976618468 134.59.2.121 (Tue, 12 Dec 2000 11:54:28 MET) To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 230 Hello, I'm starting in Icon, and if I don't know if it is exists a function witch return an upper-case character given in parameter ... Thanks a lot for every heplp !! P.S. : excuse my bad english, but I'm french ... From icon-group-sender Tue Dec 12 10:28:48 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eBCHSjs17200 for icon-group-addresses; Tue, 12 Dec 2000 10:28:45 -0700 (MST) Message-Id: <200012121728.eBCHSjs17200@baskerville.CS.Arizona.EDU> From: Steve Wampler X-Newsgroups: comp.lang.icon Subject: Re: How to upCase characters ? Date: Tue, 12 Dec 2000 10:07:10 -0700 X-Trace: noao.edu 976640830 56355 140.252.38.6 (12 Dec 2000 17:07:10 GMT) X-Complaints-To: abuse@noao.edu X-Accept-Language: en To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 605 Serge HAROUTUNIAN wrote: > > Hello, > > I'm starting in Icon, and if I don't know if it is exists a function > witch return an upper-case character given in parameter ... > > Thanks a lot for every heplp !! > > P.S. : excuse my bad english, but I'm french ... Your english is better than my french! Could you give me an example of what you mean? What the argument(s) to the function are and what you would expect to get back? I think map() is what you're looking for, but need a bit more information. Thanks -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Fri Dec 15 16:35:42 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eBFNXQI07849 for icon-group-addresses; Fri, 15 Dec 2000 16:33:26 -0700 (MST) Message-Id: <200012152333.eBFNXQI07849@baskerville.CS.Arizona.EDU> From: "John Sampson" To: Subject: Stepping Date: Fri, 15 Dec 2000 20:12:26 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 521 It would be useful to be able to step through an Icon program or set break-points in some simple way. I would have thought dummy := read() would be useful, and indeed it does step, but dummy remains null so one cannot use it to leave the program at will. If dummy acquired a value from read(), as the book leads me to expect, I could write if dummy == "q" then stop I don't understand why dummy is null - is cessation of keyboard input deemed to be EOF, thus causing the procedure to fail? Regards _John Sampson_ From icon-group-sender Mon Dec 18 09:24:39 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eBIGNQY01007 for icon-group-addresses; Mon, 18 Dec 2000 09:23:26 -0700 (MST) Message-Id: <200012181623.eBIGNQY01007@baskerville.CS.Arizona.EDU> Date: Fri, 15 Dec 2000 17:26:13 -0700 From: Steve Wampler To: John Sampson Cc: icon-group@cs.arizona.edu Subject: Re: Stepping Content-Disposition: inline User-Agent: Mutt/1.1.9i Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1424 On Fri, Dec 15, 2000 at 08:12:26PM -0000, John Sampson wrote: > It would be useful to be able to step through an Icon program or set > break-points in some simple way. I would have thought > > dummy := read() > > would be useful, and indeed it does step, but dummy remains null so one > cannot use it to leave the program at will. If dummy acquired a value from > read(), as the book leads me to expect, I could write > > if dummy == "q" then stop > > I don't understand why dummy is null - is cessation of keyboard input deemed > to be EOF, thus causing the procedure to fail? > > Regards > > _John Sampson_ > > Try this instead: read() | stop("Aborted on user command") now an EOF character will terminate the program and an ENTER will allow the program to continue. In fact, make it a procedure: procedure pauseForUser() writes("Enter EOF character to abort program, ENTER to continue: ") input := read() | stop("Terminated by user.") # # Now you can put any special processing here (say to turn tracing # on or off, or print a "stack" dump, or whatever.)! # return input end However, dummy := read() sure should assign a value to dummy if you've typed anything other than EOF. Are you sure you're not confusing null with an empty string (what you'll see if you just press ENTER)? Hope this helps! Steve -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Mon Dec 18 09:25:14 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eBIGPA601104 for icon-group-addresses; Mon, 18 Dec 2000 09:25:10 -0700 (MST) Message-Id: <200012181625.eBIGPA601104@baskerville.CS.Arizona.EDU> From: Guido Milanese To: Serge HAROUTUNIAN , icon-group@cs.arizona.edu Subject: Re: How to upCase characters ? Date: Sat, 16 Dec 2000 09:46:32 +0100 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 795 Die 12 dic 2000, Serge HAROUTUNIAN haec scripsit: > Hello, > > I'm starting in Icon, and if I don't know if it is exists a function > witch return an upper-case character given in parameter ... > > Thanks a lot for every heplp !! I am studying Armenian -- maybe this is your "original" language, isn't it? anyway, a quick answer in standard english (hopefully so): for this kind of tasks, I normally use the mreplace(o,p,q) instruction. Load "strings" and you can use it. Very nice. For simpler tasks, map() is better and probably faster. gm ---------------------------------- E-Mail: Guido Milanese Vocal Ensemble Ars Antiqua, Genova, Italia Homepage: http://fly.to/arsantiqua + + + + + + NON NOBIS DOMINE + + + + + + + ---------------------------------- From icon-group-sender Mon Dec 18 09:27:24 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eBIGRKk01190 for icon-group-addresses; Mon, 18 Dec 2000 09:27:20 -0700 (MST) Message-Id: <200012181627.eBIGRKk01190@baskerville.CS.Arizona.EDU> Date: Sat, 16 Dec 2000 08:26:58 -0700 From: Steve Wampler X-Accept-Language: en To: icon-group@cs.arizona.edu Subject: Re: Stepping Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 3005 John Sampson wrote: > > It would be useful to be able to step through an Icon program or set > break-points in some simple way. I would have thought > > dummy := read() > ... I though others might like to see how this idea can be easily extended to support a simple debugging controller. The following procedure pauses the program and allows the user to type some simple debugging commands. Typing EOF or "q" terminates the program, "c" or "n" continues program execution, "l" shows local (and global) variables, "g" shows only global variables, and "a" shows a stack trace of all variables. Finally "h" prints a simple help message. The programmer can pass in a special prompt or let it default to a standard prompt. (Passing in a prompt makes it easier to identify where in the program you've paused...). Of course, you could extend this to add any number of commands, and even write a version where the programmer could optionally pass in addition commands to allow when the procedure is called. I think I've seen better versions of similar ideas posted before - a *long* time ago. If you have one, how about reposting it? (As an aside, this could become a class in Unicon and do some *really* impressive debugging...) ---- snip "debug.icn" --- # # Simple debugger controller. Responds to user-issued debug commands. # # Still requires user to press Enter after each command, though EOF # terminates program immediately. # procedure debugCtl(prompt) # Loop until user quits program or asks to continue # repeat { writes((\prompt | "Debug")," (h for help): ") (map(read()) | "q") ? { if ="q" then stop("Program terminated by user.") else if ="h" then { # help message write("\nCommands are:\n") write("\tquit (or EOF) -- terminate program now") write("\thelp -- display help") write("\tcontinue -- continue program execution") write("\tnext -- same as continue") write("\tlocals -- display local variables") write("\tglobals -- display global variables") write("\tall -- display all variables in stack trace") write("\nOnly first character of command is needed.\n") } else if =("c"|"n") then return # continue execution else if ="l" then { # display local (and global) variables display(2) # to bad it also shows local vars for debugCtl! } else if ="g" then { # display only global variables display(0) } else if ="a" then { # display full stack dump display() } } # end of string scanning } # end of repeat loop end --- end snip "debug.icn" ---- -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Mon Dec 18 14:14:34 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eBILE3c09757 for icon-group-addresses; Mon, 18 Dec 2000 14:14:03 -0700 (MST) Message-Id: <200012182114.eBILE3c09757@baskerville.CS.Arizona.EDU> Date: Mon, 18 Dec 2000 20:01:03 +0100 (CET) From: To: icon-group@cs.arizona.edu Subject: Re: Stepping Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 594 On Fri, 15 Dec 2000, Steve Wampler wrote: > On Fri, Dec 15, 2000 at 08:12:26PM -0000, John Sampson wrote: > > > > dummy := read() > > [...] > > > > if dummy == "q" then stop [cut out something] May be it will help: if read() == "q" then stop("As you wish") In this case the condition will be true ONLY if you really enter "q". If you will enter ^d, read() will fail and then all condition will fail. In real life - it's better: if upto('q',read()) then ... or something similar :) Regards ethanak http://ethanak.i.sex.pl PS. Sorry, i can READ in English, but not WRITE :( From icon-group-sender Tue Dec 19 12:28:31 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eBJJOKE12999 for icon-group-addresses; Tue, 19 Dec 2000 12:24:20 -0700 (MST) Message-Id: <200012191924.eBJJOKE12999@baskerville.CS.Arizona.EDU> Date: Tue, 19 Dec 2000 07:08:40 -0700 From: Steve Wampler X-Accept-Language: en To: icon-group Subject: [Fwd: Runtime environment for Icon] Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 407 Ah - this is the Icon debugger I was thinking of - it's really quite impressive. Someone should use ivib to build a GUI for it! memoryalpha@juno.com wrote: > > http://www.soder-labs.com/icon/itwk232.zip > > documentation: > http://www.soder-labs.com/icon/itweak.html > > or, via ftp: > ftp://ftp.soder-labs.com/pub -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Tue Dec 26 09:56:50 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eBQGqio08268 for icon-group-addresses; Tue, 26 Dec 2000 09:52:44 -0700 (MST) Message-Id: <200012261652.eBQGqio08268@baskerville.CS.Arizona.EDU> From: "John Sampson" To: Subject: malformed tokens Date: Sat, 23 Dec 2000 20:43:41 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 230 Hello - What does '&&' mean in Icon? I used it by mistake for the conjunction operator '&' but the resulting error messages did not refer to it. Presumably it must have some legitimate meaning in Icon. Regards _John Sampson_