RE: Standard Euphoria Library Project
- Posted by mtsreborn at yahoo.com Feb 07, 2001
- 413 views
Heh? I use length({}) all the time, and never had it crash on me. I use it frequently in a language library to see if an include file wich has being parsed doesn't contain any code. BTW, that reminds me, if anyone wants this 'language.e' library, tell me and I will post it to the list. It's perfect for creating programming languages, as the boring and tedious crap like parsing and getting include files is allready done for you. I made it cos I got sick of rewriting a damned parser in every language tool I wrote, and try to reinvent an include file system. For example, the first time I wrote a language tool, I was breaking my head over how to write an include file system. Yeah I know, it sounds easy at first glance, but consider a file called a.ex wich includes l.e, wich inturn includes d.e and c.e, wich all include o.e, etc. So anyways, anyone needing this small library, especially suited for implementing Euphoria translators and interpreters, ask and I will post it to the list. Mike The Spike --- Kat <gertie at PELL.NET> wrote: > On 7 Feb 2001, at 16:42, Al Getz wrote: > > > Hi Kat, > > I ran your program: > > > > > include get.e > > > integer key > > > sequence test > > > test = "Kat" > > > > > > > > > function remove( integer i, sequence s ) > > > -- remove ith element from s > > > return s[1..i-1] & s[i+1..length(s)] > > > end function > > > > > > for i = 1 to length( test ) do > > > puts( 1, remove( i, test ) & "\n" ) > > > end for > > > ------------------------------------- eof > > > > > > key = wait_key() > > > > > > test = "" > > > puts(1,"\n"&sprintf("%d",length(test))&"\n") > > > > > > puts(1," ^ printed length of test\n") > > > key = wait_key() > > > > > > > and got the following output: > > > > at > > Kt > > Ka > > > > 0 > > ^ printed length of test > > > > So it seems the program runs just fine. Whats > wrong when you run it? > > Like i said, it runs fine, but it has crashed in > other code when i did > length(emptysequence) . > > Kat > > >