├── .gitignore ├── Checklist ├── Makefile ├── README ├── bin ├── .gitignore └── .placeholder ├── config ├── Makefile ├── aix │ ├── Makedefs │ ├── define.h │ └── status ├── bsd │ ├── Makedefs │ ├── define.h │ └── status ├── cygwin │ ├── Makedefs │ ├── define.h │ └── status ├── haiku │ ├── Makedefs │ ├── define.h │ └── status ├── hpux │ ├── Makedefs │ ├── define.h │ └── status ├── hurd │ ├── Makedefs │ ├── define.h │ └── status ├── irix │ ├── Makedefs │ ├── define.h │ └── status ├── linux │ ├── Makedefs │ ├── define.h │ └── status ├── linux_musl │ ├── Makedefs │ ├── define.h │ └── status ├── mac386 │ ├── Makedefs │ ├── define.h │ └── status ├── macintosh │ ├── Makedefs │ ├── define.h │ └── status ├── posix │ ├── Makedefs │ ├── define.h │ └── status ├── setup.sh ├── solaris │ ├── Makedefs │ ├── define.h │ └── status ├── solaris_sunc │ ├── Makedefs │ ├── define.h │ └── status └── tru64 │ ├── Makedefs │ ├── define.h │ └── status ├── doc ├── Makefile ├── blubordr.gif ├── build.htm ├── cfuncs.htm ├── clnroff.sed ├── cube128.gif ├── cygwin.htm ├── extlvals.htm ├── faq.htm ├── faqc.sed ├── files.htm ├── gb80.jpg ├── ib80.jpg ├── icon.txt ├── icont.txt ├── index.htm ├── install.htm ├── istyle.css ├── lb80.jpg ├── macintosh.htm ├── port.htm ├── relnotes.htm ├── shortcut.gif └── wwwcube.gif ├── ipl ├── BuildBin ├── BuildExe ├── CheckAll ├── Makefile ├── cfuncs │ ├── .gitignore │ ├── Makefile │ ├── README │ ├── bitcount.c │ ├── external.c │ ├── files.c │ ├── fpoll.c │ ├── icall.h │ ├── ilists.c │ ├── internal.c │ ├── lgconv.c │ ├── mkfunc.sh │ ├── mklib.sh │ ├── osf.c │ ├── pack.c │ ├── ppm.c │ ├── process.c │ └── tconnect.c ├── data │ ├── README │ ├── a2n.csg │ ├── abc.csg │ ├── abcd.csg │ ├── add.lbl │ ├── an2.csg │ ├── bb3.tur │ ├── carroll.txt │ ├── cc.tur │ ├── chart.gmr │ ├── cm.tur │ ├── colors.rsg │ ├── conman.sav │ ├── curves.dat │ ├── darwin.txt │ ├── dickens.txt │ ├── dylan.txt │ ├── egg.krs │ ├── exp.rsg │ ├── farber.sen │ ├── gilbert.txt │ ├── header │ ├── hebcalen.dat │ ├── icon.wrd │ ├── iconproj.lbl │ ├── ihelp.dat │ ├── joyce1.txt │ ├── joyce2.txt │ ├── joyce3.txt │ ├── noci.wrd │ ├── ones.tur │ ├── palin.sen │ ├── pas128.cpt │ ├── poe.txt │ ├── poem.rsg │ ├── pt1.gmr │ ├── pt2.gmr │ ├── pt3.gmr │ ├── pt4.gmr │ ├── pt5.gmr │ ├── pt6.gmr │ ├── regexp.tok │ ├── rsg.tok │ ├── sample.grh │ ├── sen.rsg │ ├── skeleton.icn │ ├── skelopt.icn │ ├── skelproc.icn │ ├── spencer.txt │ ├── termcap.dos │ ├── termcap2.dos │ └── verse.dat ├── docs │ ├── README │ ├── address.txt │ ├── hebcalen.hlp │ ├── hebcalpi.hlp │ ├── iconmake.txt │ ├── ipp.txt │ ├── mr.man │ ├── polywalk.txt │ ├── post.1 │ └── pt.man ├── gdata │ ├── README │ ├── babbage.gif │ ├── babbage.pts │ ├── brennan.gif │ ├── brennan.pts │ ├── bulb.xpm │ ├── cat.xpm │ ├── cl32.ims │ ├── claude.ims │ ├── clr.pak │ ├── gpxtest.gif │ ├── gxplor.dat │ ├── iml.pak │ ├── linden.dat │ ├── manhattn.lch │ ├── maryland.xpm │ ├── plaid.xpm │ ├── pyramid.ims │ ├── rgb.txt │ ├── sgr.ims │ ├── sphere16.ims │ ├── squares.ims │ ├── unicorn.ims │ ├── vneumann.gif │ ├── vneumann.pts │ └── xnames.ed ├── gdocs │ ├── README │ └── gtrace.txt ├── gincl │ ├── keysyms.icn │ ├── maccolor.icn │ ├── vdefns.icn │ ├── xcolors.icn │ └── xnames.icn ├── gpacks │ ├── README │ ├── carpets │ │ ├── Makefile │ │ ├── README │ │ ├── carplay.icn │ │ ├── carport.icn │ │ ├── carprec.icn │ │ └── carputil.icn │ ├── drawtree │ │ ├── Makefile │ │ ├── clr_list.icn │ │ ├── data.icn │ │ ├── data1.exm │ │ ├── data2.exm │ │ ├── draw_bar.icn │ │ ├── draw_box.icn │ │ ├── draw_crc.icn │ │ ├── draw_rec.icn │ │ ├── draw_sqr.icn │ │ ├── drawtree.icn │ │ ├── generate.icn │ │ ├── info.icn │ │ └── record.icn │ ├── ged │ │ ├── Makefile │ │ ├── control.icn │ │ ├── ged.icn │ │ └── textedit.icn │ ├── htetris │ │ ├── Makefile │ │ ├── brickdata.icn │ │ ├── brickio.icn │ │ ├── docstartpage.html │ │ ├── editor.html │ │ ├── editor.icn │ │ ├── help.icn │ │ ├── highscore.dat │ │ ├── howto.html │ │ ├── htetris.icn │ │ ├── implement.html │ │ ├── interface.html │ │ ├── matrix.icn │ │ ├── menus.html │ │ └── movement.icn │ ├── tiger │ │ ├── Makefile │ │ ├── README │ │ ├── tgrclean │ │ ├── tgrlink.icn │ │ ├── tgrmap.icn │ │ ├── tgrmerge.icn │ │ ├── tgrprep.icn │ │ ├── tgrquant.icn │ │ ├── tgrsort │ │ ├── tgrstats │ │ ├── tgrstrip │ │ └── tgrtrack.icn │ ├── vib │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── busy.icn │ │ ├── dlog.icn │ │ ├── vib.icn │ │ ├── vibbttn.icn │ │ ├── vibdefn.icn │ │ ├── vibedit.icn │ │ ├── vibfile.icn │ │ ├── vibglbl.icn │ │ ├── viblabel.icn │ │ ├── vibline.icn │ │ ├── viblist.icn │ │ ├── vibmenu.icn │ │ ├── vibradio.icn │ │ ├── vibrect.icn │ │ ├── vibsizer.icn │ │ ├── vibslidr.icn │ │ ├── vibtalk.icn │ │ └── vibtext.icn │ ├── weaving │ │ ├── Makefile │ │ ├── README │ │ ├── awl.icn │ │ ├── bibcvt.icn │ │ ├── cells.icn │ │ ├── clearpane.icn │ │ ├── colorup.icn │ │ ├── colrcvrt.icn │ │ ├── comb.icn │ │ ├── dd.icn │ │ ├── draw2gmr.icn │ │ ├── drawdown.icn │ │ ├── drawing.icn │ │ ├── drawscan.icn │ │ ├── drawup.icn │ │ ├── expand.icn │ │ ├── fill.icn │ │ ├── geom2gif.icn │ │ ├── gif2geom.icn │ │ ├── gif2html.icn │ │ ├── heddle.icn │ │ ├── htmtail.icn │ │ ├── htweav.icn │ │ ├── hypo.icn │ │ ├── ims2pat.icn │ │ ├── lindpath.icn │ │ ├── lindplot.icn │ │ ├── mtrxedit.icn │ │ ├── pat2tie.icn │ │ ├── pdbmake.icn │ │ ├── pfd2gif.icn │ │ ├── pfd2gmr.icn │ │ ├── pfd2ill.icn │ │ ├── pfd2wif.icn │ │ ├── plexity.icn │ │ ├── plotgrid.icn │ │ ├── plugger.icn │ │ ├── randweav.icn │ │ ├── sdb2wvp.icn │ │ ├── seqdraft.icn │ │ ├── seqweave.icn │ │ ├── shadow.icn │ │ ├── shadpapr.icn │ │ ├── showrav.icn │ │ ├── spray.icn │ │ ├── tdialog.icn │ │ ├── testdraw.icn │ │ ├── thm2html.icn │ │ ├── thmtail.icn │ │ ├── tie2pat.icn │ │ ├── tieimage.icn │ │ ├── tieutils.icn │ │ ├── tpath.icn │ │ ├── unravel.icn │ │ ├── wallpapr.icn │ │ ├── wdialog.icn │ │ ├── weavdefs.icn │ │ ├── weavegif.icn │ │ ├── weaver.icn │ │ ├── weaveseq.icn │ │ ├── weavrecs.icn │ │ ├── weavutil.icn │ │ ├── wif2pfd.icn │ │ ├── wifcvt.icn │ │ ├── woozles.icn │ │ ├── wvp2html.icn │ │ ├── wvp2pfd.icn │ │ └── wvptempl.icn │ └── xtiles │ │ ├── Makefile │ │ ├── README │ │ ├── convert.icn │ │ ├── smiley1.icn │ │ ├── smiley2.icn │ │ ├── smiley3.gif │ │ ├── smiley3.icn │ │ ├── xtiles.6 │ │ └── xtiles.icn ├── gprocs │ ├── attribs.icn │ ├── autopost.icn │ ├── barchart.icn │ ├── bevel.icn │ ├── bitplane.icn │ ├── button.icn │ ├── cardbits.icn │ ├── cells.icn │ ├── clip.icn │ ├── clipping.icn │ ├── clrnames.icn │ ├── clrutils.icn │ ├── color.icn │ ├── colorway.icn │ ├── colrlist.icn │ ├── colrmodl.icn │ ├── colrspec.icn │ ├── cwutils.icn │ ├── decay.icn │ ├── dialog.icn │ ├── dialogs.icn │ ├── distance.icn │ ├── drag.icn │ ├── drawcard.icn │ ├── drawcolr.icn │ ├── drawlab.icn │ ├── dsetup.icn │ ├── enqueue.icn │ ├── event.icn │ ├── evmux.icn │ ├── evplay.icn │ ├── evrecord.icn │ ├── fetchpat.icn │ ├── fstars.icn │ ├── fstartbl.icn │ ├── gdisable.icn │ ├── getcolrs.icn │ ├── gifsize.icn │ ├── glabels.icn │ ├── glib.icn │ ├── gpxlib.icn │ ├── gpxop.icn │ ├── graphics.icn │ ├── grecords.icn │ ├── gtrace.icn │ ├── ifg.icn │ ├── imagedim.icn │ ├── imageseq.icn │ ├── imgcolor.icn │ ├── imrutils.icn │ ├── imscanon.icn │ ├── imscolor.icn │ ├── imsutils.icn │ ├── imutils.icn │ ├── imxform.icn │ ├── interact.icn │ ├── isdplot.icn │ ├── isdxplot.icn │ ├── joinpair.icn │ ├── jolygs.icn │ ├── linddefs.icn │ ├── linddraw.icn │ ├── lindrec.icn │ ├── lindterp.icn │ ├── lsystem.icn │ ├── mapnav.icn │ ├── mirror.icn │ ├── modlines.icn │ ├── navitrix.icn │ ├── optwindw.icn │ ├── orbits.icn │ ├── overlay.icn │ ├── palettes.icn │ ├── pattread.icn │ ├── patutils.icn │ ├── patxform.icn │ ├── pixelmap.icn │ ├── popular.icn │ ├── psrecord.icn │ ├── putpixel.icn │ ├── randarea.icn │ ├── randfigs.icn │ ├── rawimage.icn │ ├── repeats.icn │ ├── rgbcomp.icn │ ├── rgbrec.icn │ ├── rpolys.icn │ ├── rstars.icn │ ├── rstartbl.icn │ ├── select.icn │ ├── slider.icn │ ├── spirals.icn │ ├── spokes.icn │ ├── strpchrt.icn │ ├── subturtl.icn │ ├── symrand.icn │ ├── tieedit.icn │ ├── tieutils.icn │ ├── tile.icn │ ├── tiler.icn │ ├── turtle.icn │ ├── twists.icn │ ├── vbuttons.icn │ ├── vcoupler.icn │ ├── vdialog.icn │ ├── vfilter.icn │ ├── vframe.icn │ ├── vgrid.icn │ ├── vidgets.icn │ ├── viface.icn │ ├── vlist.icn │ ├── vmenu.icn │ ├── vpane.icn │ ├── vquery.icn │ ├── vradio.icn │ ├── vscroll.icn │ ├── vsetup.icn │ ├── vslider.icn │ ├── vstd.icn │ ├── vstyle.icn │ ├── vtext.icn │ ├── wattrib.icn │ ├── weavegif.icn │ ├── wifisd.icn │ ├── win.icn │ ├── window.icn │ ├── winsnap.icn │ ├── wipe.icn │ ├── wopen.icn │ ├── xbfont.icn │ ├── xcolor.icn │ ├── xcompat.icn │ ├── xform.icn │ ├── xformimg.icn │ ├── xgtrace.icn │ ├── xio.icn │ ├── xplane.icn │ ├── xputpixl.icn │ ├── xqueue.icn │ └── xutils.icn ├── gprogs │ ├── autotile.icn │ ├── binpack.icn │ ├── bitdemo.icn │ ├── blp2grid.icn │ ├── blp2rows.icn │ ├── bme.icn │ ├── bpack.icn │ ├── breakout.icn │ ├── browser.icn │ ├── ca21.icn │ ├── calib.icn │ ├── cameleon.icn │ ├── chernoff.icn │ ├── clrs2pdb.icn │ ├── coloralc.icn │ ├── colormap.icn │ ├── colorup.icn │ ├── colorwif.icn │ ├── colrbook.icn │ ├── colrname.icn │ ├── colrpick.icn │ ├── concen.icn │ ├── cquilts.icn │ ├── cw.icn │ ├── dd2draft.icn │ ├── dd2res.icn │ ├── dd2unit.icn │ ├── dd2wif.icn │ ├── ddextend.icn │ ├── design1.icn │ ├── design2.icn │ ├── design3.icn │ ├── dlgvu.icn │ ├── drawup.icn │ ├── drip.icn │ ├── etch.icn │ ├── facebend.icn │ ├── fetti.icn │ ├── fev.icn │ ├── fileimag.icn │ ├── findrpt.icn │ ├── findtile.icn │ ├── flake.icn │ ├── floats.icn │ ├── flohisto.icn │ ├── fmap2pdb.icn │ ├── fontpick.icn │ ├── fractclr.icn │ ├── fractlin.icn │ ├── fstarlab.icn │ ├── gallery.icn │ ├── gamma.icn │ ├── gif2blp.icn │ ├── gif2isd.icn │ ├── gif2rows.icn │ ├── gif2wif.icn │ ├── gifs2pdb.icn │ ├── giftoims.icn │ ├── giftopat.icn │ ├── gpxtest.icn │ ├── gridedit.icn │ ├── gxplor.icn │ ├── hb.icn │ ├── histo.icn │ ├── hsvpick.icn │ ├── hvc.icn │ ├── img.icn │ ├── img2grid.icn │ ├── imgcolrs.icn │ ├── imgpaper.icn │ ├── imgtolst.icn │ ├── imlreduc.icn │ ├── imltogif.icn │ ├── ims2pat.icn │ ├── imstogif.icn │ ├── ipicker.icn │ ├── isd2disd.icn │ ├── isd2gif.icn │ ├── isd2grid.icn │ ├── isd2ill.icn │ ├── isd2wif.icn │ ├── isd2xgrid.icn │ ├── iview.icn │ ├── julia1.icn │ ├── kaleid.icn │ ├── kaleido.icn │ ├── keypunch.icn │ ├── koch.icn │ ├── lindcomp.icn │ ├── linden.icn │ ├── lorenz.icn │ ├── lsys.icn │ ├── mandala.icn │ ├── mandel1.icn │ ├── mandel2.icn │ ├── mandel3.icn │ ├── mercator.icn │ ├── mirroror.icn │ ├── moire.icn │ ├── mover.icn │ ├── offtiler.icn │ ├── orbit.icn │ ├── othello.icn │ ├── painterc.icn │ ├── palcheck.icn │ ├── palette.icn │ ├── pat2gif.icn │ ├── patfetch.icn │ ├── penelope.icn │ ├── pextract.icn │ ├── pgmtoims.icn │ ├── picktile.icn │ ├── plat.icn │ ├── plotter.icn │ ├── pme.icn │ ├── poller.icn │ ├── procater.icn │ ├── profile.icn │ ├── profiler.icn │ ├── prompt.icn │ ├── randweav.icn │ ├── randweb.icn │ ├── recticle.icn │ ├── rectile.icn │ ├── rects.icn │ ├── repeater.icn │ ├── rings.icn │ ├── rolypoly.icn │ ├── rows2blp.icn │ ├── rows2isd.icn │ ├── rstarlab.icn │ ├── scroll.icn │ ├── scroller.icn │ ├── seamcut.icn │ ├── selectle.icn │ ├── sensdemo.icn │ ├── showcolr.icn │ ├── showtile.icn │ ├── sier.icn │ ├── sier1.icn │ ├── sier2.icn │ ├── snapper.icn │ ├── spectra.icn │ ├── spider.icn │ ├── spiral.icn │ ├── spiro.icn │ ├── splat.icn │ ├── spokes.icn │ ├── striper.icn │ ├── subdemo.icn │ ├── sym4mm.icn │ ├── symdraw.icn │ ├── sympmm.icn │ ├── tess.icn │ ├── testpatt.icn │ ├── textures.icn │ ├── tgdemo.icn │ ├── tilescan.icn │ ├── travels.icn │ ├── trkvu.icn │ ├── tron.icn │ ├── trycolor.icn │ ├── tryfont.icn │ ├── uix.icn │ ├── unitgenr.icn │ ├── viewpane.icn │ ├── vqueens.icn │ ├── webimage.icn │ ├── wevents.icn │ ├── wheel.icn │ ├── wif2isd.icn │ ├── wifs2pdb.icn │ ├── xbm2pat.icn │ ├── xformpat.icn │ ├── xgamma.icn │ ├── xpmtoims.icn │ └── zoomtile.icn ├── incl │ ├── invkdefs.icn │ ├── lshade.icn │ └── opdefs.icn ├── packs │ ├── README │ ├── euler │ │ ├── Makefile │ │ ├── build.bat │ │ ├── ebcdic.icn │ │ ├── escape.icn │ │ ├── euler.grm │ │ ├── euler.icn │ │ ├── euler.ll1 │ │ ├── eulerint.icn │ │ ├── eulerscn.icn │ │ ├── eulersem.icn │ │ ├── parsell1.icn │ │ ├── readll1.icn │ │ ├── readme │ │ ├── semstk.icn │ │ ├── t0.eul │ │ ├── t1.eul │ │ ├── t10.eul │ │ ├── t11.eul │ │ ├── t2.eul │ │ ├── t3.eul │ │ ├── t4.eul │ │ ├── t5.eul │ │ ├── t6.eul │ │ ├── t7.eul │ │ ├── t8.eul │ │ ├── t9.eul │ │ └── xcode.icn │ ├── ibpag2 │ │ ├── Makefile │ │ ├── README │ │ ├── beta2ref.ibp │ │ ├── follow.icn │ │ ├── iacc.ibp │ │ ├── ibpag2.icn │ │ ├── ibreader.icn │ │ ├── ibutil.icn │ │ ├── ibwriter.icn │ │ ├── iiglrpar.lib │ │ ├── iiparse.lib │ │ ├── iohno.icn │ │ ├── itokens.icn │ │ ├── outbits.icn │ │ ├── rewrap.icn │ │ ├── sample.ibp │ │ ├── shrnktbl.icn │ │ ├── slritems.icn │ │ ├── slrtbls.icn │ │ ├── slshupto.icn │ │ ├── sortff.icn │ │ └── version.icn │ ├── icondb │ │ ├── Makefile │ │ ├── cgi.icn │ │ ├── icondb.icn │ │ └── mysqldb.c │ ├── idol │ │ ├── Makefile │ │ ├── NEW.8_0 │ │ ├── README │ │ ├── amiga.icn │ │ ├── autoparn.iol │ │ ├── bi_test.iol │ │ ├── buffer.iol │ │ ├── buftest.iol │ │ ├── builtins.iol │ │ ├── consttst.iol │ │ ├── events.iol │ │ ├── fraction.iol │ │ ├── globtest.iol │ │ ├── ictest.iol │ │ ├── idol.1 │ │ ├── idol.bat │ │ ├── idol.hqx │ │ ├── idol.iol │ │ ├── idol.man │ │ ├── idol.txt │ │ ├── idolboot.icn │ │ ├── idolmain.icn │ │ ├── incltest.iol │ │ ├── indextst.iol │ │ ├── install.bat │ │ ├── inverse.iol │ │ ├── itags.iol │ │ ├── labelgen.iol │ │ ├── lbltest.iol │ │ ├── linvktst.iol │ │ ├── main.iol │ │ ├── mpw.icn │ │ ├── msdos.icn │ │ ├── multitst.iol │ │ ├── mvs.icn │ │ ├── os2.icn │ │ ├── point.iol │ │ ├── seqtest.iol │ │ ├── sequence.iol │ │ ├── sinvktst.iol │ │ ├── strinvok.iol │ │ ├── systems.txt │ │ ├── unix.icn │ │ ├── vms.com │ │ ├── vms.icn │ │ ├── vmsidol.com │ │ └── warntest.iol │ ├── itweak │ │ ├── Makefile │ │ ├── README │ │ ├── dbg_run.icn │ │ ├── demo.cmd │ │ ├── ipxref.icn │ │ ├── itweak.htm │ │ ├── itweak.icn │ │ └── options.icn │ ├── loadfunc │ │ ├── Makefile │ │ ├── README │ │ ├── argdump.c │ │ ├── btest.icn │ │ ├── cspace.icn │ │ ├── cspgen.c │ │ ├── ddtest.icn │ │ ├── ddump.c │ │ ├── dldemo.icn │ │ ├── newsgrp.icn │ │ └── tnet.icn │ ├── loadfuncpp │ │ ├── Makefile │ │ ├── doc │ │ │ ├── Makefile │ │ │ ├── Makefile.mak │ │ │ ├── bang.cpp │ │ │ ├── bang.icn │ │ │ ├── compile.htm │ │ │ ├── divide.cpp │ │ │ ├── divide.icn │ │ │ ├── divide2.cpp │ │ │ ├── divide2.icn │ │ │ ├── dull.cpp │ │ │ ├── dull.icn │ │ │ ├── examples.txt │ │ │ ├── generator.cpp │ │ │ ├── generator.icn │ │ │ ├── hello.php │ │ │ ├── icall.txt │ │ │ ├── index.htm │ │ │ ├── isexternal.cpp │ │ │ ├── isexternal.icn │ │ │ ├── iterate.cpp │ │ │ ├── iterate.icn │ │ │ ├── keyword.cpp │ │ │ ├── keyword.icn │ │ │ ├── loadfuncpp.css │ │ │ ├── loadfuncpp.h │ │ │ ├── loadfuncpp.htm │ │ │ ├── makelist.cpp │ │ │ ├── makelist.icn │ │ │ ├── manual.htm │ │ │ ├── object.cpp │ │ │ └── object.icn │ │ ├── examples │ │ │ ├── Makefile │ │ │ ├── Makefile.mak │ │ │ ├── arglist.cpp │ │ │ ├── arglist.icn │ │ │ ├── callicon.cpp │ │ │ ├── callicon.icn │ │ │ ├── carl.icn │ │ │ ├── coexp.cpp │ │ │ ├── coexp.icn │ │ │ ├── compare.icn │ │ │ ├── examples.txt │ │ │ ├── extwidget.cpp │ │ │ ├── extwidget.icn │ │ │ ├── factorials.icn │ │ │ ├── hello.icn │ │ │ ├── hexwords.icn │ │ │ ├── hexwords_oneline.icn │ │ │ ├── iterate.cpp │ │ │ ├── iterate.icn │ │ │ ├── iterate2.cpp │ │ │ ├── iterate2.icn │ │ │ ├── iterate3.cpp │ │ │ ├── iterate3.icn │ │ │ ├── jmexample.cpp │ │ │ ├── jmexample.icn │ │ │ ├── kwd_vbl.cpp │ │ │ ├── kwd_vbl.icn │ │ │ ├── loadfuncpp.h │ │ │ ├── methodcall.cpp │ │ │ ├── methodcall.icn │ │ │ ├── mkexternal.cpp │ │ │ ├── mkexternal.icn │ │ │ ├── newprimes.icn │ │ │ ├── numbernamer.icn │ │ │ ├── primes.icn │ │ │ ├── runerr.cpp │ │ │ ├── runerr.icn │ │ │ ├── stop.cpp │ │ │ ├── stop.icn │ │ │ ├── sums.icn │ │ │ └── sums2.icn │ │ ├── hex.txt │ │ ├── iexample.cpp │ │ ├── iexample.icn │ │ ├── iload.cpp │ │ ├── iload.h │ │ ├── iloadgpx.cpp │ │ ├── iloadnogpx.cpp │ │ ├── loadfuncpp.h │ │ ├── loadfuncpp.icn │ │ ├── loadfuncpp_build.sh │ │ ├── savex.icn │ │ ├── xfload.cpp │ │ ├── xinterp.cpp │ │ └── xinterp64.cpp │ ├── skeem │ │ ├── Makefile │ │ ├── READ_ME │ │ ├── llist.icn │ │ ├── skbasic.icn │ │ ├── skcontrl.icn │ │ ├── skdebug.icn │ │ ├── skeem.icn │ │ ├── skextra.icn │ │ ├── skfun.icn │ │ ├── skin.icn │ │ ├── skio.icn │ │ ├── sklist.icn │ │ ├── skmisc.icn │ │ ├── sknumber.icn │ │ ├── skout.icn │ │ ├── skstring.icn │ │ ├── skuser.icn │ │ ├── skutil.icn │ │ ├── test.scm │ │ └── test.std │ └── tcll1 │ │ ├── Makefile │ │ ├── NOTICE │ │ ├── README │ │ ├── bugs.grm │ │ ├── build1.bat │ │ ├── c_ll1.grm │ │ ├── c_nll1.grm │ │ ├── declacts.icn │ │ ├── e.grm │ │ ├── e_notll1.grm │ │ ├── ea_ll1.grm │ │ ├── ea_nll1.grm │ │ ├── ebcdic.icn │ │ ├── escape.icn │ │ ├── euler.grm │ │ ├── fp.grm │ │ ├── gramanal.icn │ │ ├── if_ll1.grm │ │ ├── if_nll1.grm │ │ ├── ll1.icn │ │ ├── ls_ll1.grm │ │ ├── ls_nll1.grm │ │ ├── parsell1.icn │ │ ├── readll1.icn │ │ ├── rptperr.icn │ │ ├── scangram.icn │ │ ├── semgram.icn │ │ ├── semout.icn │ │ ├── semstk.icn │ │ ├── tcll1.grm │ │ ├── tcll1.icn │ │ ├── tcll1.ll1 │ │ ├── tcll1.pdf │ │ └── xcode.icn ├── procs │ ├── abkform.icn │ ├── adjuncts.icn │ ├── adlutils.icn │ ├── allof.icn │ ├── allpat.icn │ ├── ansi.icn │ ├── apply.icn │ ├── argparse.icn │ ├── array.icn │ ├── asciinam.icn │ ├── base64.icn │ ├── basename.icn │ ├── binary.icn │ ├── bincvt.icn │ ├── binop.icn │ ├── bitint.icn │ ├── bitstr.icn │ ├── bitstrm.icn │ ├── bkutil.icn │ ├── bold.icn │ ├── boolops.icn │ ├── bufread.icn │ ├── calendar.icn │ ├── calendat.icn │ ├── calls.icn │ ├── capture.icn │ ├── cartog.icn │ ├── caseless.icn │ ├── codeobj.icn │ ├── colmize.icn │ ├── complete.icn │ ├── complex.icn │ ├── conffile.icn │ ├── converge.icn │ ├── convert.icn │ ├── core.icn │ ├── created.icn │ ├── currency.icn │ ├── curves.icn │ ├── datefns.icn │ ├── datetime.icn │ ├── ddfread.icn │ ├── dif.icn │ ├── digitcnt.icn │ ├── dijkstra.icn │ ├── divide.icn │ ├── ebcdic.icn │ ├── echo.icn │ ├── empgsup.icn │ ├── emptygen.icn │ ├── equiv.icn │ ├── escape.icn │ ├── escapesq.icn │ ├── eval.icn │ ├── evallist.icn │ ├── eventgen.icn │ ├── everycat.icn │ ├── expander.icn │ ├── exprfile.icn │ ├── factors.icn │ ├── fastfncs.icn │ ├── feval.icn │ ├── filedim.icn │ ├── filenseq.icn │ ├── filesize.icn │ ├── findre.icn │ ├── ftype.icn │ ├── fullimag.icn │ ├── gauss.icn │ ├── gdl.icn │ ├── gdl2.icn │ ├── gedcom.icn │ ├── gen.icn │ ├── gener.icn │ ├── genrfncs.icn │ ├── geodat.icn │ ├── getchlib.icn │ ├── getkeys.icn │ ├── getmail.icn │ ├── getpaths.icn │ ├── gettext.icn │ ├── gobject.icn │ ├── graphpak.icn │ ├── hetero.icn │ ├── hexcvt.icn │ ├── hostname.icn │ ├── html.icn │ ├── ibench.icn │ ├── ichartp.icn │ ├── identgen.icn │ ├── identity.icn │ ├── ifncs.icn │ ├── iftrace.icn │ ├── image.icn │ ├── inbits.icn │ ├── indices.icn │ ├── inserts.icn │ ├── intstr.icn │ ├── io.icn │ ├── iolib.icn │ ├── iscreen.icn │ ├── iterfncs.icn │ ├── itlib.icn │ ├── itlibdos.icn │ ├── itokens.icn │ ├── itrcline.icn │ ├── ivalue.icn │ ├── jumpque.icn │ ├── kmap.icn │ ├── labeler.icn │ ├── lastc.icn │ ├── lastname.icn │ ├── lcseval.icn │ ├── levensht.icn │ ├── lindgen.icn │ ├── lindstrp.icn │ ├── list2tab.icn │ ├── lists.icn │ ├── longstr.icn │ ├── lrgapprx.icn │ ├── lstfncs.icn │ ├── lterps.icn │ ├── lu.icn │ ├── makelsys.icn │ ├── mapbit.icn │ ├── mapstr.icn │ ├── matchlib.icn │ ├── math.icn │ ├── matrix.icn │ ├── matrix2.icn │ ├── memlog.icn │ ├── memrfncs.icn │ ├── mixsort.icn │ ├── models.icn │ ├── morse.icn │ ├── mset.icn │ ├── namepfx.icn │ ├── nestlist.icn │ ├── ngrams.icn │ ├── noncase.icn │ ├── numbers.icn │ ├── openchk.icn │ ├── opnames.icn │ ├── opsyms.icn │ ├── options.icn │ ├── outbits.icn │ ├── packunpk.icn │ ├── parscond.icn │ ├── partit.icn │ ├── pascal.icn │ ├── pascltri.icn │ ├── patch.icn │ ├── patterns.icn │ ├── patword.icn │ ├── pbkform.icn │ ├── pdco.icn │ ├── periodic.icn │ ├── permutat.icn │ ├── phoname.icn │ ├── plural.icn │ ├── polynom.icn │ ├── polyseq.icn │ ├── polystuf.icn │ ├── popen.icn │ ├── pqueue.icn │ ├── printcol.icn │ ├── printf.icn │ ├── prockind.icn │ ├── procname.icn │ ├── progary.icn │ ├── pscript.icn │ ├── ptutils.icn │ ├── random.icn │ ├── rational.icn │ ├── readcpt.icn │ ├── readtbl.icn │ ├── reassign.icn │ ├── rec2tab.icn │ ├── recog.icn │ ├── records.icn │ ├── recrfncs.icn │ ├── recurmap.icn │ ├── reduce.icn │ ├── regexp.icn │ ├── repetit.icn │ ├── revadd.icn │ ├── rewrap.icn │ ├── rng.icn │ ├── sandgen.icn │ ├── scan.icn │ ├── scanmodl.icn │ ├── scanset.icn │ ├── segment.icn │ ├── senten1.icn │ ├── sentence.icn │ ├── seqfncs.icn │ ├── seqimage.icn │ ├── seqops.icn │ ├── serial.icn │ ├── sername.icn │ ├── sets.icn │ ├── showtbl.icn │ ├── shquote.icn │ ├── signed.icn │ ├── sort.icn │ ├── sortt.icn │ ├── soundex.icn │ ├── soundex1.icn │ ├── speedo.icn │ ├── spin.icn │ ├── statemap.icn │ ├── step.icn │ ├── str2toks.icn │ ├── strings.icn │ ├── strip.icn │ ├── stripcom.icn │ ├── stripunb.icn │ ├── tab2list.icn │ ├── tab2rec.icn │ ├── tables.icn │ ├── tclass.icn │ ├── title.icn │ ├── titleset.icn │ ├── tokgen.icn │ ├── trees.icn │ ├── tuple.icn │ ├── typecode.icn │ ├── unsigned.icn │ ├── usage.icn │ ├── varsub.icn │ ├── verncnt.icn │ ├── version.icn │ ├── vhttp.icn │ ├── vrml.icn │ ├── vrml1lib.icn │ ├── vrml2lib.icn │ ├── wdiag.icn │ ├── weavgenr.icn │ ├── weaving.icn │ ├── weavutil.icn │ ├── weighted.icn │ ├── wildcard.icn │ ├── word.icn │ ├── wrap.icn │ ├── writecpt.icn │ ├── xcode.icn │ ├── xcodes.icn │ ├── xforms.icn │ ├── ximage.icn │ ├── xrotate.icn │ └── zipread.icn └── progs │ ├── adlcheck.icn │ ├── adlcount.icn │ ├── adlfiltr.icn │ ├── adlfirst.icn │ ├── adllist.icn │ ├── adlsort.icn │ ├── animal.icn │ ├── applyfnc.icn │ ├── banner.icn │ ├── based.icn │ ├── bfd.icn │ ├── bj.icn │ ├── blnk2tab.icn │ ├── c2icn.icn │ ├── calc.icn │ ├── catlines.icn │ ├── chars.icn │ ├── chkhtml.icn │ ├── choose.icn │ ├── chop.icn │ ├── colm.icn │ ├── comfiles.icn │ ├── compare.icn │ ├── comply83.icn │ ├── concord.icn │ ├── conman.icn │ ├── countlst.icn │ ├── cross.icn │ ├── crypt.icn │ ├── csgen.icn │ ├── cstrings.icn │ ├── cwd.icn │ ├── datmerge.icn │ ├── daystil.icn │ ├── ddfdump.icn │ ├── deal.icn │ ├── declchck.icn │ ├── delam.icn │ ├── delamc.icn │ ├── dellines.icn │ ├── delta.icn │ ├── diffn.icn │ ├── diffsort.icn │ ├── diffsum.icn │ ├── diffu.icn │ ├── diffword.icn │ ├── digcol.icn │ ├── diskpack.icn │ ├── duplfile.icn │ ├── duplproc.icn │ ├── edscript.icn │ ├── empg.icn │ ├── envelope.icn │ ├── evaluate.icn │ ├── extweave.icn │ ├── farb.icn │ ├── farb2.icn │ ├── filecnvt.icn │ ├── filehtml.icn │ ├── fileprep.icn │ ├── fileprnt.icn │ ├── filerepl.icn │ ├── filesect.icn │ ├── filexref.icn │ ├── filtskel.icn │ ├── findstr.icn │ ├── findtext.icn │ ├── fixhqx.icn │ ├── fixpath.icn │ ├── fnctab.icn │ ├── fnctmpl.icn │ ├── format.icn │ ├── former.icn │ ├── fract.icn │ ├── fset.icn │ ├── fuzz.icn │ ├── gcomp.icn │ ├── geddump.icn │ ├── gediff.icn │ ├── gener.icn │ ├── genfile.icn │ ├── genqueen.icn │ ├── getcol.icn │ ├── getlines.icn │ ├── gftrace.icn │ ├── graphdem.icn │ ├── grpsort.icn │ ├── hcal4unx.icn │ ├── headicon.icn │ ├── hebcalen.icn │ ├── hebeng.icn │ ├── hotedit.icn │ ├── hr.icn │ ├── htget.icn │ ├── htprep.icn │ ├── huffstuf.icn │ ├── hufftab.icn │ ├── ibar.icn │ ├── ibrow.icn │ ├── icalc.icn │ ├── icalls.icn │ ├── icn2c.icn │ ├── icontent.icn │ ├── icvt.icn │ ├── idepth.icn │ ├── idxtext.icn │ ├── ifilter.icn │ ├── ifncsgen.icn │ ├── igrep.icn │ ├── iheader.icn │ ├── ihelp.icn │ ├── iidecode.icn │ ├── iiencode.icn │ ├── ilnkxref.icn │ ├── ilump.icn │ ├── imagetyp.icn │ ├── indxcomp.icn │ ├── ineeds.icn │ ├── inter.icn │ ├── interpe.icn │ ├── interpp.icn │ ├── ipatch.icn │ ├── ipldoc.icn │ ├── iplindex.icn │ ├── iplkwic.icn │ ├── iplweb.icn │ ├── ipower.icn │ ├── ipp.icn │ ├── iprint.icn │ ├── iprofile.icn │ ├── iprofl.icn │ ├── ipsort.icn │ ├── ipsplit.icn │ ├── ipxref.icn │ ├── irsort.icn │ ├── irunerr.icn │ ├── iseq.icn │ ├── isize.icn │ ├── isrcline.icn │ ├── istrip.icn │ ├── itab.icn │ ├── itags.icn │ ├── itrbksum.icn │ ├── itrcfltr.icn │ ├── itrcsum.icn │ ├── iundecl.icn │ ├── iversion.icn │ ├── iwriter.icn │ ├── knapsack.icn │ ├── krieg.icn │ ├── kross.icn │ ├── kwic.icn │ ├── kwicprep.icn │ ├── la.icn │ ├── labels.icn │ ├── lam.icn │ ├── latexidx.icn │ ├── lc.icn │ ├── lcfile.icn │ ├── lcn.icn │ ├── limitf.icn │ ├── lindcode.icn │ ├── lindsys.icn │ ├── lineseq.icn │ ├── link2url.icn │ ├── lisp.icn │ ├── lister.icn │ ├── listhtml.icn │ ├── listviz.icn │ ├── literat.icn │ ├── ll.icn │ ├── loadmap.icn │ ├── longest.icn │ ├── lower.icn │ ├── lssum.icn │ ├── lsysmap.icn │ ├── maccvt.icn │ ├── makepuzz.icn │ ├── mapcolrs.icn │ ├── midisig.icn │ ├── missile.icn │ ├── miu.icn │ ├── mkpasswd.icn │ ├── monkeys.icn │ ├── morse.icn │ ├── mr.icn │ ├── mszip.icn │ ├── mtf3.icn │ ├── newicon.icn │ ├── newsrc.icn │ ├── nim.icn │ ├── nocr.icn │ ├── noise.icn │ ├── normalize.icn │ ├── oldicon.icn │ ├── pack.icn │ ├── paginate.icn │ ├── papply.icn │ ├── parens.icn │ ├── pargen.icn │ ├── parse.icn │ ├── parsex.icn │ ├── patchu.icn │ ├── pbkdump.icn │ ├── pdecomp.icn │ ├── polydemo.icn │ ├── post.icn │ ├── press.icn │ ├── pretrim.icn │ ├── procprep.icn │ ├── procwrap.icn │ ├── proto.icn │ ├── psrsplit.icn │ ├── pt.icn │ ├── puzz.icn │ ├── qei.icn │ ├── qt.icn │ ├── queens.icn │ ├── ranstars.icn │ ├── rcat.icn │ ├── recgen.icn │ ├── repeats.icn │ ├── reply.icn │ ├── repro.icn │ ├── revfile.icn │ ├── revsort.icn │ ├── roffcmds.icn │ ├── rsg.icn │ ├── ruler.icn │ ├── sample.icn │ ├── scale.icn │ ├── scramble.icn │ ├── setmerge.icn │ ├── shar.icn │ ├── shortest.icn │ ├── shuffile.icn │ ├── shuffle.icn │ ├── sing.icn │ ├── slice.icn │ ├── snake.icn │ ├── solit.icn │ ├── sortname.icn │ ├── splitlit.icn │ ├── spread.icn │ ├── streamer.icn │ ├── strimlen.icn │ ├── strpsgml.icn │ ├── tabexten.icn │ ├── tablc.icn │ ├── tablw.icn │ ├── tabulate.icn │ ├── textcnt.icn │ ├── textcvt.icn │ ├── toktab.icn │ ├── trim.icn │ ├── ttt.icn │ ├── turing.icn │ ├── unclog.icn │ ├── unique.icn │ ├── unpack.icn │ ├── upper.icn │ ├── url2link.icn │ ├── utrim.icn │ ├── verse.icn │ ├── versum.icn │ ├── vnq.icn │ ├── vrepl.icn │ ├── weblinks.icn │ ├── what.icn │ ├── when.icn │ ├── wshfdemo.icn │ ├── xtable.icn │ ├── yahtz.icn │ ├── yescr.icn │ └── zipsort.icn ├── lib ├── .gitignore └── .placeholder ├── man └── man1 │ ├── icon.1 │ └── icont.1 ├── src ├── Makefile ├── common │ ├── .gitignore │ ├── Makefile │ ├── alloc.c │ ├── error.h │ ├── filepart.c │ ├── fixgram.icn │ ├── getopt.c │ ├── icontype.h │ ├── identify.c │ ├── infer.c │ ├── ipp.c │ ├── lextab.h │ ├── literals.c │ ├── long.c │ ├── mktoktab.icn │ ├── munix.c │ ├── op.txt │ ├── patchstr.c │ ├── pscript.icn │ ├── rswitch.c │ ├── rtdb.c │ ├── strtbl.c │ ├── time.c │ ├── tokens.txt │ ├── typespec.icn │ ├── typespec.txt │ ├── xwindow.c │ ├── yacctok.h │ └── yylex.h ├── h │ ├── .gitignore │ ├── config.h │ ├── cpuconf.h │ ├── cstructs.h │ ├── esctab.h │ ├── fdefs.h │ ├── features.h │ ├── grammar.h │ ├── graphics.h │ ├── grttin.h │ ├── gsupport.h │ ├── header.h │ ├── kdefs.h │ ├── lexdef.h │ ├── mproto.h │ ├── mswin.h │ ├── odefs.h │ ├── opdefs.h │ ├── parserr.h │ ├── rexterns.h │ ├── rmacros.h │ ├── rproto.h │ ├── rstructs.h │ ├── rt.h │ ├── sys.h │ ├── typedefs.h │ ├── version.h │ └── xwin.h ├── icont │ ├── .gitignore │ ├── Makefile │ ├── ixhdr.c │ ├── keyword.h │ ├── lcode.c │ ├── lfile.h │ ├── lglob.c │ ├── link.c │ ├── link.h │ ├── llex.c │ ├── lmem.c │ ├── lnklist.c │ ├── lsym.c │ ├── mkkwd.icn │ ├── newhdr.c │ ├── opcode.c │ ├── opcode.h │ ├── tcode.c │ ├── tglobals.c │ ├── tglobals.h │ ├── tgrammar.c │ ├── tlex.c │ ├── tmem.c │ ├── tparse.c │ ├── tproto.h │ ├── trans.c │ ├── trash.icn │ ├── tree.c │ ├── tree.h │ ├── tsym.c │ ├── tsym.h │ ├── ttoken.h │ ├── tunix.c │ └── util.c ├── preproc │ ├── bldtok.c │ ├── evaluate.c │ ├── files.c │ ├── gettok.c │ ├── macro.c │ ├── pchars.c │ ├── perr.c │ ├── pinit.c │ ├── pmem.c │ ├── pout.c │ ├── pproto.h │ ├── preproc.c │ ├── preproc.h │ └── ptoken.h ├── rtt │ ├── .gitignore │ ├── Makefile │ ├── ltoken.h │ ├── rtt.h │ ├── rtt1.h │ ├── rttdb.c │ ├── rttgram.y │ ├── rttilc.c │ ├── rttinlin.c │ ├── rttlex.c │ ├── rttmain.c │ ├── rttmisc.c │ ├── rttnode.c │ ├── rttout.c │ ├── rttparse.c │ ├── rttproto.h │ └── rttsym.c ├── runtime │ ├── .gitignore │ ├── Makefile │ ├── cnv.r │ ├── data.r │ ├── def.r │ ├── errmsg.r │ ├── fconv.r │ ├── fload.r │ ├── fmath.r │ ├── fmisc.r │ ├── fscan.r │ ├── fstr.r │ ├── fstranl.r │ ├── fstruct.r │ ├── fsys.r │ ├── fwindow.r │ ├── imain.r │ ├── imisc.r │ ├── init.r │ ├── interp.r │ ├── invoke.r │ ├── keyword.r │ ├── lmisc.r │ ├── oarith.r │ ├── oasgn.r │ ├── ocat.r │ ├── ocomp.r │ ├── omisc.r │ ├── oref.r │ ├── oset.r │ ├── ovalue.r │ ├── profile.r │ ├── ralc.r │ ├── rcoexpr.r │ ├── rcolor.r │ ├── rcomp.r │ ├── rdebug.r │ ├── rexternal.r │ ├── rimage.r │ ├── rlrgint.r │ ├── rmemmgt.r │ ├── rmisc.r │ ├── rmswin.ri │ ├── rstruct.r │ ├── rsys.r │ ├── rwindow.r │ ├── rwinrsc.r │ ├── rwinsys.r │ ├── rxrsc.ri │ └── rxwin.ri └── wincap │ ├── Makefile │ ├── copy.c │ ├── dibapi.h │ ├── dibutil.c │ ├── dibutil.h │ ├── errors.c │ ├── errors.h │ ├── file.c │ └── license.txt └── tests ├── Makefile ├── README ├── bench ├── Comp-icont ├── Execute-icont ├── Makefile ├── README ├── ReRun-icont ├── Trans-icont ├── concord.dat ├── concord.icn ├── concord.std ├── deal.icn ├── deal.std ├── ipxref.dat ├── ipxref.icn ├── ipxref.std ├── micro.icn ├── micsum.icn ├── options.icn ├── post.icn ├── queens.icn ├── queens.std ├── rsg.dat ├── rsg.icn ├── rsg.std └── shuffle.icn ├── general ├── .gitignore ├── Makefile ├── Test-icon ├── Test-opts ├── args.icn ├── args.std ├── arith.icn ├── arith.std ├── augment.icn ├── augment.std ├── btrees.dat ├── btrees.icn ├── btrees.std ├── case.icn ├── case.std ├── center.icn ├── center.std ├── cfuncs.icn ├── cfuncs.std ├── checkc.icn ├── checkc.std ├── checkfpc.icn ├── checkfpc.std ├── ck.icn ├── ck.std ├── coerce.icn ├── coerce.std ├── coexpr.icn ├── coexpr.std ├── collate.icn ├── collate.std ├── concord.dat ├── concord.icn ├── concord.std ├── cset.icn ├── cset.std ├── cxprimes.icn ├── cxprimes.std ├── diffwrds.dat ├── diffwrds.icn ├── diffwrds.std ├── endetab.dat ├── endetab.icn ├── endetab.std ├── env.icn ├── errkwds.icn ├── errkwds.std ├── errors.icn ├── errors.std ├── evalx.icn ├── evalx.std ├── every.icn ├── every.std ├── extlvals.icn ├── extlvals.std ├── features.icn ├── fncs.icn ├── fncs.std ├── fncs1.icn ├── fncs1.std ├── gc1.icn ├── gc1.std ├── gc2.icn ├── gc2.std ├── gener.icn ├── gener.std ├── genqueen.icn ├── genqueen.std ├── hello.icn ├── ilib.icn ├── ilib.std ├── image.icn ├── image.std ├── io.dat ├── io.icn ├── io.std ├── iobig.icn ├── iobig.std ├── kross.dat ├── kross.icn ├── kross.std ├── kwds.icn ├── kwds.std ├── large.icn ├── large.std ├── left.icn ├── left.std ├── level.icn ├── level.std ├── lexcmp.icn ├── lexcmp.std ├── lgint.icn ├── lgint.std ├── lists.icn ├── lists.std ├── map.icn ├── map.std ├── mathfunc.icn ├── mathfunc.std ├── meander.dat ├── meander.icn ├── meander.std ├── mega.icn ├── mega.std ├── mffsol.dat ├── mffsol.icn ├── mffsol.std ├── mindfa.dat ├── mindfa.icn ├── mindfa.std ├── misc.icn ├── misc.std ├── nargs.icn ├── nargs.std ├── numeric.icn ├── numeric.std ├── options.ok ├── others.dat ├── others.icn ├── others.std ├── over.icn ├── over.std ├── overflow.icn ├── overflow.std ├── parse.icn ├── parse.std ├── pdco.icn ├── pdco.std ├── prefix.dat ├── prefix.icn ├── prefix.std ├── prepro.dat ├── prepro.icn ├── prepro.std ├── primes.icn ├── primes.std ├── proto.icn ├── proto.std ├── queens.icn ├── queens.std ├── radix.icn ├── radix.std ├── random.icn ├── random.std ├── recent.icn ├── recent.std ├── recogn.dat ├── recogn.icn ├── recogn.std ├── record.icn ├── record.std ├── right.icn ├── right.std ├── roman.dat ├── roman.icn ├── roman.std ├── scan.icn ├── scan.std ├── scan1.icn ├── scan1.std ├── scan2.icn ├── scan2.std ├── sets.icn ├── sets.std ├── sieve.icn ├── sieve.std ├── sorting.icn ├── sorting.std ├── spellnum.icn ├── spellnum.std ├── statics.icn ├── statics.std ├── string.icn ├── string.std ├── string1.icn ├── string1.std ├── struct.icn ├── struct.std ├── subjpos.icn ├── subjpos.std ├── substring.icn ├── substring.std ├── table.icn ├── table.std ├── techo.icn ├── techo.std ├── tpp.icn ├── tpp.ok ├── tpp1.icn ├── tpp2.icn ├── tpp3.icn ├── tpp4.icn ├── tpp5.icn ├── tpp9.icn ├── tprintf.icn ├── tprintf.std ├── tracer.icn ├── tracer.std ├── transmit.dat ├── transmit.icn ├── transmit.std ├── traps.icn ├── traps.std ├── trim.icn ├── trim.std ├── var.icn ├── var.std ├── wordcnt.dat ├── wordcnt.icn └── wordcnt.std └── special ├── Makefile ├── README ├── keyboard.dat └── keyboard.icn /.gitignore: -------------------------------------------------------------------------------- 1 | Makedefs 2 | **/.DS_Store 3 | -------------------------------------------------------------------------------- /bin/.gitignore: -------------------------------------------------------------------------------- 1 | colrbook 2 | colrpick 3 | fontpick 4 | icon 5 | icont 6 | iconx 7 | libIgpx.a 8 | libcfunc.so 9 | palette 10 | rt.h 11 | rtt 12 | vib 13 | wevents 14 | xgamma 15 | -------------------------------------------------------------------------------- /bin/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/bin/.placeholder -------------------------------------------------------------------------------- /config/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for cleaning up after setup.sh 2 | 3 | TOP = .. 4 | SRC = $(TOP)/src 5 | 6 | 7 | Clean: 8 | 9 | Pure: 10 | rm -f $(TOP)/Makedefs 11 | rm -f $(SRC)/h/define.h 12 | -------------------------------------------------------------------------------- /config/aix/Makedefs: -------------------------------------------------------------------------------- 1 | # CC C compiler 2 | # CFLAGS flags for building C files 3 | # CFDYN additional flags for dynamic functions 4 | # RLINK flags for linking run-time system 5 | # RLIBS libraries to link with run-time system 6 | # TLIBS libraries to link for POSIX threads 7 | # XLIBS libraries to link for graphics 8 | 9 | CC = cc 10 | CFLAGS = -O -qMAXMEM=9999 11 | CFDYN = 12 | RLINK = 13 | RLIBS = -lm 14 | TLIBS = 15 | XLIBS = -lXpm -lX11 16 | -------------------------------------------------------------------------------- /config/aix/define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Icon configuration file for IBM RS/6000 running AIX 4.2 or newer 3 | */ 4 | 5 | #define UNIX 1 6 | #define LoadFunc /* requires 4.2 or newer */ 7 | -------------------------------------------------------------------------------- /config/aix/status: -------------------------------------------------------------------------------- 1 | System configuration: 2 | 3 | IBM RS/6000 running AIX v4.2 or newer 4 | 5 | Latest Icon version: 6 | 7 | Version 9.4.1 8 | 9 | Installer: 10 | 11 | Gregg Townsend 12 | Icon Project 13 | The University of Arizona 14 | 15 | Missing features: 16 | 17 | None 18 | 19 | Known bugs: 20 | 21 | None 22 | 23 | Comments: 24 | 25 | Tested on an RS/6000 running AIX 4.3. 26 | 27 | AIX Version 4.2 or newer is needed for loadfunc(). 28 | Although loadfunc() is enabled, I've never succeeded in 29 | building a loadable library that it finds acceptable. 30 | 31 | Date: 32 | 33 | February 15, 2002 34 | -------------------------------------------------------------------------------- /config/bsd/Makedefs: -------------------------------------------------------------------------------- 1 | # locations of X11 found in different BSD distributions 2 | X=/usr/X11R6 3 | L=/usr/local 4 | 5 | # CC C compiler 6 | # CFLAGS flags for building C files 7 | # CFDYN additional flags for dynamic functions 8 | # RLINK flags for linking run-time system 9 | # RLIBS libraries to link with run-time system 10 | # TLIBS libraries to link for POSIX threads 11 | # XLIBS libraries to link for graphics 12 | 13 | CC = cc 14 | CFLAGS = -O -I$X/include -I$L/include 15 | CFDYN = -fPIC 16 | RLINK = -Wl,-E 17 | RLIBS = -lm 18 | TLIBS = -lpthread 19 | XLIBS = -Wl,-R$X/lib -Wl,-R$L/lib -L$X/lib -L$L/lib -lXpm -lX11 20 | -------------------------------------------------------------------------------- /config/bsd/define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Icon configuration file for BSD 3 | */ 4 | 5 | #define UNIX 1 6 | #define LoadFunc 7 | -------------------------------------------------------------------------------- /config/bsd/status: -------------------------------------------------------------------------------- 1 | System configuration: 2 | 3 | All BSD variants (FreeBSD, NetBSD, OpenBSD) except Macintosh 4 | 5 | Latest Icon version: 6 | 7 | Version 9.5.20h of August 2, 2020 8 | 9 | Installer: 10 | 11 | Jacob Martin 12 | 13 | Missing features: 14 | 15 | None 16 | 17 | Known bugs: 18 | 19 | None 20 | 21 | Comments: 22 | 23 | This configuration is for FreeBSD, NetBSD, and OpenBSD. 24 | For Darwin (Apple Macintosh), use the "macintosh" configuration. 25 | 26 | Tested on OpenBSD 6.7, both i386 and amd64 architectures. 27 | 28 | older notes: 29 | 30 | Building on OpenBSD produces unsuppressible linker warnings 31 | that urge the replacement of certain standard library functions. 32 | This has not been done. 33 | 34 | Date: 35 | 36 | August 4, 2020 37 | -------------------------------------------------------------------------------- /config/cygwin/Makedefs: -------------------------------------------------------------------------------- 1 | # CC C compiler 2 | # CFLAGS flags for building C files 3 | # CFDYN additional flags for dynamic functions 4 | # RLINK flags for linking run-time system 5 | # RLIBS libraries to link with run-time system 6 | # TLIBS libraries to link for POSIX threads 7 | # XLIBS libraries to link for graphics 8 | 9 | CC = gcc 10 | CFLAGS = -O 11 | CFDYN = 12 | # make win32 import library for callbacks 13 | RLINK = -Wl,--export-all-symbols -Wl,--out-implib=iconx.a 14 | RLIBS = -lm 15 | TLIBS = 16 | XLIBS = -L/usr/X11R6/lib -lXpm -lX11 17 | 18 | # EXE extension for executable files 19 | EXE = .exe 20 | -------------------------------------------------------------------------------- /config/cygwin/define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Icon configuration file for Cygwin using X Window System graphics 3 | */ 4 | #define MSWIN 1 /* this configuration is for Microsoft Windows */ 5 | #define CYGWIN 1 /* this configuration uses Cygwin API */ 6 | #define XWindows 1 /* this configuration uses X Windows for graphics */ 7 | 8 | #define LoadFunc 1 /* enable dynamic loading */ 9 | 10 | #define ExecSuffix ".exe" 11 | #define IcodeSuffix ".exe" 12 | 13 | #define BinaryHeader 14 | #define MaxHdr 16384 15 | -------------------------------------------------------------------------------- /config/cygwin/status: -------------------------------------------------------------------------------- 1 | System configuration: 2 | 3 | Cygwin on Windows 7 4 | 5 | Latest Icon version: 6 | 7 | Version 9.5.1 8 | 9 | Installer: 10 | 11 | Carl Sturtivant 12 | University of Minnesota 13 | 14 | Missing features: 15 | 16 | None 17 | 18 | Known bugs: 19 | 20 | Icon programs can only run from a Cygwin terminal. 21 | 22 | Graphics programs can only run if Cygwin/X is already running. 23 | 24 | The "options" and "tpp" tests fail due to Unix dependencies. 25 | 26 | Comments: 27 | 28 | See the special Cygwin page in the documentation directory. 29 | 30 | Tested on Cygwin-NT-6.1 with GCC 4.5.3. 31 | 32 | Date: 33 | 34 | June 5, 2013 35 | -------------------------------------------------------------------------------- /config/haiku/Makedefs: -------------------------------------------------------------------------------- 1 | # CC C compiler 2 | # CFLAGS flags for building C files 3 | # CFDYN additional flags for dynamic functions 4 | # RLINK flags for linking run-time system 5 | # RLIBS libraries to link with run-time system 6 | # TLIBS libraries to link for POSIX threads 7 | # XLIBS libraries to link for graphics 8 | 9 | CC = gcc 10 | CFLAGS = -O -I/boot/system/develop/headers/X11 11 | CFDYN = -fPIC 12 | RLINK = -Wl,--no-undefined 13 | RLIBS = -lnetwork 14 | TLIBS = -lpthread 15 | XLIBS = -lXpm -lX11 16 | -------------------------------------------------------------------------------- /config/haiku/define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Icon configuration file for Haiku 3 | */ 4 | 5 | #define HAIKU 1 6 | #define UNIX 1 7 | #define LoadFunc 8 | -------------------------------------------------------------------------------- /config/haiku/status: -------------------------------------------------------------------------------- 1 | System configuration: 2 | 3 | Haiku 4 | 5 | Latest Icon version: 6 | 7 | Version 9.5.24a of January 17, 2024 8 | 9 | Installer: 10 | 11 | Jason Martin 12 | 13 | Missing features: 14 | 15 | None 16 | 17 | Known bugs: 18 | 19 | The graphics implementation depends on xlibe. 20 | Some esoteric operations such as pattern fill 21 | and reverse mode drawing do not work. 22 | 23 | Comments: 24 | 25 | Passed all tests on newly released Haiku OS R1/beta5. 26 | To build with graphics enabled, first install needed packages: 27 | pkgman install devel:libx11 devel:libxt devel:libxpm 28 | 29 | Date: 30 | 31 | September 15, 2024 32 | -------------------------------------------------------------------------------- /config/hpux/Makedefs: -------------------------------------------------------------------------------- 1 | # CC C compiler 2 | # CFLAGS flags for building C files 3 | # CFDYN additional flags for dynamic functions 4 | # RLINK flags for linking run-time system 5 | # RLIBS libraries to link with run-time system 6 | # TLIBS libraries to link for POSIX threads 7 | # XLIBS libraries to link for graphics 8 | 9 | CC = cc 10 | CFLAGS = -O -I/usr/X11R6/include 11 | CFDYN = +z 12 | RLINK = 13 | RLIBS = -lm 14 | TLIBS = -lrt -lpthread 15 | XLIBS = -lXpm -lX11 16 | -------------------------------------------------------------------------------- /config/hpux/define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Icon configuration file for HP-UX 3 | */ 4 | #define UNIX 1 5 | 6 | #define StackSize 10000 7 | -------------------------------------------------------------------------------- /config/hpux/status: -------------------------------------------------------------------------------- 1 | System configuration: 2 | 3 | Hewlett-Packard HP-UX operating system. 4 | 5 | Latest Icon version: 6 | 7 | Version 9.4.2 8 | 9 | Installer: 10 | 11 | Icon Project 12 | The University of Arizona 13 | (with thanks to Chris Tenaglia) 14 | 15 | Missing features: 16 | 17 | Dynamic loading (loadfunc) 18 | 19 | Known bugs: 20 | 21 | None 22 | 23 | Comments: 24 | 25 | Tested on an RX2600 server (Itanium architecture) running 26 | HP-UX version B.11.23. Will probably also work on PA-RISC. 27 | 28 | HP/UX uses the LPATH environment variable as a path to the linker. 29 | This conflicts with Icon's use of LPATH to search for $include files. 30 | 31 | Date: 32 | 33 | December 20, 2003 34 | -------------------------------------------------------------------------------- /config/hurd/Makedefs: -------------------------------------------------------------------------------- 1 | # CC C compiler 2 | # CFLAGS flags for building C files 3 | # CFDYN additional flags for dynamic functions 4 | # RLINK flags for linking run-time system 5 | # RLIBS libraries to link with run-time system 6 | # TLIBS libraries to link for POSIX threads 7 | # XLIBS libraries to link for graphics 8 | 9 | CC = gcc 10 | CFLAGS = -O 11 | CFDYN = -fPIC 12 | RLINK = -Wl,-E 13 | RLIBS = -lm -ldl 14 | TLIBS = 15 | XLIBS = -L/usr/X11R6/lib -lXpm -lX11 16 | -------------------------------------------------------------------------------- /config/hurd/define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Icon configuration file for the GNU Hurd system 3 | */ 4 | 5 | #define UNIX 1 6 | #define LoadFunc 7 | -------------------------------------------------------------------------------- /config/hurd/status: -------------------------------------------------------------------------------- 1 | System configuration: 2 | 3 | Intel architecture running the GNU system 4 | 5 | Latest Icon version: 6 | 7 | Version 9.4.0 8 | 9 | Installer: 10 | 11 | Marcus Brinkmann 12 | The Debian project 13 | 14 | Missing features: 15 | 16 | None 17 | 18 | Known bugs: 19 | 20 | None 21 | 22 | Comments: 23 | 24 | Tested under Debian GNU/Hurd. 25 | 26 | Date: 27 | 28 | August 9, 2001 29 | -------------------------------------------------------------------------------- /config/irix/Makedefs: -------------------------------------------------------------------------------- 1 | # CC C compiler 2 | # CFLAGS flags for building C files 3 | # CFDYN additional flags for dynamic functions 4 | # RLINK flags for linking run-time system 5 | # RLIBS libraries to link with run-time system 6 | # TLIBS libraries to link for POSIX threads 7 | # XLIBS libraries to link for graphics 8 | 9 | CC = c89 10 | CFLAGS = -O -OPT:Olimit=5000 -woff 1048,1116,1188,1209,1548 11 | CFDYN = 12 | RLINK = 13 | RLIBS = -lm 14 | TLIBS = -lpthread 15 | XLIBS = -lXpm -lX11 16 | -------------------------------------------------------------------------------- /config/irix/define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Icon configuration file for Silicon Graphics Irix 3 | */ 4 | 5 | #define UNIX 1 6 | #define LoadFunc 7 | 8 | #define GammaCorrection 1.0 /* for old X11R5 systems */ 9 | -------------------------------------------------------------------------------- /config/irix/status: -------------------------------------------------------------------------------- 1 | System configuration: 2 | 3 | Silicon Graphics MIPS architecture running Irix v6.4 or newer 4 | 5 | Latest Icon version: 6 | 7 | Version 9.4.2 8 | 9 | Installer: 10 | 11 | Gregg Townsend 12 | Icon Project 13 | The University of Arizona 14 | 15 | Missing features: 16 | 17 | None 18 | 19 | Known bugs: 20 | 21 | None 22 | 23 | Comments: 24 | 25 | Tested on Silicon Graphics Indigo2 IMPACT running IRIX 6.5.7f. 26 | 27 | Date: 28 | 29 | March 26, 2003 30 | -------------------------------------------------------------------------------- /config/linux/Makedefs: -------------------------------------------------------------------------------- 1 | # CC C compiler 2 | # CFLAGS flags for building C files 3 | # CFDYN additional flags for dynamic functions 4 | # RLINK flags for linking run-time system 5 | # RLIBS libraries to link with run-time system 6 | # TLIBS libraries to link for POSIX threads 7 | # XLIBS libraries to link for graphics 8 | 9 | CC = gcc 10 | CFLAGS = -O 11 | CFDYN = -fPIC 12 | RLINK = -Wl,-E 13 | RLIBS = -lm -ldl 14 | TLIBS = -lpthread 15 | XLIBS = -lXpm -lX11 16 | -------------------------------------------------------------------------------- /config/linux/define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Icon configuration file for Linux 3 | */ 4 | 5 | #define UNIX 1 6 | #define LoadFunc 7 | -------------------------------------------------------------------------------- /config/linux_musl/Makedefs: -------------------------------------------------------------------------------- 1 | # CC C compiler 2 | # CFLAGS flags for building C files 3 | # CFDYN additional flags for dynamic functions 4 | # RLINK flags for linking run-time system 5 | # RLIBS libraries to link with run-time system 6 | # TLIBS libraries to link for POSIX threads 7 | # XLIBS libraries to link for graphics 8 | 9 | CC = gcc 10 | CFLAGS = -O -D_MUSL 11 | CFDYN = -fPIC 12 | RLINK = -Wl,-E 13 | RLIBS = -lm -ldl 14 | TLIBS = -lpthread 15 | XLIBS = -lXpm -lX11 16 | -------------------------------------------------------------------------------- /config/linux_musl/define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Icon configuration file for Linux with MUSL C library 3 | */ 4 | 5 | #define UNIX 1 6 | #define LoadFunc 7 | -------------------------------------------------------------------------------- /config/linux_musl/status: -------------------------------------------------------------------------------- 1 | System configuration: 2 | 3 | Linux using the MUSL C library 4 | 5 | Latest Icon version: 6 | 7 | Version 9.5.20g of July 24, 2020 8 | 9 | Installer: 10 | 11 | Arthur Eschenlauer 12 | 13 | Missing features: 14 | 15 | None 16 | 17 | Known bugs: 18 | 19 | None 20 | 21 | Comments: 22 | 23 | Created for use with Alpine Unix. 24 | 25 | Date: 26 | 27 | July 19, 2021 28 | -------------------------------------------------------------------------------- /config/mac386/Makedefs: -------------------------------------------------------------------------------- 1 | # CC C compiler 2 | # CFLAGS flags for building C files 3 | # CFDYN additional flags for dynamic functions 4 | # RLINK flags for linking run-time system 5 | # RLIBS libraries to link with run-time system 6 | # TLIBS libraries to link for POSIX threads 7 | # XLIBS libraries to link for graphics 8 | # SFLAGS flags for stripping iconx 9 | 10 | CC = cc -arch i386 11 | CFLAGS = -I /opt/X11/include 12 | CFDYN = 13 | RLINK = -dynamic 14 | RLIBS = -lm 15 | TLIBS = 16 | XLIBS = -L/usr/X11/lib -lXpm -lX11 17 | SFLAGS = -Sx 18 | -------------------------------------------------------------------------------- /config/mac386/define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Icon configuration file for Macintosh 3 | */ 4 | 5 | #define UNIX 1 6 | #define MACINTOSH 1 7 | #define LoadFunc 8 | 9 | #define NamedSemaphores /* unnamed sempahores not implemented by OS 10.6 */ 10 | -------------------------------------------------------------------------------- /config/mac386/status: -------------------------------------------------------------------------------- 1 | System configuration: 2 | 3 | 32-bit variant configuration for Intel-based Apple Macintosh. 4 | 5 | Latest Icon version: 6 | 7 | Version 9.5.1 8 | 9 | Installer: 10 | 11 | Gregg Townsend 12 | Icon Project 13 | The University of Arizona 14 | 15 | Missing features: 16 | 17 | None 18 | 19 | Known bugs: 20 | 21 | None 22 | 23 | Comments: 24 | 25 | This configuration forces a 32-bit build of Icon on a 64-bit 26 | Intel-based Macintosh computer. This is normally not needed and 27 | the standard "macintosh" configuration should be used instead. 28 | 29 | Tested with MacOS 10.6.2 (Snow Leopard), 30 | using Xcode 3.2.1 and GCC 4.2.1. 31 | 32 | Date: 33 | 34 | May 26, 2013 35 | -------------------------------------------------------------------------------- /config/macintosh/Makedefs: -------------------------------------------------------------------------------- 1 | # CC C compiler 2 | # CFLAGS flags for building C files 3 | # CFDYN additional flags for dynamic functions 4 | # RLINK flags for linking run-time system 5 | # RLIBS libraries to link with run-time system 6 | # TLIBS libraries to link for POSIX threads 7 | # XLIBS libraries to link for graphics 8 | # SFLAGS flags for stripping iconx 9 | 10 | CC = cc 11 | CFLAGS = -O -I /opt/X11/include 12 | CFDYN = 13 | RLINK = -dynamic 14 | RLIBS = -lm 15 | TLIBS = 16 | XLIBS = -L/opt/X11/lib -lXpm -lX11 17 | SFLAGS = -Sx 18 | -------------------------------------------------------------------------------- /config/macintosh/define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Icon configuration file for Macintosh 3 | */ 4 | 5 | #define UNIX 1 6 | #define MACINTOSH 1 7 | #define LoadFunc 8 | 9 | #define NamedSemaphores /* unnamed sempahores not implemented by OS 10.6 */ 10 | -------------------------------------------------------------------------------- /config/macintosh/status: -------------------------------------------------------------------------------- 1 | System configuration: 2 | 3 | Apple Macintosh running MacOS X 4 | 5 | Latest Icon version: 6 | 7 | Version 9.5.24b of November 19, 2024 8 | 9 | Installer: 10 | 11 | Gregg Townsend 12 | Icon Project 13 | The University of Arizona 14 | 15 | Missing features: 16 | 17 | None 18 | 19 | Known bugs: 20 | 21 | None 22 | 23 | Comments: 24 | 25 | Tested most recently with MacOS Sequoia 15.3.2 on an Apple M1 Mac Mini. 26 | 27 | See the special Macintosh page in the documentation directory. 28 | 29 | Icon runs on Darwin, which is (loosely speaking) the 30 | command-line-based Unix substructure of MacOS X. The 31 | Xcode Command Line Tools must be installed to build Icon. 32 | (A full Xcode installation is not required.) 33 | 34 | Date: 35 | 36 | March 17, 2025. 37 | -------------------------------------------------------------------------------- /config/posix/Makedefs: -------------------------------------------------------------------------------- 1 | # CC C compiler 2 | # CFLAGS flags for building C files 3 | # CFDYN additional flags for dynamic functions 4 | # RLINK flags for linking run-time system 5 | # RLIBS libraries to link with run-time system 6 | # TLIBS libraries to link for POSIX threads 7 | # XLIBS libraries to link for graphics 8 | 9 | CC = cc 10 | CFLAGS = -O 11 | CFDYN = 12 | RLINK = 13 | RLIBS = -lm 14 | TLIBS = -lpthread 15 | XLIBS = -L/usr/X11/lib -lXpm -lX11 16 | -------------------------------------------------------------------------------- /config/posix/define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Icon configuration file for generic POSIX system with X windows 3 | */ 4 | 5 | #define UNIX 1 6 | #define LoadFunc 7 | 8 | -------------------------------------------------------------------------------- /config/posix/status: -------------------------------------------------------------------------------- 1 | System configuration: 2 | 3 | Generic POSIX (Unix-like) system with X windows. 4 | 5 | Latest Icon version: 6 | 7 | Version 9.5.0 8 | 9 | Installer: 10 | 11 | Gregg Townsend 12 | Icon Project 13 | The University of Arizona 14 | 15 | Missing features: 16 | 17 | None 18 | 19 | Known bugs: 20 | 21 | May need some tweaking of Makedefs for any particular system. 22 | The file ipl/cfuncs/mklib.sh will probably also need editing. 23 | 24 | Comments: 25 | 26 | This configuration can be used as a starting point for new ports. 27 | 28 | Date: 29 | 30 | October 28, 2009 31 | -------------------------------------------------------------------------------- /config/solaris/Makedefs: -------------------------------------------------------------------------------- 1 | # CC C compiler 2 | # CFLAGS flags for building C files 3 | # CFDYN additional flags for dynamic functions 4 | # RLINK flags for linking run-time system 5 | # RLIBS libraries to link with run-time system 6 | # TLIBS libraries to link for POSIX threads 7 | # XLIBS libraries to link for graphics 8 | 9 | CC = gcc 10 | CFLAGS = 11 | CFDYN = -fPIC 12 | RLINK = 13 | RLIBS = -lm -ldl 14 | TLIBS = -lposix4 -lpthread 15 | XLIBS = -Xlinker -lXpm -lX11 16 | -------------------------------------------------------------------------------- /config/solaris/define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Icon configuration file for Sun Solaris using Gnu C compiler 3 | */ 4 | 5 | #define UNIX 1 6 | #define LoadFunc 7 | -------------------------------------------------------------------------------- /config/solaris/status: -------------------------------------------------------------------------------- 1 | System configuration: 2 | 3 | Sun Solaris using GNU C compiler 4 | 5 | Latest Icon version: 6 | 7 | Version 9.5.1 8 | 9 | Installer: 10 | 11 | Gregg Townsend 12 | Icon Project 13 | The University of Arizona 14 | 15 | Missing features: 16 | 17 | None 18 | 19 | Known bugs: 20 | 21 | None 22 | 23 | Comments: 24 | 25 | Tested on SPARC Solaris 10 (SunOS 5.10) with gcc version 4.2.2. 26 | 27 | Date: 28 | 29 | May 26, 2013 30 | -------------------------------------------------------------------------------- /config/solaris_sunc/Makedefs: -------------------------------------------------------------------------------- 1 | # CC C compiler 2 | # CFLAGS flags for building C files 3 | # CFDYN additional flags for dynamic functions 4 | # RLINK flags for linking run-time system 5 | # RLIBS libraries to link with run-time system 6 | # TLIBS libraries to link for POSIX threads 7 | # XLIBS libraries to link for graphics 8 | 9 | CC = cc 10 | CFLAGS = -O -w 11 | CFDYN = -KPIC 12 | RLINK = 13 | RLIBS = -lm -ldl 14 | TLIBS = -lposix4 -lpthread 15 | XLIBS = -lXpm -lX11 16 | -------------------------------------------------------------------------------- /config/solaris_sunc/define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Icon configuration file for Solaris 2.x with SunPro C compiler 3 | */ 4 | 5 | #define UNIX 1 6 | #define LoadFunc 7 | -------------------------------------------------------------------------------- /config/solaris_sunc/status: -------------------------------------------------------------------------------- 1 | System configuration: 2 | 3 | Sun Solaris 2.x with the Sun WorkShop compiler 4 | 5 | Latest Icon version: 6 | 7 | Version 9.5.1 8 | 9 | Installer: 10 | 11 | Gregg Townsend 12 | Icon Project 13 | The University of Arizona 14 | 15 | Missing features: 16 | 17 | None 18 | 19 | Known bugs: 20 | 21 | None 22 | 23 | Comments: 24 | 25 | Tested on SPARC Solaris 10 (SunOS 5.10) with Sun C 5.9. 26 | 27 | Date: 28 | 29 | May 26, 2013 30 | -------------------------------------------------------------------------------- /config/tru64/Makedefs: -------------------------------------------------------------------------------- 1 | # CC C compiler 2 | # CFLAGS flags for building C files 3 | # CFDYN additional flags for dynamic functions 4 | # RLINK flags for linking run-time system 5 | # RLIBS libraries to link with run-time system 6 | # TLIBS libraries to link for POSIX threads 7 | # XLIBS libraries to link for graphics 8 | 9 | CC = c89 10 | CFLAGS = -O 11 | CFDYN = 12 | RLINK = -oldstyle_liblookup 13 | RLIBS = -lm 14 | TLIBS = -lrt -lpthread 15 | XLIBS = -lXpm -lX11 16 | -------------------------------------------------------------------------------- /config/tru64/define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Icon configuration file for Dec Alpha running OSF (Digital Unix) 3 | */ 4 | 5 | /* standard Unix and C */ 6 | #define UNIX 1 7 | #define LoadFunc 8 | -------------------------------------------------------------------------------- /config/tru64/status: -------------------------------------------------------------------------------- 1 | System configuration: 2 | 3 | Compaq/Digital Alpha running Tru64, formerly Digital Unix or OSF/1 4 | 5 | Latest Icon version: 6 | 7 | Version 9.4.3 8 | 9 | Installer: 10 | 11 | Gregg Townsend 12 | Icon Project 13 | The University of Arizona 14 | 15 | Missing features: 16 | 17 | None 18 | 19 | Comments: 20 | 21 | Tested on: NekoTech "Jaguar" running Digital Unix 4.0B rev 564 22 | and Compaq AlphaStation 600 running Digital Unix 4.0F rev 1229. 23 | 24 | Date: 25 | 26 | October 5, 2005 27 | -------------------------------------------------------------------------------- /doc/blubordr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/doc/blubordr.gif -------------------------------------------------------------------------------- /doc/clnroff.sed: -------------------------------------------------------------------------------- 1 | # sed(1) directives for cleaning up nroff(1) formatted man page 2 | 3 | /^User Commands/d 4 | /^ICONT/d 5 | /^University/d 6 | s/.//g 7 | s/’/'/g 8 | 9 | -------------------------------------------------------------------------------- /doc/cube128.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/doc/cube128.gif -------------------------------------------------------------------------------- /doc/faqc.sed: -------------------------------------------------------------------------------- 1 | # <> 2 | 3 | # sed directives to regenerate "table of contents" from faq.htm 4 | # (the output of this must be hand-edited back into faq.htm) 5 | 6 | 7 | /

/s/.*

\(.*\)<\/H2>.*/

\1<\/STRONG>
/p 8 | 9 | /

YXY 5 | YX->YZ 6 | 2:ZX->XXZ 7 | 2:ZY->XXY 8 | X->a 9 | Y-> 10 | G:20 11 | -------------------------------------------------------------------------------- /ipl/data/abc.csg: -------------------------------------------------------------------------------- 1 | # a(n)b(n)c(n) 2 | # Salomaa, p. 11. 3 | # Attributed to M. Soittola. 4 | # 5 | X->abc 6 | X->aYbc 7 | Yb->bY 8 | Yc->Zbcc 9 | bZ->Zb 10 | aZ->aaY 11 | aZ->aa 12 | X:10 13 | -------------------------------------------------------------------------------- /ipl/data/abcd.csg: -------------------------------------------------------------------------------- 1 | # a(n)b(n)c(n)d(n) 2 | # Fu, p. 94-95. 3 | S->aAB 4 | A->aAC 5 | A->D 6 | Dc->cD 7 | Dd->dD 8 | DC->EC 9 | EC->Ed 10 | DB->FB 11 | Ed->Gd 12 | cG->Gc 13 | dG->Gd 14 | aG->abcD 15 | bG->bbcD 16 | dFB->dFd 17 | dFd->Fdd 18 | cF->Fc 19 | bF->bbc 20 | aF->ab 21 | bB->bcd 22 | S:5 23 | -------------------------------------------------------------------------------- /ipl/data/add.lbl: -------------------------------------------------------------------------------- 1 | #k 2 | First Address 3 | 4 | 80973-000 5 | # 6 | Second Address 7 | Somewhere, USA 09321 8 | # 9 | Third Address 10 | -- with no zipcode --- 11 | # 12 | Fourth Address 13 | P.O. Box 78321 14 | Nowhere 83211 15 | -------------------------------------------------------------------------------- /ipl/data/an2.csg: -------------------------------------------------------------------------------- 1 | # a(n(2)) 2 | # Salomma, pp. 12-13. Attributed to M. Soittola. 3 | # 4 | 2:G->a 5 | G->aXBZ 6 | 2:BZ->aa 7 | 2:Xa->aa 8 | 2:Ya->aa 9 | BZ->CYXZ 10 | XA->AYX 11 | YA->CYX 12 | XC->AY 13 | YC->CY 14 | aA->aXXYB 15 | BY->XD 16 | DY->YD 17 | DX->YB 18 | G:10 19 | -------------------------------------------------------------------------------- /ipl/data/bb3.tur: -------------------------------------------------------------------------------- 1 | # 3-state busy beaver 2 | 3 | 1. 1r2 1l3 4 | 2. 1l1 1r2 5 | 3. 1l2 1h0 6 | -------------------------------------------------------------------------------- /ipl/data/carroll.txt: -------------------------------------------------------------------------------- 1 | 'Twas brillig, and the slithy toves 2 | 3 | Did gyre and gimble in the wabe: 4 | 5 | All mimsy were the borogoves, 6 | 7 | And the mome raths outgrabe. 8 | -------------------------------------------------------------------------------- /ipl/data/cc.tur: -------------------------------------------------------------------------------- 1 | # castor citcuitus 2 | 3 | 1. 0r2 0l1 4 | 2. 1r3 0h0 5 | 3. 0l3 1r4 6 | 4. 0l4 1r5 7 | 5. 1l1 0l5 8 | -------------------------------------------------------------------------------- /ipl/data/cm.tur: -------------------------------------------------------------------------------- 1 | # castor ministerialis 2 | 3 | 1. 1r2 1r1 4 | 2. 1r3 0r5 5 | 3. 1l4 0r1 6 | 4. 1l2 1l4 7 | 5. 0h0 0r2 8 | -------------------------------------------------------------------------------- /ipl/data/colors.rsg: -------------------------------------------------------------------------------- 1 | ::=square|rectangle|trapezoid|circle|ellipse|triangle|ovoid 2 | ::=red|blue|green|yellow|purple|beige|lavender|pink|red-orange 3 | ::=small|tiny|large|humongous|mediocre|ridiculous|lonely|squamous 4 | ::=the|a|every|each 5 | ::=chases|squashes|strokes|drop kicks|embraces|admires|tickles 6 | ::=very|slightly|somewhat|hardly|nearly|barely 7 | ::= 8 | ::= . 9 | 10 10 | -------------------------------------------------------------------------------- /ipl/data/dickens.txt: -------------------------------------------------------------------------------- 1 | It was the best of times, it was the worst of times, it was the age of 2 | wisdom, it was the age of foolishness, it was the epoch of belief, it was 3 | the epoch of incredulity, it was the season of Light, it was 4 | the season of Darkness, it was the spring of hope, it was the winter 5 | of dispair, we had everything before us, we had nothing before us, we 6 | were all going direct to Heaven, we were all going direct the other 7 | way -- in short, the period was so far like the present period, that some 8 | of its noisiest authorities insisted on its being received, for good or 9 | for evil, in the superlative degree of comparison only. 10 | -------------------------------------------------------------------------------- /ipl/data/egg.krs: -------------------------------------------------------------------------------- 1 | and 2 | eggplants 3 | elephants 4 | purple 5 | -------------------------------------------------------------------------------- /ipl/data/exp.rsg: -------------------------------------------------------------------------------- 1 | ::=|||+ 2 | ::=||* 3 | ::=<'xyz'>|<'0123'>|() 4 | 30 5 | -------------------------------------------------------------------------------- /ipl/data/farber.sen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/ipl/data/farber.sen -------------------------------------------------------------------------------- /ipl/data/gilbert.txt: -------------------------------------------------------------------------------- 1 | My object all sublime 2 | I shall achieve in time -- 3 | To let the punishment fit the crime -- 4 | The punishment fit the crime; 5 | And make each prisoner pent 6 | Unwillingly represent 7 | A source of innocent merriment! 8 | Of innocent merriment! 9 | -------------------------------------------------------------------------------- /ipl/data/header: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: 4 | # 5 | # Subject: 6 | # 7 | # Author: 8 | # 9 | # Date: 10 | # 11 | ############################################################################ 12 | # 13 | # Requires: 14 | # 15 | ############################################################################ 16 | # 17 | # Links: 18 | # 19 | ############################################################################ 20 | -------------------------------------------------------------------------------- /ipl/data/noci.wrd: -------------------------------------------------------------------------------- 1 | anociassociation 2 | chronocinematography 3 | Cyanocitta 4 | genocidal 5 | genocide 6 | gymnocidium 7 | monocilated 8 | monocilia 9 | monociliate 10 | monociliated 11 | monociliceae 12 | monocite 13 | Noci 14 | nociassociation 15 | nocible 16 | nociceptive 17 | nociceptor 18 | nocifensor 19 | nociferous 20 | nocin 21 | nociperception 22 | nociperceptive 23 | nocite 24 | nocive 25 | nocivous 26 | Parthenocissus 27 | phonocinematograph 28 | pneumonocirrhosis 29 | trypanocidal 30 | trypanocide 31 | uranocircite 32 | zonociliate 33 | Nocine 34 | nocite 35 | -------------------------------------------------------------------------------- /ipl/data/poe.txt: -------------------------------------------------------------------------------- 1 | On the Future!-how it tells 2 | Of the rapture that impells 3 | To the swinging and the ringing 4 | Of the bells, bells, bells- 5 | Of the bells, bells, bells, bells, 6 | Bells, bells, bells- 7 | To the rhyming and the chiming of the bells! 8 | -------------------------------------------------------------------------------- /ipl/data/poem.rsg: -------------------------------------------------------------------------------- 1 | ::= ; 2 | ::= , . 3 | ::= . 4 | ::= 5 | ::=he|she|the shadowy figure|the boy|a child 6 | ::=outlines|casts toward|stares at|captures|damns 7 | ::=lingers|pauses|reflects|alights|hesitates|turns away|returns|kneels|stares 8 | ::=and |but |and |while 9 | ::=slowly|silently|darkly|with fear|expectantly|fearfully 10 | ::=waiting|pointing|breathing 11 | ::=
12 |
::=a|the 13 | ::=sky|void|abyss|star|darkness|lake|moon|cloud 14 | ::=while|as|momentarily|frozen, 15 | 10 16 | -------------------------------------------------------------------------------- /ipl/data/pt1.gmr: -------------------------------------------------------------------------------- 1 | S -> A # 2 | A -> a B a 3 | A -> EPSILON 4 | B -> a b A 5 | B -> c 6 | -------------------------------------------------------------------------------- /ipl/data/pt2.gmr: -------------------------------------------------------------------------------- 1 | A -> ( B ) 2 | A -> B , C 3 | A -> a 4 | B -> ( C ) 5 | B -> C , A 6 | B -> b 7 | C -> ( A ) 8 | C -> A , B 9 | C -> c 10 | -------------------------------------------------------------------------------- /ipl/data/pt3.gmr: -------------------------------------------------------------------------------- 1 | S -> ( S ) 2 | S -> ( ) 3 | -------------------------------------------------------------------------------- /ipl/data/pt4.gmr: -------------------------------------------------------------------------------- 1 | S -> C C 2 | C -> c C 3 | C -> d 4 | -------------------------------------------------------------------------------- /ipl/data/pt5.gmr: -------------------------------------------------------------------------------- 1 | s -> stmt 2 | s -> ifstmt 3 | ifstmt -> if exp then s 4 | ifstmt -> if exp then s else s 5 | -------------------------------------------------------------------------------- /ipl/data/pt6.gmr: -------------------------------------------------------------------------------- 1 | program -> PROGRAM ID ; declarations compound_stmt . 2 | declarations -> declarations VAR id_list : INTEGER ; 3 | declarations -> EPSILON 4 | id_list -> ID 5 | id_list -> id_list , ID 6 | compound_stmt -> BEGIN optional_stmts END 7 | optional_stmts -> stmt_list 8 | optional_stmts -> EPSILON 9 | stmt_list -> stmt 10 | stmt_list -> stmt_list ; stmt 11 | stmt -> ID := simple_expression 12 | stmt -> compound_stmt 13 | stmt -> IF expression THEN stmt ELSE stmt 14 | stmt -> IF expression THEN stmt 15 | expression -> simple_expression 16 | expression -> simple_expression RELOP simple_expression 17 | simple_expression -> term 18 | simple_expression -> simple_expression ADDOP term 19 | term -> factor 20 | term -> term MULOP factor 21 | factor -> ID 22 | factor -> INTCON 23 | factor -> ( expression ) 24 | -------------------------------------------------------------------------------- /ipl/data/sample.grh: -------------------------------------------------------------------------------- 1 | Tucson Phoenix Bisbee Douglas Flagstaff 2 | Tucson->Phoenix 3 | Tucson->Bisbee 4 | Bisbee->Bisbee 5 | Bisbee->Douglas 6 | Douglas->Phoenix 7 | Douglas->Tucson 8 | -------------------------------------------------------------------------------- /ipl/data/sen.rsg: -------------------------------------------------------------------------------- 1 | ::= . 2 | ::=| 3 | ::= 4 | ::= 5 | ::=
|
6 | ::=||| 7 |
::=a|the 8 | ::=black|red|blue|large|hot|choclate|hairy|yawning\ 9 | |bleary|checkered|finite|twisted|frumpy 10 | ::=very|rather|possibly|frightenly|charmingly\ 11 | |willingly|singularly|refreshingly 12 | ::=eats|opens|flies|panics|paints|emebllishes 13 | ::=molds|burns|gapes|sails|poses|smokes 14 | ::=hatbox|zepplin|totilla|cupcake|gorge|sculptor|ashtray\ 15 | |cloud|corkscrew|barrel|landslide|jalopy 16 | 10 17 | -------------------------------------------------------------------------------- /ipl/data/skeleton.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: 4 | # 5 | # Subject: Program 6 | # 7 | # Author: 8 | # 9 | # Date: 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # 18 | # 19 | ############################################################################ 20 | # 21 | # Requires: 22 | # 23 | ############################################################################ 24 | # 25 | # Links: 26 | # 27 | ############################################################################ 28 | 29 | procedure main() 30 | 31 | end 32 | -------------------------------------------------------------------------------- /ipl/data/skelopt.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: 4 | # 5 | # Subject: Program 6 | # 7 | # Author: 8 | # 9 | # Date: 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # 18 | # 19 | ############################################################################ 20 | # 21 | # Requires: 22 | # 23 | ############################################################################ 24 | # 25 | # Links: options 26 | # 27 | ############################################################################ 28 | 29 | link options 30 | 31 | procedure main(args) 32 | local opts 33 | 34 | opts := options(args, "") 35 | 36 | end 37 | -------------------------------------------------------------------------------- /ipl/data/skelproc.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: 4 | # 5 | # Subject: Procedure 6 | # 7 | # Author: 8 | # 9 | # Date: 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # 18 | # 19 | ############################################################################ 20 | # 21 | # Requires: 22 | # 23 | ############################################################################ 24 | # 25 | # Links: 26 | # 27 | ############################################################################ 28 | 29 | -------------------------------------------------------------------------------- /ipl/data/spencer.txt: -------------------------------------------------------------------------------- 1 | Let us pass to the secondary evolution considered in itself. It 2 | involves two great features, -- differentiation and the increase of 3 | definiteness through segregation. The differentiation is a cumulative 4 | process, due to the fact that a plastic body keeps the traces of what 5 | has happened to it, and so constantly prepares a basis for new 6 | varieties of effects to be produced upon its various parts. 7 | The segregation is due to the sorting types of forces, such as 8 | were exemplified in our summary. 9 | -------------------------------------------------------------------------------- /ipl/docs/README: -------------------------------------------------------------------------------- 1 | address.txt documentation for address procedures 2 | hebcalen.hlp documentation for hebcalen.icn 3 | hebcalpi.hlp documentation for hebcalpi.icn 4 | iconmake.txt make skeleton for Icon 5 | ipp.txt supplementary documentation for ipp.icn 6 | mr.man manual page for mr.icn 7 | post.1 manual page source for post.icn 8 | polywalk.txt description of polynomial programs 9 | pt.man manual page for pt.icn 10 | -------------------------------------------------------------------------------- /ipl/gdata/README: -------------------------------------------------------------------------------- 1 | *.gif GIF image files 2 | *.xpm X Pixmap image files 3 | *.ims image strings in Icon code format 4 | *.lch data for gpacks/tiger/tgrmap.icn 5 | *.pts data for facebend.icn 6 | clr.pak "pack" containing Icon's color palettes 7 | gpxtest.gif GIF image from gpxtest.icn 8 | gxplor.dat test script for gxplor.icn 9 | iml.pak image strings in "pack" format 10 | linden.dat input to linden.icn 11 | uix.dat data for testing XIB-to-VIB conversion 12 | vibapp.icn sample VIB application 13 | xibapp.icn sample XIB application 14 | xnames.ed ed(1) script to convert 8.10 function names to 9.0 15 | -------------------------------------------------------------------------------- /ipl/gdata/babbage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/ipl/gdata/babbage.gif -------------------------------------------------------------------------------- /ipl/gdata/brennan.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/ipl/gdata/brennan.gif -------------------------------------------------------------------------------- /ipl/gdata/gpxtest.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/ipl/gdata/gpxtest.gif -------------------------------------------------------------------------------- /ipl/gdata/gxplor.dat: -------------------------------------------------------------------------------- 1 | fg 2 | fg blue 3 | linewidth 72 4 | drawline 12 20 55 73 5 | erasearea 6 | fillarea 7 | fillrectangle 8 | pattern 9 | pattern grid 10 | 11 | 12 | fillstyle 13 | fillstyle opaque 14 | fillstyle opaquepatterned 15 | 16 | clip 50 50 400 200 17 | fillrectangle 18 | zoom 40 40 100 100 300 50 200 200 19 | -------------------------------------------------------------------------------- /ipl/gdata/pyramid.ims: -------------------------------------------------------------------------------- 1 | # a pyramid (actually a tetrahedron) constructed by hand 2 | "16,g16, FFFFFFF8CFFFFFFF FFFFFFA79DFFFFFF_ 3 | FFFFFC769ADFFFFF FFFFF86699AEFFFF FFFFB667999BFFFF_ 4 | FFFF76679999CFFF FFFA666799999CFF FFD66667999999DF_ 5 | FE766668999999AE FA66666899999999 C6666668999999BE_ 6 | 8666666899999CFF FB666669999ADFFF FFD7666999CFFFFF_ 7 | FFFE96699CFFFFFF FFFFFB7BFFFFFFFF FFFFFFBFFFFFFFFF" 8 | -------------------------------------------------------------------------------- /ipl/gdata/sphere16.ims: -------------------------------------------------------------------------------- 1 | # a smooth-shaded dark gray sphere 2 | "16,g16,_ 3 | FFFFB98788AEFFFF_ 4 | FFD865554446AFFF_ 5 | FD856886544339FF_ 6 | E8579BA9643323AF_ 7 | A569DECA7433215E_ 8 | 7569CDB86433211A_ 9 | 5579AA9643222108_ 10 | 4456776533221007_ 11 | 4444443332210007_ 12 | 4333333222100008_ 13 | 533322221100000A_ 14 | 822222111000003D_ 15 | D41111100000019F_ 16 | FA200000000018EF_ 17 | FFA4000000028EFF_ 18 | FFFD9532248BFFFF" 19 | -------------------------------------------------------------------------------- /ipl/gdata/vneumann.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/ipl/gdata/vneumann.gif -------------------------------------------------------------------------------- /ipl/gdocs/README: -------------------------------------------------------------------------------- 1 | gtrace.txt documentation for graphic traces 2 | -------------------------------------------------------------------------------- /ipl/gpacks/README: -------------------------------------------------------------------------------- 1 | carpets numerical carpets 2 | drawtree tree-drawing package 3 | ged text editor 4 | htetris Tetris game 5 | tiger map drawing from Census TIGER data 6 | vib graphics interface builder 7 | weaving programs and procedures related to weaving 8 | xtiles game 9 | -------------------------------------------------------------------------------- /ipl/gpacks/carpets/Makefile: -------------------------------------------------------------------------------- 1 | # note that only carport is built here 2 | # carplay is built by the carport program after generating carpincl.icn 3 | 4 | carport: 5 | icont -usc carputil carprec 6 | icont -us carport 7 | 8 | 9 | # build executable and copy to ../../iexe 10 | # (nothing done in this case because the executable doesn't stand alone) 11 | Iexe: 12 | 13 | Clean: 14 | rm -f carport carplay carpincl.icn *.u[12] 15 | -------------------------------------------------------------------------------- /ipl/gpacks/carpets/README: -------------------------------------------------------------------------------- 1 | Programs for exploring numerical carpets. 2 | See issue 45 of the Icon Analyst. 3 | -------------------------------------------------------------------------------- /ipl/gpacks/carpets/carprec.icn: -------------------------------------------------------------------------------- 1 | 2 | record carprec( 3 | Name, 4 | Width, 5 | Height, 6 | Modulus, 7 | Colors, 8 | Hexpr, 9 | Vexpr, 10 | Nexpr, 11 | Symbols, 12 | Comments 13 | ) 14 | -------------------------------------------------------------------------------- /ipl/gpacks/drawtree/Makefile: -------------------------------------------------------------------------------- 1 | Build drawtree: 2 | icont -s -c -u draw_crc 3 | icont -s -c -u data 4 | icont -s -c -u draw_sqr 5 | icont -s -c -u draw_rec 6 | icont -s -c -u draw_box 7 | icont -s -c -u draw_bar 8 | icont -s -c -u clr_list 9 | icont -s -u drawtree 10 | 11 | Iexe: drawtree 12 | cp drawtree ../../iexe/ 13 | 14 | Clean: 15 | rm -f *.u* drawtree 16 | -------------------------------------------------------------------------------- /ipl/gpacks/drawtree/data1.exm: -------------------------------------------------------------------------------- 1 | animals[mammals[land[]water[]]reptile[]] 2 | -------------------------------------------------------------------------------- /ipl/gpacks/drawtree/data2.exm: -------------------------------------------------------------------------------- 1 | animals[mammals[land[small[pets[cats[bad[]good[]okay[]]dogs[hound[black[dark[]middle[]light[]]brown[]] 2 | germanshepard[baby[new[]old[]]]]]wild[]]large[pets[horse[brown[]]cow[milk[]cattle[]]]wild[]]]water[small[] 3 | large[]]]reptile[frog[big[]]toad[ugly[]cute[]]]insects[good[ugly[]nice[]]bad[]small[]big[]]] 4 | 5 | -------------------------------------------------------------------------------- /ipl/gpacks/ged/Makefile: -------------------------------------------------------------------------------- 1 | ICONT=icont 2 | IFLAGS=-us 3 | 4 | ged: ged.icn control.icn textedit.icn 5 | $(ICONT) $(IFLAGS) ged control textedit 6 | 7 | Iexe: ged 8 | cp ged ../../iexe/ 9 | 10 | Clean: 11 | rm -f ged *.u? 12 | -------------------------------------------------------------------------------- /ipl/gpacks/htetris/Makefile: -------------------------------------------------------------------------------- 1 | htetris: 2 | icont -s htetris 3 | 4 | Iexe: htetris 5 | cp htetris ../../iexe/ 6 | 7 | Clean: 8 | rm -f htetris 9 | -------------------------------------------------------------------------------- /ipl/gpacks/htetris/help.icn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/ipl/gpacks/htetris/help.icn -------------------------------------------------------------------------------- /ipl/gpacks/htetris/highscore.dat: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /ipl/gpacks/tiger/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for TIGER mapping programs 2 | 3 | 4 | IC = icont 5 | IFLAGS = -us 6 | DEST = /unspecified/destination/ 7 | 8 | PROGS = tgrprep tgrlink tgrmap tgrmerge tgrquant tgrtrack 9 | SCRIPTS = tgrsort tgrstats tgrclean 10 | 11 | 12 | .SUFFIXES: .icn 13 | .icn: ; $(IC) $(IFLAGS) $< 14 | 15 | 16 | 17 | default: $(PROGS) 18 | 19 | 20 | test: 21 | 22 | 23 | install: $(PROGS) $(SCRIPTS) 24 | cp $(PROGS) $(SCRIPTS) $(DEST) 25 | 26 | Iexe: 27 | $(MAKE) DEST=../../iexe install 28 | 29 | 30 | clean Clean: 31 | rm -f $(PROGS) *.u[12] *.out* 32 | -------------------------------------------------------------------------------- /ipl/gpacks/tiger/tgrclean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # tgrclean [file] -- remove details from line chain file 4 | # 5 | # Filters a line chain file to remove pipelines, powerlines, and minor 6 | # boundaries, except when any of these coincides with a major boundary line. 7 | # The effect of this is to produce a smaller file with less detail. 8 | 9 | sed ' 10 | /^[CEF]..0/d 11 | ' $* 12 | -------------------------------------------------------------------------------- /ipl/gpacks/tiger/tgrsort: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # tgrsort [file] -- sort TIGER line chains 4 | # 5 | # Sort keys are: 6 | # 7 | # 1. CFCC feature class, in this order: 8 | # boundary 9 | # water 10 | # other topographic feature (rare) 11 | # road 12 | # railroad 13 | # pipeline, power line, etc. 14 | # landmark 15 | # unclassified 16 | # 17 | # 2. Major category, largest (least significant) first 18 | # 19 | # The feature class and category sorting is chosen so that more important 20 | # chains are drawn later, obscuring lesser chains, instead of the reverse. 21 | # 22 | # Note that this sorting can reverse the positions of the first two lines 23 | # of the file (the min/max lines), but tgrmap.icn can handle that. 24 | 25 | TR1=FHEABCDX 26 | TR2=JKLMNPQR 27 | 28 | cat $1 | 29 | tr $TR1 $TR2 | 30 | sort -t: -k 1.1,1.1 -k 1.2,1.3r -k 1.4 | 31 | tr $TR2 $TR1 32 | -------------------------------------------------------------------------------- /ipl/gpacks/tiger/tgrstats: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # tgrstats [file...] -- report counts by CFCC code from .lch files 4 | 5 | cut -c1-3 $* | sort | uniq -c 6 | -------------------------------------------------------------------------------- /ipl/gpacks/tiger/tgrstrip: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # tgrstrip [file] -- remove details from line chain file 4 | # 5 | # Filters a line chain file to remove hydrology (water), pipelines, 6 | # powerlines, and minor roads, except when any of these coincides 7 | # with a major boundary line. The effect of this is to produce a 8 | # much smaller file with less detail. 9 | 10 | sed ' 11 | /^[CEFH]..0/d 12 | /^A[4-9].0/d 13 | ' $* 14 | -------------------------------------------------------------------------------- /ipl/gpacks/vib/.gitignore: -------------------------------------------------------------------------------- 1 | *.u? 2 | vib 3 | -------------------------------------------------------------------------------- /ipl/gpacks/vib/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for vib, the Visual Interface Builder 2 | 3 | ICONT = icont 4 | IFLAGS = -us 5 | ITRAN = $(ICONT) $(IFLAGS) 6 | 7 | OBJ = vib.u2 vibbttn.u2 vibedit.u2 vibfile.u2 vibglbl.u2 \ 8 | viblabel.u2 vibline.u2 viblist.u2 vibmenu.u2 vibradio.u2 \ 9 | vibrect.u2 vibsizer.u2 vibslidr.u2 vibtalk.u2 vibtext.u2 10 | 11 | .SUFFIXES: .icn .u2 .gif .ps 12 | 13 | .icn.u2: ; $(ITRAN) -c $< 14 | .icn: ; $(ITRAN) $< 15 | 16 | .gif.ps: 17 | giftoppm $< | ppmtopgm | pnmtops -scale .75 >$@ 18 | 19 | vib: $(OBJ) 20 | $(ITRAN) -o vib $(OBJ) 21 | 22 | $(OBJ): vibdefn.icn 23 | 24 | 25 | ipd doc: ipd265.ps 26 | 27 | ipd265.ps: ipd265.bibl fig1.ps fig2.ps 28 | bib -t stdn -p /r/che/usr/ralph/docs/reg.index ipd265.ps 30 | 31 | Iexe: vib 32 | cp vib ../../iexe/ 33 | 34 | clean Clean: 35 | rm -f vib *.ps *.u[12] app vibpro* core busy dlog 36 | -------------------------------------------------------------------------------- /ipl/gpacks/weaving/Makefile: -------------------------------------------------------------------------------- 1 | # The programs listed in this Makefile (there are more in the 2 | # directory) are those that are not labeled AD HOC that have 3 | # been verified to build cleanly. 4 | 5 | 6 | PROCS = cells.u2 tdialog.u2 tieutils.u2 tpath.u2 \ 7 | weavegif.u2 weavutil.u2 wifcvt.u2 8 | 9 | PROGS = comb draw2gmr drawdown drawup gif2geom gif2html heddle htweav \ 10 | lindpath mtrxedit pfd2gif pfd2gmr pfd2ill pfd2wif plexity randweav \ 11 | seqdraft shadow shadpapr showrav tieimage unravel wallpapr weaver wif2pfd 12 | 13 | 14 | IC = icont 15 | IFLAGS = -us 16 | 17 | .SUFFIXES: .icn .u2 18 | .icn.u2: ; $(IC) $(IFLAGS) -c $< 19 | .icn: ; $(IC) $(IFLAGS) $< 20 | 21 | 22 | all: $(PROGS) 23 | 24 | $(PROGS): $(PROCS) 25 | 26 | Iexe: $(PROGS) 27 | cp $(PROGS) ../../iexe/ 28 | 29 | clean Clean: 30 | rm -f $(PROGS) *.u? 31 | -------------------------------------------------------------------------------- /ipl/gpacks/weaving/README: -------------------------------------------------------------------------------- 1 | This package contains programs related to weaving, and goes 2 | along with the articles in the Icon Analyst on the subject. 3 | 4 | The files here mostly are works in progress. 5 | -------------------------------------------------------------------------------- /ipl/gpacks/weaving/clearpane.icn: -------------------------------------------------------------------------------- 1 | 2 | procedure clear_pane(win, n, m, size) 3 | local x, y, width, height, save_fg 4 | 5 | width := n * size + 1 6 | height := m * size + 1 7 | 8 | save_fg := Fg(win) 9 | 10 | Fg(win, "black") 11 | 12 | every x := 0 to width by size do 13 | DrawLine(win, x, 0, x, height) 14 | 15 | every y := 0 to height by size do 16 | DrawLine(win, 0, y, width, y) 17 | 18 | Fg(win, save_fg) 19 | 20 | return 21 | 22 | end 23 | -------------------------------------------------------------------------------- /ipl/gpacks/weaving/expand.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: expand.icn 4 | # 5 | # Subject: Program to expand pattern forms 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: June 26, 1998 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # AD HOC. 18 | # 19 | ############################################################################ 20 | # 21 | # Links: expander 22 | # 23 | ############################################################################ 24 | 25 | link expander 26 | 27 | procedure main() 28 | 29 | while write(pfl2str(read(), 8)) 30 | 31 | end 32 | -------------------------------------------------------------------------------- /ipl/gpacks/weaving/fill.icn: -------------------------------------------------------------------------------- 1 | 2 | procedure fillcell(win, n, m, color) 3 | local save_fg 4 | 5 | save_fg := Fg(win) 6 | Fg(win, color) 7 | 8 | FillRectangle(win, (n - 1) * cellsize, (m - 1) * cellsize, cellsize, 9 | cellsize) 10 | 11 | Fg(win, save_fg) 12 | 13 | return 14 | 15 | end 16 | -------------------------------------------------------------------------------- /ipl/gpacks/weaving/htmtail.icn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ipl/gpacks/weaving/hypo.icn: -------------------------------------------------------------------------------- 1 | procedure main() 2 | 3 | every m := 2 to 5 do 4 | every k := 2 to 5 do 5 | write("m=", m, " k=", k, " n=", compute(m, k)) 6 | 7 | end 8 | 9 | procedure compute(m, k) 10 | 11 | return (2 ^ ((m ^ 2) - 3)) * (k ^ 3) 12 | 13 | end 14 | -------------------------------------------------------------------------------- /ipl/gpacks/weaving/testdraw.icn: -------------------------------------------------------------------------------- 1 | link wopen 2 | 3 | procedure main() 4 | 5 | ims := read() 6 | 7 | ims ? { 8 | size := tab(upto(',')) 9 | } 10 | WOpen("size=" || size || "," || size) | stop("*** cannot open file") 11 | 12 | DrawImage(0, 0, ims) | stop("*** DrawImage() failed") 13 | 14 | WriteImage("testscan.gif") 15 | 16 | ZDone() 17 | 18 | end 19 | -------------------------------------------------------------------------------- /ipl/gpacks/weaving/thmtail.icn: -------------------------------------------------------------------------------- 1 | tail := [ 2 | "\t\t", 3 | "\t", 4 | "", 5 | "" 6 | ] 7 | -------------------------------------------------------------------------------- /ipl/gpacks/weaving/weavdefs.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: weavdefs.icn 4 | # 5 | # Subject: Definitions for weaving applications 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: May 25, 1999 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # These definitions are used in some weaving programs. 18 | # 19 | ############################################################################ 20 | 21 | $define C1Ex "!#$%&'()*+,-./:;<=>?@[]^`{|}" # special characters in c1 22 | $define C1In &cset[162+:28] # safe replacements 23 | 24 | $define Mask ("123456789" || &letters || &cset[162:-1]) # NEEDS FIXING 25 | -------------------------------------------------------------------------------- /ipl/gpacks/weaving/wvptempl.icn: -------------------------------------------------------------------------------- 1 | $define Repeat 2 | $define Reflect 3 | link seqfncs 4 | link strings 5 | $define Comments "Monday, October 26, 1998 2:12 pm" 6 | $define Name "test37" 7 | $define Palette "c1" 8 | $define WarpColors (ExtendSeq{S,128}) 9 | $define WeftColors (Reverse{!"WarpColors",}) 10 | $define Tieup "1000000001000000001000000001000000001000000001000000001000000001" 11 | $define Width (128) 12 | $define Height (Width) 13 | $define Modulus (8) 14 | $define Threading (ExtendSeq{P | V | C,128}) 15 | $define Treadling (ExtendSeq{M | P | M,128}) 16 | $define C (repl(!chaosseq() \ 16, ?10)) 17 | $define F (!fibseq() \ 16) 18 | $define M (repl(!multiseq(1,3,1) \ 16, ?10)) 19 | $define P (repl(!primeseq() \ 16, ?10)) 20 | $define R (!meander("ABCD",3)) 21 | $define S (repl(!meander("DHM", 2), ?7)) 22 | $define V (repl(!versumseq() \ 16, ?4)) 23 | 24 | -------------------------------------------------------------------------------- /ipl/gpacks/xtiles/Makefile: -------------------------------------------------------------------------------- 1 | SRC = xtiles.icn smiley1.icn smiley2.icn smiley3.icn 2 | 3 | xtiles: $(SRC) 4 | icont -s xtiles.icn 5 | 6 | Iexe: xtiles 7 | cp xtiles ../../iexe/ 8 | 9 | Clean: 10 | rm -f xtiles *.u[12] 11 | -------------------------------------------------------------------------------- /ipl/gpacks/xtiles/convert.icn: -------------------------------------------------------------------------------- 1 | link graphics 2 | 3 | procedure nextpixel(w) 4 | suspend PaletteKey(c1, Pixel(w)) 5 | end 6 | 7 | procedure main(L) 8 | WOpen("image="||L[1], "gamma=1.0") | die("no image ?") 9 | writes("\"") 10 | g := create nextpixel(&window) 11 | every 1 to WAttrib("height") do 12 | every (| writes(@g) \ WAttrib(&window, "width")) | write("_") 13 | write("\"") 14 | end 15 | 16 | -------------------------------------------------------------------------------- /ipl/gpacks/xtiles/smiley3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/ipl/gpacks/xtiles/smiley3.gif -------------------------------------------------------------------------------- /ipl/gprocs/dialogs.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: dialogs.icn 4 | # 5 | # Subject: Declaration to link to dialog 6 | # 7 | # Author: Gregg M. Townsend 8 | # 9 | # Date: November 4, 1995 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # compatibility file 18 | # 19 | ############################################################################ 20 | 21 | link dialog 22 | -------------------------------------------------------------------------------- /ipl/gprocs/distance.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: distance.icn 4 | # 5 | # Subject: Procedure to compute distance in n-dimensions 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: January 3, 1994 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # distance(d1, d2, d3, ...) returns the distance between points in n-space 18 | # distances d1, d2, d3, ... from the origin. 19 | # 20 | ############################################################################ 21 | 22 | procedure distance(d[]) 23 | local sum 24 | 25 | sum := 0 26 | 27 | every sum +:= !d ^ 2 28 | 29 | return sqrt(sum) 30 | 31 | end 32 | -------------------------------------------------------------------------------- /ipl/gprocs/imutils.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: imutils.icn 4 | # 5 | # Subject: Declarations to link graphics utilities 6 | # 7 | # Author: Gregg M. Townsend 8 | # 9 | # Date: October 11, 1994 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | 17 | link imscolor 18 | link color 19 | link gpxop 20 | link gpxlib 21 | link wopen 22 | -------------------------------------------------------------------------------- /ipl/gprocs/lindrec.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: lindrec.icn 4 | # 5 | # Subject: Declarations for L-systems 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: August 18, 1994 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # These declarations are provided for representing Lindenmayer systems 18 | # as records. 19 | # 20 | ############################################################################ 21 | 22 | record lsys_0l(axiom, rewrite, gener, angle, length, x, y, color) 23 | -------------------------------------------------------------------------------- /ipl/gprocs/vidgets.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: vidgets.icn 4 | # 5 | # Subject: Procedures for vidgets 6 | # 7 | # Author: Jon Lipp 8 | # 9 | # Date: September 17, 1997 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # Links to basic vidget files needed to use the library. 18 | # 19 | ############################################################################ 20 | 21 | link graphics 22 | link vcoupler 23 | link vframe 24 | link viface 25 | link vlist 26 | link vmenu 27 | link vpane 28 | link vstd 29 | -------------------------------------------------------------------------------- /ipl/gprocs/xcolor.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: xcolor.icn 4 | # 5 | # Subject: Declaration to link color 6 | # 7 | # Author: Gregg M. Townsend 8 | # 9 | # Date: June 9, 1994 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # compatibility file 18 | # 19 | ############################################################################ 20 | 21 | link color 22 | -------------------------------------------------------------------------------- /ipl/gprocs/xio.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: xio.icn 4 | # 5 | # Subject: Declarations to link window I/O 6 | # 7 | # Author: Gregg M. Townsend 8 | # 9 | # Date: June 9, 1994 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # compatibility file 18 | # 19 | ############################################################################ 20 | 21 | link wopen 22 | link window 23 | -------------------------------------------------------------------------------- /ipl/gprocs/xplane.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: xplane.icn 4 | # 5 | # Subject: Declaration to link bitplane 6 | # 7 | # Author: Gregg M. Townsend 8 | # 9 | # Date: June 9, 1994 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # compatibility file 18 | # 19 | ############################################################################ 20 | 21 | link bitplane 22 | -------------------------------------------------------------------------------- /ipl/gprocs/xputpixl.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: xputpixl.icn 4 | # 5 | # Subject: Declaration to link putpixel 6 | # 7 | # Author: Gregg M. Townsend 8 | # 9 | # Date: June 9, 1994 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # compatibility file 18 | # 19 | ############################################################################ 20 | 21 | link putpixel 22 | -------------------------------------------------------------------------------- /ipl/gprocs/xqueue.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: xqueue.icn 4 | # 5 | # Subject: Declaration to link enqueue 6 | # 7 | # Author: Gregg M. Townsend 8 | # 9 | # Date: June 9, 1994 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # compatibility file 18 | # 19 | ############################################################################ 20 | 21 | link enqueue 22 | -------------------------------------------------------------------------------- /ipl/incl/lshade.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: lshade.icn 4 | # 5 | # Subject: Definitions for VRML 1.0 ornament 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: July 27, 1997 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # This VRML object is a kind of lampshade. 18 | # 19 | ############################################################################ 20 | 21 | Separator([ #. VRML 1.0 lampshade 22 | Cone(10.0, 1.0), 23 | Cone(9.0, 2.0), 24 | Cone(8.0, 3.0), 25 | Cone(7.0, 4.0), 26 | Cone(6.0, 5.0), 27 | Cone(5.0, 6.0), 28 | Cone(4.0, 7.0) 29 | ]) 30 | 31 | -------------------------------------------------------------------------------- /ipl/packs/README: -------------------------------------------------------------------------------- 1 | Contributed packages distributed with Icon: 2 | 3 | euler Euler compiler and interpreter 4 | icondb loadable C function for access to SQL database 5 | ibpag2 LR-based parser generator 6 | idol Idol; object-oriented Icon written in Icon 7 | itweak interactive debugger 8 | loadfunc C functions loaded dynamically 9 | loadfuncpp interface for loading C++ functions 10 | skeem Scheme language, implemented in Icon 11 | tcll1 parser-generator and parser 12 | -------------------------------------------------------------------------------- /ipl/packs/euler/Makefile: -------------------------------------------------------------------------------- 1 | euler: 2 | icont -s -c xcode escape ebcdic 3 | icont -s -c parsell1 readll1 semstk eulerscn 4 | icont -s -fs euler eulersem eulerint \ 5 | parsell1.u1 readll1.u1 semstk.u1 eulerscn.u1 6 | 7 | Iexe: euler 8 | cp euler ../../iexe/ 9 | 10 | Clean: 11 | rm -f euler *.u[12] 12 | -------------------------------------------------------------------------------- /ipl/packs/euler/build.bat: -------------------------------------------------------------------------------- 1 | icont -c xcode escape ebcdic 2 | 3 | icont -s -c parsell1 readll1 semstk eulerscn 4 | icont -s -fs euler eulersem eulerint parsell1.u1 readll1.u1 semstk.u1 eulerscn.u1 5 | rem pause 6 | 7 | -------------------------------------------------------------------------------- /ipl/packs/euler/t0.eul: -------------------------------------------------------------------------------- 1 | begin 2 | out 1 3 | end 4 | 5 | -------------------------------------------------------------------------------- /ipl/packs/euler/t1.eul: -------------------------------------------------------------------------------- 1 | begin new x; new s; 2 | s <- (2, 'begin x<- x+1; s[x] end', 'out x'); 3 | x <- s[1]; 4 | s[x] 5 | end 6 | -------------------------------------------------------------------------------- /ipl/packs/euler/t10.eul: -------------------------------------------------------------------------------- 1 | begin new P; new Q; new S; 2 | P <- '0'; 3 | Q <- ' begin new R; 4 | R <- ' 5 | out "Hi!" 6 | ' ; 7 | P; 8 | R 9 | end' ; 10 | S <- ' begin 11 | P; 12 | Q 13 | end'; 14 | S 15 | end 16 | 17 | -------------------------------------------------------------------------------- /ipl/packs/euler/t11.eul: -------------------------------------------------------------------------------- 1 | begin label L; new x; 2 | x<-@x; 3 | L: out L; 4 | out 'x'; 5 | out @x 6 | end 7 | 8 | -------------------------------------------------------------------------------- /ipl/packs/euler/t2.eul: -------------------------------------------------------------------------------- 1 | begin new a; new r; 2 | a<-(1,(2,3),4); 3 | r<-@a[2]; 4 | out r.[1]; out r.[2]; 5 | r.[1] <- undef 6 | end 7 | -------------------------------------------------------------------------------- /ipl/packs/euler/t3.eul: -------------------------------------------------------------------------------- 1 | begin new p; new n; new f; 2 | n<-0; 3 | p<-'begin n<-n+1; if n < 100 then p else p<-f(n) end'; 4 | f<-'formal x; x'; 5 | out p; 6 | out p 7 | end 8 | 9 | -------------------------------------------------------------------------------- /ipl/packs/euler/t4.eul: -------------------------------------------------------------------------------- 1 | begin new p; new a; new i; 2 | p <- 'formal x; formal k; 3 | begin k <- k+1; out x end'; 4 | i <- 1; 5 | a <- (4,9,16); 6 | p(a[i],@i); p('a[i]',@i); out i 7 | (* should write: 4 16 3 *) 8 | end 9 | -------------------------------------------------------------------------------- /ipl/packs/euler/t5.eul: -------------------------------------------------------------------------------- 1 | begin new p; new a; new i; 2 | p <- 'formal x; formal k; 3 | begin k <- k+1; x<-k end'; 4 | i <- 1; 5 | a <- list 3; 6 | p(@a[i],@i); p('@a[i]',@i); 7 | out a[1]; out if isu a[2] then "undef" else "~undef"; out a[3] 8 | (* should write: 2 undef 3 *) 9 | end 10 | -------------------------------------------------------------------------------- /ipl/packs/euler/t7.eul: -------------------------------------------------------------------------------- 1 | begin new x; new s; 2 | x<-1; 3 | out x; 4 | s <- (1,2,3); 5 | out s[1]; out s[2]; out s[3]; 6 | s[1] <- s[1] + 1; 7 | out s[1]; out s[2]; out s[3]; 8 | x<-1; 9 | out s[x]; 10 | out s[x+1]; 11 | out s[x+2] 12 | end 13 | -------------------------------------------------------------------------------- /ipl/packs/euler/t9.eul: -------------------------------------------------------------------------------- 1 | begin new p; new i; label L; 2 | L: 3 | p<-'formal x; 4 | begin 5 | out "isn x"; 6 | out isn x; 7 | out "isb x"; 8 | out isb x; 9 | out "isr x"; 10 | out isr x; 11 | out "isl x"; 12 | out isl x; 13 | out "isli x"; 14 | out isli x; 15 | out "isy x"; 16 | out isy x; 17 | out "isp x"; 18 | out isp x; 19 | out "isu x"; 20 | out isu x; 21 | undef 22 | end'; 23 | out "x<-1;"; 24 | p(1); 25 | out "x<-true;"; 26 | p(true); 27 | out "x<-@i;"; 28 | p(@i); 29 | out "x<-L;"; 30 | p(L); 31 | out "x<-();"; 32 | p(()); 33 | out "x<-symbol;"; 34 | p("A"); 35 | out "x<-'1';"; 36 | p('1'); 37 | out "x<-undef;"; 38 | p(undef); 39 | out "done" 40 | end 41 | -------------------------------------------------------------------------------- /ipl/packs/ibpag2/version.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # Name: version.icn 4 | # 5 | # Title: return Ibpag2 version number 6 | # 7 | # Author: Richard L. Goerwitz 8 | # 9 | # Version: 1.13 10 | # 11 | ############################################################################ 12 | # 13 | # See also: ibpag2.icn 14 | # 15 | ############################################################################ 16 | 17 | procedure ib_version() 18 | return "Ibpag2, version 1.3.7" 19 | end 20 | -------------------------------------------------------------------------------- /ipl/packs/idol/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Sample makefile for compiling Idol 3 | # 4 | idol: idol.iol idolmain.u1 unix.u1 idolboot 5 | ./idolboot idol unix.u1 idolmain.u1 6 | 7 | idolboot: idolboot.icn unix.u1 8 | icont -s idolboot unix.u1 9 | 10 | unix.u1: unix.icn 11 | icont -s -c unix 12 | 13 | idolmain.u1: idolmain.icn 14 | icont -s -c idolmain 15 | 16 | 17 | # Build executable and copy to ../../iexe. 18 | # (Nothing done in this case because the executable doesn't stand alone.) 19 | Iexe: 20 | 21 | 22 | Clean: 23 | rm -rf *.u[12] idol idolboot idolmain unix idolcode.env 24 | -------------------------------------------------------------------------------- /ipl/packs/idol/autoparn.iol: -------------------------------------------------------------------------------- 1 | # 2 | # Here is a sample test of automatic parenthesizing 3 | # 4 | class autotest(public yo) 5 | method foo(x) 6 | return x 7 | end 8 | initially 9 | self.yo := "yo, bro" 10 | end 11 | 12 | procedure main() 13 | x := autotest() 14 | write(x$foo(x$yo)) # yo almost becomes a data item, notation-wise 15 | end 16 | -------------------------------------------------------------------------------- /ipl/packs/idol/bi_test.iol: -------------------------------------------------------------------------------- 1 | # 2 | # Tests for the various builtins 3 | # 4 | procedure main() 5 | 6 | x := Table(1) 7 | write("\nTesting class ",x$class()) 8 | write("Fields:") 9 | every write("\t", x$fieldnames ) 10 | write("Methods:") 11 | every write("\t", x$methodnames ) 12 | write() 13 | x$setElement("world","hello") 14 | write(x$getElement("world")) 15 | write(x$getElement("hello")) 16 | 17 | x := Deque() 18 | write("\nTesting class ",x$class()) 19 | x$push("hello") 20 | x$push("world") 21 | write("My deque is size ",$*x) 22 | every write("give me a ",$!x) 23 | write("A random element is ",$?x) 24 | write("getting ",x$get()," popping ",x$pop()) 25 | 26 | x := List(["Tucson", "Pima", 85721]) 27 | write("\nTesting class ",x$class()) 28 | every write("give me a ",$!x) 29 | 30 | end 31 | -------------------------------------------------------------------------------- /ipl/packs/idol/buftest.iol: -------------------------------------------------------------------------------- 1 | # buffer classes' tests 2 | 3 | procedure main(args) 4 | if *args=0 then stop("usage: buftest cp file1 file2") 5 | every i := 1 to *args do { 6 | case args[i] of { 7 | "cp": { 8 | cp(args) 9 | } 10 | } 11 | } 12 | end 13 | procedure cp(args) 14 | b1 := buffer(args[2]) 15 | b2 := buffer(args[3]) 16 | b2$erase() 17 | while s:=b1$forward() do b2$insert(s) 18 | b2$write() 19 | end 20 | -------------------------------------------------------------------------------- /ipl/packs/idol/consttst.iol: -------------------------------------------------------------------------------- 1 | const foo := 1 2 | global barfoo 3 | procedure baz() 4 | barfoo := "OK" 5 | end 6 | procedure main() 7 | baz() 8 | bar1 := "gag!" 9 | write(foo) 10 | write(barfoo) 11 | write("foo") 12 | end 13 | -------------------------------------------------------------------------------- /ipl/packs/idol/events.iol: -------------------------------------------------------------------------------- 1 | const E_Tick := ".", E_Line := "_", E_Mask := '._' 2 | -------------------------------------------------------------------------------- /ipl/packs/idol/fraction.iol: -------------------------------------------------------------------------------- 1 | class fraction(n,d) 2 | method n() 3 | return self.n 4 | end 5 | method d() 6 | return self.d 7 | end 8 | method times(f) 9 | return fraction(self.n * f$n(), self.d * f$d()) 10 | end 11 | method asString() 12 | return self.n||"/"||self.d 13 | end 14 | method asReal() 15 | return real(self.n) / self.d 16 | end 17 | initially 18 | if self.d=0 then stop("fraction: denominator=0") 19 | end 20 | -------------------------------------------------------------------------------- /ipl/packs/idol/globtest.iol: -------------------------------------------------------------------------------- 1 | global here, # here 2 | are, # are 3 | some, # some 4 | globals # globals 5 | 6 | procedure main() 7 | write("hi there") 8 | end 9 | -------------------------------------------------------------------------------- /ipl/packs/idol/ictest.iol: -------------------------------------------------------------------------------- 1 | class ictester() 2 | method classmethod() 3 | write("hello, world") 4 | end 5 | end 6 | 7 | procedure main() 8 | x := ictester() 9 | x$classmethod() 10 | ictester_classmethod(x) 11 | end 12 | -------------------------------------------------------------------------------- /ipl/packs/idol/idol.bat: -------------------------------------------------------------------------------- 1 | iconx idol %1 %2 %3 %4 %5 %6 %7 %8 %9 2 | idolt 3 | -------------------------------------------------------------------------------- /ipl/packs/idol/incltest.iol: -------------------------------------------------------------------------------- 1 | #include events.iol 2 | procedure main() 3 | write("E_Tick ",E_Tick) 4 | end 5 | -------------------------------------------------------------------------------- /ipl/packs/idol/indextst.iol: -------------------------------------------------------------------------------- 1 | class indextst() 2 | method index(y) 3 | write("index(",y,")") 4 | end 5 | end 6 | 7 | procedure main() 8 | x := indextst() 9 | x $[ "hello, world" ] 10 | end 11 | -------------------------------------------------------------------------------- /ipl/packs/idol/install.bat: -------------------------------------------------------------------------------- 1 | rem msdos Idol installation 2 | rem This compiles Idol in order to to test the system 3 | icont -Sr1000 -SF30 -Si1000 idolboot msdos 4 | mkdir idolcode.env 5 | iconx idolboot -t -install 6 | chdir idolcode.env 7 | icont -c i_object 8 | chdir .. 9 | iconx idolboot idol idolmain msdos 10 | idolt 11 | -------------------------------------------------------------------------------- /ipl/packs/idol/inverse.iol: -------------------------------------------------------------------------------- 1 | class inverse:fraction(d) 2 | initially 3 | self.n := 1 4 | end 5 | 6 | procedure main() 7 | x := inverse(2) 8 | y := fraction(3,4) 9 | z := x$times(y) 10 | write("The decimal equivalent of ",z$asString(), 11 | " is ",trim(z$asReal(),'0')) 12 | end 13 | -------------------------------------------------------------------------------- /ipl/packs/idol/labelgen.iol: -------------------------------------------------------------------------------- 1 | class labelgen : Sequence(prefix,postfix) 2 | method activate() 3 | return self.prefix||self$Sequence.activate()||self.postfix 4 | end 5 | initially 6 | /(self.prefix) := "" 7 | /(self.postfix) := "" 8 | /(self.bounds) := [50000] 9 | end 10 | -------------------------------------------------------------------------------- /ipl/packs/idol/lbltest.iol: -------------------------------------------------------------------------------- 1 | procedure main() 2 | label := labelgen("L",":") 3 | every i := 1 to 10 do write($@label) 4 | end 5 | -------------------------------------------------------------------------------- /ipl/packs/idol/linvktst.iol: -------------------------------------------------------------------------------- 1 | # 2 | # List invocation for methods. Icon uses binary ! but Idol 3 | # uses $! for "foreach", so list invocation is specified via $$. 4 | # 5 | 6 | class abang() 7 | method a(args[]) 8 | write("a:") 9 | every write (image(!args)) 10 | end 11 | end 12 | 13 | class bbang : abang() 14 | method b(args[]) 15 | write("b:") 16 | every write (image(!args)) 17 | return self $$ a(["yo"]|||args) 18 | end 19 | end 20 | 21 | procedure main() 22 | x := bbang() 23 | x$b("yin","yang") 24 | 25 | end 26 | -------------------------------------------------------------------------------- /ipl/packs/idol/main.iol: -------------------------------------------------------------------------------- 1 | procedure main() 2 | mydeque := Deque() 3 | mydeque$push("hello") 4 | mydeque$push("world") 5 | write("My deque is size ",mydeque$size()) 6 | every write("give me a ",mydeque$foreach()) 7 | write("A random element is ",mydeque$random()) 8 | write("getting ",mydeque$get()," popping ",mydeque$pop()) 9 | end 10 | -------------------------------------------------------------------------------- /ipl/packs/idol/multitst.iol: -------------------------------------------------------------------------------- 1 | class multitst( a, b, c, d, e, 2 | f, g, h 3 | , i, j, k) 4 | method writemsg(x,y,z) 5 | write(x,y,z) 6 | end 7 | method write( plus, 8 | other 9 | ,stuff) 10 | every write(image(!self)) 11 | write(plus,other,stuff) 12 | end 13 | initially 14 | self$writemsg( 15 | "this ", 16 | "is ","not the") 17 | self$writemsg 18 | ("this is a","classical Icon-style bug","and it isn't printed") 19 | self$writemsg("this ", 20 | "is ","almost the") 21 | self$writemsg() 22 | self$write("end","of","test") 23 | end 24 | 25 | procedure main() 26 | multitst("hi","there","this",,"is",1,"test") 27 | end 28 | -------------------------------------------------------------------------------- /ipl/packs/idol/point.iol: -------------------------------------------------------------------------------- 1 | class Cartesian : Radian (x,y) 2 | initially 3 | if /(self.r) then { 4 | self.r := sqrt(self.x^2+self.y^2) 5 | self.d := 0 # this should really be some awful mess 6 | } 7 | end 8 | class Radian : Cartesian(d,r) 9 | initially 10 | if /(self.x) then { 11 | self.x := 0 12 | self.y := 0 13 | } 14 | end 15 | -------------------------------------------------------------------------------- /ipl/packs/idol/seqtest.iol: -------------------------------------------------------------------------------- 1 | procedure main() 2 | decimal := sequence(255) 3 | hex := sequence("0123456789ABCDEF","0123456789ABCDEF") 4 | octal := sequence(3,7,7) 5 | character := sequence(string(&cset)) 6 | while write(right($@decimal,3)," ",$@hex," ",$@octal," ",image($@character)) 7 | end 8 | -------------------------------------------------------------------------------- /ipl/packs/idol/sequence.iol: -------------------------------------------------------------------------------- 1 | procedure sequence(bounds[ ]) 2 | return Sequence(bounds) 3 | end 4 | 5 | class Sequence(bounds,indices) 6 | method max(i) 7 | elem := self.bounds[i] 8 | return (type(elem)== "integer",elem) | *elem-1 9 | end 10 | method elem(i) 11 | elem := self.bounds[i] 12 | return (type(elem)== "integer",self.indices[i]) | elem[self.indices[i]+1] 13 | end 14 | method activate() 15 | top := *(self.indices) 16 | if self.indices[1] > self$max(1) then fail 17 | s := "" 18 | every i := 1 to top do { 19 | s ||:= self$elem(i) 20 | } 21 | repeat { 22 | self.indices[top] +:= 1 23 | if top=1 | (self.indices[top] <= self$max(top)) then break 24 | self.indices[top] := 0 25 | top -:= 1 26 | } 27 | return s 28 | end 29 | initially 30 | / (self.indices) := list(*self.bounds,0) 31 | end 32 | -------------------------------------------------------------------------------- /ipl/packs/idol/sinvktst.iol: -------------------------------------------------------------------------------- 1 | class sinvbuffer : strinvokable() 2 | method forward_char() 3 | write("success") 4 | end 5 | method eval(s,args[]) 6 | suspend self$strinvokable.eval(map(s,"-","_")) 7 | end 8 | end 9 | 10 | procedure main() 11 | x := sinvbuffer() 12 | x $ eval("forward-char") 13 | end 14 | -------------------------------------------------------------------------------- /ipl/packs/idol/strinvok.iol: -------------------------------------------------------------------------------- 1 | # 2 | # a builtin class, subclasses of which support string invocation for methods 3 | # (sort of) 4 | # this is dependent upon Idol internals which are subject to change... 5 | # 6 | class strinvokable() 7 | method eval(s,args[]) 8 | i := 1 9 | every methodname := name(!(self.__methods)) do { 10 | methodname[1 : find(".",methodname)+1 ] := "" 11 | if s == methodname then { 12 | suspend self.__methods[i] ! ([self]|||args) 13 | fail 14 | } 15 | i +:= 1 16 | } 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /ipl/packs/idol/vms.com: -------------------------------------------------------------------------------- 1 | $ ! A script used internally by Idol on VMS 2 | $ set default [.idolenv] 3 | $ icont -c 'P1' 4 | $ set default [-] 5 | -------------------------------------------------------------------------------- /ipl/packs/idol/vmsidol.com: -------------------------------------------------------------------------------- 1 | $ ! VMS Idol invocation script for simple compiles 2 | $ iconx idol "-t" 'P1' 'P2' 'P3' 'P4' 'P5' 'P6' 'P7' 'P8' 'P9' 3 | $ icont "-Sr1000" "-Sg500" "-SF30" 'P1' 4 | -------------------------------------------------------------------------------- /ipl/packs/idol/warntest.iol: -------------------------------------------------------------------------------- 1 | # This is a test of the emergency broadcasting system. 2 | # This is only a test. 3 | 4 | class a ( field ) 5 | end 6 | 7 | class b : a ( field ) 8 | end 9 | -------------------------------------------------------------------------------- /ipl/packs/loadfunc/README: -------------------------------------------------------------------------------- 1 | This directory contains some demonstrations of loadfunc(). 2 | Some more generally useful C functions are provided in the ipl/cfuncs 3 | directory, and some of these test drivers depend on them. 4 | 5 | Set IPATH and FPATH, then type "make" to build everything. 6 | 7 | The C functions are as follows: 8 | argdump print arguments on standard output 9 | cspgen cellular automata ager for "cspace" (below) 10 | ddump dump descriptor in hexadecimal 11 | 12 | The Icon programs are as follows: 13 | btest simple demo using bitcount() from cfuncs library 14 | cspace cellular automata demonstration; opens a graphics window 15 | ddtest simple demo using ddump() 16 | dldemo simple demo using argdump() 17 | newsgrp connect to news server and print subjects from a newsgroup 18 | tnet very simple telnet client 19 | 20 | Further information is contained in the comments in the individual files. 21 | -------------------------------------------------------------------------------- /ipl/packs/loadfunc/btest.icn: -------------------------------------------------------------------------------- 1 | # Simple demonstration of standard "bitcount" function 2 | 3 | link cfunc # link standard C functions transparently 4 | 5 | procedure main() 6 | local i 7 | 8 | every i := 500 to 520 do 9 | write(i, " ", bitcount(i)) 10 | end 11 | -------------------------------------------------------------------------------- /ipl/packs/loadfunc/ddtest.icn: -------------------------------------------------------------------------------- 1 | # ddtest.icn -- test ddump 2 | # 3 | # Calls a simple C function that prints out its arguments. 4 | 5 | $include "libnames.icn" 6 | 7 | global ddump 8 | 9 | procedure main() 10 | ddump := loadfunc(FUNCLIB, "ddump") 11 | ddump(-1, 51, 11213) 12 | write() 13 | ddump(&null, 1, "a", 3.4, 'cset') 14 | end 15 | -------------------------------------------------------------------------------- /ipl/packs/loadfunc/ddump.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ddump(a1, ...) -- descriptor dump 3 | * 4 | * The arguments are dumped in hexadecimal on standard output. 5 | * 6 | * This function does not require "icall.h". 7 | */ 8 | 9 | #include 10 | 11 | typedef struct { 12 | long dword; 13 | long vword; 14 | } descriptor; 15 | 16 | int ddump(int argc, descriptor *argv) 17 | { 18 | int i, n; 19 | 20 | n = 2 * sizeof(long); 21 | for (i = 1; i <= argc; i++) 22 | printf("%d. %0*lX %0*lX\n", i, n, argv[i].dword, n, argv[i].vword); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /ipl/packs/loadfunc/dldemo.icn: -------------------------------------------------------------------------------- 1 | # dldemo.icn -- dynamic loading demo 2 | # 3 | # Calls a simple C function that prints out its arguments. 4 | 5 | $include "libnames.icn" 6 | 7 | global argdump 8 | 9 | procedure main() 10 | argdump := loadfunc(FUNCLIB,"argdump") 11 | write("loadfunc result: ", image(argdump)) 12 | xcall(1, "a") 13 | xcall() 14 | xcall(&null) 15 | xcall(1, 2, 3) 16 | xcall("abc", "abcde"[2+:2], 123, 4.56, 'quick brown fox') 17 | xcall(&input, &output, &errout) 18 | xcall(main, argdump, [], &main, ) 19 | end 20 | 21 | procedure xcall(args[]) 22 | writes("\nargs:") 23 | every writes(" ", image(!args) | "\n") 24 | write("--- ", image(argdump ! args) | "failed") 25 | end 26 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/Makefile.mak: -------------------------------------------------------------------------------- 1 | 2 | ifndef TARGET 3 | ifneq ($(strip $(shell g++ -v 2>&1 | grep "cygwin")),) 4 | TARGET=cygwin 5 | else 6 | TARGET=other 7 | endif 8 | endif 9 | 10 | FLAGS_cygwin = /opt/icon/bin/iload.a -Wl,--enable-auto-import 11 | FLAGS_other = 12 | 13 | PIC_other = -fPIC 14 | 15 | EXAMPLES = #exe# 16 | DYNAMICS = #so# 17 | 18 | %.so : %.cpp loadfuncpp.h 19 | g++ -shared $(PIC_$(TARGET)) -o $@ $< $(FLAGS_$(TARGET)) 20 | 21 | %.exe : %.icn %.so 22 | icont -so $@ $* 23 | 24 | default: $(DYNAMICS) $(EXAMPLES) 25 | 26 | .PHONY : loadfuncpp.h 27 | 28 | loadfuncpp.h : ../loadfuncpp.h 29 | cp ../loadfuncpp.h ./ 30 | 31 | test : clean default 32 | 33 | clean : 34 | rm -f *.exe *.so *.o *% *~ core .#* 35 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/bang.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make iexample' to build. 5 | * Carl Sturtivant, 2008/3/16 6 | */ 7 | 8 | #include "loadfuncpp.h" 9 | using namespace Icon; 10 | 11 | 12 | 13 | 14 | struct addup: public iterate { 15 | safe total; 16 | int count; 17 | 18 | addup(): total(0L), count(0) {} 19 | 20 | virtual void takeNext(const value& x) { 21 | total = total + x; 22 | } 23 | virtual bool wantNext(const value& x) { 24 | return ++count <= 10; 25 | } 26 | }; 27 | 28 | extern "C" int sumlist(value argv[]) { 29 | addup sum; 30 | sum.bang(argv[1]); 31 | argv[0] = sum.total; 32 | return SUCCEEDED; 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/bang.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | 5 | procedure main() 6 | sumlist := loadfuncpp("./bang.so", "sumlist", 1) 7 | write( sumlist([1,2,3,4,5]) ) 8 | end 9 | 10 | 11 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/divide.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* Example of a C++ extension to icon via loadfunc, 4 | * without garbage collection difficulties. 5 | * Type 'make iexample' to build. 6 | * Carl Sturtivant, 2008/3/16 7 | */ 8 | 9 | 10 | #include "loadfuncpp.h" 11 | using namespace Icon; 12 | 13 | extern "C" int div(value argv[]) { 14 | safe x(argv[1]), y(argv[2]), z; 15 | z = ( x/y, x%y ); 16 | argv[0] = z; 17 | return SUCCEEDED; 18 | } 19 | 20 | 21 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/divide.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | procedure main() 5 | div := loadfuncpp("./divide.so", "div", 2) 6 | ls := div(79, 10) 7 | every write(!ls) 8 | end 9 | 10 | 11 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/divide2.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* Example of a C++ extension to icon via loadfunc, 4 | * without garbage collection difficulties. 5 | * Type 'make iexample' to build. 6 | * Carl Sturtivant, 2008/3/16 7 | */ 8 | 9 | 10 | #include "loadfuncpp.h" 11 | using namespace Icon; 12 | 13 | extern "C" int div(value argv[]) { 14 | safe x(argv[1]), y(argv[2]), z; 15 | z = ( x/y, x%y ); 16 | argv[0] = z; 17 | return SUCCEEDED; 18 | } 19 | 20 | 21 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/divide2.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | procedure main() 5 | div := loadfuncpp("./divide2.so", "div", 2) 6 | ls := div(79, 10) 7 | every write(!ls) 8 | end 9 | 10 | 11 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/dull.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make iexample' to build. 5 | * Carl Sturtivant, 2008/3/16 6 | */ 7 | 8 | #include "loadfuncpp.h" 9 | using namespace Icon; 10 | 11 | extern "C" int dull(value argv[]) { 12 | argv[0] = nullvalue; 13 | return SUCCEEDED; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/dull.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | 5 | procedure main() 6 | dull := loadfuncpp("./dull.so", "dull", 1) 7 | write(image( dull() )) 8 | end 9 | 10 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/examples.txt: -------------------------------------------------------------------------------- 1 | bang 2 | divide 3 | divide2 4 | dull 5 | generator 6 | isexternal 7 | iterate 8 | keyword 9 | makelist 10 | object 11 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/generator.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make iexample' to build. 5 | * Carl Sturtivant, 2008/3/16 6 | */ 7 | 8 | #include "loadfuncpp.h" 9 | using namespace Icon; 10 | 11 | class sequence: public generator { 12 | safe current, inc; 13 | public: 14 | sequence(safe start, safe increment) { 15 | current = start - increment; 16 | inc = increment; 17 | } 18 | virtual bool hasNext() { 19 | return true; 20 | } 21 | virtual value giveNext() { 22 | return current = current + inc; 23 | } 24 | }; 25 | 26 | extern "C" int seq2(value argv[]){ 27 | sequence seq(argv[1], argv[2]); 28 | return seq.generate(argv); 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/generator.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | 5 | procedure main() 6 | seq2 := loadfuncpp("./generator.so", "seq2", 1) 7 | every write( seq2(1001, 99) \ 30 ) 8 | end 9 | 10 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/hello.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World 4 | 5 | 6 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/isexternal.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* Example of a C++ extension to icon via loadfunc, 4 | * without garbage collection difficulties. 5 | * Type 'make iexample' to build. 6 | * Carl Sturtivant, 2008/3/16 7 | */ 8 | 9 | 10 | #include "loadfuncpp.h" 11 | using namespace Icon; 12 | 13 | class myval: public external { 14 | public: 15 | virtual value name() { return "my external"; } 16 | }; 17 | 18 | extern "C" int myext(value argv[]) { 19 | argv[0] = new myval(); 20 | return SUCCEEDED; 21 | } 22 | 23 | extern "C" int ismine(value argv[]) { 24 | if( argv[1].isExternal("my external") ) 25 | argv[0] = "Yes!"; 26 | else 27 | argv[0] = "No!"; 28 | return SUCCEEDED; 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/isexternal.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | procedure main() 5 | myext := loadfuncpp("./isexternal.so", "myext", 0) 6 | ismine := loadfuncpp("./isexternal.so", "ismine", 1) 7 | x := myext() 8 | write(image(x)) 9 | write(image(type(x))) 10 | write("is mine? ", ismine(x)) 11 | write("is also mine? ", ismine(3)) 12 | end 13 | 14 | 15 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/iterate.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make iexample' to build. 5 | * Carl Sturtivant, 2008/3/16 6 | */ 7 | 8 | #include "loadfuncpp.h" 9 | using namespace Icon; 10 | 11 | 12 | struct addup: public iterate { 13 | safe total; 14 | int count; 15 | 16 | addup(): total(0L), count(0) {} 17 | 18 | virtual void takeNext(const value& x) { 19 | total = total + x; 20 | } 21 | virtual bool wantNext(const value& x) { 22 | return ++count <= 10; 23 | } 24 | }; 25 | 26 | 27 | extern "C" int sum10(value argv[]){ 28 | addup sum; 29 | sum.every(argv[1], argv[2]); 30 | argv[0] = sum.total; 31 | return SUCCEEDED; 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/iterate.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | 5 | procedure main() 6 | sum10 := loadfuncpp("./iterate.so", "sum10", 2) 7 | write( sum10(f,[]) ) 8 | end 9 | 10 | procedure f() 11 | suspend 1 to 15 12 | end 13 | 14 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/keyword.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make iexample' to build. 5 | * Carl Sturtivant, 2008/3/16 6 | */ 7 | 8 | #include "loadfuncpp.h" 9 | using namespace Icon; 10 | 11 | extern "C" int assignprog(value argv[]) { 12 | safe newname(argv[1]); 13 | &progname = newname; 14 | return FAILED; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/keyword.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | 5 | procedure main() 6 | assignprog := loadfuncpp("./keyword.so", "assignprog", 1) 7 | assignprog("Silly") 8 | write(&progname) 9 | end 10 | 11 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/makelist.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make iexample' to build. 5 | * Carl Sturtivant, 2008/3/16 6 | */ 7 | 8 | #include "loadfuncpp.h" 9 | using namespace Icon; 10 | 11 | extern "C" int makelist(int argc, value argv[]) { 12 | safe arglist(argc, argv); 13 | argv[0] = arglist; 14 | return SUCCEEDED; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/makelist.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | 5 | procedure main() 6 | makelist := loadfuncpp("./makelist.so", "makelist") 7 | write(image( ls := makelist(1,2,3) )) 8 | every write(!ls) 9 | end 10 | 11 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/object.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make iexample' to build. 5 | * Carl Sturtivant, 2008/3/16 6 | */ 7 | 8 | #include "loadfuncpp.h" 9 | using namespace Icon; 10 | 11 | extern "C" int dummy(value argv[]) { 12 | return SUCCEEDED; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/doc/object.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | record object(val, print) 5 | 6 | procedure print() 7 | obj := self() | fail 8 | write( obj.val ) 9 | end 10 | 11 | procedure newObject(x) 12 | obj := object(x) #don't assign print method yet 13 | #print will be a copy bound to the record it's embedded in 14 | obj.print := bindself(print, obj) 15 | return obj 16 | end 17 | 18 | procedure main() 19 | obj := newObject("Hello") 20 | obj.print() 21 | end 22 | 23 | 24 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/Makefile.mak: -------------------------------------------------------------------------------- 1 | 2 | ifndef TARGET 3 | ifneq ($(strip $(shell g++ -v 2>&1 | grep "cygwin")),) 4 | TARGET=cygwin 5 | else 6 | TARGET=other 7 | endif 8 | endif 9 | 10 | FLAGS_cygwin = /opt/icon/bin/iload.a -Wl,--enable-auto-import 11 | FLAGS_other = 12 | 13 | PIC_other = -fPIC 14 | 15 | EXAMPLES = #exe# 16 | DYNAMICS = #so# 17 | 18 | %.so : %.cpp loadfuncpp.h loadfuncpp.u1 19 | g++ -shared $(PIC_$(TARGET)) -o $@ $< $(FLAGS_$(TARGET)) 20 | 21 | %.exe : %.icn %.so iload.so 22 | icont -so $@ $* 23 | 24 | default: $(DYNAMICS) $(EXAMPLES) 25 | 26 | .PHONY : iload.so loadfuncpp.h loadfuncpp.u1 27 | 28 | loadfuncpp.h : ../loadfuncpp.h 29 | cp ../loadfuncpp.h ./ 30 | 31 | test : clean default 32 | 33 | clean : 34 | rm -f *.exe *.so *.o *% *~ core .#* 35 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/arglist.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make ' to build. 5 | * For available s type 'make'. 6 | * Carl Sturtivant, 2007/9/25 7 | */ 8 | 9 | #include "loadfuncpp.h" 10 | 11 | 12 | extern "C" int iexample(int argc, value argv[]) { 13 | safe x(argc, argv); //make the arguments into an Icon list 14 | argv[0] = x; 15 | return SUCCEEDED; 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/arglist.icn: -------------------------------------------------------------------------------- 1 | 2 | procedure main() 3 | loadfunc("./iload.so", "loadfuncpp") 4 | f := loadfunc("./iexample.so", "iexample") 5 | every write( !( f(1,2,3,4) ) ) 6 | end 7 | 8 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/callicon.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make ' to build. 5 | * For available s type 'make'. 6 | * Carl Sturtivant, 2007/9/25 7 | */ 8 | 9 | #include "loadfuncpp.h" 10 | 11 | 12 | 13 | extern "C" int iexample(int argc, value argv[]) { 14 | argv[0] = argv[1].apply(argv[2]); 15 | return SUCCEEDED; 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/callicon.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | procedure main() 5 | icall := loadfuncpp("./callicon.so", "iexample") 6 | 7 | write( icall(f, ["Argument passed"]) ) 8 | end 9 | 10 | procedure f(arg) 11 | write(arg) 12 | write("Called from C++") 13 | every write( g(arg) ) 14 | x := create g(arg) 15 | while writes(@x) 16 | write() 17 | return "Result string!" 18 | end 19 | 20 | procedure g(arg) 21 | suspend !arg 22 | end 23 | 24 | 25 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/coexp.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make ' to build. 5 | * For available s type 'make'. 6 | * Carl Sturtivant, 2007/9/25 7 | */ 8 | 9 | #include "loadfuncpp.h" 10 | 11 | extern "C" int activate(int argc, value argv[]) { 12 | argv[0] = argv[1].activate(); 13 | return SUCCEEDED; 14 | } 15 | 16 | extern "C" int refresh(int argc, value argv[]) { 17 | argv[0] = argv[1].refreshed(); 18 | return SUCCEEDED; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/coexp.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | procedure main() 5 | activate := loadfuncpp("./coexp.so", "activate") 6 | refresh := loadfuncpp("./coexp.so", "refresh") 7 | x := create 1 to 7 8 | @x 9 | @x 10 | write( activate(x) ) 11 | x := refresh(x) 12 | write( activate(x) ) 13 | end 14 | 15 | 16 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/compare.icn: -------------------------------------------------------------------------------- 1 | 2 | procedure main() 3 | loadfunc("./iload.so", "loadfuncpp") 4 | f := loadfunc("./iexample.so", "iexample") 5 | write( f(100,10) ) 6 | end 7 | 8 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/examples.txt: -------------------------------------------------------------------------------- 1 | callicon 2 | coexp 3 | extwidget 4 | iterate 5 | iterate2 6 | iterate3 7 | jmexample 8 | kwd_vbl 9 | methodcall 10 | mkexternal 11 | runerr 12 | stop 13 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/extwidget.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make iexample' to build. 5 | * Carl Sturtivant, 2008/3/16 6 | */ 7 | 8 | #include "loadfuncpp.h" 9 | using namespace Icon; 10 | 11 | #include 12 | 13 | class Widget: public external { 14 | long state; 15 | public: 16 | Widget(long x): state(x) {} 17 | 18 | virtual value name() { 19 | return "Widget"; 20 | } 21 | virtual external* copy() { 22 | return new Widget(state); 23 | } 24 | virtual value image() { 25 | char sbuf[100]; 26 | sprintf(sbuf, "Widget_%ld(%ld)", id, state); 27 | return value(NewString, sbuf); 28 | } 29 | }; 30 | 31 | extern "C" int iexample(int argc, value argv[]) { 32 | argv[0] = new Widget(99); 33 | return SUCCEEDED; 34 | } 35 | 36 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/extwidget.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | procedure main() 5 | iexample := loadfuncpp("./extwidget.so", "iexample") 6 | external := iexample() 7 | external2 := copy(external) 8 | write( type(external) ) 9 | write( image(external) ) 10 | write( type(external2) ) 11 | write( image(external2) ) 12 | end 13 | 14 | 15 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/factorials.icn: -------------------------------------------------------------------------------- 1 | procedure main () 2 | every n := 1 to 10 do { 3 | write (n, "! = ", memoized_factorial ( n ) ); 4 | } 5 | n := 135; write(n, "! = ", memoized_factorial ( n ) ); 6 | n := 155; write(n, "! = ", memoized_factorial ( n ) ); 7 | end 8 | procedure memoized_factorial ( k ) 9 | static results; 10 | static k_limit; 11 | static k_old; 12 | initial { 13 | results := [1]; 14 | k_limit := 10 ^ 5; 15 | k_old := 1; 16 | } 17 | if (k < k_limit) then { 18 | while (k > *results) do results := results ||| list(*results) 19 | every n := (k_old + 1) to k do { 20 | results[n] := n * results[n - 1]; 21 | } 22 | k_old := k; 23 | return results[k]; 24 | } else { 25 | return ((k / &e) ^ n) * sqrt(2 * &pi * n); 26 | } 27 | end 28 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/hello.icn: -------------------------------------------------------------------------------- 1 | procedure main () 2 | write ( "Yarrr, matey, bilge the yardarm!" ); 3 | end 4 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/hexwords.icn: -------------------------------------------------------------------------------- 1 | procedure printable(word) 2 | if ("" == word) then { 3 | return ""; 4 | } else { 5 | return map(map(word, "oOiIzZeEsStT", "001122335577"), &lcase, &ucase); 6 | } 7 | end 8 | procedure main(arg) 9 | word_file := "/usr/share/dict/words"; 10 | find := '0123456789abcdefABCDEFoOiIzZeEsStT'; 11 | usage := "Finds all the words in a word file that can be written using /^[A-Fa-f0-9$/"; 12 | words := open(word_file) | stop("Unable to open: " || word_file) 13 | while word := trim(read(words)) do { 14 | if ('' == word -- find) then { 15 | write(printable(word) || " " || word); 16 | } 17 | } 18 | end 19 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/hexwords_oneline.icn: -------------------------------------------------------------------------------- 1 | procedure printable(word) 2 | return "" == word | map(map(word, "oOiIzZeEsStT", "001122335577"), &lcase, &ucase); 3 | end 4 | procedure main() 5 | find := '0123456789abcdefABCDEFoOiIzZeEsS'; 6 | words := open(word_file := "/usr/share/dict/words") | stop("Unable to open: " || word_file); 7 | every write(printable( | 1 ( | (word := trim(read(words))) , not("" == word) , ('' == word -- find)))); 8 | end 9 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/iterate.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make iexample' to build. 5 | * Carl Sturtivant, 2008/3/16 6 | */ 7 | 8 | #include "loadfuncpp.h" 9 | using namespace Icon; 10 | 11 | 12 | struct addup: public iterate { 13 | safe total; 14 | addup(): total((long)0) {} 15 | virtual void takeNext(const value& x) { 16 | total = total + x; 17 | } 18 | }; 19 | 20 | extern "C" int iexample(int argc, value argv[]) { 21 | addup sum; 22 | sum.every(argv[1], argv[2]); 23 | argv[0] = sum.total; 24 | return SUCCEEDED; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/iterate.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | 5 | procedure main() 6 | total := loadfuncpp("./iterate.so", "iexample") 7 | write( total(g, [1,2,3,4,5]) ) 8 | end 9 | 10 | procedure g(ls[]) 11 | suspend !ls 12 | end 13 | 14 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/iterate2.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make iexample' to build. 5 | * Carl Sturtivant, 2008/3/16 6 | */ 7 | 8 | #include "loadfuncpp.h" 9 | using namespace Icon; 10 | 11 | 12 | struct addup: public iterate { 13 | safe total; 14 | int count; 15 | addup(): total((long)0), count(0) {} 16 | 17 | virtual void takeNext(const value& x) { 18 | total = total + x; 19 | } 20 | virtual bool wantNext(const value& x) { 21 | return ++count <= 3; 22 | } 23 | }; 24 | 25 | extern "C" int iexample(int argc, value argv[]) { 26 | addup sum; 27 | sum.every(argv[1], argv[2]); 28 | argv[0] = sum.total; 29 | return SUCCEEDED; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/iterate2.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | 5 | procedure main() 6 | total := loadfuncpp("./iterate2.so", "iexample") 7 | write( total(g, [1,2,3,4,5]) ) 8 | end 9 | 10 | procedure g(ls[]) 11 | suspend !ls 12 | end 13 | 14 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/iterate3.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make iexample' to build. 5 | * Carl Sturtivant, 2008/3/16 6 | */ 7 | 8 | #include "loadfuncpp.h" 9 | using namespace Icon; 10 | 11 | 12 | struct addup: public iterate { 13 | safe total; 14 | int count; 15 | addup(): total((long)0) { 16 | count = 0; 17 | } 18 | virtual void takeNext(const value& x) { 19 | total = total + x; 20 | } 21 | virtual bool wantNext(const value& x) { 22 | return ++count <= 3; 23 | } 24 | }; 25 | 26 | extern "C" int iexample(value argv[]) { 27 | addup sum; 28 | sum.bang(argv[1]); 29 | argv[0] = sum.total; 30 | return SUCCEEDED; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/iterate3.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | 5 | procedure main() 6 | total := loadfuncpp("./iterate3.so", "iexample", 1) #arity present 7 | write( total([1,2,3,4,5]) ) 8 | end 9 | 10 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/jmexample.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | procedure main() 5 | f := loadfuncpp("./jmexample.so", "jm_test_1") 6 | every write(f(1, 10) | f(10, 1) | f(10, 10) | f(-1, 1)) 7 | end 8 | 9 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/kwd_vbl.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make iexample' to build. 5 | * Carl Sturtivant, 2007/9/25 6 | */ 7 | 8 | #include "loadfuncpp.h" 9 | using namespace Icon; 10 | 11 | extern "C" int iexample(int argc, value argv[]) { 12 | safe y = argv[1]; 13 | &progname = y; 14 | argv[0] = &progname; 15 | return SUCCEEDED; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/kwd_vbl.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | procedure main() 5 | keyword := loadfuncpp("./kwd_vbl.so", "iexample") 6 | x := keyword("frog") 7 | write(&progname) 8 | end 9 | 10 | 11 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/methodcall.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make iexample' to build. 5 | * Carl Sturtivant, 2008/3/16 6 | */ 7 | 8 | #include "loadfuncpp.h" 9 | using namespace Icon; 10 | 11 | #include 12 | 13 | extern "C" int iexample(int argc, value argv[]) { 14 | 15 | 16 | return SUCCEEDED; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/methodcall.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | 5 | record thing(val, method) 6 | 7 | procedure method(x) 8 | object := self() | stop("not bound to a record") 9 | object.val := x 10 | end 11 | 12 | procedure main() 13 | 14 | obj := thing() 15 | obj.method := bindself(method, obj) 16 | 17 | write(image(obj.method)) 18 | 19 | obj.method(99) 20 | 21 | write( obj.val ) 22 | end 23 | 24 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/mkexternal.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make iexample' to build. 5 | * Carl Sturtivant, 2007/9/25 6 | */ 7 | 8 | #include "loadfuncpp.h" 9 | using namespace Icon; 10 | 11 | extern "C" int iexample(int argc, value argv[]) { 12 | argv[0] = new external(); 13 | return SUCCEEDED; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/mkexternal.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | procedure main() 5 | iexample := loadfuncpp("./mkexternal.so", "iexample") 6 | external := iexample() 7 | external2 := copy(external) 8 | write( type(external) ) 9 | write( image(external) ) 10 | write( type(external2) ) 11 | write( image(external2) ) 12 | end 13 | 14 | 15 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/newprimes.icn: -------------------------------------------------------------------------------- 1 | procedure main() 2 | #limit to the first 10000 primes 3 | every write(!(p := 1, a := [2])| 1(|(p +:= 2), not(p % !a = 0), put(a, p))) \1000 4 | end 5 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/primes.icn: -------------------------------------------------------------------------------- 1 | procedure main() 2 | #limit to the first x primes 3 | local x; 4 | x := 20; 5 | every write(!(p := 1, a := [2])| 1(|(p +:= 2), not(p % !a = 0), put(a, p))) \x 6 | list_primes(x); 7 | end 8 | 9 | procedure list_primes(prime_limit) 10 | local p; 11 | local a; 12 | local s; 13 | initial { 14 | p := 1; 15 | a := [2]; 16 | } 17 | until (prime_limit <= *a) do { 18 | p +:= 2; 19 | s := sqrt(p); 20 | 21 | if (not(p % !a = 0)) then { 22 | put(a, p); 23 | } 24 | } 25 | every write(!a) 26 | end 27 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/runerr.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make iexample' to build. 5 | * Carl Sturtivant, 2007/9/25 6 | */ 7 | 8 | #include "loadfuncpp.h" 9 | 10 | #include 11 | 12 | extern "C" int iexample(value argv[]) { 13 | safe callme(argv[1]), text(argv[2]); 14 | printf("Calling callme\n"); 15 | callme(); 16 | printf("Callme returned\n"); 17 | printf("Calling callme\n"); 18 | callme(); 19 | printf("Callme returned\n"); 20 | //Icon::runerr(123, text); 21 | return FAILED; 22 | } 23 | 24 | extern "C" int iexample2(value argv[]) { 25 | //Icon::display(&Icon::level, &Icon::output); 26 | safe nextcall(argv[1]), rerr(argv[2]); 27 | nextcall(); 28 | rerr(123, "Bye!"); 29 | //Icon::runerr(123, "Bye!"); 30 | return FAILED; 31 | } 32 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/runerr.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | procedure main() 5 | x := [1,2,3] 6 | main2() 7 | end 8 | 9 | global newdisplay 10 | 11 | procedure main2() 12 | newrunerr := loadfuncpp("runerr.so", "iexample", 2) 13 | newdisplay := loadfuncpp("runerr.so", "iexample2", 2) 14 | #&trace := -1 15 | newrunerr(callme, "Hello!") 16 | write("We don't get here!") 17 | end 18 | 19 | procedure callme() 20 | initial { 21 | write("callme() called! first time!") 22 | return 23 | } 24 | write("callme() called for second time!") 25 | newdisplay(nextcall, runerr) 26 | #runerr(123, "callme error termination!") 27 | return 28 | end 29 | 30 | procedure nextcall() 31 | write("Call to nextcall") 32 | end 33 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/stop.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* Example of a C++ extension to icon via loadfunc, 3 | * without garbage collection difficulties. 4 | * Type 'make iexample' to build. 5 | * Carl Sturtivant, 2007/9/25 6 | */ 7 | 8 | #include "loadfuncpp.h" 9 | using namespace Icon; 10 | 11 | extern "C" int iexample(int argc, value argv[]) { 12 | safe x = argv[1]; 13 | stop(x); 14 | return SUCCEEDED; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/stop.icn: -------------------------------------------------------------------------------- 1 | 2 | link loadfuncpp 3 | 4 | procedure main() 5 | newstop := loadfuncpp("./stop.so", "iexample") 6 | newstop("Stop!") 7 | write("We don't get here!") 8 | end 9 | 10 | 11 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/sums.icn: -------------------------------------------------------------------------------- 1 | procedure main() 2 | local n, sum # Declare two local variables 3 | sum := 0 # Set the sum to zero 4 | every n := 1 to 5 do # For n equal to 1, 2, 3, 4, 5 ... 5 | sum := sum + n; # ...add n to the sum 6 | 7 | write ( "The sum of all numbers from 1 to 5 is ", sum ); 8 | end 9 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/examples/sums2.icn: -------------------------------------------------------------------------------- 1 | procedure main() 2 | local sum; 3 | sum := 0; 4 | every sum +:= 1 to 5 5 | write ( "The sum of all numbers from 1 to 5 is ", sum ); 6 | end 7 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/hex.txt: -------------------------------------------------------------------------------- 1 | 2d3a674a9265858a427fb642aaf89a62 2 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/iexample.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "loadfuncpp.h" 3 | 4 | extern "C" int integertobytes(value argv[]) { 5 | argv[0] = integertobytes(argv[1]); 6 | return SUCCEEDED; 7 | } 8 | 9 | extern "C" int bytestointeger(value argv[]) { 10 | argv[0] = bytestointeger(argv[1]); 11 | return SUCCEEDED; 12 | } 13 | 14 | extern "C" int base64(value argv[]) { 15 | argv[0] = base64(argv[1]); 16 | return SUCCEEDED; 17 | } 18 | 19 | extern "C" int base64tostring(value argv[]) { 20 | argv[0] = base64tostring(argv[1]); 21 | return SUCCEEDED; 22 | } 23 | 24 | extern "C" int base64tointeger(value argv[]) { 25 | argv[0] = base64tointeger(argv[1]); 26 | return SUCCEEDED; 27 | } 28 | -------------------------------------------------------------------------------- /ipl/packs/loadfuncpp/loadfuncpp_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o verbose #echo on 4 | 5 | #loadfuncpp itself 6 | make clean 7 | make 8 | 9 | pushd cgi 10 | make 11 | popd 12 | 13 | #pushd icondb 14 | #make 15 | #popd 16 | 17 | pushd socket 18 | make clean 19 | make 20 | popd 21 | 22 | pushd system 23 | make clean 24 | make 25 | popd 26 | 27 | pushd openssl 28 | make clean 29 | make 30 | popd 31 | 32 | set +o verbose #echo off 33 | -------------------------------------------------------------------------------- /ipl/packs/skeem/Makefile: -------------------------------------------------------------------------------- 1 | ICONT=icont 2 | IFLAGS=-us 3 | 4 | SRC = skeem.icn skbasic.icn skcontrl.icn skdebug.icn skextra.icn skfun.icn \ 5 | skin.icn skio.icn sklist.icn skmisc.icn sknumber.icn skout.icn \ 6 | skstring.icn skuser.icn skutil.icn llist.icn 7 | 8 | 9 | skeem: $(SRC) 10 | $(ICONT) $(IFLAGS) $(SRC) 11 | 12 | 13 | Test: skeem 14 | MSTKSIZE=500000 ./skeem test.scm >test.out 15 | cmp test.std test.out 16 | 17 | 18 | Iexe: skeem 19 | cp skeem ../../iexe/ 20 | 21 | Clean: 22 | rm -f skeem *.u? *.out tmp? 23 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/Makefile: -------------------------------------------------------------------------------- 1 | tcll1: 2 | icont -s -c xcode escape ebcdic 3 | icont -s -c gramanal ll1 semstk readll1 parsell1 scangram semgram 4 | icont -s -fs tcll1 5 | 6 | Iexe: tcll1 7 | cp tcll1 ../../iexe/ 8 | 9 | Clean: 10 | rm -f *.u[12] tcll1 11 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/NOTICE: -------------------------------------------------------------------------------- 1 | In order to comply with the file-naming requirements for 2 | CD-ROM production, dashes in file names have been converted to 3 | underscores. You may find references to file names with 4 | dashes in the documentation; use the underscore versions. 5 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/bugs.grm: -------------------------------------------------------------------------------- 1 | start = e. 2 | e = e "+" t . 3 | e = e "-" t . 4 | t = t "*" t . 5 | t = t "/" t . 6 | t = f . 7 | p = i . 8 | p = "(" e ")" . 9 | 10 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/build1.bat: -------------------------------------------------------------------------------- 1 | rem These are from the Icon Program Library: 2 | 3 | icont -c xcode escape ebcdic 4 | 5 | rem These form the parser generator proper 6 | 7 | icont -c gramanal ll1 semstk readll1 parsell1 scangram semgram 8 | icont -fs tcll1 9 | 10 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/c_ll1.grm: -------------------------------------------------------------------------------- 1 | # c-ll1 2 | # LL(1) 3 | start = s . 4 | 5 | s = i ("=" e | ttail etail) . 6 | s = n ttail etail . 7 | s = "(" e ")" ttail etail . 8 | 9 | e = t etail. 10 | etail = { "+" t | "-" t } . 11 | 12 | t = f ttail . 13 | ttail = [ "*" t | f "/" t ]. 14 | 15 | f = i . 16 | f = n . 17 | f = "(" e ")" . 18 | 19 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/c_nll1.grm: -------------------------------------------------------------------------------- 1 | # c-nll1 2 | # not LL(1) 3 | 4 | start = s . 5 | s = e . 6 | s = i "=" e . 7 | e = e "+" t . 8 | e = e "-" t . 9 | e = t . 10 | t = f "*" t . 11 | t = f "/" t . 12 | t = f . 13 | f = i . 14 | f = n . 15 | f = "(" e ")" . 16 | 17 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/e.grm: -------------------------------------------------------------------------------- 1 | start = e . 2 | e = t { ("+" | "-") t } . 3 | t = f [ ("*" | "/") t ]. 4 | f = i | "(" e ")" . 5 | 6 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/e_notll1.grm: -------------------------------------------------------------------------------- 1 | # errors--not LL(1) 2 | 3 | start = e . 4 | e = e "+" t . 5 | e = e "-" t . 6 | e = t . 7 | t = f "*" t . 8 | t = f "/" t . 9 | t = f . 10 | f = i . 11 | f = "(" e ")" . 12 | 13 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/ea_ll1.grm: -------------------------------------------------------------------------------- 1 | # ea-ll1.grm 2 | # action symbols 3 | # LL(1) 4 | start = e . 5 | e = t { "+" t A! | "-" t S!} . 6 | t = f [ "*" t M! | "/" t D!]. 7 | f = i N! | "(" e ")" P!. 8 | 9 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/ea_nll1.grm: -------------------------------------------------------------------------------- 1 | # ea-nll1.grm 2 | # action symbols 3 | # not LL(1) 4 | 5 | start = e . 6 | e = e "+" t A!. 7 | e = e "-" t S!. 8 | e = t . 9 | t = f "*" t M!. 10 | t = f "/" t D!. 11 | t = f . 12 | f = i N!. 13 | f = "(" e ")" P!. 14 | 15 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/if_ll1.grm: -------------------------------------------------------------------------------- 1 | # if-ll1 2 | # still not really LL(1), but as close as we can get 3 | start = statement . 4 | statement = if e then statement else_option 5 | | i "=" e. 6 | else_option = [ else statement ]. 7 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/if_nll1.grm: -------------------------------------------------------------------------------- 1 | # if-nll1 2 | # not LL(1) 3 | start = statement . 4 | statement = if e then statement 5 | | if e then statement else statement 6 | | i "=" e. 7 | 8 | 9 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/ls_ll1.grm: -------------------------------------------------------------------------------- 1 | # ls-ll1 2 | # LL(1) 3 | start = labeled_statement . 4 | 5 | #labeled_statement = label statement . 6 | #label = i ":" label | . 7 | #statement = i "=" e. 8 | 9 | #labeled_statement = i ":" label statement . 10 | #labeled_statement = statement . 11 | #label = i ":" label | . 12 | #statement = i "=" e. 13 | 14 | #labeled_statement = i ":" label statement . 15 | #labeled_statement = i "=" e . 16 | #label = i ":" label | . 17 | #statement = i "=" e. 18 | 19 | labeled_statement = i labeled_statement_tail . 20 | labeled_statement_tail = "=" e . 21 | labeled_statement_tail = ":" labeled_statement . 22 | 23 | 24 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/ls_nll1.grm: -------------------------------------------------------------------------------- 1 | # ls-nll1 2 | # not LL(1) 3 | start = labeled_statement . 4 | labeled_statement = label statement . 5 | label = { i ":" }. 6 | statement = i "=" e. 7 | 8 | 9 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/rptperr.icn: -------------------------------------------------------------------------------- 1 | # 2 | # this is a minimal version of the error reporting procedure 3 | # needed by the parser 4 | # 5 | 6 | procedure reportParseError(t) 7 | write(&errout,"error: unexpected input ",t.body, 8 | " at line ",t.line," column ",t.column) 9 | return 10 | end 11 | 12 | 13 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/semout.icn: -------------------------------------------------------------------------------- 1 | # Routines to test grammars passed through the TCLL1 2 | # parser generator. 3 | # Link this with parseLL1 and it will write out the tokens 4 | # and action symbols recognized by the parser. 5 | # (written by Dr. Thomas W. Christopher) 6 | # 7 | procedure outToken(tok) 8 | write(tok.type," ",tok.line," ",tok.column," ",tok.body) 9 | return 10 | end 11 | 12 | procedure outAction(a) 13 | write(a) 14 | return 15 | end 16 | 17 | procedure outError(t) 18 | write("ERROR: ",t) 19 | return 20 | end 21 | 22 | procedure initSemantics() 23 | return 24 | end 25 | 26 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/tcll1.grm: -------------------------------------------------------------------------------- 1 | # Grammar for tlcll1 parser generator 2 | start = grammar. 3 | grammar = { declaration }. 4 | declaration = ID DeclLHS! ( COLON rhs DOT DeclSymbols! | 5 | EQ alts DOT DeclProduction!). 6 | rhs = StartRHS! {elem ExtendRHS!}. 7 | alts = rhs FirstAlt! {BAR rhs NextAlt!}. 8 | elem = ID bangOpt | 9 | LPAR alts RPAR Group! | 10 | LBRACE alts RBRACE Repeat! | 11 | LBRACK alts RBRACK Option! . 12 | bangOpt = [BANG DeclAction!]. 13 | fiducials : DOT. 14 | 15 | -------------------------------------------------------------------------------- /ipl/packs/tcll1/tcll1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/ipl/packs/tcll1/tcll1.pdf -------------------------------------------------------------------------------- /ipl/procs/binop.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: binop.icn 4 | # 5 | # Subject: Procedure to apply binary operation to list of values 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: July 15, 1995 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # This procedure applies a binary operation to a list of arguments. 18 | # For example, 19 | # 20 | # binop("+", 1, 2, 3) 21 | # 22 | # returns 6. 23 | # 24 | ############################################################################ 25 | 26 | procedure binop(op, result, rest[]) #: apply binary operation 27 | 28 | every result := op(result, !rest) 29 | 30 | return result 31 | 32 | end 33 | -------------------------------------------------------------------------------- /ipl/procs/filesize.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: filesize.icn 4 | # 5 | # Subject: Procedure to get the size of a file 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: July 9, 1998 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # filesize(s) returns the number of characters in the file named s; it 18 | # fails if s cannot be opened. 19 | # 20 | ############################################################################ 21 | 22 | procedure filesize(s) #: file size 23 | local input, size 24 | 25 | input := open(s) | fail 26 | 27 | size := 0 28 | 29 | while size +:= *reads(input, 10000) 30 | 31 | close(input) 32 | 33 | return size 34 | 35 | end 36 | -------------------------------------------------------------------------------- /ipl/procs/inserts.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: inserts.icn 4 | # 5 | # Subject: Procedures to build tables with duplicate keys 6 | # 7 | # Author: Robert J. Alexander 8 | # 9 | # Date: September 7, 1990 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # inserts() -- Inserts values into a table in which the same key can 18 | # have more than one value (i.e., duplicate keys). The value of each 19 | # element is a list of inserted values. The table must be created 20 | # with default value &null. 21 | # 22 | 23 | procedure inserts(tabl,key,value) 24 | (/tabl[key] := [value]) | put(tabl[key],value) 25 | return tabl 26 | end 27 | -------------------------------------------------------------------------------- /ipl/procs/progary.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: progary.icn 4 | # 5 | # Subject: Procedure to place program in a array 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: April 30, 1993 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # This procedure creates an array with one element for each program token. 18 | # The program is read from file. The initial value of each element is value. 19 | # 20 | ############################################################################ 21 | 22 | procedure progary(file, value) 23 | local A 24 | 25 | A := [] 26 | 27 | while put(A, list(*read(file), value)) 28 | 29 | return A 30 | 31 | end 32 | -------------------------------------------------------------------------------- /ipl/procs/seqfncs.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: seqfncs.icn 4 | # 5 | # Subject: Procedures for designing with sequences 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: September 30, 2001 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # Links: genrfncs, lterps, math, numbers, partit, pdco, seqops, strings, 18 | # convert 19 | # 20 | ############################################################################ 21 | 22 | link convert 23 | link genrfncs 24 | link lterps 25 | link math 26 | link numbers 27 | link partit 28 | link pdco 29 | link seqops 30 | link strings 31 | -------------------------------------------------------------------------------- /ipl/procs/serial.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: serial.icn 4 | # 5 | # Subject: Procedure to return serial number of structure 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: April 19, 1996 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # Procedure to return the serial number of a structure. 18 | # 19 | ############################################################################ 20 | 21 | procedure serial(x) #: structure serial number 22 | 23 | return image(x) ? { # fails on non-structure or bogus kind 24 | tab(upto('_') + 1) | fail 25 | return integer(tab(many(&digits))) 26 | } 27 | 28 | end 29 | -------------------------------------------------------------------------------- /ipl/procs/tclass.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: tclass.icn 4 | # 5 | # Subject: Procedure to classify values as atomic or composite 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: August 14, 1996 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # tclass(x) returns "atomic" or "composite" depending on the type of x. 18 | # 19 | ############################################################################ 20 | 21 | procedure tclass(x) 22 | 23 | return case type(x) of { 24 | "null" | 25 | "integer" | 26 | "real" | 27 | "string" | 28 | "cset": "atomic" 29 | default: "composite" 30 | } 31 | 32 | end 33 | -------------------------------------------------------------------------------- /ipl/procs/version.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: version.icn 4 | # 5 | # Subject: Procedures to produce Icon version number 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: September 2, 1991 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # This procedure produces the version number of Icon on which a 18 | # program is running. It only works if the &version is in the 19 | # standard form. 20 | # 21 | ############################################################################ 22 | 23 | procedure version() 24 | 25 | &version ? { 26 | tab(find("Version ") + 8) | fail 27 | tab(many('0123456789.')) ? return tab(-1) 28 | } 29 | 30 | end 31 | -------------------------------------------------------------------------------- /ipl/progs/applyfnc.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: applyfnc.icn 4 | # 5 | # Subject: Program to apply function to lines of a file 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: November 25, 1996 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # This program applies a function specified on the command line to the 18 | # lines of a file. 19 | # 20 | ############################################################################ 21 | 22 | procedure main(args) 23 | local func 24 | 25 | func := args[1] | stop("*** no function specified") 26 | 27 | while args[1] := read() do 28 | every write(func ! args) 29 | 30 | end 31 | -------------------------------------------------------------------------------- /ipl/progs/catlines.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: catlines.icn 4 | # 5 | # Subject: Program to concatenate lines of a file 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: January 14, 1999 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # This program concatenates all the lines from standard input and 18 | # writes the result to standard output. 19 | # 20 | ############################################################################ 21 | 22 | procedure main() 23 | local line 24 | 25 | line := "" 26 | 27 | while line ||:= read() 28 | 29 | write(line) 30 | 31 | end 32 | -------------------------------------------------------------------------------- /ipl/progs/chars.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: chars.icn 4 | # 5 | # Subject: Program to list the different characters in a file 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: March 26, 2002 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # This program lists all the different characters in a file. image() 18 | # is used to show printable representations. 19 | # 20 | ############################################################################ 21 | 22 | procedure main() 23 | local chars 24 | 25 | chars := '' 26 | 27 | while chars ++:= read() 28 | 29 | every write(image(!chars)) 30 | 31 | end 32 | -------------------------------------------------------------------------------- /ipl/progs/chkhtml.icn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/ipl/progs/chkhtml.icn -------------------------------------------------------------------------------- /ipl/progs/delta.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: delta.icn 4 | # 5 | # Subject: Program to list differences between successive numbers 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: January 22, 1999 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # This program reads a stream of numbers from standard input and write 18 | # a stream of their first differences to standard output. 19 | # 20 | ############################################################################ 21 | 22 | procedure main() 23 | local i, j 24 | 25 | i := read() | exit() 26 | 27 | while j := read() do { 28 | write(j - i) 29 | i := j 30 | } 31 | 32 | end 33 | -------------------------------------------------------------------------------- /ipl/progs/irunerr.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: irunerr.icn 4 | # 5 | # Subject: Program to print Icon runtime errors 6 | # 7 | # Author: Robert J. Alexander 8 | # 9 | # Date: September 22, 1993 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # Program to list Icon runtime errors. 18 | # 19 | ############################################################################ 20 | 21 | procedure main() 22 | local i 23 | 24 | every i := 100 to 500 do { 25 | &error := 1 26 | runerr(i) 27 | write(&errornumber," ","" ~== &errortext) 28 | } 29 | 30 | end 31 | -------------------------------------------------------------------------------- /ipl/progs/iwriter.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: iwriter.icn 4 | # 5 | # Subject: Program to write Icon code to write input 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: March 7, 1990 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # Program that reads standard input and produces Icon expressions, 18 | # which when compiled and executed, write out the original input. 19 | # 20 | # This is handy for incorporating, for example, message text in 21 | # Icon programs. Or even for writing Icon programs that write Icon 22 | # programs that ... . 23 | 24 | procedure main() 25 | 26 | while write("write(",image(read()),")") 27 | 28 | end 29 | -------------------------------------------------------------------------------- /ipl/progs/lister.icn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/ipl/progs/lister.icn -------------------------------------------------------------------------------- /ipl/progs/listviz.icn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/ipl/progs/listviz.icn -------------------------------------------------------------------------------- /ipl/progs/literat.icn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/ipl/progs/literat.icn -------------------------------------------------------------------------------- /ipl/progs/maccvt.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: maccvt.icn 4 | # 5 | # Subject: Program to convert Macintosh special characters to ASCII 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: September 18, 1998 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # This program maps the Macintosh characters for quotation and various 18 | # minus signs into their ASCII equivalents. 19 | # 20 | ############################################################################ 21 | 22 | procedure main() 23 | 24 | while write(map(read(), "\xd0\xd1\xd2\xd3\xd4\xd5", "--\"\"''")) 25 | 26 | end 27 | -------------------------------------------------------------------------------- /ipl/progs/revfile.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: revfile.icn 4 | # 5 | # Subject: Program to reverse the order of lines in a file 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: August 11, 1999 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # This program reverses the order of lines in a file. Beware of large 18 | # files. 19 | # 20 | ############################################################################ 21 | 22 | procedure main() 23 | local lines 24 | 25 | lines := [] 26 | 27 | every push(lines, !&input) 28 | 29 | every write(!lines) 30 | 31 | end 32 | -------------------------------------------------------------------------------- /ipl/progs/revsort.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: revsort.icn 4 | # 5 | # Subject: Program to sort strings backwards 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: September 5, 1995 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # This program sorts strings with characters in reverse order. 18 | # 19 | ############################################################################ 20 | 21 | procedure main() 22 | local terms 23 | 24 | terms := [] 25 | 26 | while put(terms, reverse(read())) 27 | 28 | terms := sort(terms) 29 | 30 | while write(reverse(get(terms))) 31 | 32 | end 33 | -------------------------------------------------------------------------------- /ipl/progs/sample.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: sample.icn 4 | # 5 | # Subject: Program to "sample" input stream 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: January 21, 1999 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # This program filters the input stream, producing every ith 18 | # value, starting at 1. i is given as a command-line argument; default 0. 19 | # 20 | ############################################################################ 21 | 22 | procedure main(args) 23 | local line, skip 24 | 25 | skip := integer(args[1]) | 0 26 | 27 | while write(read()) do 28 | every 1 to skip do read() 29 | 30 | end 31 | -------------------------------------------------------------------------------- /ipl/progs/unique.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: unique.icn 4 | # 5 | # Subject: Program to delete identical adjacent lines 6 | # 7 | # Author: Anthony V. Hewitt, modified by Bob Alexander 8 | # 9 | # Date: October 21, 1991 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # Filters out identical adjacent lines in a file. 18 | # 19 | ############################################################################ 20 | 21 | procedure main() 22 | local s 23 | 24 | every write(s ~===:= !&input) 25 | 26 | end 27 | -------------------------------------------------------------------------------- /ipl/progs/url2link.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # File: url2link.icn 4 | # 5 | # Subject: Program to convert bookmarked URLs to link references 6 | # 7 | # Author: Ralph E. Griswold 8 | # 9 | # Date: October 19, 1998 10 | # 11 | ############################################################################ 12 | # 13 | # This file is in the public domain. 14 | # 15 | ############################################################################ 16 | # 17 | # This program reads URLs from standard input and writes HTML links to 18 | # standard output. 19 | # 20 | ############################################################################ 21 | 22 | procedure main() 23 | 24 | while write("
") 25 | 26 | end 27 | -------------------------------------------------------------------------------- /lib/.gitignore: -------------------------------------------------------------------------------- 1 | *.u? 2 | *.icn 3 | icall.h 4 | -------------------------------------------------------------------------------- /lib/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/lib/.placeholder -------------------------------------------------------------------------------- /src/common/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | infer 3 | -------------------------------------------------------------------------------- /src/common/alloc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * alloc.c -- allocation routines for the Icon compiler 3 | */ 4 | 5 | #include "../h/gsupport.h" 6 | 7 | /* 8 | * salloc - allocate and initialize string 9 | */ 10 | 11 | char *salloc(char *s) 12 | { 13 | register char *s1; 14 | 15 | s1 = (char *)malloc(strlen(s) + 1); 16 | if (s1 == NULL) { 17 | fprintf(stderr, "salloc(%d): out of memory\n", (int)strlen(s) + 1); 18 | exit(EXIT_FAILURE); 19 | } 20 | return strcpy(s1, s); 21 | } 22 | 23 | /* 24 | * alloc - allocate n bytes 25 | */ 26 | 27 | pointer alloc(unsigned int n) 28 | { 29 | register pointer a; 30 | 31 | if (n == 0) /* Work-around for 0 allocation */ 32 | n = 1; 33 | 34 | a = calloc(n, sizeof(char)); 35 | if (a == NULL) { 36 | fprintf(stderr, "alloc(%d): out of memory\n", (int)n); 37 | exit(EXIT_FAILURE); 38 | } 39 | return a; 40 | } 41 | -------------------------------------------------------------------------------- /src/common/identify.c: -------------------------------------------------------------------------------- 1 | #include "../h/gsupport.h" 2 | 3 | #include "../h/version.h" 4 | 5 | extern char *progname; 6 | 7 | /* 8 | * id_comment - output a comment C identifying the date and time and what 9 | * program is producing the output. 10 | */ 11 | void id_comment(FILE *f) 12 | { 13 | static char sbuf[26]; 14 | static int first_time = 1; 15 | time_t ct; 16 | 17 | if (first_time) { 18 | time(&ct); 19 | strcpy(sbuf, ctime(&ct)); 20 | first_time = 0; 21 | } 22 | fprintf(f, "/*\n"); 23 | fprintf(f, " * %s", sbuf); 24 | fprintf(f, " * This file was produced by\n"); 25 | fprintf(f, " * %s: %s\n", progname, Version); 26 | fprintf(f, " */\n"); 27 | } 28 | -------------------------------------------------------------------------------- /src/common/long.c: -------------------------------------------------------------------------------- 1 | /* 2 | * long.c -- functions for handling long values on 16-bit computers. 3 | */ 4 | 5 | #include "../h/gsupport.h" 6 | 7 | /* 8 | * Write a long string in int-sized chunks. 9 | */ 10 | 11 | long longwrite(char *s, long len, FILE *file) 12 | { 13 | long tally = 0; 14 | int n = 0; 15 | int leftover, loopnum; 16 | char *p; 17 | 18 | leftover = (int)(len % (long)MaxInt); 19 | for (p = s, loopnum = (int)(len / (long)MaxInt); loopnum; loopnum--) { 20 | n = fwrite(p,sizeof(char),MaxInt,file); 21 | tally += (long)n; 22 | p += MaxInt; 23 | } 24 | if (leftover) { 25 | n = fwrite(p,sizeof(char),leftover,file); 26 | tally += (long)n; 27 | } 28 | if (tally != len) 29 | return -1; 30 | else return tally; 31 | } 32 | -------------------------------------------------------------------------------- /src/h/.gitignore: -------------------------------------------------------------------------------- 1 | arch.h 2 | define.h 3 | -------------------------------------------------------------------------------- /src/h/gsupport.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Group of include files for translators, etc. 3 | */ 4 | 5 | #include "../h/define.h" 6 | 7 | #include "../h/arch.h" 8 | #include "../h/config.h" 9 | #include "../h/sys.h" 10 | #include "../h/typedefs.h" 11 | #include "../h/cstructs.h" 12 | #include "../h/mproto.h" 13 | #include "../h/cpuconf.h" 14 | -------------------------------------------------------------------------------- /src/h/rt.h: -------------------------------------------------------------------------------- 1 | #ifndef RT_DOT_H /* only include once */ 2 | #define RT_DOT_H 1 3 | 4 | /* 5 | * Inhibit complaints about unnecessary generated parentheses. 6 | */ 7 | #pragma clang diagnostic ignored "-Wparentheses" 8 | 9 | /* 10 | * Include files. 11 | */ 12 | 13 | #include "../h/define.h" 14 | #include "../h/arch.h" 15 | #include "../h/config.h" 16 | #include "../h/sys.h" 17 | #include "../h/typedefs.h" 18 | #include "../h/cstructs.h" 19 | #include "../h/mproto.h" 20 | #include "../h/cpuconf.h" 21 | #include "../h/rmacros.h" 22 | #include "../h/rstructs.h" 23 | 24 | #ifdef Graphics 25 | #include "../h/graphics.h" 26 | #endif /* Graphics */ 27 | 28 | #include "../h/rexterns.h" 29 | #include "../h/rproto.h" 30 | 31 | #endif /* RT_DOT_H */ 32 | -------------------------------------------------------------------------------- /src/icont/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | hdr.h 3 | icont 4 | ixhdr.hdr 5 | newhdr 6 | -------------------------------------------------------------------------------- /src/icont/lfile.h: -------------------------------------------------------------------------------- 1 | /* 2 | * A linked list of files named by link declarations is maintained using 3 | * lfile structures. 4 | */ 5 | struct lfile { 6 | char *lf_name; /* name of the file */ 7 | struct lfile *lf_link; /* pointer to next file */ 8 | }; 9 | 10 | extern struct lfile *lfiles; 11 | 12 | 13 | /* 14 | * "Invocable" declarations are recorded in a list of invkl structs. 15 | */ 16 | struct invkl { 17 | char *iv_name; /* name of global */ 18 | struct invkl *iv_link; /* link to next entry */ 19 | }; 20 | 21 | extern struct invkl *invkls; 22 | -------------------------------------------------------------------------------- /src/icont/opcode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Opcode table structure. 3 | */ 4 | 5 | struct opentry { 6 | char *op_name; /* name of opcode */ 7 | int op_code; /* opcode number */ 8 | }; 9 | 10 | /* 11 | * External definitions. 12 | */ 13 | 14 | extern struct opentry optable[]; 15 | extern int NOPCODES; 16 | 17 | #include "../h/opdefs.h" 18 | -------------------------------------------------------------------------------- /src/icont/tglobals.c: -------------------------------------------------------------------------------- 1 | /* 2 | * tglobals.c - declaration and initialization of icont globals. 3 | */ 4 | 5 | #include "../h/gsupport.h" 6 | #include "tproto.h" 7 | 8 | #define Global 9 | #define Init(v) = v 10 | #include "tglobals.h" /* define globals */ 11 | 12 | /* 13 | * Initialize globals that cannot be handled statically. 14 | */ 15 | void initglob(void) { 16 | /* 17 | * Round hash table sizes to next power of two, and set masks for hashing. 18 | */ 19 | lchsize = round2(lchsize); cmask = lchsize - 1; 20 | fhsize = round2(fhsize); fmask = fhsize - 1; 21 | ghsize = round2(ghsize); gmask = ghsize - 1; 22 | ihsize = round2(ihsize); imask = ihsize - 1; 23 | lhsize = round2(lhsize); lmask = lhsize - 1; 24 | } 25 | -------------------------------------------------------------------------------- /src/icont/tlex.c: -------------------------------------------------------------------------------- 1 | /* 2 | * tlex.c -- the lexical analyzer for icont. 3 | */ 4 | 5 | #include "../h/gsupport.h" 6 | #undef T_Real 7 | #undef T_String 8 | #undef T_Cset 9 | #include "../h/lexdef.h" 10 | #include "ttoken.h" 11 | #include "tree.h" 12 | #include "tproto.h" 13 | #include "../h/parserr.h" 14 | #include "../common/lextab.h" 15 | #include "../common/yylex.h" 16 | #include "../common/error.h" 17 | -------------------------------------------------------------------------------- /src/rtt/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | rtt 3 | -------------------------------------------------------------------------------- /src/rtt/rtt.h: -------------------------------------------------------------------------------- 1 | #include "ltoken.h" 2 | #include "rtt1.h" 3 | -------------------------------------------------------------------------------- /src/runtime/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | iconx 3 | -------------------------------------------------------------------------------- /src/runtime/rwinsys.r: -------------------------------------------------------------------------------- 1 | /* 2 | * File: rwinsys.r 3 | * Window-system-specific window support routines. 4 | * This file simply includes an appropriate r*win.ri file. 5 | */ 6 | 7 | #passthru #pragma GCC diagnostic ignored "-Wunused-variable" 8 | 9 | #ifdef Graphics 10 | 11 | #ifdef XWindows 12 | #include "rxwin.ri" 13 | #endif /* XWindows */ 14 | 15 | #ifdef WinGraphics 16 | #include "rmswin.ri" 17 | #endif /* WinGraphics */ 18 | 19 | #endif /* Graphics */ 20 | -------------------------------------------------------------------------------- /src/wincap/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for creating a library of the parts of Wincap used by Icon. 2 | 3 | include ../../Makedefs 4 | 5 | W32DEFS = -mwin32 6 | OBJS = copy.o dibutil.o errors.o file.o 7 | 8 | .c.o: 9 | $(CC) -c $(CFLAGS) $(W32DEFS) $*.c 10 | 11 | libWincap.a: $(OBJS) 12 | rm -f $@ 13 | ar qc $@ $(OBJS) 14 | 15 | copy.o: copy.c dibapi.h dibutil.h errors.h 16 | 17 | dibutil.o: dibutil.c dibutil.h 18 | 19 | errors.o: errors.c errors.h 20 | 21 | file.o: file.c dibapi.h dibutil.h errors.h 22 | 23 | Clean: 24 | rm -f *.o *.a 25 | -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for testing Icon 2 | 3 | 4 | # The default is to run all tests. 5 | 6 | Test Test-icont: ; cd general; $(MAKE) Test 7 | Samples Samples-icont: ; cd general; $(MAKE) Samples 8 | 9 | 10 | # Clean up. 11 | 12 | Clean Pure: 13 | cd bench; $(MAKE) Clean 14 | cd general; $(MAKE) Clean 15 | cd special; $(MAKE) Clean 16 | -------------------------------------------------------------------------------- /tests/README: -------------------------------------------------------------------------------- 1 | The sub-directories here contain various test material for Version 9.5 of Icon. 2 | 3 | bench benchmarking suite 4 | general main test suite, including quick "samples" subset 5 | special tests of special features 6 | -------------------------------------------------------------------------------- /tests/bench/Comp-icont: -------------------------------------------------------------------------------- 1 | for i in $* 2 | do 3 | echo translating $i 4 | ../../bin/icont -s -o $i-t $i 5 | done 6 | -------------------------------------------------------------------------------- /tests/bench/Execute-icont: -------------------------------------------------------------------------------- 1 | echo Running concord ... 2 | ./concord-t concord-t.out 3 | echo Running deal ... 4 | ./deal-t -h 500 >deal-t.out 5 | echo Running ipxref ... 6 | ./ipxref-t ipxref-t.out 7 | echo Running queens ... 8 | ./queens-t -n9 >queens-t.out 9 | echo Running rsg ... 10 | ./rsg-t rsg-t.out 11 | -------------------------------------------------------------------------------- /tests/bench/Makefile: -------------------------------------------------------------------------------- 1 | default: benchmark 2 | 3 | 4 | micro microbench microbenchmark: 5 | ../../bin/icon micro.icn >micro.out 6 | ../../bin/icon micsum.icn micro.out >micro.sum 7 | cat micro.sum 8 | 9 | benchmark: 10 | $(MAKE) benchmark-icont 11 | 12 | benchmark-icont: 13 | $(MAKE) translate-icont compile-icont run-icont check-icont 14 | 15 | translate-icont: 16 | sh Trans-icont post options shuffle 17 | 18 | compile-icont: 19 | sh Comp-icont concord deal ipxref queens rsg 20 | 21 | run-icont: 22 | sh Execute-icont 23 | 24 | rerun-icont: 25 | sh ReRun-icont 26 | 27 | check-icont: 28 | grep elapsed *-t.out 29 | 30 | Clean: 31 | rm -f *.out *.sum *-t *.u? 32 | -------------------------------------------------------------------------------- /tests/bench/README: -------------------------------------------------------------------------------- 1 | This directory contains programs and scripts for benchmarking 2 | Icon. The whole thing can be done with 3 | 4 | make benchmark 5 | 6 | Notes: 7 | 8 | In order for the benchmarks to be compared meaningfully to benchmarks 9 | from other computers, the Icon string and block region sizes must 10 | be consistent. The output shows the values used. 11 | 12 | The benchmarks normally are run with normal program output turned off 13 | to prevent the results from being affected by i/o factors. Output can be 14 | turned on by setting the environment variable OUTPUT. Timings with output 15 | turned on generally cannot be compared meaningfully to benchmarks from 16 | other platforms. 17 | 18 | Benchmarking is contingent on Icon running properly. Output from benchmark- 19 | ing icont on a Sun 4/490 is contained in the files *.std, and can be used for 20 | comparison if there is any doubt. 21 | -------------------------------------------------------------------------------- /tests/bench/ReRun-icont: -------------------------------------------------------------------------------- 1 | echo Running concord ... 2 | ./concord-t >concord-t.out 3 | echo Running deal ... 4 | ./deal-t -h 500 >>deal-t.out 5 | echo Running ipxref ... 6 | ./ipxref-t >ipxref-t.out 7 | echo Running queens ... 8 | ./queens-t -n9 >>queens-t.out 9 | echo Running rsg ... 10 | ./rsg-t >rsg-t.out 11 | -------------------------------------------------------------------------------- /tests/bench/Trans-icont: -------------------------------------------------------------------------------- 1 | for i in $* 2 | do 3 | echo translating $i 4 | ../../bin/icont -s -c $i 5 | done 6 | -------------------------------------------------------------------------------- /tests/bench/concord.std: -------------------------------------------------------------------------------- 1 | Icon Interpreter Version 8.10. March 11, 1993 2 | cheltenham 3 | UNIX 4 | interpreted 5 | ASCII 6 | co-expressions 7 | direct execution 8 | environment variables 9 | error trace back 10 | external functions 11 | fixed regions 12 | keyboard functions 13 | large integers 14 | math functions 15 | multiple regions 16 | pipes 17 | string invocation 18 | system function 19 | window functions 20 | X Windows 21 | regions 22 | static 0 23 | string 65000 24 | block 65000 25 | concord elapsed time = 5650 26 | regions 27 | static 0 28 | string 65000 29 | block 65000 30 | storage 31 | static 0 32 | string 64605 33 | block 25108 34 | collections 35 | total 4 36 | static 0 37 | string 4 38 | block 0 39 | -------------------------------------------------------------------------------- /tests/bench/deal.std: -------------------------------------------------------------------------------- 1 | Icon Interpreter Version 8.10. March 11, 1993 2 | cheltenham 3 | UNIX 4 | interpreted 5 | ASCII 6 | co-expressions 7 | direct execution 8 | environment variables 9 | error trace back 10 | external functions 11 | fixed regions 12 | keyboard functions 13 | large integers 14 | math functions 15 | multiple regions 16 | pipes 17 | string invocation 18 | system function 19 | window functions 20 | X Windows 21 | regions 22 | static 0 23 | string 65000 24 | block 65000 25 | deal elapsed time = 5967 26 | regions 27 | static 0 28 | string 65000 29 | block 65000 30 | storage 31 | static 0 32 | string 48277 33 | block 27612 34 | collections 35 | total 45 36 | static 0 37 | string 45 38 | block 0 39 | -------------------------------------------------------------------------------- /tests/bench/ipxref.std: -------------------------------------------------------------------------------- 1 | Icon Interpreter Version 8.10. March 11, 1993 2 | cheltenham 3 | UNIX 4 | interpreted 5 | ASCII 6 | co-expressions 7 | direct execution 8 | environment variables 9 | error trace back 10 | external functions 11 | fixed regions 12 | keyboard functions 13 | large integers 14 | math functions 15 | multiple regions 16 | pipes 17 | string invocation 18 | system function 19 | window functions 20 | X Windows 21 | regions 22 | static 0 23 | string 65000 24 | block 65000 25 | ipxref elapsed time = 1416 26 | regions 27 | static 0 28 | string 65000 29 | block 65000 30 | storage 31 | static 0 32 | string 27271 33 | block 63480 34 | collections 35 | total 1 36 | static 0 37 | string 0 38 | block 1 39 | -------------------------------------------------------------------------------- /tests/bench/queens.std: -------------------------------------------------------------------------------- 1 | Icon Interpreter Version 8.10. March 11, 1993 2 | cheltenham 3 | UNIX 4 | interpreted 5 | ASCII 6 | co-expressions 7 | direct execution 8 | environment variables 9 | error trace back 10 | external functions 11 | fixed regions 12 | keyboard functions 13 | large integers 14 | math functions 15 | multiple regions 16 | pipes 17 | string invocation 18 | system function 19 | window functions 20 | X Windows 21 | regions 22 | static 0 23 | string 65000 24 | block 65000 25 | elapsed time = 7884 26 | regions 27 | static 0 28 | string 65000 29 | block 65000 30 | storage 31 | static 0 32 | string 39895 33 | block 11924 34 | collections 35 | total 3 36 | static 0 37 | string 3 38 | block 0 39 | -------------------------------------------------------------------------------- /tests/bench/rsg.dat: -------------------------------------------------------------------------------- 1 | ::= ; 2 | ::= , . 3 | ::= . 4 | ::= 5 | ::=he|she|the shadowy figure|the boy|a child 6 | ::=outlines|casts toward|stares at|captures|damns 7 | ::=lingers|pauses|reflects|alights|hesitates|turns away|returns|kneels|stares 8 | ::=and |but |and |while 9 | ::=slowly|silently|darkly|with fear|expectantly|fearfully 10 | ::=waiting|pointing|breathing 11 | ::=
12 |
::=a|the 13 | ::=sky|void|abyss|star|darkness|lake|moon|cloud 14 | ::=while|as|momentarily|frozen, 15 | 1000 16 | -------------------------------------------------------------------------------- /tests/bench/rsg.std: -------------------------------------------------------------------------------- 1 | Icon Interpreter Version 8.10. March 11, 1993 2 | cheltenham 3 | UNIX 4 | interpreted 5 | ASCII 6 | co-expressions 7 | direct execution 8 | environment variables 9 | error trace back 10 | external functions 11 | fixed regions 12 | keyboard functions 13 | large integers 14 | math functions 15 | multiple regions 16 | pipes 17 | string invocation 18 | system function 19 | window functions 20 | X Windows 21 | regions 22 | static 0 23 | string 65000 24 | block 65000 25 | elapsed time = 8766 26 | regions 27 | static 0 28 | string 65000 29 | block 65000 30 | storage 31 | static 0 32 | string 537 33 | block 45812 34 | collections 35 | total 44 36 | static 0 37 | string 0 38 | block 44 39 | -------------------------------------------------------------------------------- /tests/bench/shuffle.icn: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # 3 | # Name: shuffle.icn 4 | # 5 | # Title: Shuffle values 6 | # 7 | # Author: Ward Cunningham 8 | # 9 | # Date: June 10, 1988 10 | # 11 | ############################################################################ 12 | # 13 | # The procedure shuffle(x) shuffles a string or list. In the case 14 | # that x is a string, a corresponding string with the characters 15 | # randomly rearranged is produced. In the case that x is a list, 16 | # the values in the list are randomly rearranged. 17 | # 18 | ############################################################################ 19 | 20 | procedure shuffle(x) 21 | x := string(x) 22 | every !x :=: ?x 23 | return x 24 | end 25 | -------------------------------------------------------------------------------- /tests/general/.gitignore: -------------------------------------------------------------------------------- 1 | *.out 2 | features 3 | foo.baz 4 | hello.p 5 | tpp.all 6 | tpp.err 7 | tmp? 8 | -------------------------------------------------------------------------------- /tests/general/btrees.dat: -------------------------------------------------------------------------------- 1 | a(b,c) 2 | 1(2(3,4),5) 3 | a(2,8(a,c(d,e))) 4 | -------------------------------------------------------------------------------- /tests/general/btrees.std: -------------------------------------------------------------------------------- 1 | tree walk 2 | b 3 | c 4 | a 5 | leaves 6 | b 7 | c 8 | tree walk 9 | 3 10 | 4 11 | 2 12 | 5 13 | 1 14 | leaves 15 | 3 16 | 4 17 | 5 18 | tree walk 19 | 2 20 | a 21 | d 22 | e 23 | c 24 | 8 25 | a 26 | leaves 27 | 2 28 | a 29 | d 30 | e 31 | -------------------------------------------------------------------------------- /tests/general/case.icn: -------------------------------------------------------------------------------- 1 | #SRC: JCON 2 | 3 | record rec(a) 4 | 5 | procedure main(args) 6 | local L, s, x, r, c 7 | 8 | r := rec(45) 9 | c := create 1 | 2 10 | L := [&null, 0, 1, 2, 0.0, 1.0, 2.0, "", "0", "1", "2", '', '0', '1', '2', 11 | rec, main, foo, rec, rec(), r, c, []] 12 | put(L, L) 13 | 14 | every x := !L do { 15 | s := case x of { 16 | 1: "1" 17 | '1': "'1'" 18 | 1.0: "1.0" 19 | "1": "\"1\"" 20 | &null: "null" 21 | main: "main" 22 | rec: "rec" 23 | rec(): "rec()" # shouldn't ever match 24 | r: "r" 25 | c: "c" 26 | L: "L" 27 | default: "default" 28 | } 29 | write(right(s, 10), " : " , image(x)) 30 | } 31 | end 32 | 33 | procedure foo() 34 | end 35 | -------------------------------------------------------------------------------- /tests/general/case.std: -------------------------------------------------------------------------------- 1 | null : &null 2 | default : 0 3 | 1 : 1 4 | default : 2 5 | default : 0.0 6 | 1.0 : 1.0 7 | default : 2.0 8 | default : "" 9 | default : "0" 10 | "1" : "1" 11 | default : "2" 12 | default : '' 13 | default : '0' 14 | '1' : '1' 15 | default : '2' 16 | rec : record constructor rec 17 | main : procedure main 18 | default : procedure foo 19 | rec : record constructor rec 20 | default : record rec_2(1) 21 | r : record rec_1(1) 22 | c : co-expression_2(0) 23 | default : list_2(0) 24 | L : list_3(24) 25 | -------------------------------------------------------------------------------- /tests/general/center.icn: -------------------------------------------------------------------------------- 1 | #SRC: JCON 2 | 3 | procedure main() 4 | write(center("12345",3, "")) 5 | write(center("1",3, "")) 6 | write(center("123")) 7 | write(center("12")) 8 | write(center("1234",1)) 9 | write(center("1234",2)) 10 | write(center("1234",3)) 11 | write(center("12345",1)) 12 | write(center("12345",2)) 13 | write(center("12345",3)) 14 | write(center("123",8)) 15 | write(center("12",8)) 16 | write(center("123",9)) 17 | write(center("12",9)) 18 | write(center("123",8,"<>")) 19 | write(center("12",8,"<>")) 20 | write(center("123",9,"<>")) 21 | write(center("12",9,"<>")) 22 | end 23 | -------------------------------------------------------------------------------- /tests/general/center.std: -------------------------------------------------------------------------------- 1 | 234 2 | 1 3 | 2 4 | 2 5 | 3 6 | 23 7 | 234 8 | 3 9 | 34 10 | 234 11 | 123 12 | 12 13 | 123 14 | 12 15 | <>123><> 16 | <><12><> 17 | <><123><> 18 | <><12<><> 19 | -------------------------------------------------------------------------------- /tests/general/cfuncs.icn: -------------------------------------------------------------------------------- 1 | # Test dynamic loading with a few standard cfuncs. 2 | 3 | link cfunc 4 | 5 | procedure main() 6 | local i 7 | 8 | every i := 500 to 513 do 9 | gen(bitcount, i) 10 | 11 | write() 12 | gen(vword, 314159) 13 | gen(lgconv, 10 ^ 30) 14 | gen(unpack, "abcd") 15 | gen(pack, 1684234849) 16 | end 17 | 18 | procedure gen(p, a) 19 | write(image(p), "(", image(a), ") = ", p(a) | "[failed]") 20 | return 21 | end 22 | -------------------------------------------------------------------------------- /tests/general/cfuncs.std: -------------------------------------------------------------------------------- 1 | procedure bitcount(500) = 6 2 | function bitcount(501) = 7 3 | function bitcount(502) = 7 4 | function bitcount(503) = 8 5 | function bitcount(504) = 6 6 | function bitcount(505) = 7 7 | function bitcount(506) = 7 8 | function bitcount(507) = 8 9 | function bitcount(508) = 7 10 | function bitcount(509) = 8 11 | function bitcount(510) = 8 12 | function bitcount(511) = 9 13 | function bitcount(512) = 1 14 | function bitcount(513) = 2 15 | 16 | procedure vword(314159) = 314159 17 | procedure lgconv(integer(~10^30)) = 1000000000000000000000000000000 18 | procedure unpack("abcd") = 1684234849 19 | procedure pack(1684234849) = abcd 20 | -------------------------------------------------------------------------------- /tests/general/cxprimes.icn: -------------------------------------------------------------------------------- 1 | # prime number generation using co-expressions 2 | 3 | procedure main(args) 4 | local s, n, x 5 | 6 | n := integer(get(args)) | 100 7 | s := create (2 to n) 8 | while (x := @s) do { 9 | write(x) 10 | s := create sieve(x, s) 11 | } 12 | end 13 | 14 | procedure sieve(x, s) 15 | local t 16 | 17 | while t := @s do { 18 | if t % x ~= 0 then suspend t 19 | } 20 | end 21 | -------------------------------------------------------------------------------- /tests/general/cxprimes.std: -------------------------------------------------------------------------------- 1 | 2 2 | 3 3 | 5 4 | 7 5 | 11 6 | 13 7 | 17 8 | 19 9 | 23 10 | 29 11 | 31 12 | 37 13 | 41 14 | 43 15 | 47 16 | 53 17 | 59 18 | 61 19 | 67 20 | 71 21 | 73 22 | 79 23 | 83 24 | 89 25 | 97 26 | -------------------------------------------------------------------------------- /tests/general/diffwrds.dat: -------------------------------------------------------------------------------- 1 | procedure main() 2 | local limit, s, i 3 | limit := 100 4 | s := set([]) 5 | every insert(s,1 to limit) 6 | every member(s,i := 2 to limit) do 7 | every delete(s,i + i to limit by i) 8 | primes := sort(s) 9 | write("There are ",*primes," primes in the first ",limit," integers.") 10 | write("The primes are:") 11 | every write(right(!primes,*limit + 1)) 12 | end 13 | -------------------------------------------------------------------------------- /tests/general/diffwrds.icn: -------------------------------------------------------------------------------- 1 | # 2 | # D I F F E R E N T W O R D S 3 | # 4 | 5 | # This program lists all the different words in the input text. 6 | # The definition of a "word" is naive. 7 | 8 | procedure main() 9 | words := set() 10 | while text := read() do 11 | text ? while tab(upto(&letters)) do 12 | insert(words,tab(many(&letters))) 13 | every write(!sort(words)) 14 | end 15 | -------------------------------------------------------------------------------- /tests/general/diffwrds.std: -------------------------------------------------------------------------------- 1 | The 2 | There 3 | are 4 | by 5 | delete 6 | do 7 | end 8 | every 9 | first 10 | i 11 | in 12 | insert 13 | integers 14 | limit 15 | local 16 | main 17 | member 18 | primes 19 | procedure 20 | right 21 | s 22 | set 23 | sort 24 | the 25 | to 26 | write 27 | -------------------------------------------------------------------------------- /tests/general/endetab.std: -------------------------------------------------------------------------------- 1 | testing entab/detab(s) 2 | testing entab/detab(s,5) 3 | testing entab/detab(s,8,12) 4 | testing entab/detab(s,11,18,30,36) 5 | testing entab/detab(s,11,60) 6 | testing entab/detab(s,2) 7 | testing entab/detab(s,2,4) 8 | testing entab/detab(s,3) 9 | testing entab/detab(s,3,4) 10 | testing entab/detab(s,5) 11 | testing entab/detab(s,5,7,10) 12 | -------------------------------------------------------------------------------- /tests/general/env.icn: -------------------------------------------------------------------------------- 1 | procedure main() 2 | write() 3 | write("&host: ", &host) 4 | write("&dateline: ", &dateline) 5 | write(" &date: ", &date) 6 | write(" &clock: ", &clock) 7 | write("&version: ", &version) 8 | write("&features:") 9 | every write(" ", &features) 10 | write("getenv(\"HOME\"): ", getenv("HOME") | "[failed]") 11 | write("getenv(\"SHELL\"): ", getenv("SHELL") | "[failed]") 12 | write("uname -a: ", read(open("uname -a", "p")) | "[failed]") 13 | write() 14 | end 15 | -------------------------------------------------------------------------------- /tests/general/errkwds.icn: -------------------------------------------------------------------------------- 1 | #SRC: JCON 2 | #OPT: -fe 3 | 4 | procedure main() 5 | write(&error) 6 | write(&errornumber | "fail") 7 | write(&errortext | "fail") 8 | write(image(&errorvalue) | "fail") 9 | &error := 1 10 | write(&error) 11 | write(&null() | "fail") 12 | write(&error) 13 | write(&errornumber | "fail") 14 | write(&errortext | "fail") 15 | write(image(&errorvalue) | "fail") 16 | write(&error) 17 | write(&errornumber | "fail") 18 | write(&errortext | "fail") 19 | write(image(&errorvalue) | "fail") 20 | errorclear() 21 | write(&error) 22 | write(&errornumber | "fail") 23 | write(&errortext | "fail") 24 | write(image(&errorvalue) | "fail") 25 | end 26 | -------------------------------------------------------------------------------- /tests/general/errkwds.std: -------------------------------------------------------------------------------- 1 | 0 2 | fail 3 | fail 4 | fail 5 | 1 6 | fail 7 | 0 8 | 106 9 | procedure or integer expected 10 | &null 11 | 0 12 | 106 13 | procedure or integer expected 14 | &null 15 | 0 16 | fail 17 | fail 18 | fail 19 | -------------------------------------------------------------------------------- /tests/general/every.std: -------------------------------------------------------------------------------- 1 | a. 2 | b. -3 3 | c. 1 4 | c. 2 5 | c. 3 6 | c. 4 7 | c. 5 8 | c. 6 9 | c. 7 10 | c. 8 11 | c. 9 12 | c. 10 13 | d. 1 14 | d. 4 15 | d. 7 16 | d. 10 17 | e. 1 18 | e. 4 19 | e. 7 20 | e. 10 21 | f. 1 22 | f. 4 23 | f. 7 24 | f. 10 25 | h. 10 26 | h. 7 27 | h. 4 28 | h. 1 29 | i. 11 30 | i. 8 31 | i. 5 32 | i. 2 33 | j. 12 34 | j. 9 35 | j. 6 36 | j. 3 37 | k. 9 38 | k. 9.1 39 | k. 8.5 40 | k. 8.6 41 | l. hello world 42 | l. hello mom 43 | l. goodbye world 44 | l. goodbye mom 45 | n. a 46 | o. a 47 | o. b 48 | o. c 49 | o. d 50 | o. e 51 | p. - 52 | p. 5 53 | p. 1 54 | p. 4 55 | q. 1 56 | q. 2 57 | q. . 58 | q. 5 59 | r. .bcde 60 | r. ..cde 61 | r. ...de 62 | r. ....e 63 | r. ..... 64 | s. 101 65 | s. 102 66 | s. 101 67 | s. 102 68 | t. 201 69 | t. 202 70 | t. 201 71 | t. 202 72 | u. 5 73 | u. -5 74 | -------------------------------------------------------------------------------- /tests/general/gc1.icn: -------------------------------------------------------------------------------- 1 | procedure main() 2 | write("filling ...") 3 | every 1 to 100 do { 4 | every 1 to 100 do 5 | list(1000) 6 | } 7 | #write(&collections) 8 | write("collecting ...") 9 | collect() 10 | write("filling ...") 11 | every s := repl("x",1 to 1000) do { 12 | cset(string(&lcase)) 13 | t := table() 14 | set([s]) 15 | s[2 : 5] 16 | } 17 | write("done") 18 | end 19 | -------------------------------------------------------------------------------- /tests/general/gc1.std: -------------------------------------------------------------------------------- 1 | filling ... 2 | collecting ... 3 | filling ... 4 | done 5 | -------------------------------------------------------------------------------- /tests/general/hello.icn: -------------------------------------------------------------------------------- 1 | # hello.icn -- used in various ways by the Test-opts script 2 | 3 | procedure main(args) 4 | write("\t\t\t\t\t\t\tHello, ", get(args) | "there", ".") 5 | every 1 to 7 do 6 | sqrt(42) 7 | end 8 | -------------------------------------------------------------------------------- /tests/general/io.dat: -------------------------------------------------------------------------------- 1 | aaa 2 | bbbb 3 | ccccc 4 | dddddd 5 | eeeeeee 6 | ffffffff 7 | ggggggggg 8 | hhhhhhhhhh 9 | iiiiiiiiiii 10 | jjjjjjjjjjjj 11 | kkkkkkkkkkkkk 12 | llllllllllllll 13 | mmmmmmmmmmmmmmm 14 | -------------------------------------------------------------------------------- /tests/general/iobig.std: -------------------------------------------------------------------------------- 1 | writing file(tmp3) 2 | reading file(tmp3) 3 | closing file(tmp3) 4 | writing file(tmp4) 5 | reading file(tmp4) 6 | closing file(tmp4) 7 | no problems found 8 | -------------------------------------------------------------------------------- /tests/general/kross.dat: -------------------------------------------------------------------------------- 1 | elephants:peanuts 2 | encroachment:roaches 3 | gaggle:geese 4 | -------------------------------------------------------------------------------- /tests/general/kross.icn: -------------------------------------------------------------------------------- 1 | # 2 | # W O R D I N T E R S E C T I O N S 3 | # 4 | 5 | # This program procedure accepts string pairs from standard input, with 6 | # the strings separated by semicolons. It then diagrams all the 7 | # intersections of the two strings in a common character. 8 | 9 | procedure main() 10 | local line, j 11 | while line := read() do $( 12 | write() 13 | j := upto(':',line) 14 | cross(line$<1:j$>,line$) 15 | $) 16 | end 17 | 18 | procedure cross(s1,s2) 19 | local j, k 20 | every j := upto(s2,s1) do 21 | every k := upto(s1$,s2) do 22 | xprint(s1,s2,j,k) 23 | end 24 | 25 | procedure xprint(s1,s2,j,k) 26 | write() 27 | every write(right(s2$<1 to k-1$>,j)) 28 | write(s1) 29 | every write(right(s2$,j)) 30 | end 31 | -------------------------------------------------------------------------------- /tests/general/left.icn: -------------------------------------------------------------------------------- 1 | #SRC: JCON 2 | 3 | procedure main() 4 | 5 | write(left("abc")) 6 | write(left("def", )) 7 | write(left("ghi", &null)) 8 | write(left("jkl", 2)) 9 | write(left("mno", 3)) 10 | write(left(237, 4)) 11 | write(left("stu", 5)) 12 | write(left("vwx", 6)) 13 | 14 | write(left("abc", 3, )) 15 | write(left("def", , ".")) 16 | write(left("ghi", &null, ".")) 17 | write(left("jkl", 2, ".")) 18 | write(left("mno", 3, ".")) 19 | write(left(237, 4, ".")) 20 | write(left("stu", 5, ".")) 21 | write(left("vwx", 6, ".")) 22 | 23 | write(left("abc", 3, )) 24 | write(left("def", , "<>")) 25 | write(left("ghi", &null, "<>")) 26 | write(left("jkl", 2, "<>")) 27 | write(left("mno", 3, "<>")) 28 | write(left(237, 4, "<>")) 29 | write(left("stu", 5, "<>")) 30 | write(left("vwx", 6, "<>")) 31 | end 32 | -------------------------------------------------------------------------------- /tests/general/left.std: -------------------------------------------------------------------------------- 1 | a 2 | d 3 | g 4 | jk 5 | mno 6 | 237 7 | stu 8 | vwx 9 | abc 10 | d 11 | g 12 | jk 13 | mno 14 | 237. 15 | stu.. 16 | vwx... 17 | abc 18 | d 19 | g 20 | jk 21 | mno 22 | 237> 23 | stu<> 24 | vwx><> 25 | -------------------------------------------------------------------------------- /tests/general/level.icn: -------------------------------------------------------------------------------- 1 | #SRC: JCON 2 | 3 | procedure main() 4 | write(&level); 5 | foo(3); 6 | write(&level); 7 | every bar(3) 8 | write(&level); 9 | end 10 | 11 | procedure foo(n) 12 | write(&level); 13 | if n ~= 0 then foo(n-1) 14 | write(&level); 15 | end 16 | 17 | procedure bar(n) 18 | write(&level); 19 | suspend 1 to n do write(&level) 20 | write(&level); 21 | end 22 | -------------------------------------------------------------------------------- /tests/general/level.std: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 4 5 | 5 6 | 5 7 | 4 8 | 3 9 | 2 10 | 1 11 | 2 12 | 2 13 | 2 14 | 2 15 | 2 16 | 1 17 | -------------------------------------------------------------------------------- /tests/general/lexcmp.icn: -------------------------------------------------------------------------------- 1 | #SRC: JCON 2 | 3 | # lexical comparison test 4 | 5 | procedure main() 6 | local s, t 7 | 8 | write(" s1 s2 << <<= == ~== >>= >>") 9 | 10 | every (s := "" | "a" | "b" | 'c' | "x" | 2 | '') & 11 | (t := "" | "a" | "c" | 'x' | '2') do { 12 | wr(s) 13 | wr(t) 14 | wr(s << t | &null) 15 | wr(s <<= t | &null) 16 | wr(s == t | &null) 17 | wr(s ~== t | &null) 18 | wr(s >>= t | &null) 19 | wr(s >> t | &null) 20 | write() 21 | } 22 | end 23 | 24 | procedure wr(s) 25 | writes(right(image(\s) | "---", 6)) 26 | return 27 | end 28 | -------------------------------------------------------------------------------- /tests/general/map.icn: -------------------------------------------------------------------------------- 1 | #SRC: JCON 2 | 3 | procedure main() 4 | write(map("aBcDeF")) 5 | write(map("AbCdEf")) 6 | write(map("aBcDeF", "abcdefghijklmnopqrstuvwxyz")) 7 | write(map("AbCdEf", "abcdefghijklmnopqrstuvwxyz")) 8 | write(map("aBcDeF", , "12345678901234567890123456")) 9 | write(map("AbCdEf", , "12345678901234567890123456")) 10 | write(map("aBcDeF", "abcdef", "!@#$%^")) 11 | write(map("AbCdEf", "abcdef", "!@#$%^")) 12 | write(map("", "abcdef", "!@#$%^")) 13 | write(map("abcdef", "aa", "bc")) 14 | end 15 | -------------------------------------------------------------------------------- /tests/general/map.std: -------------------------------------------------------------------------------- 1 | abcdef 2 | abcdef 3 | aBcDeF 4 | AbCdEf 5 | a2c4e6 6 | 1b3d5f 7 | !B#D%F 8 | A@C$E^ 9 | 10 | cbcdef 11 | -------------------------------------------------------------------------------- /tests/general/meander.dat: -------------------------------------------------------------------------------- 1 | abc:2 2 | 1234:2 3 | ABC:4 4 | -------------------------------------------------------------------------------- /tests/general/meander.icn: -------------------------------------------------------------------------------- 1 | # 2 | # M E A N D E R I N G S T R I N G S 3 | # 4 | 5 | # This main procedure accepts specifications for meandering strings 6 | # from standard input with the alphabet separated from the length by 7 | # a colon. 8 | 9 | procedure main() 10 | local line, alpha, n 11 | while line := read() do $( 12 | line ? if $( 13 | alpha := tab(upto(':')) & 14 | move(1) & 15 | n := integer(tab(0)) 16 | $) 17 | then write(meander(alpha,n)) 18 | else stop("*** erroneous input ***") 19 | $) 20 | end 21 | 22 | procedure meander(alpha,n) 23 | local result, t, i, c, k 24 | i := k := *alpha 25 | t := n-1 26 | result := repl(alpha$<1$>,t) 27 | while c := alpha$ do $( 28 | if find(result$<-t:0$> || c,result) 29 | then i -:= 1 30 | else $(result ||:= c; i := k$) 31 | $) 32 | return result 33 | end 34 | -------------------------------------------------------------------------------- /tests/general/meander.std: -------------------------------------------------------------------------------- 1 | accbcabbaa 2 | 14434241332312211 3 | AAACCCCBCCCACCBBCCBACCABCCAACBCBCACBBBCBBACBABCBAACACABBCABACAABCAAABBBBABBAABABAAAA 4 | -------------------------------------------------------------------------------- /tests/general/mega.std: -------------------------------------------------------------------------------- 1 | strlength bits hexlength 2 | okay: 63 6 0000_003F 3 | okay: 126 7 0000_007E 4 | okay: 252 8 0000_00FC 5 | okay: 504 9 0000_01F8 6 | okay: 1,008 10 0000_03F0 7 | okay: 2,016 11 0000_07E0 8 | okay: 4,032 12 0000_0FC0 9 | okay: 8,064 13 0000_1F80 10 | okay: 16,128 14 0000_3F00 11 | okay: 32,256 15 0000_7E00 12 | okay: 64,512 16 0000_FC00 13 | okay: 129,024 17 0001_F800 14 | okay: 258,048 18 0003_F000 15 | okay: 516,096 19 0007_E000 16 | okay: 1,032,192 20 000F_C000 17 | PASS. 18 | -------------------------------------------------------------------------------- /tests/general/mffsol.dat: -------------------------------------------------------------------------------- 1 | [ constructed by hand ] 2 | ABCD EFGH IJKL MNOP 3 | AEIM BFJN CGKO DHLP 4 | AHKN BGLM CFIP DEJO 5 | AFLO BEKP CHJM DGIN 6 | AGJP BHIO CELN DFKM 7 | -------------------------------------------------------------------------------- /tests/general/mindfa.dat: -------------------------------------------------------------------------------- 1 | abcdefgh 2 | 01 3 | d 4 | a 5 | b 6 | a 7 | a 8 | c 9 | d 10 | b 11 | d 12 | a 13 | d 14 | f 15 | g 16 | e 17 | f 18 | g 19 | g 20 | d 21 | -------------------------------------------------------------------------------- /tests/general/options.ok: -------------------------------------------------------------------------------- 1 | Translating: 2 | hello.icn: 3 | main 4 | No errors 5 | Linking: 6 | Executing: 7 | Hello, there. 8 | Hello, north. 9 | Hello, south. 10 | Hello, east. 11 | [profiling to $ICONPROFILE = hello.p] 12 | Hello, profiler. 13 | $ 1 hello.icn 3 14 | $ 1 hello.icn 4 15 | $ 1 hello.icn 5 16 | $ 7 hello.icn 6 17 | $ 1 hello.icn 7 18 | : main(list_1 = ["west"]) 19 | Hello, west. 20 | hello.icn : 7 main failed 21 | Hello, Tucson. 22 | Hello, Pima. 23 | Hello, Arizona. 24 | Hello, world. 25 | Hello, galaxy. 26 | Hello, universe. 27 | HOWDY! 28 | -------------------------------------------------------------------------------- /tests/general/others.dat: -------------------------------------------------------------------------------- 1 | # 2 | # W O R D T A B U L A T I O N 3 | # 4 | 5 | # This main procedure processes standard input and writes the results 6 | # with the words in a column 20 characters wide. 7 | 8 | procedure main() 9 | wordcount(20) 10 | end 11 | 12 | procedure wordcount(n) 13 | local t, line, x, y 14 | static letters 15 | initial letters := &lcase ++ &ucase 16 | t := table(,0) 17 | every line := !&input do 18 | scan line using 19 | while tab(upto(letters)) do 20 | t[tab(many(letters))] +:= 1 21 | x := sort(t) 22 | every y := !x do write(left(y[1],n),y[2]) 23 | end 24 | -------------------------------------------------------------------------------- /tests/general/over.icn: -------------------------------------------------------------------------------- 1 | procedure main() 2 | if not(&features == "large integers") then 3 | stop("large integers not supported") 4 | i := 100000 + 10000 5 | write(i) 6 | i +:= 2 ^ 30 7 | write(i) 8 | i +:= i 9 | write(i) 10 | i := 100000 * 10000 11 | write(i) 12 | i +:= 2 ^ 30 13 | write(i) 14 | i *:= i 15 | write(i) 16 | i := -100000 - 10000 17 | write(i) 18 | i +:= -(2 ^ 30) 19 | write(i) 20 | i -:= 2 ^ 30 21 | write(i) 22 | end 23 | -------------------------------------------------------------------------------- /tests/general/over.std: -------------------------------------------------------------------------------- 1 | 110000 2 | 1073851824 3 | 2147703648 4 | 1000000000 5 | 2073741824 6 | 4300405152606846976 7 | -110000 8 | -1073851824 9 | -2147593648 10 | -------------------------------------------------------------------------------- /tests/general/parse.icn: -------------------------------------------------------------------------------- 1 | #SRC: JCON 2 | 3 | # test grouping of various operators 4 | 5 | procedure main() 6 | write(3^3^2) 7 | write(8/4/2) 8 | write(2-2-2) 9 | write(image(f![g]![2])) 10 | write((2<3>2)|"fail") 11 | every write(1 to 2 to 3) 12 | write("x" ? (tab(0)||"y") ? tab(0)) 13 | end 14 | 15 | procedure f(x) 16 | return x 17 | end 18 | 19 | procedure g(x) 20 | return x+2 21 | end 22 | -------------------------------------------------------------------------------- /tests/general/parse.std: -------------------------------------------------------------------------------- 1 | 19683 2 | 1 3 | -2 4 | 4 5 | 2 6 | 1 7 | 2 8 | 3 9 | 2 10 | 3 11 | xy 12 | -------------------------------------------------------------------------------- /tests/general/prefix.dat: -------------------------------------------------------------------------------- 1 | x 2 | (((x))) 3 | x+1 4 | x-y-z 5 | 3*delta+1 6 | ((x+1)) 7 | 2^2^n 8 | (x^n)/(z+1) 9 | -------------------------------------------------------------------------------- /tests/general/prefix.std: -------------------------------------------------------------------------------- 1 | x 2 | x 3 | +(x,1) 4 | -(-(x,y),z) 5 | +(*(3,delta),1) 6 | +(x,1) 7 | ^(2,^(2,n)) 8 | /(^(x,n),+(z,1)) 9 | -------------------------------------------------------------------------------- /tests/general/prepro.dat: -------------------------------------------------------------------------------- 1 | # prepro.dat -- code fragment $included by prepro.icn 2 | 3 | write("prepro.dat here") 4 | 5 | $undef abc 6 | $define abc 321 7 | $define xyzzy 47 8 | -------------------------------------------------------------------------------- /tests/general/prepro.std: -------------------------------------------------------------------------------- 1 | abc,def,ghi,xx,yy: 123 456 987 1 2 2 | prepro.dat here 3 | xyzzy: 47 4 | abc,def,ghi,xx,yy: 321 456 987 1 2 5 | found feature: ASCII 6 | no feature: EBCDIC 7 | done 8 | -------------------------------------------------------------------------------- /tests/general/primes.icn: -------------------------------------------------------------------------------- 1 | #SRC: JCON 2 | 3 | # a simple and slow prime number generator 4 | 5 | procedure main() 6 | local i 7 | every i := 2 to 100 do { 8 | if i % (2 to i - 1) = 0 then 9 | next 10 | write(i) 11 | } 12 | end 13 | -------------------------------------------------------------------------------- /tests/general/primes.std: -------------------------------------------------------------------------------- 1 | 2 2 | 3 3 | 5 4 | 7 5 | 11 6 | 13 7 | 17 8 | 19 9 | 23 10 | 29 11 | 31 12 | 37 13 | 41 14 | 43 15 | 47 16 | 53 17 | 59 18 | 61 19 | 67 20 | 71 21 | 73 22 | 79 23 | 83 24 | 89 25 | 97 26 | -------------------------------------------------------------------------------- /tests/general/proto.std: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/tests/general/proto.std -------------------------------------------------------------------------------- /tests/general/recogn.dat: -------------------------------------------------------------------------------- 1 | ac 2 | acx 3 | c 4 | eb 5 | aadcb 6 | abc 7 | cse 8 | f 9 | -------------------------------------------------------------------------------- /tests/general/recogn.icn: -------------------------------------------------------------------------------- 1 | # 2 | # C F L R E C O G N I T I O N 3 | # 4 | 5 | # This program takes strings from standard input and determines 6 | # whether or not they are sentences in the language defined by . 7 | 8 | procedure main() 9 | local line 10 | while line := read() do 11 | if recogn(s,line) then write("accepted") else write("rejected") 12 | end 13 | 14 | procedure recogn(goal,text) 15 | return text ? (goal() & pos(0)) 16 | end 17 | 18 | # ::= a | b | c 19 | 20 | procedure s() 21 | suspend (="a" || s()) | (t() || ="b") | ="c" 22 | end 23 | 24 | # ::= d d | e | f 25 | 26 | procedure t() 27 | suspend (="d" || s() || ="d") | ="e" | ="f" 28 | end 29 | -------------------------------------------------------------------------------- /tests/general/recogn.std: -------------------------------------------------------------------------------- 1 | accepted 2 | rejected 3 | accepted 4 | accepted 5 | rejected 6 | rejected 7 | rejected 8 | rejected 9 | -------------------------------------------------------------------------------- /tests/general/record.icn: -------------------------------------------------------------------------------- 1 | #SRC: JCON 2 | 3 | record simple(f) 4 | record rec(f1, f2) 5 | 6 | procedure main() 7 | local a, b 8 | 9 | a := rec() 10 | a.f1 := 1 11 | a.f2 := 2 12 | write(a.f1, " ", a.f2) 13 | a := rec(3) 14 | a.f2 := 4 15 | write(a.f1, " ", a.f2) 16 | a := rec(5,6) 17 | write(a.f1, " ", a.f2) 18 | a.f1 := 7 19 | a.f2 := 8 20 | write(a.f1, " ", a.f2) 21 | a := rec(9,10,11) 22 | write(a.f1, " ", a.f2) 23 | a := rec(11, 12) 24 | every write(!a) 25 | every !a := 13 26 | write(a.f2) 27 | 28 | b := simple(14) 29 | write(?b) 30 | ?b := 15 31 | write(!b) 32 | 33 | b := rec(3, 7) 34 | every write(b[1 to 3]) 35 | every write(b["f" || (1 to 3)]) 36 | 37 | a := rec(1, 2) 38 | b := rec(3, 4) 39 | a.f1 +:= 10 40 | a.f2 +:= 20 41 | every !b +:= 70 42 | every writes(" ", !a | !b | "\n") 43 | end 44 | -------------------------------------------------------------------------------- /tests/general/record.std: -------------------------------------------------------------------------------- 1 | 1 2 2 | 3 4 3 | 5 6 4 | 7 8 5 | 9 10 6 | 11 7 | 12 8 | 13 9 | 14 10 | 15 11 | 3 12 | 7 13 | 3 14 | 7 15 | 11 22 73 74 16 | -------------------------------------------------------------------------------- /tests/general/right.icn: -------------------------------------------------------------------------------- 1 | #SRC: JCON 2 | 3 | procedure main() 4 | 5 | write(right("abc")) 6 | write(right("def", )) 7 | write(right("ghi", &null)) 8 | write(right("jkl", 2)) 9 | write(right("mno", 3)) 10 | write(right(237, 4)) 11 | write(right("stu", 5)) 12 | write(right("vwx", 6)) 13 | 14 | write(right("abc", 3, )) 15 | write(right("def", , ".")) 16 | write(right("ghi", &null, ".")) 17 | write(right("jkl", 2, ".")) 18 | write(right("mno", 3, ".")) 19 | write(right(237, 4, ".")) 20 | write(right("stu", 5, ".")) 21 | write(right("vwx", 6, ".")) 22 | 23 | write(right("abc", 3, )) 24 | write(right("def", , "<>")) 25 | write(right("ghi", &null, "<>")) 26 | write(right("jkl", 2, "<>")) 27 | write(right("mno", 3, "<>")) 28 | write(right(237, 4, "<>")) 29 | write(right("stu", 5, "<>")) 30 | write(right("vwx", 6, "<>")) 31 | end 32 | -------------------------------------------------------------------------------- /tests/general/right.std: -------------------------------------------------------------------------------- 1 | c 2 | f 3 | i 4 | kl 5 | mno 6 | 237 7 | stu 8 | vwx 9 | abc 10 | f 11 | i 12 | kl 13 | mno 14 | .237 15 | ..stu 16 | ...vwx 17 | abc 18 | f 19 | i 20 | kl 21 | mno 22 | <237 23 | <>stu 24 | <> 18 | integer(n) > 0 | fail 19 | result := "" 20 | every arabic := !n do 21 | result := map(result,"IVXLCDM","XLCDM**") || equiv$ 22 | if find("*",result) then fail else return result 23 | end 24 | -------------------------------------------------------------------------------- /tests/general/roman.std: -------------------------------------------------------------------------------- 1 | XIII 2 | IV 3 | VI 4 | cannot convert 5 | cannot convert 6 | XXXIX 7 | MMMCMXCIX 8 | cannot convert 9 | -------------------------------------------------------------------------------- /tests/general/scan2.std: -------------------------------------------------------------------------------- 1 | simple 2 | fg 3 | 3 4 | hj 5 | nested 6 | 12 7 | ab 8 | 3 9 | cd 10 | 3 11 | 34 12 | break 13 | 1 14 | 2 15 | 3 16 | 4 17 | 5 18 | nested break 19 | 6 20 | 1 21 | 2 22 | 3 23 | 4 24 | 5 25 | next 26 | 98 27 | 98 28 | non-local 29 | q 30 | w 31 | 1 32 | q 33 | 2 34 | w 35 | 3 36 | e 37 | 4 38 | r 39 | 5 40 | t 41 | 6 42 | y 43 | 1 44 | 4 45 | 1 46 | -------------------------------------------------------------------------------- /tests/general/sieve.icn: -------------------------------------------------------------------------------- 1 | # 2 | # S I E V E O F E R A T O S T H E N E S 3 | # 4 | 5 | # This program illustrates the use of sets in implementing the 6 | # classical sieve algorithm for computing prime numbers. 7 | 8 | procedure main() 9 | local limit, s, i 10 | limit := 100 11 | s := set() 12 | every insert(s,1 to limit) 13 | every member(s,i := 2 to limit) do 14 | every delete(s,i + i to limit by i) 15 | delete(s,1) 16 | primes := sort(s) 17 | write("There are ",*primes," primes in the first ",limit," integers.") 18 | write("The primes are:") 19 | every write(right(!primes,*limit + 1)) 20 | end 21 | -------------------------------------------------------------------------------- /tests/general/sieve.std: -------------------------------------------------------------------------------- 1 | There are 25 primes in the first 100 integers. 2 | The primes are: 3 | 2 4 | 3 5 | 5 6 | 7 7 | 11 8 | 13 9 | 17 10 | 19 11 | 23 12 | 29 13 | 31 14 | 37 15 | 41 16 | 43 17 | 47 18 | 53 19 | 59 20 | 61 21 | 67 22 | 71 23 | 73 24 | 79 25 | 83 26 | 89 27 | 97 28 | -------------------------------------------------------------------------------- /tests/general/spellnum.icn: -------------------------------------------------------------------------------- 1 | # test procedure spell() from the core file numbers.icn 2 | 3 | link numbers 4 | 5 | procedure main() 6 | local L, n 7 | L := [] 8 | every put(L, -2 to 31) 9 | every put(L, 47 to 92 by 9) 10 | every put(L, 100 | 113 | 144 | (200 to 1400 by 100) | 3456 | 7803) 11 | every n := 10 ^ (4 to 25) do 12 | every put(L, n, integer(n * &pi)) 13 | every n := !L do 14 | write(n, ": ", spell(n) | "[failed]") 15 | end 16 | -------------------------------------------------------------------------------- /tests/general/statics.icn: -------------------------------------------------------------------------------- 1 | #SRC: JCON 2 | 3 | procedure main() 4 | foo() 5 | foo() 6 | p() 7 | p() 8 | end 9 | 10 | procedure foo() 11 | static a 12 | 13 | write(image(a)) 14 | a := 1; 15 | end 16 | 17 | 18 | procedure p() 19 | static c 20 | initial c := 0 21 | 22 | c +:= 1 23 | 24 | write(c) 25 | 26 | end 27 | -------------------------------------------------------------------------------- /tests/general/statics.std: -------------------------------------------------------------------------------- 1 | &null 2 | 1 3 | 1 4 | 2 5 | -------------------------------------------------------------------------------- /tests/general/string1.std: -------------------------------------------------------------------------------- 1 | type string 2 | *s 5 3 | s: abcde 4 | s: "abcde" 5 | !: abcde 6 | 1: abcde 7 | 0: abcde 8 | -5: abcde 9 | -7: abcde 10 | s1: abcde 11 | s2: abcde 12 | s3: abcde 13 | s4: abcde 14 | s5: abcde 15 | s6: abcde 16 | s7: abcde 17 | s8: bc 18 | s9: bc 19 | k1: ABCDE 20 | k2: ABCDE 21 | k3: ABCDE 22 | k4: ABCDE 23 | k5: ABCDE 24 | k6: ABCDE 25 | k7: ABCDE 26 | k8: BC 27 | k9: BC 28 | t: "abcde" 29 | ?x: x 30 | ?y: y 31 | ?z: nope 32 | c1: "" 33 | c2: "a" 34 | c3: "b" 35 | c4: "cdef" 36 | c5: "3.14159" 37 | c6: "abcdef" 38 | -------------------------------------------------------------------------------- /tests/general/table.std: -------------------------------------------------------------------------------- 1 | initial : 0 : 2 | >> 3 | >> 3 3 4 | +2+4+a : 3 : [2]3 [4]7 ["a"]"A" 5 | !x=88 : 3 : [2]88 [4]88 ["a"]88 6 | [all]=99 : 3 : [2]99 [4]99 ["a"]99 7 | x[k]=k : 3 : [2]2 [4]4 ["a"]"a" 8 | insert : 6 : [&null]"null" [1]&null [3]&null [5]55 [6]66 [7]77 9 | delete : 2 : [5]55 [6]66 10 | 0 11 | t0 : 0 : 12 | t0i : 6 : [&null]"null" [1]&null [3]&null [5]55 [6]66 [7]77 13 | t0d : 2 : [5]55 [6]66 14 | 15 | k 3 16 | v 7 17 | 30s : 5 : [0]30 [1]31 [2]32 [3]33 [4]34 18 | 50s : 5 : [0]50 [1]51 [2]52 [3]53 [4]54 19 | -------------------------------------------------------------------------------- /tests/general/techo.std: -------------------------------------------------------------------------------- 1 | It is now 12:34:56 on 2010/02/30 and you have savings of $47.23. 2 | The number of wombats is 22. 3 | It is now 12:34:56 on 2010/02/30 and you have 22 wombats. 4 | There is no global variable named "". 5 | This does not work: It is now . 6 | 7 | The previous echo() example printed an empty line. 8 | 9 | Here is another way to use echo()... 10 | 11 | It is now 12:34:56 on 2010/02/30 and you have savings of $47.23. 12 | The number of wombats is 22. 13 | It is now 12:34:56 on 2010/02/30 and you have 22 wombats. 14 | There is no global variable named "". 15 | This does not work: It is now . 16 | 17 | The previous input line printed an empty output line. 18 | 19 | Fee, fi, fo, fum, 20 | I smell the blood 21 | of an Englishman! 22 | -------------------------------------------------------------------------------- /tests/general/tpp1.icn: -------------------------------------------------------------------------------- 1 | # tpp1.icn: part 1 of circular include test 2 | =1= 3 | $include "tpp2.icn" 4 | =1= 5 | -------------------------------------------------------------------------------- /tests/general/tpp2.icn: -------------------------------------------------------------------------------- 1 | # tpp2.icn: part 1 of circular include test 2 | =2= 3 | $include "tpp3.icn" 4 | =2= 5 | -------------------------------------------------------------------------------- /tests/general/tpp3.icn: -------------------------------------------------------------------------------- 1 | # tpp3.icn: part 1 of circular include test 2 | =3= 3 | $include "tpp1.icn" 4 | =3= 5 | -------------------------------------------------------------------------------- /tests/general/tpp5.icn: -------------------------------------------------------------------------------- 1 | # tpp5.icn: test for unterminated $if 2 | 3 | $endif # should not match includer's $if 4 | 5 | $else # should not match includer's $if 6 | 7 | $ifdef id5 8 | $ifdef x 9 | $else 10 | $endif 11 | 12 | #outer unterminated $ifdef should get error 13 | -------------------------------------------------------------------------------- /tests/general/tpp9.icn: -------------------------------------------------------------------------------- 1 | # tpp9.icn: test that predefined symbols revert 2 | # to correct values with the start of a new file 3 | 4 | pipes:_PIPES ascii:_ASCII ebcdic:_EBCDIC # were redefined in tpp.icn 5 | 6 | should be defined as 1: _ASCII _PIPES _SYSTEM_FUNCTION 7 | should not be defined: _VMS _EBCDIC _DOS_FUNCTIONS 8 | it depends: _COMPILED _INTERPRETED 9 | -------------------------------------------------------------------------------- /tests/general/tprintf.icn: -------------------------------------------------------------------------------- 1 | # test the library printf procedure 2 | # 3 | # also incidentally tests large integers, real arithmetic, etc. 4 | 5 | link printf 6 | 7 | procedure main() 8 | local v, vlist 9 | 10 | vlist := [ -16r80000000, -16r7FFFFFFF, -16r40000000, -16r3FFFFFFF, 11 | -16r10000, -16RFFFF, -20104, -719, -2, -1, 0, 1, 2, 7, 15, 47, 11213, 12 | 16rFFFF, 16r10000, 16r7FFFFFFF, 16r80000000, 16rFFFFFFFF, 16r100000000, 13 | 0.125, &phi, &e, &pi, "4.56789", 16.0, 1024.0, 65536.0, 5e12, 6.02e23 ] 14 | 15 | every v := !vlist | realseq() | -realseq() do 16 | printf("%16s %15.3r %10.3e %11d %12o %9x\n", v, v, v, v, v, v) 17 | end 18 | 19 | procedure realseq() 20 | suspend 0.0 21 | suspend 10.0 ^ (-12 to 30) * (1.0 | 13./9 | 3./2 | 5./2. | 14./9 ) 22 | end 23 | -------------------------------------------------------------------------------- /tests/general/tracer.icn: -------------------------------------------------------------------------------- 1 | global s 2 | procedure main() 3 | &trace := -1 4 | s := "abcdef" 5 | &subject := "123456" 6 | &pos := 4 7 | every tracer(1) 8 | every foo(&pos | &subject | &pos[1] | &subject[2:5]) 9 | display() 10 | write(&line) 11 | write(&file) 12 | write(&level) 13 | end 14 | 15 | procedure tracer(a) 16 | local i 17 | static j 18 | i := 2 19 | j := 3 20 | suspend .(a | i | j | s | &subject | 21 | &pos | &random | &trace | &subject[3:4] | &pos[1] | 22 | s[3] | s[3:5] | &random[1] | &trace[1] | &subject[2:5][1]) 23 | suspend (a | i | j | s | &subject | 24 | &pos | &random | &trace | &subject[3:4] | &pos[1] | 25 | s[3] | s[3:5] | &random[1] | &trace[1] | &subject[2:5][1]) 26 | end 27 | 28 | procedure foo(s) 29 | return s 30 | end 31 | -------------------------------------------------------------------------------- /tests/general/transmit.dat: -------------------------------------------------------------------------------- 1 | Version 7 of Icon corrects a number of problems 2 | with co-expressions that existed in previous 3 | versions. The most significant one is proper 4 | handling of co-expression return points. 5 | -------------------------------------------------------------------------------- /tests/general/transmit.icn: -------------------------------------------------------------------------------- 1 | global words, lines, writer 2 | 3 | procedure main() 4 | if not(&features == "co-expressions") then 5 | stop("co-expressions not supported") 6 | &trace := -1 7 | 8 | words := create word() 9 | lines := create reader() 10 | writer := create output() 11 | @writer 12 | end 13 | 14 | procedure word() 15 | static letters 16 | initial letters := &lcase ++ &ucase 17 | while line := @lines do 18 | line ? while tab(upto(letters)) do 19 | tab(many(letters)) @ writer 20 | end 21 | 22 | procedure reader() 23 | while read() @ words 24 | end 25 | 26 | procedure output() 27 | while write(&errout,@words) 28 | @&main 29 | end 30 | -------------------------------------------------------------------------------- /tests/general/traps.std: -------------------------------------------------------------------------------- 1 | TVTBL test 1 2 | Assignment test: Assigned Assigned 3 | Reassignment test: Reassigned Reassigned 4 | Deletion test: Defaulted Defaulted 5 | Insertion test: Reassigned Reassigned 6 | 7 | TVTBL test 2 8 | Assignment test: Assigned 9 | Reassignment test: Reassigned 10 | Deletion test: Reassigned 11 | Insertion test: Reassigned 12 | 13 | TVSUBS test 14 | Subs of new table elem: ...X. 15 | Subs of existing table elem: ...X. 16 | Subs of string trapped var: ...X. 17 | 18 | -------------------------------------------------------------------------------- /tests/general/trim.icn: -------------------------------------------------------------------------------- 1 | #SRC: JCON 2 | 3 | procedure main() 4 | write(image(trim("abc "))) 5 | write(image(trim("abc ", ' '))) 6 | write(image(trim("abc ", 'x'))) 7 | write(image(trim("abc ", 'abc '))) 8 | write(image(trim("a c ", ' '))) 9 | write(image(trim("a c", ' '))) 10 | write(image(trim(" ", ' '))) 11 | write(image(trim(" ", ' '))) 12 | write(image(trim("", ' '))) 13 | write(image(trim(""))) 14 | end 15 | -------------------------------------------------------------------------------- /tests/general/trim.std: -------------------------------------------------------------------------------- 1 | "abc" 2 | "abc" 3 | "abc " 4 | "" 5 | "a c" 6 | "a c" 7 | "" 8 | "" 9 | "" 10 | "" 11 | -------------------------------------------------------------------------------- /tests/general/wordcnt.dat: -------------------------------------------------------------------------------- 1 | # 2 | # W O R D T A B U L A T I O N 3 | # 4 | 5 | # This main procedure processes standard input and writes the results 6 | # with the words in a column 20 characters wide. 7 | 8 | procedure main() 9 | wordcount(20) 10 | end 11 | 12 | procedure wordcount(n) 13 | local t, line, x, y 14 | static letters 15 | initial letters := &lcase ++ &ucase 16 | t := table(,0) 17 | every line := !&input do 18 | scan line using 19 | while tab(upto(letters)) do 20 | t[tab(many(letters))] +:= 1 21 | x := sort(t) 22 | every y := !x do write(left(y[1],n),y[2]) 23 | end 24 | -------------------------------------------------------------------------------- /tests/general/wordcnt.icn: -------------------------------------------------------------------------------- 1 | # 2 | # W O R D C O U N T I N G 3 | # 4 | 5 | # This program tabulates the words in standard input and writes the 6 | # results with the words in a column 20 characters wide. The definition 7 | # of a "word" is naive. 8 | 9 | procedure main() 10 | wordcount(20) 11 | end 12 | 13 | procedure wordcount(n) 14 | local t, line, x, i 15 | static letters 16 | initial letters := &lcase ++ &ucase 17 | t := table(0) 18 | while line := read() do 19 | line ? while tab(upto(letters)) do 20 | t$ +:= 1 21 | x := sort(t,3) 22 | every i := 1 to *x - 1 by 2 do 23 | write(left(x$,n),x$) 24 | end 25 | -------------------------------------------------------------------------------- /tests/special/Makefile: -------------------------------------------------------------------------------- 1 | what: 2 | @echo "What do you want to make?" 3 | 4 | Clean: 5 | rm -f keyboard 6 | -------------------------------------------------------------------------------- /tests/special/README: -------------------------------------------------------------------------------- 1 | This directory contains test programs for some special features of 2 | some implementations of Icon. 3 | -------------------------------------------------------------------------------- /tests/special/keyboard.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtownsend/icon/8f7fed0edfb9c4948b30db15a3a662bc217fe74d/tests/special/keyboard.dat --------------------------------------------------------------------------------