-= B E G I N =- X-EUFORUM: 20270 Date: 2008 May 1 3:17 From: Jason Gade Subject: Re: Namespace clobbering internals Shawn Pringle wrote: > > I saw the idea of keeping symbols out of the global scope necessary for > porting existing EUPHORIA applications and libraries to the new standard library. > Imagine you have 12,000 lines of code and you wish to use this new standard > > library. Can you imagine having to do a search and replace for every builtin > > to include an eu: namespace qualifier? > > Perhaps it is just better to avoid the names of builtins in the first place > unless > you really want to override them. Instead of open and close, the same kind > of > thing could be called connect() and disconnect(). > > Shawn Pringle But you wouldn't have to do that really (although automation certainly eases the task). You would only have to add a namespace qualifier to symbols that clashed. And if a namespace keyword was adopted as has been suggested then I think that conflicts would be far easier to fix. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20271 Date: 2008 May 1 3:19 From: Kat Subject: eunet mods I am adding an outgoing header hander to eunet. I may not finish tonite, but i am close to it now. It has some generic defaults, a way to modify them, and of course you can list them. It builds from the record to the http format and sends them. Kat -= B E G I N =- X-EUFORUM: 20272 Date: 2008 May 1 3:52 From: Shawn Pringle Subject: Re: Enhanced dir() function Marco Achury wrote: > > > Linux users currently only get info about 'd' attrib, > they would like to get a unix style chmod sequence like: > > "drwxr-x---" > > In this case the position of the char changes the sense. The character 'r' is documented as readonly in the dir() documentation. It would be trivial to give 'r' to the Linux community by testing if the current process has write access. It leads to cleaner looking code for dir() to provide the same interface regardless of platform. On the other hand, if you name your function to something new like folder_list(), then you can design any interface you like and you can set positional flags that are peclular to all the filesystems you will likely use: ext2, vfat, ntfs, and reiser. Shawn Pringle -= B E G I N =- X-EUFORUM: 20273 Date: 2008 May 1 3:54 From: Jeremy Cowgar Subject: Re: Namespace clobbering internals Jason Gade wrote: > > Shawn Pringle wrote: > > > > I saw the idea of keeping symbols out of the global scope necessary for > > porting existing EUPHORIA applications and libraries to the new standard library. > > Imagine you have 12,000 lines of code and you wish to use this new standard > > > > library. Can you imagine having to do a search and replace for every builtin > > > > to include an eu: namespace qualifier? > > > > But you wouldn't have to do that really (although automation certainly eases > the task). You would only have to add a namespace qualifier to symbols that > clashed. > I think Shawn is right. Say, you have your program that uses the function close() many times to close a file. Then you include, say, my pgsql.e file which also defines close(). Now, everywhere in his code that contains close() (as referring to the built-in close()), would require a prefix of eu: added. Otherwise, it would call the close() defined in pgsql.e, even though pgsql.e included inside of a namespace. I think I am back to my original thoughts on this: http://www.openeuphoria.org/EUforum/m20234.html Now, Matt replied that it would break existing code, as people who have over-ridden built-in's intentionally to have their own version of printf() for use while debugging or something. Depending on how many people do that, it may just be better to realize that as soon as anyone anywhere defines a function by the name of an internal, then you've lost the ability to use that internal (as soon as you include that file in your code that is). That doesn't seem quite right, but that is how things are looking right now? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20274 Date: 2008 May 1 4:04 From: Shawn Pringle Subject: Re: Namespace clobbering internals Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > Shawn Pringle wrote: > > > > > > I saw the idea of keeping symbols out of the global scope necessary for > > > porting existing EUPHORIA applications and libraries to the new standard library. > > > Imagine you have 12,000 lines of code and you wish to use this new standard > > > > > > library. Can you imagine having to do a search and replace for every builtin > > > > > > to include an eu: namespace qualifier? > > > > > > > But you wouldn't have to do that really (although automation certainly eases > > the task). You would only have to add a namespace qualifier to symbols that > > clashed. > > > > I think Shawn is right. Say, you have your program that uses the function close() > many times to close a file. Then you include, say, my pgsql.e file which also > defines close(). > > Now, everywhere in his code that contains close() (as referring to the built-in > close()), would require a prefix of eu: added. Otherwise, it would call the > close() defined in pgsql.e, even though pgsql.e included inside of a namespace. > > I think I am back to my original thoughts on this: > > http://www.openeuphoria.org/EUforum/m20234.html > > Now, Matt replied that it would break existing code, as people who have over-ridden > built-in's intentionally to have their own version of printf() for use while > debugging or something. > > Depending on how many people do that, it may just be better to realize that > as soon as anyone anywhere defines a function by the name of an internal, then > you've lost the ability to use that internal (as soon as you include that file > in your code that is). That doesn't seem quite right, but that is how things > are looking right now? > > -- > Jeremy Cowgar > http://jeremy.cowgar.com Consider this: (eu.e:) global procedure old_close( integer fd ) close( fd ) end procedure global procedure close( integer fd ) close( fd ) end procedure global function open( sequence filename, sequence access ) open( filename, access ) end function ---- main.ex include eu.e as eu include db.e as db integer fd object line fd = eu:open( "c:\autoexec.bat", "r" ) line = gets(fd) while sequence(line) ? line line = gets(fd) end while old_close( fd ) You see you can setup a builtin namespace without touching the backend source. You can still access the builtin but you have to alter how you access it. This would break any large project: win32lib.ew, ide.exw and thus inhibit the standard library's acceptance to large existing projects. This is what we did for redefining printf(). Often the new printf would need to call the old printf you needed to give the old printf another name: old_printf. Shawn -= B E G I N =- X-EUFORUM: 20275 Date: 2008 May 1 4:58 From: Kat Subject: Re: eunet mods I have mod'd my copy of eunet to get this url, http://en.wikipedia.org/wiki/USNS_General_Harry_Taylor_(T-AP-145) and http://en.wikipedia.org/wiki/USNS%5FGeneral%5FHarry%5FTaylor%5F%28T%2DAP%2D145%29 which eunet could not do this morning. I added several functions, using overly long names: sequence sendheader = {} -- as opposed to receiveheader defaultsetsendheader = set a default header setsendheaderline = sets a header line you ask for by name getsendheaderline = returns a header line you ask for by name formatsendheader = makes the header record presentable to eunet_send() urlencoding = not done yet -- convert non-alphanumeric to %hexhex pagedeflate = not done yet, un-gzip(?) -- any takers? I didn't do POST yet, gnite! All subject to change by Michael Sabal, if he's here? How to get this file out to you, i don't know yet. Kat -= B E G I N =- X-EUFORUM: 20276 Date: 2008 May 1 10:58 From: Matt Lewis Subject: Re: Namespace clobbering internals Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > Shawn Pringle wrote: > > > > > > I saw the idea of keeping symbols out of the global scope necessary for > > > porting existing EUPHORIA applications and libraries to the new > > > standard library. Imagine you have 12,000 lines of code and you wish > > > to use this new standard library. Can you imagine having to do a > > > search and replace for every builtin to include an eu: namespace > > > qualifier? > > > > But you wouldn't have to do that really (although automation certainly > > eases the task). You would only have to add a namespace qualifier to > > symbols that clashed. > > > > I think Shawn is right. Say, you have your program that uses the function > close() many times to close a file. Then you include, say, my pgsql.e file > which also defines close(). > > Now, everywhere in his code that contains close() (as referring to the > built-in close()), would require a prefix of eu: added. Otherwise, it > would call the close() defined in pgsql.e, even though pgsql.e included > inside of a namespace. Well, remember, this is only if he wants to do add something new to his existing 12KLOC. If he keeps using the libraries he has, nothing changes. How many built-ins are we talking about overriding? > I think I am back to my original thoughts on this: > > http://www.openeuphoria.org/EUforum/m20234.html > > Now, Matt replied that it would break existing code, as people who have > over-ridden built-in's intentionally to have their own version of printf() > for use while debugging or something. Yes. But also consider your hypothetical pgsql.e. It couldn't use its own close() function, unless it defines a namespace for itself. This fails the principle of least surprise. > Depending on how many people do that, it may just be better to realize > that as soon as anyone anywhere defines a function by the name of an > internal, then you've lost the ability to use that internal (as soon as > you include that file in your code that is). That doesn't seem quite right, > but that is how things are looking right now? I remain unconvinced that refactoring your code to accommodate a new library is too much of a burden. Matt -= B E G I N =- X-EUFORUM: 20277 Date: 2008 May 1 11:46 From: ChrisBurch3 Subject: Forward referencing Hi How much of a problem would it be to re introduce the bug that Rob squashed a few years ago for eu 4 - ie calling functions and procedures after they have been called? routine _id would still be unaffected, so no present code would be broken. It may make includes a bit easier to implement. Chris -= B E G I N =- X-EUFORUM: 20278 Date: 2008 May 1 12:48 From: Michael J. Sabal Subject: Re: eunet mods Kat wrote: > > I have mod'd my copy of eunet to get this url, > > All subject to change by Michael Sabal, if he's here? How to get this file out > to you, i don't know yet. > > Kat Wow, that's awesome! It probably would have taken me a couple weeks to get everything done and tested, squeezing it in between the work I get paid for :). If you have, or were able to sign up for a SourceForge account, and had SVN installed, I could add you to the project so you could commit code directly. Otherwise, you could email me your modded version, or submit the modded .e to recent user contributions. My addy is m underscore sabal ta yahoo tod com. Thanks. Michael Sabal -= B E G I N =- X-EUFORUM: 20279 Date: 2008 May 1 13:44 From: Jeremy Cowgar Subject: Re: Namespace clobbering internals Matt Lewis wrote: > > How many built-ins are we talking about overriding? > Here are some common ones that would make libraries easier if we can override them. The reason I say this, is why come up with 20 creative names for the same task just to prevent collisions. Now, if I want to delete a record from a database I have to use delete, then to remove something from a map, I have to use vanish, then to delete an item in a sequence I have to remove, etc... If diff libs could all use remove or delete to remove or delete something, then it makes things easier. append, prepend, remove, length, compare, equal, find, match, sort, open, close. That's just real quick off the top of my head. Again, being able to use these function names makes programming libraries and using libraries simpler. map:length() for instance. Instead of coming up with map:size(), map:length_of(), map:mass(), map:volume(), map:extent(), map:porpotion(), etc... or... map:remove() instead of map:delete(), map:take(), map:take_off(), map:withdraw(), etc... Again, this creates a simpler API. One problem with programming in Forth is the requirement of every single word has to be a new name, so when programming anything sizeable in forth you wind up becoming an English scholar and your dictionary becomes your greatest tool in programming. You then come up with names that are so very similar that later you even question what it does. > > Yes. But also consider your hypothetical pgsql.e. It couldn't use its > own close() function, unless it defines a namespace for itself. This > fails the principle of least surprise. > Yes, that's a problem. I wonder if in addition to a eu: namespace if we should borrow a good idea from the OO people (not to make Euphoria OO, and not to suggest that I like Java better than Euphoria, but why not learn from other languages? To not learn from other languages is not very smart), self:, this:, current:, me: or something like that. Just more thinking about the subject. Matt, I think the eu: namespace is a critical addition, even if we do or do not use it to solve some of these problems we are speaking of right now. What it will do is give, in example, the pgsql.e file the ability to call the built-in close() or it's own close(). I do not think anyone will complain if we add the eu: namespace as it will not break a thing and will only help in situations. Can you give me a pointer or direction in implementing this? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20280 Date: 2008 May 1 13:48 From: C Bouzy Subject: Win32Lib Error Fixes Hello All, Today I began using the latest Win32Lib for Nexus Radio and I found two errors. Look for the procedure setScrollRange and find: ctrl_Range[ id ][1] = { min, max } Replace it with: ctrl_Range[ id ][1] = { min, max } ctrl_Range[ id ][2] = { min, max } Also replace the DefProcessing function with the follow code: ----------------------------------------------------------------------------- function DefProcessing(integer id, integer pSource, atom hWnd, atom iMsg, atom wParam, atom lParam) ----------------------------------------------------------------------------- atom lResult lResult = 0 if (id = 0) or (pSource = kMainMsg) then lResult = w32Func( xDefWindowProc, { hWnd, iMsg, wParam, lParam } ) else lResult = w32Func( xCallWindowProc, { ctrl_Function[id], hWnd, iMsg, wParam, lParam } ) end if if lResult = 0 then return 0 else return lResult end if end function r_defaultProcessing = routine_id("DefProcessing") ~ CBouzy "If you do what you have always done, you will get what you always got." -= B E G I N =- X-EUFORUM: 20281 Date: 2008 May 1 14:49 From: CChris Subject: Re: Namespace clobbering internals Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > Shawn Pringle wrote: > > > > > > I saw the idea of keeping symbols out of the global scope necessary for > > > porting existing EUPHORIA applications and libraries to the new standard library. > > > Imagine you have 12,000 lines of code and you wish to use this new standard > > > > > > library. Can you imagine having to do a search and replace for every builtin > > > > > > to include an eu: namespace qualifier? > > > > > > > But you wouldn't have to do that really (although automation certainly eases > > the task). You would only have to add a namespace qualifier to symbols that > > clashed. > > > > I think Shawn is right. Say, you have your program that uses the function close() > many times to close a file. Then you include, say, my pgsql.e file which also > defines close(). > > Now, everywhere in his code that contains close() (as referring to the built-in > close()), would require a prefix of eu: added. Otherwise, it would call the > close() defined in pgsql.e, even though pgsql.e included inside of a namespace. > > I think I am back to my original thoughts on this: > > http://www.openeuphoria.org/EUforum/m20234.html > > Now, Matt replied that it would break existing code, as people who have over-ridden > built-in's intentionally to have their own version of printf() for use while > debugging or something. > > Depending on how many people do that, it may just be better to realize that > as soon as anyone anywhere defines a function by the name of an internal, then > you've lost the ability to use that internal (as soon as you include that file > in your code that is). That doesn't seem quite right, but that is how things > are looking right now? > > -- > Jeremy Cowgar > http://jeremy.cowgar.com If someone somewhere overrides a builtin, I guess that the purpose is to extend the builtin without changing its normal processing. This way, the user can take advantage of the enhancements without bothering to use yet another name[space]. Then, what is the point of insisting on calling the builtin? For the sake of peace of mind, something easy can be done. Usually, extending a builtin takes the following form: procedure print_wrapped(whatever) -- wrap builtin as a regular routine, because builtins have no routine_id print(whatever) end procedure -- now we have an alternate way of calling print() constant print_id=routine_id("print_wrapped") -- now redefine the builtin, while elying on it if the extensions are not -- needed on some call. global procedure print(whatever) -- Very, very unfortunately, the signature cannot be changed. if my_own_procesing() then my_smecial_code() else call_proc(print_id,{whatever}) end if end procedure Extending a builtin otherwise would have to be discouraged. Notice that, if print_id is made global, then you can call the vintage print() again. Some piece of (good) kludgy ol' Eu. In most languages, the proecess is very straightforward. CChris -= B E G I N =- X-EUFORUM: 20282 Date: 2008 May 1 14:53 From: Greg Haberek Subject: Re: Forward referencing ChrisBurch3 wrote: > > Hi > > How much of a problem would it be to re introduce the bug that Rob squashed > a > few years ago for eu 4 - ie calling functions and procedures after they > have been called? routine _id would still be unaffected, so no present code > would be broken. It may make includes a bit easier to implement. > > Chris I don't see the necessity for this. It opens up all sorts of potential bugs. This would be the proper method of forward referencing (which I use frequently). integer r_Func2 function Func1( integer i ) return call_func( r_Func2, {2} ) end function function Func2( integer i ) return i * 2 end function r_Func2 = routine_id("Func2") Could you post an example of how you could better implement the includes with the bug reintrocuced? -Greg -= B E G I N =- X-EUFORUM: 20283 Date: 2008 May 1 14:58 From: Jeremy Cowgar Subject: Re: Namespace clobbering internals CChris wrote: > > If someone somewhere overrides a builtin, I guess that the purpose is to extend > the builtin without changing its normal processing. This is not the case, Please see my post: http://www.openeuphoria.org/EUforum/m20279.html -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20284 Date: 2008 May 1 15:15 From: Jason Gade Subject: Re: Namespace clobbering internals Jeremy Cowgar wrote: > > CChris wrote: > > > > If someone somewhere overrides a builtin, I guess that the purpose is to extend > > the builtin without changing its normal processing. > > This is not the case, Please see my post: > > http://www.openeuphoria.org/EUforum/m20279.html > > -- > Jeremy Cowgar > http://jeremy.cowgar.com What you describe isn't overriding, it's overloading. The namespace proposals so far (default namespace in include, eu namespace for builtins) should enable overloading. Unless I'm missing something in the conversation. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20285 Date: 2008 May 1 15:36 From: Jeremy Cowgar Subject: Re: Namespace clobbering internals Jason Gade wrote: > > > What you describe isn't overriding, it's overloading. > Yes, but the original problem is that there is no way to overload, it is overriding. > The namespace proposals so far (default namespace in include, eu namespace for > builtins) should enable overloading. Except that it will force people to use eu: in their code even when they include map.e as map ... Let's say map overload's the find() function (may be a dumb example, but an example). include map.e as map map:map m m = map:new() m = map:put(m, "name", "Jason") m = map:find(m, "Jason") sequence e e = {1,2,3} ? find(3, e) So, the lower part dealing with the sequence was code that existed already in programmer Joe's code. Now Joe makes use of the new map. Well, his find() for the sequence e is now broke. He has to go back and prefix find() with eu: Now, as Matt said, it may not be that big of a conversion path for people to do that. My original thinking was in the above example, find() exists in both the built-in namespace and the map namespace. If there is a conflict and no namespace is given, then Euphoria should chose the built-in function, however, that would take away the ability to override a built-in (again as Matt pointed out to me). -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20286 Date: 2008 May 1 15:43 From: CChris Subject: Re: Win32Lib Error Fixes C Bouzy wrote: > > Hello All, > > Today I began using the latest Win32Lib for Nexus Radio and I found two errors. > > > Look for the procedure setScrollRange and find: > > ctrl_Range[ id ][1] = { min, max } > > > Replace it with: > > ctrl_Range[ id ][1] = { min, max } > ctrl_Range[ id ][2] = { min, max } > > Are you sure? First, there are several instances of the statment in the routine. Which one is supposed to be completed? Second, ctrl_Range[id] holds either: * for Window controls, a pair of ranges, for H and V scroll bars; * For other usable controls, a single range, they have only one to monitor. I checked further, and I think the error is in getScrollRange rather, which should read as global function getScrollRange( object id ) -- Get the allowable range for a scroll bar atom lWhichBar if sequence(id) then lWhichBar = w32iff(find(id[2], {SB_VERT,SB_HORZ}), id[2], SB_VERT) id = id[1] else lWhichBar = SB_VERT end if -- changed part if ctrl_Family[id]=WINDOW then if lWhichBar = SB_HORZ then return ctrl_Range[id][2] else return ctrl_Range[id][1] end if else return ctrl_Range[id][1] end if end function See if this isn't a better fix, I expect it is. > Also replace the DefProcessing function with the follow code: > > > ----------------------------------------------------------------------------- > function DefProcessing(integer id, integer pSource, atom hWnd, atom iMsg, atom wParam, atom > lParam) > ----------------------------------------------------------------------------- > atom lResult > lResult = 0 > > if (id = 0) or (pSource = kMainMsg) then > lResult = w32Func( xDefWindowProc, { hWnd, iMsg, wParam, lParam } ) > else > lResult = w32Func( xCallWindowProc, { ctrl_Function[id], hWnd, iMsg, wParam, > lParam } ) > end if > > if lResult = 0 > then > return 0 > else > return lResult > end if > end function > r_defaultProcessing = routine_id("DefProcessing") > > The second chunk of code looks like an uselessly complex way to return lResult. Does it make a difference? I added the lResult=0 initialisation. CChris > ~ CBouzy > > "If you do what you have always done, you will get what you always got." -= B E G I N =- X-EUFORUM: 20287 Date: 2008 May 1 15:51 From: CChris Subject: Re: Namespace clobbering internals Jeremy Cowgar wrote: > > CChris wrote: > > > > If someone somewhere overrides a builtin, I guess that the purpose is to extend > > the builtin without changing its normal processing. > > This is not the case, Please see my post: > > http://www.openeuphoria.org/EUforum/m20279.html > > -- > Jeremy Cowgar > http://jeremy.cowgar.com I see. The overloading of a single routine name to perform similar actions on different sorts of objects has been consistently fought off on this list. Of course, as a user of some OO languages (mostly Eiffel and less Delphi), I think that overloading would make the language much easier to learn and use. I'd be delighted if we could at last come back from this nonsense of "if it does something else, give it another name". Nevertheless, extensions in the way I described are also useful, and should be made posible *as well*. CChris -= B E G I N =- X-EUFORUM: 20288 Date: 2008 May 1 15:53 From: ChrisBurch2 Subject: Re: Forward referencing Greg Haberek wrote: > > ChrisBurch3 wrote: > > > > Hi > > > > How much of a problem would it be to re introduce the bug that Rob squashed > > a > > few years ago for eu 4 - ie calling functions and procedures after they > > have been called? routine _id would still be unaffected, so no present code > > would be broken. It may make includes a bit easier to implement. > > > > Chris > > I don't see the necessity for this. It opens up all sorts of potential bugs. > This would be the proper method of forward referencing (which I use frequently). > Well, it didn't for 2-3 weeks until the 'bug' was noticed. > > integer r_Func2 > > function Func1( integer i ) > return call_func( r_Func2, {2} ) > end function > > function Func2( integer i ) > return i * 2 > end function > r_Func2 = routine_id("Func2") > > > Well, that may the 'proper' way of doing things, but function Func1( integer i ) atom x Func2(2) end function function Func2( integer i ) return i * 2 end function is a lot easier. I guess C must have it wrong then. > Could you post an example of how you could better implement the includes with > the bug reintrocuced? > > -Greg Weeeeeell, thats a bit more tricky, and probably more to do with lazy programming than anything else a.e contains stuff b.e contains other stuff main.exw include a.e include b.e contains funcs called in both a and e later on b.e is edited to add a great function then a.e is edited to call the great function in b.e - but it can't, because its not in the right order. So you create routine ids, which is fine, but its taken extra work to do it. So, perhaps you could give an example of an introduced bug created by forward referencing. Chris -= B E G I N =- X-EUFORUM: 20289 Date: 2008 May 1 15:53 From: CChris Subject: Re: Namespace clobbering internals Jason Gade wrote: > > Jeremy Cowgar wrote: > > > > CChris wrote: > > > > > > If someone somewhere overrides a builtin, I guess that the purpose is to extend > > > the builtin without changing its normal processing. > > > > This is not the case, Please see my post: > > > > http://www.openeuphoria.org/EUforum/m20279.html > > > > -- > > Jeremy Cowgar > > http://jeremy.cowgar.com > > What you describe isn't overriding, it's overloading. > > The namespace proposals so far (default namespace in include, eu namespace for > builtins) should enable overloading. > > Unless I'm missing something in the conversation. > > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. Yes, they would. CChris -= B E G I N =- X-EUFORUM: 20290 Date: 2008 May 1 16:01 From: Jason Gade Subject: Re: Forward referencing I believe that the bug referenced only applied to routine_id() calls, not forward referencing in general. Enabling code like this: function Func1( integer i ) return call_func( routine_id("Func2"), {2} ) -- "Func2" not resolved until called end function function Func2( integer i ) return i * 2 end function I support this bug/feature for routine_id, not for general forward referencing. I've heard that it would have helped writing Win32lib greatly. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20291 Date: 2008 May 1 16:01 From: Jason Gade Subject: Re: Namespace clobbering internals Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > > > What you describe isn't overriding, it's overloading. > > > > Yes, but the original problem is that there is no way to overload, it is overriding. > > > The namespace proposals so far (default namespace in include, eu namespace for > > builtins) should enable overloading. > > Except that it will force people to use eu: in their code even when they include > map.e as map ... Let's say map overload's the find() function (may be a dumb > example, but an example). > > > include map.e as map > > map:map m > m = map:new() > m = map:put(m, "name", "Jason") > m = map:find(m, "Jason") > > sequence e > e = {1,2,3} > ? find(3, e) > > > So, the lower part dealing with the sequence was code that existed already in > programmer Joe's code. Now Joe makes use of the new map. Well, his find() for > the sequence e is now broke. He has to go back and prefix find() with eu: > > Now, as Matt said, it may not be that big of a conversion path for people to > do that. My original thinking was in the above example, find() exists in both > the built-in namespace and the map namespace. If there is a conflict and no > namespace is given, then Euphoria should chose the built-in function, however, > that would take away the ability to override a built-in (again as Matt pointed > out to me). > > -- > Jeremy Cowgar > http://jeremy.cowgar.com I understand the problem a bit better now. A proper solution requires some thought I think... -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20292 Date: 2008 May 1 16:19 From: ChrisBurch2 Subject: Re: Forward referencing Hi I've just a forum search for 'forward reference' Sorry, looks like a got hornets nest, and may be too much trouble to re write the interpreter. However, I'm still interested as to why allowing forward refs would introduce bugs. Is this not a simplistic view of how an eu progrom is interpreted. 1. stretch out all the files (includes etc) into one long program 2. build a table with all the variables (globals and locals) and functions and procedures. 3. run the program with the addresses of the functions referenced from the name table if so, why not allow references to funcs and procedures that occur later in the program list? Chris -= B E G I N =- X-EUFORUM: 20293 Date: 2008 May 1 18:09 From: Jeremy Cowgar Subject: 3.2, Wrapping DLLs and Float types I've wrapped PgSQL and used Sqlite, PCRE and Iup in 3.2 now w/no problems, once the stack offset was fixed for gcc 4.3.0, however, none of those use the Float type. Now, before going further, the C examples I have created work great, and the wrapper that I've created works identical to the C examples when executed with Euphoria 3.1.1. However, the results are different with the same wrapper, the same examples on the same computer when run with 3.2. I am now wrapping LibHaru, which will be released into the archives and will give Euphoria PDF capabilities. However, floats, I have identified what I think is a bug, but I do not have the knowledge to track it down. The bug is this: constant fHPDF_Page_SetFontAndSize = define_c_func(lib, "HPDF_Page_SetFontAndSize", {P, P, F}, I), fHPDF_Page_TextOut = define_c_func(lib, "HPDF_Page_TextOut", {P, F, F, P}, I) -- P = C_POINTER, F = C_FLOAT, I = C_INT. The parameters for TextOut are: Page, X, Y and Text. The problem is the resulting PDF outputs for X, Y: 761 0 Td when it should be 60 761. What that tells PDF readers is unimportant, the part that is important is that Y is being shifted to X's position, and Y is 0. The parameters for SetFontAndSize are: Page, Font, Size. The Font section is output correctly, but the size is in the PDF as: 0 Tf when it should be 12 Tf. So, once again the Float is being lost/corrupted somehow in 3.2. Again, this all works great in 3.1.1. Thanks for any input. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20294 Date: 2008 May 1 18:15 From: Jeremy Cowgar Subject: Re: 3.2, Wrapping DLLs and Float types Oh, I should add, that is 3.2 is also compiled with gcc 4.3.0, so it may be another change in 4.3.0 ? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20295 Date: 2008 May 1 18:40 From: Jason Gade Subject: Re: 3.2, Wrapping DLLs and Float types Jeremy Cowgar wrote: > > I've wrapped PgSQL and used Sqlite, PCRE and Iup in 3.2 now w/no problems, once > the stack offset was fixed for gcc 4.3.0, however, none of those use the Float > type. > > Now, before going further, the C examples I have created work great, and the > wrapper that I've created works identical to the C examples when executed with > Euphoria 3.1.1. However, the results are different with the same wrapper, the > same examples on the same computer when run with 3.2. > > I am now wrapping LibHaru, which will be released into the archives and will > give Euphoria PDF capabilities. However, floats, I have identified what I think > is a bug, but I do not have the knowledge to track it down. The bug is this: > > > constant > fHPDF_Page_SetFontAndSize = define_c_func(lib, "HPDF_Page_SetFontAndSize", > {P, P, F}, I), > fHPDF_Page_TextOut = define_c_func(lib, "HPDF_Page_TextOut", > {P, F, F, P}, I) > > -- P = C_POINTER, F = C_FLOAT, I = C_INT. > > > The parameters for TextOut are: Page, X, Y and Text. The problem is the resulting > PDF outputs for X, Y: 761 0 Td when it should be 60 761. What that tells PDF > readers is unimportant, the part that is important is that Y is being shifted > to X's position, and Y is 0. > > The parameters for SetFontAndSize are: Page, Font, Size. The Font section is > output correctly, but the size is in the PDF as: 0 Tf when it should be 12 Tf. > > So, once again the Float is being lost/corrupted somehow in 3.2. Again, this > all works great in 3.1.1. > > Thanks for any input. > > -- > Jeremy Cowgar > http://jeremy.cowgar.com This is getting outside of my expertise, but where there any compiler flags different for 3.0 than from 3.2? Maybe the offset you changed was still a little wrong but close enough to work most of the time? I'm wondering if one of the float arguments is being passed in a register instead of on the stack, or if it is being consumed by another function, or whether it is being passed at all. Also, are you sure the arguments are supposed to be floats and not doubles? I know they're different sizes but I don't know if GCC allocates the same amount of space on the stack for them. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20296 Date: 2008 May 1 18:50 From: Jeremy Cowgar Subject: Re: 3.2, Wrapping DLLs and Float types Jason Gade wrote: > > This is getting outside of my expertise, but where there any compiler flags > different for 3.0 than from 3.2? Maybe the offset you changed was still a little > wrong but close enough to work most of the time? > I'm not sure either. Matt helped me find the right offsets. > Also, are you sure the arguments are supposed to be floats and not doubles? Yes, I just went back and tripple checked. HPDF_STATUS HPDF_Page_SetFontAndSize (HPDF_Page page, HPDF_Font font, HPDF_REAL size); HPDF_STATUS HPDF_Page_TextOut (HPDF_Page page, HPDF_REAL xpos, HPDF_REAL ypos, const char *text); In hpdf_types.h: /* float type (32bit IEEE754) */ typedef float HPDF_REAL; -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20297 Date: 2008 May 1 20:44 From: C Bouzy Subject: Re: Win32Lib Error Fixes Hello CChris, I have been using Win32Lib since 2001 for all of my apps :) The error is in setScrollRange, just replace all 3 instances. In regards to DefProcessing, the code I posted might seem redundant but it is not. In some cases when running large complex Win32Lib apps on some machines you will get a weird error, that simple piece of code fixes it. ~ C Bouzy "If you do what you have always done, you will get what you always got." -= B E G I N =- X-EUFORUM: 20298 Date: 2008 May 1 21:27 From: CChris Subject: Re: Forward referencing Jason Gade wrote: > > I believe that the bug referenced only applied to routine_id() calls, not forward > referencing in general. > > Enabling code like this: > > > function Func1( integer i ) > return call_func( routine_id("Func2"), {2} ) -- "Func2" not resolved until called > end function > > function Func2( integer i ) > return i * 2 > end function > > > I support this bug/feature for routine_id, not for general forward referencing. > I've heard that it would have helped writing Win32lib greatly. > > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. In a project with hundreds of routines that may call one another in any order and are hopefully split across a few files, imagine how tricky it is to position routines so that they are seen by the includes that need them and appear after any routine thta calls them. You can do everything using routine_ids, but this accounted for a few dozens of undocumented global symbols in previous versions of win32lib. I could clean up that mess using the alternate w32routine_id, but: * routine placement is just doable, not easily so * any given large library has no need for a w32routine_id mechanism. Forward referencing is not a problem at all: see Orac and my modified interperter, for instance. Additionally, backward referencing forces to write program upside down: utilities first, then routines that call them, and on and on. I don't know about you, but I usually read from top to bottom. This makes programs needlessly harder to understand. CChris -= B E G I N =- X-EUFORUM: 20299 Date: 2008 May 1 21:33 From: CChris Subject: Re: Forward referencing ChrisBurch2 wrote: > > Hi > > I've just a forum search for 'forward reference' Sorry, looks like > a got hornets nest, and may be too much trouble to re write the interpreter. > > However, I'm still interested as to why allowing forward refs would > introduce bugs. > > Is this not a simplistic view of how an eu progrom is interpreted. > > 1. stretch out all the files (includes etc) into one long program > 2. build a table with all the variables (globals and locals) and functions > and procedures. > 3. run the program with the addresses of the functions referenced > from the name table > > if so, why not allow references to funcs and procedures that occur > later in the program list? > > Chris Probably because of he various checks to be performed on exiting a file and on completing parsing. That was the hardest part in implementing it. routine_id(unheard_of_routine) should return -1, no problem with that either. Perhaps it is the fright of and recoiling at... yes, spaghetti phantoms in the code. I've never seen such coding, but perhaps I'm just too young. CChris -= B E G I N =- X-EUFORUM: 20300 Date: 2008 May 1 21:43 From: Jason Gade Subject: Re: Forward referencing CChris wrote: > > Jason Gade wrote: > > > > I believe that the bug referenced only applied to routine_id() calls, not forward > > referencing in general. > > > > Enabling code like this: > > > > > > function Func1( integer i ) > > return call_func( routine_id("Func2"), {2} ) -- "Func2" not resolved until called > > end function > > > > function Func2( integer i ) > > return i * 2 > > end function > > > > > > I support this bug/feature for routine_id, not for general forward referencing. > > I've heard that it would have helped writing Win32lib greatly. > > > > -- > > A complex system that works is invariably found to have evolved from a simple > > system that works. > > --John Gall's 15th law of Systemantics. > > > > "Premature optimization is the root of all evil in programming." > > --C.A.R. Hoare > > > > j. > > In a project with hundreds of routines that may call one another in any order > and are hopefully split across a few files, imagine how tricky it is to position > routines so that they are seen by the includes that need them and appear after > any routine thta calls them. If the program is factored correctly then I disagree. > You can do everything using routine_ids, but this accounted for a few dozens > of undocumented global symbols in previous versions of win32lib. I could clean > up that mess using the alternate w32routine_id, but: > * routine placement is just doable, not easily so > * any given large library has no need for a w32routine_id mechanism. > > Forward referencing is not a problem at all: see Orac and my modified interperter, > for instance. > > Additionally, backward referencing forces to write program upside down: utilities > first, then routines that call them, and on and on. I don't know about you, > but I usually read from top to bottom. This makes programs needlessly harder > to understand. > > CChris Again, I disagree here too. Yes, I read from top to bottom usually, but I know that in most programming languages the object is to find the main routine (or the file containing the main routine) and start there. I don't remember the reasons now, but I remember Rob had pretty good reasons for not having general forward-referencing. I think that I'll stick with that. After all, he's the one with the degree, not me. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20301 Date: 2008 May 1 22:01 From: CChris Subject: Re: Win32Lib Error Fixes C Bouzy wrote: > > Hello CChris, > > I have been using Win32Lib since 2001 for all of my apps :) The error is in > setScrollRange, just replace all 3 instances. > We are, I think, both right. getScrollRange() checks whether the bar is horizontal or vertical, and returns item 1 or 2 in ctrl_Range[id] accordingly. Since a progressbar or somesuch may be either horizontal or vertical, both fields should be ranges, and your fix works. However, all controls have one range to take care of, except Window. So, leaving setScrollRange() alone and changing getScrollRange() should work just as well. I prefer the latter as more consistent. Could you tell me whether that way works for you? CChris > In regards to DefProcessing, the code I posted might seem redundant but it is > not. In some cases when running large complex Win32Lib apps on some machines > you will get a weird error, that simple piece of code fixes it. > Ok, but is the error simply lResult being uninitialised, or lResult holding something unexpected? Just curious here. CChris > ~ C Bouzy > > "If you do what you have always done, you will get what you always got." -= B E G I N =- X-EUFORUM: 20302 Date: 2008 May 1 22:15 From: c.k.lester Subject: Re: Forward referencing CChris wrote: > > In a project with hundreds of routines that may call one another in any order > and are hopefully split across a few files, imagine how tricky it is to position > routines so that they are seen by the includes that need them and appear after > any routine thta calls them. I can tell you it's a pain in the brain. BBCMF uses TONS of include files (modularization, dontcha know), and I have sometimes had to jostle them around, or move funcs/procs to a more appropriate location. Having said that, I don't need forward referencing. I like the define-it- before-you-use-it approach. It's intuitive to me, now. :/ -= B E G I N =- X-EUFORUM: 20303 Date: 2008 May 2 0:53 From: Jeremy Cowgar Subject: New Docs, new layout When adding many new functions and then trying to document those functions, then with the addition of new includes using namespaces, the current method of grouping the function reference by A-B, C-D, etc... became very difficult. I spoke to Rob and with his blessing, I've changed the way the documentation works a bit. I will update the doc processing before the release of 3.2/4.0 to include an alphabetical index of all functions, but that is not there yet. The new docs add's a navigation toolbar to the top and bottom of the library reference, and it also groups functions by their functional group, not by alphabetical order. So, on one page, you can view all the functions dealing with sequences. On another page, you can view all the functions dealing with the operating system, etc... The library page is still there that lists all the functions with a short description grouped by their functional type. I have compiled the new documentation and placed it on my web server for others to view and comment on. Here are a few key URL's you will want to visit: Starting point: http://jeremy.cowgar.com/euphoria/overview.htm Where things begin to change: http://jeremy.cowgar.com/euphoria/library.htm Where you can see a functional grouping page instead of an alphabetical grouping: http://jeremy.cowgar.com/euphoria/lib_math.htm This is a rough draft, so please let me know what you think. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20304 Date: 2008 May 2 1:04 From: Jason Gade Subject: Re: New Docs, new layout With only a glance so far, I like it. Familiar, yet functional. I'll dig in a bit more. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20305 Date: 2008 May 2 2:35 From: Shawn Pringle Subject: Re: Namespace clobbering internals If you set builtins as always being the one used when a namespace is not specified you will break overloading. If you leave the interpreter the way it is, your new library's use of functions with the same names as builtins will break much more code than what's in print.e. A third alternative is to introduce some kind of hiding into a namespace. A fourth alternative involves avoiding any builtin names. When I say, hiding objects into a namespace. I would like you to suppose that insert() is a routine defined in db.e. 'include db.e' means you can only access db.e's insert() function as insert(). 'include db.e as db' means you can access db.e's insert() function as both insert() and db:insert(). You could hack the backend such that that allows you can get access to insert() as db:insert() but not as insert(). I don't like the idea of modifying the backend, though. The fourth alternative is, you can use the same method names over and over if you ensure they are not builtins. All new libraries can use routines names over and over so long as the name doesn't appear twice in the same file. So, you may need to find synonyms for some builtin names but you only need to find one synonym for each one. There is no modifying the backend and you wont break any existing code. The fourth alternative, I have to say is less bug proned than the third alternative since you are not modifying the interpreter C-source itself. You don't need to put the builtins into their own namespace because you purposely avoid using builtins. This means that large programs like Judith's IDE could use it without renaming or namespaceing other things. The third alternative has appeal to me. I think it would be neat to do a kind of overloading only for things inside a namespace. You might introduce bugs into the EU interpreter but large programs could then use this library without renaming or namespacing other things. The first two ideas are well understood by anyone who reads Matt's posts so I will not talk more about them here. :) Shawn -= B E G I N =- X-EUFORUM: 20306 Date: 2008 May 2 11:15 From: Shawn Pringle Subject: Re: New Docs, new layout Hey Jeremy, Two things: Firstly, I found two functions in the category 'C-Interface'; free_console(), and msg_box(). These two functions have nothing to do with the C-interface itself. I suppose they are there until you can think of a better category? How about 'User Interface'? Secondly, there are so many types that seem to be only implemented as functions. Why not implement them as types to extend their functionality? These types include isxdigit(), for example. Shawn Pringle -= B E G I N =- X-EUFORUM: 20307 Date: 2008 May 2 12:34 From: jiri babor Subject: Re: Namespace clobbering internals I must admit I have not followed your discussion from the start, but one simpler solution seems to me rather obvious: instead of adding ever more convoluted namespace rules, introduce a special, restricted type of global identifiers, which will have to be *always* preceded by a context specifier. A single new keyword will be required, say 'export' instead of 'global'. Using example similar to Jason's: -- map.e export type map(... export function new(... export function put(... export function find(... -- myprog.ex include map.e as map integer index map:map m m = map:new() m = map:put(m, "name", "Jason") index = map:find(m, "Jason") sequence e e = {1,2,3} ? find(3, e) -- system function not clobbered! The globals can stay as they are, but they should be used for important, system-wide identifiers only. Their wholesale use should be strongly discouraged. This approach will leave the global space uncluttered, programs more understandable, and not much, if any legacy code will be broken. jiri -= B E G I N =- X-EUFORUM: 20308 Date: 2008 May 2 13:20 From: Marco Achury Subject: Freedos package The Euphoria for DOS zip file has been included at FreeDOS repository. http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/devel/euphoria/ Is not a real installer, just a zip file with installed system without the windows specific files. This is the first step to include it in a future FreeDOS release. +-+-+-+-+-+-+-+ Marco A. Achury Caracas, Venezuela -= B E G I N =- X-EUFORUM: 20309 Date: 2008 May 2 14:15 From: Jeremy Cowgar Subject: Re: New Docs, new layout Shawn Pringle wrote: > > Hey Jeremy, > > Two things: Firstly, I found two functions in the category 'C-Interface'; > free_console(), and msg_box(). These two functions have nothing to do with > the C-interface itself. I suppose they are there until you can think of a > better category? How about 'User Interface'? Yeah, I didn't like that either when I put them there, however, I did not categorize them as C-interface. In the current docs they are listed under C-interface, so I just stuck with it. http://rapideuphoria.com/library.htm#call_c_func >Secondly, there are so many > types that seem to be only implemented as functions. Why not implement them > as types to extend their functionality? These types include isxdigit(), > for example. I was thinking of that, but do we want types for all those C is??? functions? i.e. the types would be: alnum, alpha, ascii, cntrl, digit, graph, lower, print, punct, space, upper, xdigit ... some of thse in there we cannot use (lower, print, upper) and others would be confusing as a type (space, graph). I was unsure of exactly how to handle them. So, I found others using the names of the standard C functions found in ctypes.h, isascii, isdigit, etc... However, I think the section you found those in is called Type Checking, not really Types? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20310 Date: 2008 May 2 14:17 From: Jeremy Cowgar Subject: Re: Namespace clobbering internals jiri babor wrote: > > > keyword will be required, say 'export' instead of 'global'. > I wonder if the inverse might be helpful? override ... for instance, say you want to override the print function: override function close(...) --- code end function Now, those that wish to override internals can, and those that just want to make their own close() function for a database, or a PDF writer, or who knows what, they can. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20311 Date: 2008 May 2 14:22 From: Matt Lewis Subject: Re: Namespace clobbering internals jiri babor wrote: > > I must admit I have not followed your discussion from the start, but one > simpler solution seems to me rather obvious: instead of adding ever more > convoluted namespace rules, introduce a special, restricted type of global > identifiers, which will have to be *always* preceded by a context specifier. > A single new keyword will be required, say 'export' instead of 'global'. Of *course* it's obvious to you, Jiri. Seriously, though, it's good to hear from you again. > The globals can stay as they are, but they should be used for important, > system-wide identifiers only. Their wholesale use should be strongly > discouraged. > > This approach will leave the global space uncluttered, programs more > understandable, and not much, if any legacy code will be broken. Yes, this gets into the 'packaging' topic that has been discussed a bit. I think this is very similar to what I've proposed in that arena. I'd add a little to this idea, to say that you have to use the namespace that is specific to that file, because a namespace also can apply to the globals included by the file given the namespace. -- app.ex include foo.e as foo include bar.e as bar foo:baz() -- ok bar:bar() -- ok foo:bar() -- error! -- foo.e include bar.e as bar ... bar:bar() -- bar.e export procedure bar() end procedure global procedure baz() end procedure I like this because no matter where bar.e goes, the behavior stays the same, and it's scope is obvious. I'm contrasting this to CChris' packaging proposal, where we would have to add some additional packaging information in other files. This would allow library writers to spread out among multiple files (making their lives easier) but without exposing the internals to library users, who can possibly come to rely on something meant to be internal, and subject to change without notice. Matt -= B E G I N =- X-EUFORUM: 20312 Date: 2008 May 2 14:36 From: Jeremy Cowgar Subject: Re: Namespace clobbering internals I don't know if anyone else is, but I'm having troubles following all the suggestions, the pros/cons, etc... I wonder if we should create a wiki page for a Namespace plan or something? Seems kind of hard to act on any of this because it seems we've made no decision and it's hard to even decide what choices there are to make a decision about, or for that matter, what the problem actually is any more :-) -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20313 Date: 2008 May 2 16:41 From: C Bouzy Subject: Re: Win32Lib Error Fixes Hello CChris, Actually it wouldn't hurt to put it in both places. In regards to the Defprocessing error, lResult will return something unexpected or nothing at all. ~C Bouzy "If you do what you have always done, you will get what you always got." -= B E G I N =- X-EUFORUM: 20314 Date: 2008 May 2 17:18 From: Jeremy Cowgar Subject: locale support? I finished documenting datetime.e: http://jeremy.cowgar.com/euphoria/lib_dtm.htm And it has a format function that allows you to: d = new(2008, 5, 2, 12, 58, 32) s = format(d, "%A, %B %d '%y %H:%M%p") -- s is "Friday, May 2 '08 12:58PM" So, the problem is not that the format function cannot support other languages (because it can), but how to deal with locale support. Right now, in datetime.e there are a few sequences titled things like: month_names, month_abbrs, day_names, day_abbrs. Those are global sequences that format() uses to populate the resulting string with. If you do not speak English, you can easily change the content of those global sequences and format will happily use your language to format the date/time. However, do we need a greater support? i.e. should I introduce a locale.e or something? For instance, the GNU C locale support has abilities for dates, times, numbers, money, etc... -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20315 Date: 2008 May 2 18:05 From: Matt Lewis Subject: Re: Namespace clobbering internals Jeremy Cowgar wrote: > > I don't know if anyone else is, but I'm having troubles following all the suggestions, > the pros/cons, etc... I wonder if we should create a wiki page for a Namespace plan or > something? Seems kind of hard to act on any of this because it seems we've made no decision > and it's hard to even decide what choices there are to make a decision about, or for > that matter, what the problem actually is any more :-) In fact, there already is one, although it's out of date now, as it describes stuff already implemented: http://rapideuphoria.wiki.sourceforge.net/Namespace_Resolution Matt -= B E G I N =- X-EUFORUM: 20316 Date: 2008 May 2 18:27 From: Ryan W. Johnson Subject: Re: locale support? Yes, it would be great if the app could use format dates, times, etc. according to the OS settings. ~Ryan W. Johnson Fluid Application Environment http://www.fluidae.com/ [cool quote here, if i ever think of one...] -= B E G I N =- X-EUFORUM: 20317 Date: 2008 May 2 20:31 From: Jeremy Cowgar Subject: All current functions documented Ok, I just documented about 20 functions this afternoon that were previously in the standard library but not yet documented. Now's your chance to get a preview of the new doc layout and all the functions that currently exist in Euphoria 3.2/4.0. http://jeremy.cowgar.com/euphoria/library.htm -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20318 Date: 2008 May 2 20:36 From: Salix Subject: Re: Freedos package Just a quick note. Thank you for taking care of the DOS distribution. I am proud to see Euphoria in FreeDOS repository. Regards, Salix -= B E G I N =- X-EUFORUM: 20319 Date: 2008 May 2 20:55 From: c.k.lester Subject: Re: All current functions documented Jeremy Cowgar wrote: > > Now's your chance to get a preview > of the new doc layout and all the functions that currently exist in Euphoria > 3.2/4.0. Great job, Jeremy! I think you can safely call it 4.0 from now on. ;) -= B E G I N =- X-EUFORUM: 20320 Date: 2008 May 2 22:16 From: Alan F Subject: Re: New Docs, new layout Jeremy Cowgar wrote: > > Shawn Pringle wrote: > > > > Hey Jeremy, > > > >Secondly, there are so many > > types that seem to be only implemented as functions. Why not implement them > > as types to extend their functionality? These types include isxdigit(), > > for example. > > I was thinking of that, but do we want types for all those C is??? functions? > i.e. the types would be: alnum, alpha, ascii, cntrl, digit, graph, lower, print, > punct, space, upper, xdigit ... some of thse in there we cannot use (lower, > print, upper) and others would be confusing as a type (space, graph). > I think it would be useful to have these as types rather than simply as functions, but I agree that simply leaving the 'is' and dropping it entirely to make the type name is not ideal. Perhaps some sort of prefix, like 't_', in front of the name, so we have t_alnum, t_alpha, etc. -= B E G I N =- X-EUFORUM: 20321 Date: 2008 May 2 22:40 From: CChris Subject: Re: Win32Lib Error Fixes C Bouzy wrote: > > Hello CChris, > > Actually it wouldn't hurt to put it in both places. In regards to the Defprocessing > error, lResult will return something unexpected or nothing at all. > > ~C Bouzy > > "If you do what you have always done, you will get what you always got." It won't hurt, just perhaps a little puzzling for any future maintainer. As for DefProcessing, then i'll put your code with a comment about the condition you experienced. Doesn't this result from an OS thread switch, by any chance? CChris -= B E G I N =- X-EUFORUM: 20322 Date: 2008 May 2 23:39 From: Alex Caracatsanis Subject: [DOS] Display Copyright Symbol Hi folks Can someone please tell me what code will result in the display of a copyright symbol (ASCII value ©) on the console? Thank you Alex Caracatsanis -= B E G I N =- X-EUFORUM: 20323 Date: 2008 May 3 0:10 From: Larry Miller Subject: Re: [DOS] Display Copyright Symbol Alex Caracatsanis wrote: > > Hi folks > > Can someone please tell me what code will result in the display of a > copyright symbol (ASCII value ©) on the console? > > Thank you > > Alex Caracatsanis I am assuming you are using a console window with Windows. The default font used on the console does not have the copyright symbol. Many of the special symbols were sacrificed for the line drawing characters. To display the copyright character you will have to change the font by using console properties to Lucida Console. Larry Miller -= B E G I N =- X-EUFORUM: 20324 Date: 2008 May 3 0:26 From: Alex Caracatsanis Subject: [DOS32] Fonts for Console Display? Another quick question... Is it possible to use a variety of fonts to display output on the console? Can you display something in italics, for example, or change the size of letters? (WinXP) Thank you Alex Caracatsanis -= B E G I N =- X-EUFORUM: 20325 Date: 2008 May 3 0:32 From: Alex Caracatsanis Subject: Re: [DOS] Display Copyright Symbol - END Larry Miller wrote: > > Alex Caracatsanis wrote: > > > > Can someone please tell me what code will result in the display of a > > copyright symbol (ASCII value ©) on the console? > > To display the copyright character you will have to change the font by > using console properties to Lucida Console. > Larry Miller Thanks Larry. I think you might have also answered my next post. Alex -= B E G I N =- X-EUFORUM: 20326 Date: 2008 May 3 0:36 From: Larry Miller Subject: Re: [DOS32] Fonts for Console Display? Alex Caracatsanis wrote: > > Another quick question... > > Is it possible to use a variety of fonts to display output on the console? > Can you display something in italics, for example, or change the size of > letters? (WinXP) > > Thank you > > Alex Caracatsanis I suppose this could be done but it would not be easy. Windows provides very little support for this kind of thing on a console window. DOS provides even less. In any case this is well beyond anything I have even attempted. Larry Miller -= B E G I N =- X-EUFORUM: 20327 Date: 2008 May 3 1:24 From: Alex Caracatsanis Subject: Re: [DOS32] Fonts for Console Display? - END Larry Miller wrote: > > Alex Caracatsanis wrote: > > > > Is it possible to use a variety of fonts to display output on the console? > I suppose this could be done but it would not be easy. Thanks Larry. That's good enough for me. Alex -= B E G I N =- X-EUFORUM: 20328 Date: 2008 May 3 4:27 From: don cole Subject: Button Aesthetics Hello, My fellow Euphorians, How can I make the text of a Button look like this: C l o s e with IDE? Don Cole -= B E G I N =- X-EUFORUM: 20329 Date: 2008 May 3 5:30 From: C Bouzy Subject: Re: Win32Lib Error Fixes Hello CChris, I wish I could tell you what causes the error, but I have never been able to reproduce the error on-demand. It just happens randomly and only with certain types of apps. ~C Bouzy "If you do what you have always done, you will get what you always got." -= B E G I N =- X-EUFORUM: 20330 Date: 2008 May 3 9:51 From: Judith Evans Subject: Re: Button Aesthetics don cole wrote: > > > Hello, My fellow Euphorians, > > How can I make the text of a Button look like this: > > C > l > o > s > e > Enter the caption as C\nl\no\ns\ne and in Properties OtherStyles check multiline. judith > with IDE? > > Don Cole -= B E G I N =- X-EUFORUM: 20331 Date: 2008 May 3 13:23 From: Greg Haberek Subject: Re: [DOS32] Fonts for Console Display? - END Alex Caracatsanis wrote: > > Larry Miller wrote: > > > > I suppose this could be done but it would not be easy. > > Thanks Larry. That's good enough for me. > > Alex Alex, Are you actually programming in DOS, or the Windows console? If you're using pure DOS, Jiri Babor has some amazing graphical font routines in the Archive. If you're using Windows, then perhaps you could make your own "console" in Win32Lib? -Greg -= B E G I N =- X-EUFORUM: 20332 Date: 2008 May 3 13:42 From: Greg Haberek Subject: Re: Button Aesthetics Judith Evans wrote: > > Enter the caption as C\nl\no\ns\ne and in Properties OtherStyles check multiline. Judith, are you still working on your colored buttons library? Perhaps this could be of some use. I haven't been using it in a while. You could make rotated buttons with it. global procedure setFontRotated( integer pId, sequence pFont, integer pSize, integer pStyle, integer pAngle ) pAngle *= 10 while pAngle < 0 do pAngle += 3600 end while while pAngle > 3600 do pAngle -= 3600 end while setFont( pId, pFont, pSize, {pStyle,0,pAngle,pAngle,DEFAULT_CHARSET,0,0,0,0} ) end procedure -Greg -= B E G I N =- X-EUFORUM: 20333 Date: 2008 May 3 14:06 From: Bernie Ryan Subject: Re: [DOS] Display Copyright Symbol Alex Caracatsanis wrote: > > Hi folks > > Can someone please tell me what code will result in the display of a > copyright symbol (ASCII value ©) on the console? > > Thank you > > Alex Caracatsanis I think if you try #251 in a windows text string that may work. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20334 Date: 2008 May 3 14:15 From: Bernie Ryan Subject: Re: [DOS] Display Copyright Symbol Bernie Ryan wrote: > > Alex Caracatsanis wrote: > > > > Hi folks > > > > Can someone please tell me what code will result in the display of a > > copyright symbol (ASCII value ©) on the console? > > > > Thank you > > > > Alex Caracatsanis > > I think if you try #251 in a windows text string that may work. > > Bernie > > My files in archive: > WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API > > Can be downloaded here: > http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan CORRECTION THAT SHOULD BE " \251 " ( the slash has to be there no # sign ) I haven't woke up yet. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20335 Date: 2008 May 3 14:15 From: don cole Subject: Re: Button Aesthetics Judith Evans wrote: > > don cole wrote: > > > > > > Hello, My fellow Euphorians, > > > > How can I make the text of a Button look like this: > > > > C > > l > > o > > s > > e > > > > Enter the caption as C\nl\no\ns\ne and in Properties OtherStyles check multiline. > > judith > > with IDE? > > > > Don Cole Thank you Judth, When I highlite the button and right click properties nothing happens. I'm using version 0.22.0 Don Cole -= B E G I N =- X-EUFORUM: 20336 Date: 2008 May 3 14:15 From: Jason Gade Subject: Re: Namespace clobbering internals Jeremy Cowgar wrote: > > jiri babor wrote: > > > > > > keyword will be required, say 'export' instead of 'global'. > > > > I wonder if the inverse might be helpful? override ... for instance, say you > want to override the print function: > > > override function close(...) > --- code > end function > > > Now, those that wish to override internals can, and those that just want to > make their own close() function for a database, or a PDF writer, or who knows > what, they can. > > -- > Jeremy Cowgar > http://jeremy.cowgar.com You know, I was reading some Python docs last night, for no particular reason, and one of their standards and practices for naming routines that might clash with a built-in is to append an underscore to the identifier: function open_(sequence name) -- Do stuff here end function Not a permanent solution because we really do need to decide how scopes and namespaces should work better, but maybe a good temporary solution since we never seem to be able to come to a consensus. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20337 Date: 2008 May 3 14:18 From: don cole Subject: Judith never mind I see it now. Also I like t6he idea of rotating buttons. Don Cole -= B E G I N =- X-EUFORUM: 20338 Date: 2008 May 3 14:25 From: Jeremy Cowgar Subject: Re: 3.2, Wrapping DLLs and Float types Ok. I installed gcc-3.3 on my computer and Euphoria 3.2/4.0 works fine, floats and all when compiled with gcc-3.3. It works fine when compiled with gcc-4.3.0, except when using floats. So, the problem is with something changing in gcc. I am just not sure what. I am going to start a new thread about Euphoria and gcc-4.3.0 compatibility. Please comment there (so we can have proper subject titles). -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20339 Date: 2008 May 3 14:34 From: Jeremy Cowgar Subject: Euphoria and gcc-4.3.0 compatibility I made a change to the gcc call stack offset for version 4.3.0 of gcc, with the help of Matt. Once I made this change things seemed to work just fine with gcc 4.3.0, however, later I realized that when calling a function with C_FLOAT types, there is some mangling there. Sometimes the output of the C function using the C_FLOAT is zero, other times it is 1 parameter off. I have not tested other types. How can we resolve this as a lot of Linux distributions are either at or moving toward gcc 4.3 for their standard compiler, making Euphoria incompatible with many Linux distributions. Now, I should have prefixed the above with, if the user chooses to compile from source, which many do, and also if we wish to get Euphoria into major distributions, they will compile from source most likely. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20340 Date: 2008 May 3 14:50 From: Jeremy Cowgar Subject: Organization (was Re: Namespace clobbering internals) Jason Gade wrote: > > Not a permanent solution because we really do need to decide how scopes and > namespaces should work better, but maybe a good temporary solution since we > never seem to be able to come to a consensus. > I've been a long time Euphoria user but not always active on EUforum but one of the things it seems to me about Euphoria is we cannot make a decision, therefore, a lot of things that could make the language nicer are never done. I do not think this is the fault of anyone here, I think we may just need a bit more organization. The forums are great for discussing topics, but I really think we need to start using a wiki a bit. I know there is one on SF for Euphoria and then there is http://euwiki.ayo.biz/Main_Page . It's just an opinion, but I think the SF wiki is too slow and people are discouraged waiting for it all the time and Media Wiki is too complex for a simple wiki. However, either will work. What I think we need is a wiki page first of all describing the problem we face. Then let people add their suggested solutions. Discussion can then take place here about suggested solutions. As we find pro's/con's, those should be added to the wiki page under the proposed solution. Once discussion on the solutions is complete, review what is on the Wiki. My guess is a lot of solutions could simply be removed because the con's outweigh the pro's. We will then be down to a few solutions. Discussion should then start comparing solution A to solution B and eventually we are down to 1 solution. It can then turn into a task to be completed. As it stands now we rarely get to a task to be completed, thus, nothing is ever done about it. There is a saying, "A good plan today is better than a perfect one tomorrow." While this is not totally true in application to a programming language, its message has truth for us. Other languages have very structured processes to complete such tasks as I've outlined. I'm not suggesting that we become so structured we have to create an organizing body to oversee the language, but I am suggesting that we organize better. Thoughts? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20341 Date: 2008 May 3 14:54 From: Bernie Ryan Subject: Re: Euphoria and gcc-4.3.0 compatibility Jeremy Cowgar wrote: > I have not tested other types. How can we resolve this as a lot of Linux distributions > are either at or moving toward gcc 4.3 for their standard compiler, making Euphoria > incompatible with many Linux distributions. > > Now, I should have prefixed the above with, if the user chooses to compile from > source, which many do, and also if we wish to get Euphoria into major distributions, > they will compile from source most likely. If you are distributing source for Linux I think your distribution should be checking for any necessary dependence for that compile. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20342 Date: 2008 May 3 14:59 From: Jeremy Cowgar Subject: Re: Euphoria and gcc-4.3.0 compatibility Bernie Ryan wrote: > > If you are distributing source for Linux I think your distribution > should be checking for any necessary dependence for that compile. > We do distribute source, anyone can download it from rapideuphoria.com. It's not as easy as checking dependencies. For instance, a dependency is liba or libb not being present. The user can then install liba or libb. With gcc, most distributions are built on 1 version of gcc and it's not a matter of installing gcc version 4.1 or 4.2, etc... It is that you have gcc-4.3.0 and that's it. For the average user, they are not going to be able to deal with multiple versions of gcc. Fact of the matter is, Euphoria should compile w/o problem on 4.3.0. We need to fix Euphoria for it to do so. Currently there are different #ifdef/#else/#endif statements in the source code to make it work on different versions of gcc, and that is the proper way to fix this problem. The proper way is not to say the user must have 4.1 installed or 3.3. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20343 Date: 2008 May 3 15:15 From: Bernie Ryan Subject: Re: Euphoria and gcc-4.3.0 compatibility Jeremy Cowgar wrote: > We do distribute source, anyone can download it from rapideuphoria.com. It's > not as easy as checking dependencies. For instance, a dependency is liba or > libb not being present. The user can then install liba or libb. With gcc, most > distributions are built on 1 version of gcc and it's not a matter of installing > gcc version 4.1 or 4.2, etc... It is that you have gcc-4.3.0 and that's it. > For the average user, they are not going to be able to deal with multiple versions > of gcc. > > Fact of the matter is, Euphoria should compile w/o problem on 4.3.0. We need > to fix Euphoria for it to do so. Currently there are different #ifdef/#else/#endif > statements in the source code to make it work on different versions of gcc, > and that is the proper way to fix this problem. The proper way is not to say > the user must have 4.1 installed or 3.3. > Jeremy: What I am saying is that most LINUX program distributions that I have downloaded and installed automatically checked dependencies before installation and you expect the average user to compile exu on their system Euphoria MUST be available in that form. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20344 Date: 2008 May 3 15:18 From: Jeremy Cowgar Subject: Re: Euphoria and gcc-4.3.0 compatibility Bernie Ryan wrote: > > > What I am saying is that most LINUX program distributions that > I have downloaded and installed automatically checked dependencies > before installation and you expect the average user to compile exu > on their system Euphoria MUST be available in that form. I'm not sure I follow what your saying. Euphoria really has no dependencies. Just a working compiler. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20345 Date: 2008 May 3 15:35 From: Jason Gade Subject: Re: Euphoria and gcc-4.3.0 compatibility Jeremy Cowgar wrote: > > Bernie Ryan wrote: > > > > > > What I am saying is that most LINUX program distributions that > > I have downloaded and installed automatically checked dependencies > > before installation and you expect the average user to compile exu > > on their system Euphoria MUST be available in that form. > > I'm not sure I follow what your saying. Euphoria really has no dependencies. > Just a working compiler. > > -- > Jeremy Cowgar > http://jeremy.cowgar.com Like Jeremy said, the Euphoria binary doesn't really have any dependencies. The average user probably won't be compiling from source, either. But Linux users are more likely to do so than Windows users. I think that Matt or someone made a .deb package for installing the Euphoria binary with apt. I think that it's a work in progress though. Oh, yeah. It's on the sourceforge site and it's labeled "3.2.0.alpha-1". Jeremy's problem with compiling under gcc 4.3.0 is finding what the difference is with that version of gcc from previous versions so that the source can be modified to fix that. The #ifdefs take care of the dependency. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20346 Date: 2008 May 3 15:49 From: Matt Lewis Subject: Re: Euphoria and gcc-4.3.0 compatibility Bernie Ryan wrote: > > Jeremy Cowgar wrote: > > > > I have not tested other types. How can we resolve this as a lot of Linux > > distributions are either at or moving toward gcc 4.3 for their standard > > compiler, making Euphoria incompatible with many Linux distributions. > > > > Now, I should have prefixed the above with, if the user chooses to compile > > from source, which many do, and also if we wish to get Euphoria into major > > distributions, they will compile from source most likely. > > If you are distributing source for Linux I think your distribution > should be checking for any necessary dependence for that compile. That's the point of a package in a package management system. However, your comment has nothing to do with Jeremy's. Matt -= B E G I N =- X-EUFORUM: 20347 Date: 2008 May 3 16:01 From: Matt Lewis Subject: Re: Euphoria and gcc-4.3.0 compatibility Jeremy Cowgar wrote: > > I made a change to the gcc call stack offset for version 4.3.0 of gcc, with > the help of Matt. Once I made this change things seemed to work just fine with > gcc 4.3.0, however, later I realized that when calling a function with C_FLOAT > types, there is some mangling there. Sometimes the output of the C function > using the C_FLOAT is zero, other times it is 1 parameter off. From: http://gcc.gnu.org/gcc-4.3/changes.html * Starting from GCC 4.3.1, decimal floating point variables are aligned to their natural boundaries when they are passed on stack for i386. Could you write a very simple program that passes the types of arguments that you're passing and compile it to asm? Then we could take a look to see what it's doing. Matt -= B E G I N =- X-EUFORUM: 20348 Date: 2008 May 3 16:10 From: Bernie Ryan Subject: Re: Euphoria and gcc-4.3.0 compatibility Matt Lewis wrote: > > That's the point of a package in a package management system. However, > your comment has nothing to do with Jeremy's. > Matt: I have seen some programs that only will compile with older versions gcc and the package manager would refuse to install from source using new version of gcc because of dependencies. As far as the #if conditionals in the source is a problem; That is why I have said in the past a new interpreter version needs to be written for each platform to eliminate this patch-work of code. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20349 Date: 2008 May 3 16:15 From: Jeremy Cowgar Subject: Re: Euphoria and gcc-4.3.0 compatibility Matt Lewis wrote: > > Could you write a very simple program that passes the types of arguments > that you're passing and compile it to asm? Then we could take a look to > see what it's doing. > Hm, my gcc reports: $ gcc -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../configure --prefix=/usr --enable-shared --enable-languages=c,c++,fortran,objc,obj-c++,treelang --enable-threads=posix --mandir=/usr/share/man --enable-__cxa_atexit --disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch --with-tune=generic Thread model: posix gcc version 4.3.0 (GCC) However, here is the C program: float hello(float abc) { return abc; } int main(int argc, char **argv) { hello(12.5); return 0; } Here is the assembler output: .file "hello.c" .text .globl hello .type hello, @function hello: pushl %ebp movl %esp, %ebp subl $4, %esp movl 8(%ebp), %eax movl %eax, -4(%ebp) flds -4(%ebp) leave ret .size hello, .-hello .globl main .type main, @function main: leal 4(%esp), %ecx andl $-16, %esp pushl -4(%ecx) pushl %ebp movl %esp, %ebp pushl %ecx subl $4, %esp movl $0x41480000, %eax movl %eax, (%esp) call hello fstp %st(0) movl $0, %eax addl $4, %esp popl %ecx popl %ebp leal -4(%ecx), %esp ret .size main, .-main .ident "GCC: (GNU) 4.3.0" .section .note.GNU-stack,"",@progbits -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20350 Date: 2008 May 3 16:15 From: Bernie Ryan Subject: Re: Euphoria and gcc-4.3.0 compatibility Whoops I return key before finishing my post I understand why the code was written with the conditionals to make easier for Rob to maintain the code for all platforms. But now I think it would be easier to maintain if it was broke out into different platforms. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20351 Date: 2008 May 3 17:16 From: Jeremy Cowgar Subject: Re: Euphoria and gcc-4.3.0 compatibility Bernie Ryan wrote: > > I understand why the code was written with the conditionals to > make easier for Rob to maintain the code for all platforms. > But now I think it would be easier to maintain if it was broke out > into different platforms. > The section of code in question is switching 2 define statements, it'd be a bummer to move to a complex system of multiple source files, determining the platform, optionally switching different files in and out for just 2 lines of code that are different. Here's an example, the LCC and DJGPP #if/else/endif: #ifdef ELCC #define push() _asm("pushl -8(%ebp)") #define pop() _asm("addl -36(%ebp), %esp") #endif #ifdef EDJGPP #define push() asm("pushl -4(%ebp)") #define pop() #endif -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20352 Date: 2008 May 3 17:22 From: Matt Lewis Subject: Re: Euphoria and gcc-4.3.0 compatibility Bernie Ryan wrote: > > > Whoops I return key before finishing my post > I understand why the code was written with the conditionals to > make easier for Rob to maintain the code for all platforms. > But now I think it would be easier to maintain if it was broke out > into different platforms. I couldn't disagree with this more. Matt -= B E G I N =- X-EUFORUM: 20353 Date: 2008 May 3 18:24 From: Judith Evans Subject: Re: Button Aesthetics Greg Haberek wrote: > > Judith Evans wrote: > > > > Enter the caption as C\nl\no\ns\ne and in Properties OtherStyles check multiline. > > Judith, are you still working on your colored buttons library? Perhaps this > could be of some use. I haven't been using it in a while. You could make rotated > buttons with it. > > > global procedure setFontRotated( integer pId, sequence pFont, integer pSize, integer pStyle, integer > pAngle ) > > > pAngle *= 10 > > > while pAngle < 0 do > > pAngle += 3600 > > end while > > > while pAngle > 3600 do > > pAngle -= 3600 > > end while > > > setFont( pId, pFont, pSize, {pStyle,0,pAngle,pAngle,DEFAULT_CHARSET,0,0,0,0} ) > > > end procedure > > > > -Greg I really like this and I always like getting contributions. Rotating the text works nicely. I need a routine to "rotate" the drawn button -- you wouldn't have one handy ..... would you? Thanks for the contribution to colored buttons. judith -= B E G I N =- X-EUFORUM: 20354 Date: 2008 May 3 20:42 From: CChris Subject: Re: Win32Lib Error Fixes C Bouzy wrote: > > Hello CChris, > > I wish I could tell you what causes the error, but I have never been able to > reproduce the error on-demand. It just happens randomly and only with certain > types of apps. > > ~C Bouzy > > "If you do what you have always done, you will get what you always got." Ok; this confirms my gut feelings about a race condition. At any rate I have include the code you posted, with a note for any future maintainer (or me 12 month from now). CChris -= B E G I N =- X-EUFORUM: 20355 Date: 2008 May 3 22:22 From: Shawn Pringle Subject: building EUPHORIA on Linux I have been experimenting with EUPHORIA 3.1 on Linux. After building the interpreter I found that the qsort.exw demo freezes with the interpreter I built. After displaying the unsorted list it gets stuck in the qsort() call. The interpreter distributed with EUPHORIA doesn't have this bahavior, however. A log of my shell follows. I reunpacked from sources. Recompiled. Ran it and ran it again with strace. pringles@piva:~/bin/euphoria/source$ uname -a Linux piva 2.6.18-6-686 #1 SMP Sun Feb 10 22:11:31 UTC 2008 i686 GNU/Linux pringles@piva:~/bin/euphoria/source$ tar -xzf ~/Desktop/Downloads/euphor31.tar -C ~/bin pringles@piva:~/bin/euphoria/source$ make make: Nothing to be done for `all'. pringles@piva:~/bin/euphoria/source$ make clean rm main-.c rm *.o pringles@piva:~/bin/euphoria/source$ make exu ec.ex int.ex make: exu: Command not found make: *** [main-.o] Error 127 pringles@piva:~/bin/euphoria/source$ PATH="/home/pringles/bin/euphoria/bin:$PATH" make exu ec.ex int.ex 21 .c files were created. To build your executable file, type: ./emake gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer main-.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer main-0.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer pathopen.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer init-.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer wildcard.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer file.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer error.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer machine.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer symtab.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer scanner.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer scanne_0.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer main.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer emit.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer emit_0.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer emit_1.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer parser.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer parser_0.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer parser_1.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer backend.c gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer compress.c gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_execute.c gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_task.c gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_main.c gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_alloc.c gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fno-defer-pop be_callc.c gcc -S -w -DELINUX -fsigned-char -O2 -ffast-math -fno-defer-pop be_callc.c gcc -finline-functions -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_inline.c gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_machine.c gcc -c -w -DELINUX -fsigned-char -O -Os -fno-inline-functions -ffast-math -fomit-frame-pointer be_rterror.c gcc -c -w -DELINUX -fsigned-char -O -Os -fno-inline-functions -ffast-math -fomit-frame-pointer be_syncolor.c gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_runtime.c gcc -S -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_runtime.c gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_symtab.c gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_w.c making exu gcc main-.o main-0.o pathopen.o init-.o wildcard.o file.o error.o machine.o symtab.o scanner.o scanne_0.o main.o emit.o emit_0.o emit_1.o parser.o parser_0.o parser_1.o backend.o compress.o be_execute.o be_task.o be_main.o be_alloc.o be_callc.o be_inline.o be_machine.o be_rterror.o be_syncolor.o be_runtime.o be_symtab.o be_w.o -lm -ldl -oexu pringles@piva:~/bin/euphoria/source$ exu ../demo/linux/qsort.exu bash: exu: command not found pringles@piva:~/bin/euphoria/source$ ./exu ../demo/linux/qsort.exu before sorting: {78,93,211,86,198,224,168,16,175,224,245,43,9,242,170,194,143,98,216, 79,103,84,248,153,165,199,77,29,4,148,192,180,77,53,161,15,216,94,54, 183,39,131,39,196,16,172,252,199,73,21} pringles@piva:~/bin/euphoria/source$ ./exu ../demo/linux/qsort.exu before sorting: {51,221,51,150,52,119,64,61,8,109,97,8,4,211,26,222,184,98,246,212, 128,46,85,113,99,220,184,251,42,180,25,150,139,61,34,27,113,34,221, 72,20,102,100,224,25,142,79,227,149,171} pringles@piva:~/bin/euphoria/source$ echo $EUDIR /home/pringles/bin/euphoria pringles@piva:~/bin/euphoria/source$ strace ./exu ../demo/linux/qsort.exu execve("./exu", ["./exu", "../demo/linux/qsort.exu"], [/* 33 vars */]) = 0 uname({sys="Linux", node="piva", ...}) = 0 brk(0) = 0x80c2000 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f33000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/home/pringles/.libs/tls/i686/sse2/cmov/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/home/pringles/.libs/tls/i686/sse2/cmov", 0xbf884278) = -1 ENOENT (No such file or directory) open("/home/pringles/.libs/tls/i686/sse2/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/home/pringles/.libs/tls/i686/sse2", 0xbf884278) = -1 ENOENT (No such file or directory) open("/home/pringles/.libs/tls/i686/cmov/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/home/pringles/.libs/tls/i686/cmov", 0xbf884278) = -1 ENOENT (No such file or directory) open("/home/pringles/.libs/tls/i686/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/home/pringles/.libs/tls/i686", 0xbf884278) = -1 ENOENT (No such file or directory) open("/home/pringles/.libs/tls/sse2/cmov/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/home/pringles/.libs/tls/sse2/cmov", 0xbf884278) = -1 ENOENT (No such file or directory) open("/home/pringles/.libs/tls/sse2/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/home/pringles/.libs/tls/sse2", 0xbf884278) = -1 ENOENT (No such file or directory) open("/home/pringles/.libs/tls/cmov/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/home/pringles/.libs/tls/cmov", 0xbf884278) = -1 ENOENT (No such file or directory) open("/home/pringles/.libs/tls/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/home/pringles/.libs/tls", 0xbf884278) = -1 ENOENT (No such file or directory) open("/home/pringles/.libs/i686/sse2/cmov/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/home/pringles/.libs/i686/sse2/cmov", 0xbf884278) = -1 ENOENT (No such file or directory) open("/home/pringles/.libs/i686/sse2/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/home/pringles/.libs/i686/sse2", 0xbf884278) = -1 ENOENT (No such file or directory) open("/home/pringles/.libs/i686/cmov/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/home/pringles/.libs/i686/cmov", 0xbf884278) = -1 ENOENT (No such file or directory) open("/home/pringles/.libs/i686/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/home/pringles/.libs/i686", 0xbf884278) = -1 ENOENT (No such file or directory) open("/home/pringles/.libs/sse2/cmov/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/home/pringles/.libs/sse2/cmov", 0xbf884278) = -1 ENOENT (No such file or directory) open("/home/pringles/.libs/sse2/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/home/pringles/.libs/sse2", 0xbf884278) = -1 ENOENT (No such file or directory) open("/home/pringles/.libs/cmov/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/home/pringles/.libs/cmov", 0xbf884278) = -1 ENOENT (No such file or directory) open("/home/pringles/.libs/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/home/pringles/.libs", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 open("/etc/ld.so.cache", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=56498, ...}) = 0 mmap2(NULL, 56498, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f25000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/tls/i686/cmov/libm.so.6", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`3\0\000"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=145136, ...}) = 0 mmap2(NULL, 147584, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f00000 mmap2(0xb7f23000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22) = 0xb7f23000 close(3) = 0 open("/home/pringles/.libs/libdl.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/tls/i686/cmov/libdl.so.2", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\f\0"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=9592, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7eff000 mmap2(NULL, 12404, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7efb000 mmap2(0xb7efd000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb7efd000 close(3) = 0 open("/home/pringles/.libs/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240O\1"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=1241392, ...}) = 0 mmap2(NULL, 1247388, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7dca000 mmap2(0xb7ef1000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x127) = 0xb7ef1000 mmap2(0xb7ef8000, 10396, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7ef8000 close(3) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7dc9000 mprotect(0xb7ef1000, 20480, PROT_READ) = 0 set_thread_area({entry_number:-1 -> 6, base_addr:0xb7dc96c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 munmap(0xb7f25000, 56498) = 0 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, TIOCGWINSZ, {ws_row=24, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0 brk(0) = 0x80c2000 brk(0x80e3000) = 0x80e3000 time(NULL) = 1209849081 open("/etc/localtime", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=1059, ...}) = 0 fstat64(3, {st_mode=S_IFREG|0644, st_size=1059, ...}) = 0 mmap2(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7da9000 read(3, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0\0\0\6\0\0"..., 131072) = 1059 close(3) = 0 munmap(0xb7da9000, 131072) = 0 mprotect(0x80c8000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80cc000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 open("../demo/linux/qsort.exu", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=1253, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f32000 read(3, "-- Calling a Euphoria routine fr"..., 4096) = 1253 open("../demo/linux/dll.e", O_RDONLY) = -1 ENOENT (No such file or directory) open("../demo/linux/dll.e", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/pringles/bin/euphoria/include/dll.e", O_RDONLY) = 4 fstat64(4, {st_mode=S_IFREG|0644, st_size=2317, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f31000 read(4, "-- (c) Copyright 2007 Rapid Depl"..., 4096) = 2317 read(4, "", 4096) = 0 close(4) = 0 munmap(0xb7f31000, 4096) = 0 open("../demo/linux/machine.e", O_RDONLY) = -1 ENOENT (No such file or directory) open("../demo/linux/machine.e", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/pringles/bin/euphoria/include/machine.e", O_RDONLY) = 4 fstat64(4, {st_mode=S_IFREG|0644, st_size=9341, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f31000 read(4, "-- (c) Copyright 2007 Rapid Depl"..., 4096) = 4096 read(4, "\n-- bits 24-31} (most sign"..., 4096) = 4096 read(4, " machine_func(M_A_TO_F64, a)\nend"..., 4096) = 1149 read(4, "", 4096) = 0 close(4) = 0 munmap(0xb7f31000, 4096) = 0 read(3, "", 4096) = 0 close(3) = 0 munmap(0xb7f32000, 4096) = 0 mprotect(0x80dc000, 20480, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80db000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80cf000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80c9000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80ce000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d4000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d6000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d8000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80cc000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d0000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80cc000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80cc000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d7000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d2000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d6000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d5000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d7000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d8000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d9000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d8000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d6000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e0000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e0000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e0000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d7000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d8000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d7000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80db000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d9000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d7000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d6000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80da000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d8000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d8000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d8000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d8000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80e1000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d8000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d3000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80cc000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d8000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 rt_sigaction(SIGINT, {0x8084eaf, [INT], SA_RESTART}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGILL, {0x80829a0, [ILL], SA_RESTART}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGSEGV, {0x80829a0, [SEGV], SA_RESTART}, {SIG_DFL}, 8) = 0 mprotect(0x80d8000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 open("/lib/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220T\1"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0755, st_size=1147548, ...}) = 0 mmap2(NULL, 1157428, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7cae000 mmap2(0xb7dbf000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x110) = 0xb7dbf000 mmap2(0xb7dc6000, 10548, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7dc6000 close(3) = 0 mprotect(0xb7dbf000, 20480, PROT_READ) = 0 mprotect(0x80d4000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 mprotect(0x80d1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 1), ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f32000 write(1, "before sorting:", 15before sorting:) = 15 write(1, "\n", 1 ) = 1 write(1, "{171,62,11,229,207,155,230,200,1"..., 68{171,62,11,229,207,155,230,200,158,207,188,254,3,203,245,165,66,162,) = 68 write(1, "\n", 1 ) = 1 write(1, "127,246,134,37,45,103,82,161,20,"..., 67127,246,134,37,45,103,82,161,20,242,243,62,238,15,218,190,2,222,23,) = 67 write(1, "\n", 1 ) = 1 write(1, "19,7,235,142,223,179,166,218,134"..., 4619,7,235,142,223,179,166,218,134,36,43,105,80}) = 46 write(1, "\n", 1 ) = 1 futex(0x80d7228, FUTEX_WAIT, 2, NULL -= B E G I N =- X-EUFORUM: 20356 Date: 2008 May 3 22:42 From: Judith Evans Subject: Re: Button Aesthetics Greg Haberek wrote: > Judith, are you still working on your colored buttons library? Perhaps this > could be of some use. I haven't been using it in a while. You could make rotated > buttons with it. > > > global procedure setFontRotated( integer pId, sequence pFont, integer pSize, integer pStyle, integer > pAngle ) > > > pAngle *= 10 > > > while pAngle < 0 do > > pAngle += 3600 > > end while > > > while pAngle > 3600 do > > pAngle -= 3600 > > end while > > > setFont( pId, pFont, pSize, {pStyle,0,pAngle,pAngle,DEFAULT_CHARSET,0,0,0,0} ) > > > end procedure > > > > -Greg I've tested with various font names and notice MS Sans Serif, System, Courier and Fixedsys do not rotate. Do you know why? judith -= B E G I N =- X-EUFORUM: 20357 Date: 2008 May 3 23:06 From: "Gregory Haberek" Subject: Re: Button Aesthetics > posted by: Judith Evans > > I've tested with various font names and notice MS Sans Serif, System, Courier and Fixedsys do not rotate. Do you know why? Probably because they're not TrueType? -Greg -= B E G I N =- X-EUFORUM: 20358 Date: 2008 May 4 1:10 From: "Euler German" Subject: Re: locale support? > On 2 May 2008 at 10:18, Jeremy Cowgar wrote (maybe snipped): > > > posted by: Jeremy Cowgar > > I finished documenting datetime.e: > > http://jeremy.cowgar.com/euphoria/lib_dtm.htm > > And it has a format function that allows you to: > > > d = new(2008, 5, 2, 12, 58, 32) > s = format(d, "%A, %B %d '%y %H:%M%p") > -- s is "Friday, May 2 '08 12:58PM" > > > So, the problem is not that the format function cannot support other > languages (because it can), but how to deal with locale support. Right > now, in datetime.e there are a few sequences titled things like: > month_names, month_abbrs, day_names, day_abbrs. Those are global > sequences that format() uses to populate the resulting string with. > > If you do not speak English, you can easily change the content of > those global sequences and format will happily use your language to > format the date/time. However, do we need a greater support? i.e. > should I introduce a locale.e or something? > Definitely, yes! I fully support the motion and I'm voluteering to do my part in translation. All I need is original text in English and commenting for disambiguation. Question: would namespace be applicable here? So... d = br:new(2008, 5, 2, 12, 58, 32) s = format(d, "%A, %d de %B de %Y %H:%M") -- s is "Sexta, 2 de Maio de 2008 12:58" Best, Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com _| ----------------------------- _| Reply preferably to the list, _| or to the address above. Thx! -= B E G I N =- X-EUFORUM: 20359 Date: 2008 May 4 2:21 From: Ricardo Silva Veloso Subject: text_color() equivalent in C/C++ Wich is the equivalent to Euphoria text_color() in C/C++? Thanks. _______ http://pt.wikipedia.org/wiki/User:Ricvelozo -= B E G I N =- X-EUFORUM: 20360 Date: 2008 May 4 5:06 From: Marco Achury Subject: Re: Freedos package Salix wrote: > > Just a quick note. Thank you for taking care of the DOS distribution. I am proud > to see Euphoria in FreeDOS repository. > > Regards, > > Salix Yes, is nice to find Euphoria at ibiblio (and mirrors). FreeDOS has not oportunity to compete agains windows or linux as the main operative system for daily use. Except for people with very old hardware. But has some applications. FreeDOS has received a lot of free publicity from DELL that included the system as an option for people buying PCs. Video card manufacturers and others have included in the hardware a FreeDOS boot disk (CDROM or floppy) with tools to make bios updates and other maintenance work. There will be an impresive market for embebed applications like point of sale or industrial control computers. Look an example at: http://www.jkmicro.com/products/flashtcp.html This kind of equipment may receive a very small version of the interpreter, or Euphoria code translated and compiled on C. +-+-+-+-+-+-+-+ Marco A. Achury Caracas, Venezuela -= B E G I N =- X-EUFORUM: 20361 Date: 2008 May 4 5:20 From: Greg Haberek Subject: wxEditor Project As a change of pace, I'm starting to host some of my projects on SourceForge. My goal is to get others involved with my projects, so that many of my ideas can get off the ground. Otherwise, I seem to start projects on my own only to have them fizzle out as I lose interest. The first project of this is wxEditor. With Pete having dropped off the face of the planet (and Edita with him), and Euphoria 4.0 on the horizon, I figured I'd strike while the iron's hot. I just registered the project, so it's still in pending status. I'll collect the code I have so far and get it posted once the project's approved. http://sourceforge.net/projects/wxeditor/ Matt... this means I (we?) need to get wxStyledTextControl working. My efforts have been rather fruitless, and I just end up mangling C++ code in hopes I'll get something working. Right now, wxEditor operates as a basic text editor with multiple tabs, using wxNotebook and wxTextCtrl. I'd like to get the syntax highlighting working from the get-go. I see that as a major benefit to a code editor. -Greg -= B E G I N =- X-EUFORUM: 20362 Date: 2008 May 4 5:56 From: Marco Achury Subject: Re: [DOS] Display Copyright Symbol Larry Miller wrote: > > Alex Caracatsanis wrote: > > > > Hi folks > > > > Can someone please tell me what code will result in the display of a > > copyright symbol (ASCII value ©) on the console? > > > > Thank you > > > > Alex Caracatsanis > > I am assuming you are using a console window with Windows. > The default font used on the console does not have the copyright symbol. Many > of the special symbols were sacrificed for the line drawing characters. To display > the copyright character you will have to change the font by using console properties > to Lucida Console. > > Larry Miller On a real DOS system, the default US table code 437 doesn't includes that simbol. Multiligual Latin 1, the default for spanish and other languages included it as 184, 169 showed the symbol for Registered (R) +-+-+-+-+-+-+-+ Marco A. Achury Caracas, Venezuela -= B E G I N =- X-EUFORUM: 20363 Date: 2008 May 4 6:06 From: Marco Achury Subject: Re: [DOS32] Fonts for Console Display? > > Is it possible to use a variety of fonts to display output on the console? > > Can you display something in italics, for example, or change the size of > > letters? (WinXP) On a real DOS system you can manipulate the code page, the file or the copy on memory, to create your own customized characters. You can't go out of the rectangular area assigned to each character, so you are limited in change size. But I'm sure the windows emulation console will not enable you to make this. Of course you can create your own font file for windows with mixed normal + italic characters. Allways will be a lot of work. +-+-+-+-+-+-+-+ Marco A. Achury Caracas, Venezuela -= B E G I N =- X-EUFORUM: 20364 Date: 2008 May 4 13:16 From: CChris Subject: remainder() is not right The remainder of x by y, which remainder() is supposed to return, is the number with the smallest magnitude and the sign of y such that, if we call it z, x-z is a multiple of y. But remainder() has a quirkier response. For instance: ?remainder(-27,3600) -- -27, instead of 3573 ?remainder(-3627,3600) -- ditto ?remainder(-3627,-3600) -- -27 is correct here ?remainder(27,-3600) -- 27, instead of -3573 Changing remainder()'s behaviour will break any code that works around this behaviour. So perhaps should we add another function with the appropriate return values; perhaps signed_remainder()? Notionally, it might work like this: global function signed_remainder(object a,object b) integer atom_a,atom_b atom c if find(b,{{},0.0} then return {} -- not a valid 2nd argument -- crash("Invalid 2nd argument to remainder()") end if atom_a=atom(a) atom_b=atom(b) if atom_a!=atom_b then if atom_a then -- atom,sequence for i=1 to length(b) do b[i]=signed_remainder(a,b[i]) end for return b else -- sequence,atom for i=1 to length(a) do a[i]=signed_remainder(a[i],b) end for return a end if elsif atom_a=0 then -- two sequences if length(a)!=length(b) then return {} -- let caller handle the mismatch -- crash("Sequence lengths don't match") else for i=1 to length(a) do a[i]=signed_remainder(a[i],b[i]) end for return a end if else -- two atoms c=remainder(a,b) -- smallest magnitude and sign of a if a<0!=b<0 then return c+b else return c end if end function It will be probably better implemented as a builtin if there is a corresponding C stdlib function with the desired behaviour. If only to take advantage of the sequence extension mechanism binary_op() in be_runtime.c provides. CChris -= B E G I N =- X-EUFORUM: 20365 Date: 2008 May 4 14:32 From: "Euler German" Subject: Re: remainder() is not right > On 4 May 2008 at 6:16, CChris wrote (maybe snipped): > The remainder of x by y, which remainder() is supposed to return, is > the number with the smallest magnitude and the sign of y such that, if > we call it z, x-z is a multiple of y. > > But remainder() has a quirkier response. For instance: > ?remainder(-27,3600) -- -27, instead of 3573 > ?remainder(-3627,3600) -- ditto > ?remainder(-3627,-3600) -- -27 is correct here > ?remainder(27,-3600) -- 27, instead of -3573 > Chris, IMHO actual results are coherent to function's description found in Refman, or am I missing something? Isn't it supposed to return the remainder of division of the first element by the second? Best, Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com _| ----------------------------- _| Reply preferably to the list, _| or to the address above. Thx! -= B E G I N =- X-EUFORUM: 20366 Date: 2008 May 4 15:09 From: Jeremy Cowgar Subject: Formatting numbers/money according to Locale in Win32? Does anyone know how to format numbers/money in Win32 according to the locale? In linux, you simply use strfmon. I have localization complete in Linux. Just need the number/money formatting in Windows. I'm looking for a C api call. I see GetCurrencyFormat() but thus far have been unable to find where it's actually defined. All uses come back with a function id of -1. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20367 Date: 2008 May 4 15:10 From: jacques deschênes Subject: Re: remainder() is not right I get the same result as euphoria with the following C code compiled with bcc55 #include int main(int argc, char** argv){ printf("%d\n",-27 % 3600); printf("%d\n",-3627 % 3600); printf("%d\n",-3627 % -3600); printf("%d\n",27 % -3600); } Jacques Deschênes CChris wrote: > > > The remainder of x by y, which remainder() is supposed to return, is the number > with the smallest magnitude and the sign of y such that, if we call it z, x-z > is a multiple of y. > > But remainder() has a quirkier response. For instance: > ?remainder(-27,3600) -- -27, instead of 3573 > ?remainder(-3627,3600) -- ditto > ?remainder(-3627,-3600) -- -27 is correct here > ?remainder(27,-3600) -- 27, instead of -3573 > > Changing remainder()'s behaviour will break any code that works around this > behaviour. So perhaps should we add another function with the appropriate return > values; perhaps signed_remainder()? > > Notionally, it might work like this: > > global function signed_remainder(object a,object b) > integer atom_a,atom_b > atom c > > if find(b,{{},0.0} then > return {} -- not a valid 2nd argument > -- crash("Invalid 2nd argument to remainder()") > end if > atom_a=atom(a) > atom_b=atom(b) > if atom_a!=atom_b then > if atom_a then -- atom,sequence > for i=1 to length(b) do > b[i]=signed_remainder(a,b[i]) > end for > return b > else -- sequence,atom > for i=1 to length(a) do > a[i]=signed_remainder(a[i],b) > end for > return a > end if > elsif atom_a=0 then -- two sequences > if length(a)!=length(b) then > return {} -- let caller handle the mismatch > -- crash("Sequence lengths don't match") > else > for i=1 to length(a) do > a[i]=signed_remainder(a[i],b[i]) > end for > return a > end if > else -- two atoms > c=remainder(a,b) -- smallest magnitude and sign of a > if a<0!=b<0 then > return c+b > else > return c > end if > end function > > > It will be probably better implemented as a builtin if there is a corresponding > C stdlib function with the desired behaviour. If only to take advantage of the > sequence extension mechanism binary_op() in be_runtime.c provides. > > CChris -= B E G I N =- X-EUFORUM: 20368 Date: 2008 May 4 15:17 From: Jeremy Cowgar Subject: Re: locale support? I was originally thinking of providing a 100% euphoria solution, however, there are a lot of locales! So, I started in Linux, wrapped setlocale, strfmon and strftime. This gives us complete locale support in linux. You can use *any* locale that the user has installed. It'll format dates, times, currency and numbers according to that locale: include locale.e as l include datetime.e as d d:datetime now now = d:now() l:set("en_US") printf(1, "%s, %s, %s\n", { l:datetime("%A, %B %d %Y", now), l:money(10928.2), l:number(1029.35)}) Output is: Sunday, May 4 2008, $10,928.20, 1,029.35 You can set any locale and the date language will change, the currency symbol, the thousands and decimal point, etc... The final There are two more things to do: 1. make it work in Windows, see: http://www.openeuphoria.org/EUforum/m20366.html 2. Message localization. My ideas here are to provide .ini files (cross-platform) to provide localization files: data/en_US.ini data/en_CA.ini etc... HELLO=Hello WORLD=World GREETING=%s, %s! ERROR=Error: %i %s ERR_FILE_OPEN=%s could not be opened include locale.e as l l:set({"en_US", "data"}) puts(1, l:tr("$GREETING", {l:w("HELLO"), l:w("WORLD")})) puts(1, l:tr("$GREETING", {l:w("HELLO"), "John"})) puts(1, l:tr("$ERROR", {10, l:w("ERR_FILE_OPEN"), filename})) Since you use the tr and w functions often, they are tiny. tr = translate, w = word or lookup word. Anyway that's where I am at. Any thoughts? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20369 Date: 2008 May 4 15:57 From: Jules Subject: ed problem ed on Linux crashes with this error message when I try to save a file in DOS format: "attempt to move cursor off the screen to line 1, column 89" Normally I get asked whether I want to save the file in DOS or Linux format, but for some reason this prompt is being bypassed. Can anyone help? Thanks. -= B E G I N =- X-EUFORUM: 20370 Date: 2008 May 4 16:06 From: jacques deschênes Subject: Re: remainder() is not right In fact remainder(x,y) means q*y+r=x so remainder(-27,3600)= (-27) is ok as 0*3600+(-27)=(-27) remainder(-3627,3600)=(-27) is ok as -1*3600+(-27)=(-3627) remainder(-3627,-3600) = -27 is ok as 1*(-3600)+(-27)=(-3627) remainder(27,-3600) = 27 is ok as 0*3600+ 27 = 27 Jacques Deschênes CChris wrote: > > > The remainder of x by y, which remainder() is supposed to return, is the number > with the smallest magnitude and the sign of y such that, if we call it z, x-z > is a multiple of y. > > But remainder() has a quirkier response. For instance: > ?remainder(-27,3600) -- -27, instead of 3573 > ?remainder(-3627,3600) -- ditto > ?remainder(-3627,-3600) -- -27 is correct here > ?remainder(27,-3600) -- 27, instead of -3573 > > Changing remainder()'s behaviour will break any code that works around this > behaviour. So perhaps should we add another function with the appropriate return > values; perhaps signed_remainder()? > > Notionally, it might work like this: > > global function signed_remainder(object a,object b) > integer atom_a,atom_b > atom c > > if find(b,{{},0.0} then > return {} -- not a valid 2nd argument > -- crash("Invalid 2nd argument to remainder()") > end if > atom_a=atom(a) > atom_b=atom(b) > if atom_a!=atom_b then > if atom_a then -- atom,sequence > for i=1 to length(b) do > b[i]=signed_remainder(a,b[i]) > end for > return b > else -- sequence,atom > for i=1 to length(a) do > a[i]=signed_remainder(a[i],b) > end for > return a > end if > elsif atom_a=0 then -- two sequences > if length(a)!=length(b) then > return {} -- let caller handle the mismatch > -- crash("Sequence lengths don't match") > else > for i=1 to length(a) do > a[i]=signed_remainder(a[i],b[i]) > end for > return a > end if > else -- two atoms > c=remainder(a,b) -- smallest magnitude and sign of a > if a<0!=b<0 then > return c+b > else > return c > end if > end function > > > It will be probably better implemented as a builtin if there is a corresponding > C stdlib function with the desired behaviour. If only to take advantage of the > sequence extension mechanism binary_op() in be_runtime.c provides. > > CChris -= B E G I N =- X-EUFORUM: 20371 Date: 2008 May 4 16:18 From: jacques deschênes Subject: Re: Formatting numbers/money according to Locale in Win32? ref: http://msdn.microsoft.com/en-us/library/ms776318(VS.85).aspx GetCurrencyFormat is in kernel32.dll but there 2 version of it ANSI and UNICODE GetCurrencyFormmatA and GetCurrencyFormatW Jacques Deschênes Jeremy Cowgar wrote: > > Does anyone know how to format numbers/money in Win32 according to the locale? > In linux, you simply use strfmon. I have localization complete in Linux. Just > need the number/money formatting in Windows. > > I'm looking for a C api call. I see GetCurrencyFormat() but thus far have been > unable to find where it's actually defined. All uses come back with a function > id of -1. > > -- > Jeremy Cowgar > http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20372 Date: 2008 May 4 16:48 From: Arthur Crump Subject: Re: remainder() is not right Nobody seems to have ponted out yet that the documenation for remainder says that the result is the same sign as the first argument, not the second, as CChris seems to have assumed. Arthur Crump, UK --------------------------------------------------------------------- CChris wrote: > > > The remainder of x by y, which remainder() is supposed to return, is the number > with the smallest magnitude and the sign of y such that, if we call it z, x-z > is a multiple of y. > > But remainder() has a quirkier response. For instance: > ?remainder(-27,3600) -- -27, instead of 3573 > ?remainder(-3627,3600) -- ditto > ?remainder(-3627,-3600) -- -27 is correct here > ?remainder(27,-3600) -- 27, instead of -3573 > > Changing remainder()'s behaviour will break any code that works around this > behaviour. So perhaps should we add another function with the appropriate return > values; perhaps signed_remainder()? > ... Code omitted ... > CChris -= B E G I N =- X-EUFORUM: 20373 Date: 2008 May 4 17:49 From: Larry Miller Subject: stack.e functions I was looking at the functions defined in stack.e on SourceForge and found 2 problems. push() will not word properly if value is a sequence. dup() will not work properly if the top element is a sequence. The corrected functions: global function push(stack sk, object value) if sk[1] = FIFO then if length(sk) = 1 then return sk & {value} end if return FIFO & {value} & sk[2..$] else return sk[1..$] & {value} end if end function global function dup(stack sk) if length(sk) = 1 then crash("stack underflow in dup()", {}) end if return sk & {sk[$]} end function Larry Miller -= B E G I N =- X-EUFORUM: 20374 Date: 2008 May 4 20:09 From: don cole Subject: Re: ed problem Jules wrote: > > ed on Linux crashes with this error message when I try to save a file in DOS > format: > > "attempt to move cursor off the screen to line 1, column 89" > > Normally I get asked whether I want to save the file in DOS or Linux format, > but for some reason this prompt is being bypassed. Can anyone help? > Thanks. hello Jules, Use Edita or some other editor. Pete Lomax has dissappeared I uploaded what I have of his files. Unfortunately they are all Windows versions. I'm sure someone has the Linux version out there some place. There are other free editors available. I hear Crimson is good you could also try Mike's Editor in the Archives. That ED seems to me to be very clumsy when I use it. It comes stock with Euphoria but I don't much care for it. Check the Archives for Editors Linux. Also TextPad (you have to set it up for Euphoria) is free. Don Cole -= B E G I N =- X-EUFORUM: 20375 Date: 2008 May 4 20:55 From: Kenneth Rhodes Subject: Re: ed problem don cole wrote: > > Jules wrote: > > > > ed on Linux crashes with this error message when I try to save a file in DOS > > format: > > > > "attempt to move cursor off the screen to line 1, column 89" > > > > Normally I get asked whether I want to save the file in DOS or Linux format, > > but for some reason this prompt is being bypassed. Can anyone help? > > Thanks. > > hello Jules, > > Use Edita or some other editor. Pete Lomax has dissappeared I uploaded what > I > have of his files. Unfortunately they are all Windows versions. I'm sure someone > has the Linux version out there some place. There never was a Linux version of Pete Lomax's Edita. At one point there was some discussion on the forum of trying to port Edita to Linux; however, if I recall correctly, there was a problem due to some aspect of Pete's Edita license. All of which underscores the value of using programs with true open sourced code. >There are other free editors available. > I hear Crimson is good you could also try > Mike's Editor in the Archives. That ED seems to me to be very clumsy when I > use it. It comes stock with Euphoria but I don't much care for it. Check the > Archives for Editors Linux. Also TextPad (you have to set it up for Euphoria) > is free. > > Don Cole Greg Habarek has recently initiated a new wxEuphoria editor project. There is a wxEuphoria editor which Matt Lewis included with the wxEuphoria distribution, I believe. It is the only true cross platform GUI editor written in Euphoria. I'm wondering if Rob introduced a bug in the ed.ex code when he dropped ncurses. I recall encountering problems with "attempt to move the cursor off the screen" errors when I was trying to implement my version of ed.ex in the Euphoria 3.0 code which uses ascii codes to position the curser. One of ed.ex's neat features was it's ability to save files in either Linux or DOS line ending formats. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.0 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 20376 Date: 2008 May 4 21:38 From: Judith Evans Subject: Re: Button Aesthetics Greg Haberek wrote: > Judith, are you still working on your colored buttons library? Perhaps this > could be of some use. I haven't been using it in a while. You could make rotated > buttons with it. > > -Greg Can I assume that rotating buttons are circular instead of rectangular or square? judith -= B E G I N =- X-EUFORUM: 20377 Date: 2008 May 4 23:38 From: Jeremy Cowgar Subject: Re: ed problem For the fun of it, I tried EE in the archives since it has both a DOS and Linux version. Problem is, the DOS version will no longer run with newer versions of Windows (Vista) due to it not really having DOS (i.e. things like free_low, dos_interrupt, vga modes, full screen DOS consoles, etc... do not work). So, it seems now that going forward ed is the only cross platform editor that currently exists and is written in Euphoria. There are many editors that are cross platform that support Euphoria, see the recent thread about editors. Now, I've tried ed in Linux and Windows and have had no problems with it. Since it is still distributed w/Euphoria, I think if a problem exists, we should probably try to figure it out. We do not want to distribute a broken ed w/Euphoria knowingly. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20378 Date: 2008 May 4 23:40 From: CChris Subject: Re: remainder() is not right Euler German wrote: > > > On 4 May 2008 at 6:16, CChris wrote (maybe snipped): > > > The remainder of x by y, which remainder() is supposed to return, is > > the number with the smallest magnitude and the sign of y such that, if > > we call it z, x-z is a multiple of y. > > > > But remainder() has a quirkier response. For instance: > > ?remainder(-27,3600) -- -27, instead of 3573 > > ?remainder(-3627,3600) -- ditto > > ?remainder(-3627,-3600) -- -27 is correct here > > ?remainder(27,-3600) -- 27, instead of -3573 > > > > Chris, IMHO actual results are coherent to function's description > found in Refman, or am I missing something? Isn't it supposed to > return the remainder of division of the first element by the second? > > Best, > Euler > > -- > _ > _| euler f german > _| sete lagoas, mg, brazil > _| efgerman{AT}gmail{DOT}com > _| ----------------------------- > _| Reply preferably to the list, > _| or to the address above. Thx! > > It returns *a* emainder. When a and b are positive, this is the expected value. When signs are otherwise, then a discrepancy appears with what, in arithmetic, is called "remainder". CChris -= B E G I N =- X-EUFORUM: 20379 Date: 2008 May 4 23:44 From: CChris Subject: Re: remainder() is not right jacques deschênes wrote: > > In fact remainder(x,y) means q*y+r=x > so > remainder(-27,3600)= (-27) is ok as 0*3600+(-27)=(-27) > remainder(-3627,3600)=(-27) is ok as -1*3600+(-27)=(-3627) > remainder(-3627,-3600) = -27 is ok as 1*(-3600)+(-27)=(-3627) > remainder(27,-3600) = 27 is ok as 0*3600+ 27 = 27 > > Jacques Deschênes > True. And signed_remainder() also respects this identity. But see, there are at least two ways of defining it, the mathematic way and the C way. CChris > CChris wrote: > > > > > > The remainder of x by y, which remainder() is supposed to return, is the number > > with the smallest magnitude and the sign of y such that, if we call it z, x-z > > is a multiple of y. > > > > But remainder() has a quirkier response. For instance: > > ?remainder(-27,3600) -- -27, instead of 3573 > > ?remainder(-3627,3600) -- ditto > > ?remainder(-3627,-3600) -- -27 is correct here > > ?remainder(27,-3600) -- 27, instead of -3573 > > > > Changing remainder()'s behaviour will break any code that works around this > > behaviour. So perhaps should we add another function with the appropriate return > > values; perhaps signed_remainder()? > > > > Notionally, it might work like this: > > > > global function signed_remainder(object a,object b) > > integer atom_a,atom_b > > atom c > > > > if find(b,{{},0.0} then > > return {} -- not a valid 2nd argument > > -- crash("Invalid 2nd argument to remainder()") > > end if > > atom_a=atom(a) > > atom_b=atom(b) > > if atom_a!=atom_b then > > if atom_a then -- atom,sequence > > for i=1 to length(b) do > > b[i]=signed_remainder(a,b[i]) > > end for > > return b > > else -- sequence,atom > > for i=1 to length(a) do > > a[i]=signed_remainder(a[i],b) > > end for > > return a > > end if > > elsif atom_a=0 then -- two sequences > > if length(a)!=length(b) then > > return {} -- let caller handle the mismatch > > -- crash("Sequence lengths don't match") > > else > > for i=1 to length(a) do > > a[i]=signed_remainder(a[i],b[i]) > > end for > > return a > > end if > > else -- two atoms > > c=remainder(a,b) -- smallest magnitude and sign of a > > if a<0!=b<0 then > > return c+b > > else > > return c > > end if > > end function > > > > > > It will be probably better implemented as a builtin if there is a corresponding > > C stdlib function with the desired behaviour. If only to take advantage of the > > sequence extension mechanism binary_op() in be_runtime.c provides. > > > > CChris -= B E G I N =- X-EUFORUM: 20380 Date: 2008 May 4 23:46 From: Jeremy Cowgar Subject: Re: stack.e functions Larry Miller wrote: > > I was looking at the functions defined in stack.e on SourceForge and found 2 > problems. push() will not word properly if value is a sequence. dup() will not > work properly if the top element is a sequence. > > The corrected functions: Thanks Larry! This is what the standard libraries are all about! I added a few tests to exploit the bug you found: sk = s:push(sk, {10,20}) test_equal("FIFO push sequence #1", {FILO, {10,20}}, sk) sk = s:push(sk, {30,40}) test_equal("FIFO push sequence #3", {FILO, {10,20},{30,40}}, sk) sk = s:dup(sk) test_equal("FIFO dup sequence", {FILO, {10,20},{30,40},{30,40}}, sk) I then applied replaced the dup and push functions with your variants and all tests pass again. The changes have been committed to SVN. 579 tests run, 579 passed, 0 failed, 100% success -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20381 Date: 2008 May 5 0:03 From: Matt Lewis Subject: Re: ed problem Jeremy Cowgar wrote: > > > For the fun of it, I tried EE in the archives since it has both a DOS and > Linux version. Problem is, the DOS version will no longer run with newer > versions of Windows (Vista) due to it not really having DOS (i.e. things > like free_low, dos_interrupt, vga modes, full screen DOS consoles, etc... do > not work). So, it seems now that going forward ed is the only cross platform > editor that currently exists and is written in Euphoria. Well, there's wxIDE, which, admittedly isn't the greatest editor ever, but it does run under Windows, Linux and FreeBSD. Matt -= B E G I N =- X-EUFORUM: 20382 Date: 2008 May 5 0:07 From: Jeremy Cowgar Subject: Re: Formatting numbers/money according to Locale in Win32? jacques deschênes wrote: > > > ref: http://msdn.microsoft.com/en-us/library/ms776318(VS.85).aspx > GetCurrencyFormat is in kernel32.dll but there 2 version of it ANSI and UNICODE > GetCurrencyFormmatA and GetCurrencyFormatW > Ah. GetCurrencyFormatA... In the docs I was looking at it is references GetCurrencyFormat. Great. I found GetNumberFormat as well. So, now date/time, number and currency formatting are all locales based on the OS locale data! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20383 Date: 2008 May 5 0:08 From: Jeremy Cowgar Subject: Re: ed problem Matt Lewis wrote: > > Well, there's wxIDE, which, admittedly isn't the greatest editor ever, but > it does run under Windows, Linux and FreeBSD. > Ah, that's right. Sorry to leave that out Matt. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20384 Date: 2008 May 5 0:15 From: Jeremy Cowgar Subject: Re: locale support? Ok, locale support now works on Windows and Linux. Please see my problem at the end of this message. include locale.e as l include datetime.e as d d:datetime now now = d:now() l:set("en_US") printf(1, "%s, %s, %s\n", { l:datetime("%A, %B %d %Y", now), l:money(10928.2), l:number(1029.35)}) Output is: Sunday, May 4 2008, $10,928.20, 1,029.35 You can set any locale and the date language will change, the currency symbol, the thousands and decimal point, etc... The best part is it uses OS dependent locale data so we do not have to manage locale data, have to do no translations, and Euphoria can now be set for any locale that a user happens to have installed. ======== Problem ======== Locale names are different on Linux and Windows. For instance, to get the locale for United States English, on Windows you must: l:set("English_United States") however, under Linux you must: l:set("en_US") Creating a cross-walk may not be that easy but if we have to, it's still easier than translating hundreds of locales to pure Euphoria. So. Any suggestions/thoughts? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20385 Date: 2008 May 5 0:19 From: Jason Gade Subject: Re: locale support? Well, the Linux stuff should be Posix, but if nothing else then I guess you have to wrap it in a platform() test. Are there posix-compatible functions in msvcrt.dll? -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20386 Date: 2008 May 5 0:34 From: Marco Achury Subject: ed + DSL Re: ed problem What version of ED causes the error, the distributed with the last euphoria installer or the one at SVN? I added an constant ACCENT, if you have english keyboard is better to set it to 0. I have seen some days ago another small bug at ed on linux. running in DSL Linux, when invoque ed, the prompt asking the file name appear some lines over the line where must to appear. Also note that the configuration instructions at Euphoria DSL package are not rigth. Is the author in the forum? I get sucess adding at .bashrc export EUDIR=/opt/euphoria export EUINC=/opt/euphoria/include export PATH=/opt/euphoria/bin:$PATH Works OK but with the small bug when launching ed. +-+-+-+-+-+-+-+ Marco A. Achury Caracas, Venezuela -= B E G I N =- X-EUFORUM: 20387 Date: 2008 May 5 0:39 From: Jeremy Cowgar Subject: Re: locale support? Jason Gade wrote: > > Well, the Linux stuff should be Posix, but if nothing else then I guess you > have to wrap it in a platform() test. > > Are there posix-compatible functions in msvcrt.dll? > Yes, I had a bit of trouble tracking down GetCurrencyFormatA, but finally got it. So, we now have locale support in Windows and Linux/FreeBSD. However, I still have this problem: http://www.openeuphoria.org/EUforum/m20384.html -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20388 Date: 2008 May 5 1:05 From: Matt Lewis Subject: Re: locale support? Jeremy Cowgar wrote: > > Ok, locale support now works on Windows and Linux. Please see my problem at > the end of this message. I notice some oddities about locale.e that were probably left in by mistake. For instance, your platform error message references IUp. Also, the setlocale and strftime imports aren't within the LINUX/BSD platform guards. More on topic, I thought Windows used LCIDs, which are numbers, rather than strings, to denote specific locales. Matt -= B E G I N =- X-EUFORUM: 20389 Date: 2008 May 5 1:10 From: Jeremy Cowgar Subject: Re: locale support? Matt Lewis wrote: > > Jeremy Cowgar wrote: > > > > Ok, locale support now works on Windows and Linux. Please see my problem at > > the end of this message. > > I notice some oddities about locale.e that were probably left in by > mistake. For instance, your platform error message references IUp. Ops! That's what you get for copy/paste to saving time :-) I've corrected it in my copy. It'll be in my next commit. > Also, the setlocale and strftime imports aren't within the LINUX/BSD > platform guards. They are the same function on both Windows and Unix systems. > > More on topic, I thought Windows used LCIDs, which are numbers, rather than > strings, to denote specific locales. > The setlocale function works the same in Windows as in Linux, it just takes different Locale names. I am no locale expert, but that's what I understand from the docs. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20390 Date: 2008 May 5 1:55 h=domainkey-signature:received:received:from:to:date:mime-version:subject:message-id:priority:in-reply-to:references:x-pgp-keyid:x-pgp-web2get:x-pgp-mail2get:x-mailer:content-type:content-transfer-encoding:content-description; bh=wY9eMse4AsUMrhy3VJa5tYPciQ/WjwBSLWJ8mjiADco=; b=nhTMZQhTXPkcezjKneSH+NTm2kWPgMIbsf1ciIeVaRkK15wz7pPl+pdxUYXgXeFdN+aR5EJo2z8p80SjLs84Txi43o9mNu6ABUcnVVAYLNy/2LnrADLcLjKSVd/bsSmDbAr0eS9jxRtUn5BD+4UUzDMqn/VEHMaGzLpvjITKUog= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:date:mime-version:subject:message-id:priority:in-reply-to:references:x-pgp-keyid:x-pgp-web2get:x-pgp-mail2get:x-mailer:content-type:content-transfer-encoding:content-description; b=d/H8Fgl/4MnjnLVeAsCv/sPWIOrm/6IuHHOXyiloTIMKoXy2PJfucE854dl5gH/zIuMaTYufFioEtAWmANX5PGGFH4nTGMgKjzJRdL+TYcEENclj0gDnTd1RXSqNUj/7kr+4h2XwKR4Q16SHQWANymlI4DvrhHoKBwUTtES/Q6g= Received: by 10.150.69.41 with SMTP id r41mr5574597yba.128.1209952103259; Sun, 04 May 2008 18:48:23 -0700 (PDT) Received: from ?192.168.0.3? ( [200.159.215.207]) by mx.google.com with ESMTPS id 9sm12121052ywf.2.2008.05.04.18.48.20 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 04 May 2008 18:48:22 -0700 (PDT) From: "Euler German" To: EUforum at topica.com Date: Sun, 04 May 2008 22:47:58 -0300 MIME-Version: 1.0 Subject: Re: remainder() is not right Message-ID: <481E3D1E.23029.969FA0 at eulerg.gmail.com> Priority: normal In-reply-to: <491977603-1463792126-1209944434 at boing.topica.com> References: <491977603-1463792126-1209944434 at boing.topica.com> X-PGP-KeyID: 0xB65367CB X-PGP-Web2Get: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xB65367CB X-PGP-Mail2Get: X-mailer: Pegasus Mail for Windows (4.41) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body > On 4 May 2008 at 16:40, CChris wrote (maybe snipped): > It returns *a* emainder. When a and b are positive, this is the > expected value. When signs are otherwise, then a discrepancy appears > with what, in arithmetic, is called "remainder". > > CChris > Please, I'm not discussing mathematical discrepancies. I only stated that remainder(), as described in reference manual, works as said, thus returning the "left over" of a division, so it can't be told wrong. I'm NOT saying there's no need for a "signed_remainder()", though I have no use for it. YMMV. Some quick explanation at: - http://en.wikipedia.org/wiki/Remainder - http://en.wikipedia.org/wiki/Modulo_operation Best, Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com _| ----------------------------- _| Reply preferably to the list, _| or to the address above. Thx! -= B E G I N =- X-EUFORUM: 20391 Date: 2008 May 5 2:32 From: Jeremy Cowgar Subject: Full locale support now in SVN! Wow, it's finally working! We can now format date/time values, money, numbers and finally also message translation. Instead of going with an INI file, I went with the same format that gettext uses, the po file because there are many nice editors (not text editors but translation tools) for .po files. There are also text editors for the po format, as it is a simple text file. So, here's an example program: ---- File: po/en_US.po # English language file for greeter app hello Hello world World greeting %s, %s! ---- File: po/es_MX.po # Spanish language file for greeter app hello Hola world Mundo greeting %s, %s! ---- File: greeter.ex include locale.e as l include datetime.e as d d:datetime now now = d:now() l:set_po_path("po") l:set("en_US") printf(1, "Date: %s\n", {l:datetime("%A, %B %d, %Y", now)}) printf(1, "Average car price: %s\n", {l:money(22652)}) printf(1, "Population: %s\n", {l:number(10000)}) printf(1, l:w("greeting"), {l:w("hello"), l:w("world")}) puts(1, "\n") l:set("es_MX") printf(1, "Date: %s\n", {l:datetime("%A, %B %d, %Y", now)}) printf(1, "Average car price: %s\n", {l:money(22652)}) printf(1, "Population: %s\n", {l:number(10000)}) printf(1, l:w("greeting"), {l:w("hello"), l:w("world")}) ---- Output: Date: Sunday, May 04, 2008 Average car price: $22,652.00 Population: 10,000 Hello, World! Date: domingo, mayo 04, 2008 Average car price: $22,652.00 Population: 10,000 Hola, Mundo! ---- So, that's it. Now, I do have one more problem that many other systems do not address and maybe they do not because it's a very rare case? The problem is in the example of Hello, World!. Some languages may say who they are greeting first, like: World Hello! or something like that. In this situation, our localization will not work. As it is positional ("%s, %s!"). Any thoughts from someone better at localizing apps than I am? Oh, I know the date/time, money, number formatting did not change, but it's the same for English and Spanish... here's output if the locale is changed to de_DE: Date: Sonntag, Mai 04, 2008 Average car price: 1.020,50 EUR Population: 10.000 -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20392 Date: 2008 May 5 2:44 From: Kat Subject: Re: Full locale support now in SVN! Jeremy Cowgar wrote: > > Wow, it's finally working! We can now format date/time values, money, numbers > and finally also message translation. > > Instead of going with an INI file, I went with the same format that gettext > uses, the po file because there are many nice editors (not text editors but > translation tools) for .po files. There are also text editors for the po format, > as it is a simple text file. So, here's an example program: > > ---- File: po/en_US.po > # English language file for greeter app > hello Hello > world World > greeting %s, %s! > > ---- File: po/es_MX.po > # Spanish language file for greeter app > hello Hola > world Mundo > greeting %s, %s! > > ---- File: greeter.ex > > include locale.e as l > include datetime.e as d > > d:datetime now > now = d:now() > > l:set_po_path("po") > l:set("en_US") > printf(1, "Date: %s\n", {l:datetime("%A, %B %d, %Y", now)}) > printf(1, "Average car price: %s\n", {l:money(22652)}) > printf(1, "Population: %s\n", {l:number(10000)}) > printf(1, l:w("greeting"), {l:w("hello"), l:w("world")}) > puts(1, "\n") > > l:set("es_MX") > printf(1, "Date: %s\n", {l:datetime("%A, %B %d, %Y", now)}) > printf(1, "Average car price: %s\n", {l:money(22652)}) > printf(1, "Population: %s\n", {l:number(10000)}) > printf(1, l:w("greeting"), {l:w("hello"), l:w("world")}) > > > ---- Output: > Date: Sunday, May 04, 2008 > Average car price: $22,652.00 > Population: 10,000 > Hello, World! > > Date: domingo, mayo 04, 2008 > Average car price: $22,652.00 > Population: 10,000 > Hola, Mundo! > ---- > > So, that's it. Now, I do have one more problem that many other systems do not > address and maybe they do not because it's a very rare case? The problem is > in the example of Hello, World!. Some languages may say who they are greeting > first, like: World Hello! or something like that. In this situation, our localization > will not work. As it is positional ("%s, %s!"). > > Any thoughts from someone better at localizing apps than I am? I suggest again that the users in those locales submit the translations. They'd know (more than we would) what's appropriate. As for a program that automagically changes word order in any given sentence, well, that would be a great translation program, and beyond doing free. Unless you know native speakers to volunteer in all those locales. I once considered having Tiggr learn by reading pages in other languages, when good english translations exist, but the signal:noise ratio is too high online. As much as 90% of unknown user submitted posts are trash, as far as language use and factual data content is concerned. Kat -= B E G I N =- X-EUFORUM: 20393 Date: 2008 May 5 3:33 From: Jeremy Cowgar Subject: Re: Full locale support now in SVN! Kat wrote: > > I suggest again that the users in those locales submit the translations. They'd > know (more than we would) what's appropriate. As for a program that automagically > changes word order in any given sentence, well, that would be a great translation > program, and beyond doing free. Unless you know native speakers to volunteer > in all those locales. I once considered having Tiggr learn by reading pages > in other languages, when good english translations exist, but the signal:noise > ratio is too high online. As much as 90% of unknown user submitted posts are > trash, as far as language use and factual data content is concerned. > Yes, the author of the application will be responsible to create their own language files for messages used in his/her app. However, in one language it may say Hello, World, while in another World, Hello. I was thinking maybe something like this would work? ---- en_US.po file message = $1%s, $2%s! ---- SomeOther.po file message = $2%s $1%s! include locale.e as l --- init code puts(1, l:translate("message", {l:w("hello"), l:w("world")})) So... translate would take parameters from the sequence sent in a positional order, possibly just reorder them and send the remainder %s %s! to sprintf. Just thinking aloud. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20394 Date: 2008 May 5 3:46 From: Kat Subject: Re: Full locale support now in SVN! Jeremy Cowgar wrote: > > Kat wrote: > > > > I suggest again that the users in those locales submit the translations. They'd > > know (more than we would) what's appropriate. As for a program that automagically > > changes word order in any given sentence, well, that would be a great translation > > program, and beyond doing free. Unless you know native speakers to volunteer > > in all those locales. I once considered having Tiggr learn by reading pages > > in other languages, when good english translations exist, but the signal:noise > > ratio is too high online. As much as 90% of unknown user submitted posts are > > trash, as far as language use and factual data content is concerned. > > > > Yes, the author of the application will be responsible to create their own language > files for messages used in his/her app. However, in one language it may say > Hello, World, while in another World, Hello. > > I was thinking maybe something like this would work? > > ---- en_US.po file > message = $1%s, $2%s! > > ---- SomeOther.po file > message = $2%s $1%s! > > > include locale.e as l > --- init code > puts(1, l:translate("message", {l:w("hello"), l:w("world")})) > > > So... translate would take parameters from the sequence sent in a positional > order, possibly just reorder them and send the remainder %s %s! to sprintf. But you just cannot do that. fly paper = sticky paper to trap flies paper fly = an origami insect replicant hard drive = you know... drive hard = you prolly know too ... egg roll = roll egg = etc... Kat -= B E G I N =- X-EUFORUM: 20395 Date: 2008 May 5 4:11 From: "Euler German" Subject: Re: remainder() is not right > On 4 May 2008 at 9:48, Arthur Crump wrote (maybe snipped): > Nobody seems to have ponted out yet that the documenation for > remainder says that the result is the same sign as the first argument, > not the second, as CChris seems to have assumed. > In my opinion he is proposing a modulo function, say mod(x, y). It could be defined as: mod(x, y) = x - y * floor(x / y) ...and it will produce those results he claim remainder(x, y) should give. I just think they are different functions. Maybe mod(x, y) could be part of math.e Best, Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com _| ----------------------------- _| Reply preferably to the list, _| or to the address above. Thx! -= B E G I N =- X-EUFORUM: 20396 Date: 2008 May 5 4:29 From: "Euler German" Subject: Re: remainder() is not right > On 4 May 2008 at 16:40, CChris wrote (maybe snipped): > It returns *a* emainder. When a and b are positive, this is the > expected value. When signs are otherwise, then a discrepancy appears > with what, in arithmetic, is called "remainder". > Please, I'm not discussing mathematical discrepancies. I only stated that remainder(), as described in reference manual, works as said, thus returning the "left over" of a division, so it can't be told wrong. I'm NOT saying there's no need for a "signed_remainder()", though I have no use for it. YMMV. Some quick explanation at: - http://en.wikipedia.org/wiki/Remainder - http://en.wikipedia.org/wiki/Modulo_operation IMO you're describing a modulo function (or operator) so, if we had something like: m = mod(x, y) this would be in Euphoria as: m = x - y * floor(x / y) ...and produces those same results you claim. Best, Euler PS: This message was sent earlier but didn't find a safe way to the list. Maybe munged headers and body. Sorry if you're getting this twice. -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com _| ----------------------------- _| Reply preferably to the list, _| or to the address above. Thx! -= B E G I N =- X-EUFORUM: 20397 Date: 2008 May 5 8:41 From: Jules Subject: Re: ed problem Well, I'm making some progress on this, Both the location of the file and it's MIME type are affecting whether ed crashes or not. If I try to save a file of of MIME type text/x-vhdl AND it's in the eu directory, ed prompts me to convert the file and doesn't crash (the same file will crash ed if trying to save it when it's NOT in the eu directory). BUT, another file (which IS in the eu directory) and is of MIME type text/plain, WILL crash ed. Both files have the .exw file extension. -= B E G I N =- X-EUFORUM: 20398 Date: 2008 May 5 9:46 From: CChris Subject: Re: Full locale support now in SVN! Jeremy Cowgar wrote: > > Kat wrote: > > > > I suggest again that the users in those locales submit the translations. They'd > > know (more than we would) what's appropriate. As for a program that automagically > > changes word order in any given sentence, well, that would be a great translation > > program, and beyond doing free. Unless you know native speakers to volunteer > > in all those locales. I once considered having Tiggr learn by reading pages > > in other languages, when good english translations exist, but the signal:noise > > ratio is too high online. As much as 90% of unknown user submitted posts are > > trash, as far as language use and factual data content is concerned. > > > > Yes, the author of the application will be responsible to create their own language > files for messages used in his/her app. However, in one language it may say > Hello, World, while in another World, Hello. > > I was thinking maybe something like this would work? > > ---- en_US.po file > message = $1%s, $2%s! > > ---- SomeOther.po file > message = $2%s $1%s! > > > include locale.e as l > --- init code > puts(1, l:translate("message", {l:w("hello"), l:w("world")})) > > > So... translate would take parameters from the sequence sent in a positional > order, possibly just reorder them and send the remainder %s %s! to sprintf. > > Just thinking aloud. > > -- > Jeremy Cowgar > http://jeremy.cowgar.com Your scheme doesn't even take care of the following. Even in the extremely simple "Hllo, World!" example. In spanish, sentences that end with an emphasis mark (!) start with an inverted emphasis mark (¡Hola, Mundo!). Changing word order just doesn't help. Completely agreeing with you, Kat. CChris -= B E G I N =- X-EUFORUM: 20399 Date: 2008 May 5 10:01 From: CChris Subject: Re: remainder() is not right Euler German wrote: > > > On 4 May 2008 at 16:40, CChris wrote (maybe snipped): > > > It returns *a* emainder. When a and b are positive, this is the > > expected value. When signs are otherwise, then a discrepancy appears > > with what, in arithmetic, is called "remainder". > > > > Please, I'm not discussing mathematical discrepancies. I only stated > that remainder(), as described in reference manual, works as said, > thus returning the "left over" of a division, so it can't be told > wrong. I'm NOT saying there's no need for a "signed_remainder()", > though I have no use for it. YMMV. > > Some quick explanation at: > - http://en.wikipedia.org/wiki/Remainder > - http://en.wikipedia.org/wiki/Modulo_operation > > IMO you're describing a modulo function (or operator) so, if we had > something like: > > m = mod(x, y) this would be in Euphoria as: > > > m = x - y * floor(x / y) > > > ...and produces those same results you claim. > > Best, > Euler > > PS: This message was sent earlier but didn't find a safe way to the > list. Maybe munged headers and body. Sorry if you're getting this > twice. > > -- > _ > _| euler f german > _| sete lagoas, mg, brazil > _| efgerman{AT}gmail{DOT}com > _| ----------------------------- > _| Reply preferably to the list, > _| or to the address above. Thx! > > Ok for mod() or modulo(), and the formula would be right. Since that's what I mostly need, I have learned not to use remainder() but when both operands are above 0 (with extension to sequences). CChris -= B E G I N =- X-EUFORUM: 20400 Date: 2008 May 5 11:08 From: Jeremy Cowgar Subject: Re: Full locale support now in SVN! CChris wrote: > > Your scheme doesn't even take care of the following. Even in the extremely simple > "Hllo, World!" example. In spanish, sentences that end with an emphasis mark > (!) start with an inverted emphasis mark (¡Hola, Mundo!). Changing word order > just doesn't help. > Completely agreeing with you, Kat. > The scheme does support it just fine. -- English.po hello Hello world World message=$1%s, $2%s! ---- Spanish.po hello Hola world Mundo message=!$2%s $1%s(!) l:set("English") puts(1, l:translate("message", {l:w("hello"), l:w("world")})) l:set("Spanish") puts(1, l:translate("message", {l:w("hello"), l:w("world")})) ---- Output: Hello, World! !Mundo, Hola(!) -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20401 Date: 2008 May 5 11:08 From: MBianchi Subject: Gtk-Server for Eu In the effort to find a common, cross-platform GUI solution for Eu, might I suggest to consider the GTK-Server (http://www.gtk-server.org/index.html) too? It seems quite general and supported enough (even with glade designer) to be a viable alternative .... IMHO. Cheers. MBianchi. -= B E G I N =- X-EUFORUM: 20402 Date: 2008 May 5 11:15 From: Jeremy Cowgar Subject: Re: Full locale support now in SVN! Kat wrote: > > > But you just cannot do that. > > fly paper = sticky paper to trap flies > paper fly = an origami insect replicant > > hard drive = you know... > drive hard = you prolly know too ... > > egg roll = > roll egg = > I'm not seeing where any of this is a problem. Your keys would not change. It's the text after the keys that change. Also, please note, I modeled this after gettext which is about the standard in localization, however, they do not support the word re-ordering as I have mentioned. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20403 Date: 2008 May 5 11:46 From: Jules Subject: Re: Gtk-Server for Eu Now this looks cool, thanks! -= B E G I N =- X-EUFORUM: 20404 Date: 2008 May 5 12:08 From: Jules Subject: Re: Gtk-Server for Eu I don't need a GUI very often, but when I do I use EuWinGui (using Wine on Linux). I've had a look at wxeuphoria, but the sheer size and complexity of it puts me off and for my purposes it would be a sledge-hammer to crack a nut. Now if only Andrea Cini would write a "EuLinGui"... -= B E G I N =- X-EUFORUM: 20405 Date: 2008 May 5 12:27 From: Jeremy Cowgar Subject: Re: Gtk-Server for Eu Jules wrote: > > I don't need a GUI very often, but when I do I use EuWinGui (using Wine on Linux). > I've had a look at wxeuphoria, but the sheer size and complexity of it puts > me off and for my purposes it would be a sledge-hammer to crack a nut. > > Now if only Andrea Cini would write a "EuLinGui"... Maybe a self promotion, but I've always enjoyed Iup, and I've wrapped it in Euphoria (IupEu): http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=iup -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20406 Date: 2008 May 5 12:27 From: Michael J. Sabal Subject: Re: Gtk-Server for Eu MBianchi wrote: > > In the effort to find a common, cross-platform GUI solution for Eu, might I > suggest to consider the GTK-Server (http://www.gtk-server.org/index.html) > too? From the gtk-server website: Q: My language 'XYZ' already has a binding with GTK! Why use the GTK-server? A: If your language already has a binding with GTK, well, use that binding! The GTK-server primarily was designed with Shell scripts and console-based interpreters in mind. The idea is that you do not want to hack the sourcecode of an interpreter to achieve GUI programming. Languages like Python and Perl already have their own bindings to GTK, so there is no need to use the GTK-server in these cases. (The Python and Perl scripts at the examples page are there just to demonstrate the concept.) :end-quote Euphoria already has GTK bindings, (http://sourceforge.net/projects/eugtk) so there is no need to go through the extra work of connecting to gtk-server, unless you really want to for the educational experience of it. -= B E G I N =- X-EUFORUM: 20407 Date: 2008 May 5 12:32 From: Ricardo Forno Subject: Re: remainder() is not right If we define the quotient to be floor(a / b), then it is true that remaider() is not right. In fact, floor((-27) / 3600) is -1, not 0. Anyway, I noticed this problem long ago, and implemented a Residue function in my General Functions package. Maybe it should be called mod() instead. Regards. -= B E G I N =- X-EUFORUM: 20408 Date: 2008 May 5 12:35 From: Ricardo Forno Subject: Re: remainder() is not right More on the subject. In C, there are two ways to get an integer quotient: q = floor(a /(double)b); and q = (int)(a / (double)b); For negative "a", they give different results. Regards. -= B E G I N =- X-EUFORUM: 20409 Date: 2008 May 5 12:42 From: Jeremy Cowgar Subject: Re: remainder() is not right I've added mod() to the standard library global function mod(atom x, atom y) return x - y * floor(x / y) end function The test cases all pass: test_equal("mod() #1", 3573, mod(-27, 3600)) test_equal("mod() #2", 3573, mod(-3627, 3600)) test_equal("mod() #3", -27, mod(-3627, -3600)) test_equal("mod() #4", -3573, mod(27, -3600)) test_equal("mod() #5", 0, mod(10, 2)) Should I add any other tests to test for any strange parameters? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20410 Date: 2008 May 5 13:07 From: Jeremy Cowgar Subject: Roadmap for 4.0 Please, if you have comments on a particular item, such as adding Regular Expressions, please start a new thread so we can track the discussion. If you have comments about the roadmap, please feel free to reply to this thread. I was thinking about a roadmap for 4.0 so that we have some target in sight and we know when things are 4.0 :-) As of right now, 105 new functions have been added to the standard library with over 600 tests and a unit testing framework that can be utilized in any Euphoria library/application. I am thinking an alpha of 4.0 can be released now. When I think alpha, I think API *will* change and there are sure to be bugs. When I think beta, I think API *might* change, only if necessary. Outstanding library tasks: ========================== 1. Regular Expressions. Include EuRegExp or a wrap around PCRE? I am not sure but I think regular expressions should be part of the 4.0 release. 2. Possibly a cross-platform socket library. I have been watching EuNet, but I am open to suggestions. 3. Locale support requires different locale names depending on OS. This should be resolved some how. 4. Audit new functions for conformity of name and parameters. For instance, the find_any methods use to pass haystack then needle, however, this was backward from built in find() method of needle then haystack. Other functions must be checked/fixed for this type of inconsistency. 5. Newest functions (mod() and locale.e) need documented. Others: ======= 1. There are outstanding issues with using gcc 4.3.0 that should be resolved before 4.0 is released. 2. Add a namespace keyword for library authors? 3. Make all internal functions accessible at all times via an eu: namespace? 4. Fix ed.ex as shipped with Euphoria to work on DOS, Windows and Linux. 5. Review all documentation. free() was found to be omitted in the new docs, therefore, we must do an audit to make sure no others were omitted by mistake. 6. Create a DOS only distribution? 7. Change installer to associate .ex files with exwc? 8. Final decision on : or . for namespace. I wrote it off, then when I did so, I was contacted as to why. There are many supporters (I was not the originator of the idea, I just brought it up as a possible task). 9. Continued documentation refinement. Others ====== I'm not the one calling the shots on releasing, so, please, all other developers on Euphoria, please add tasks you see fit as well to this list. Once this list has been discussed, I'll make a final list on the wiki and ask tasks are done, I can move them to the "Completed" section so everyone can see the progress and how close we are to 4.0. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20411 Date: 2008 May 5 13:10 From: MBianchi Subject: Gtk-Server for Eu Michael J. Sabal wrote: ..snip >Euphoria already has GTK bindings, (h >ttp://sourceforge.net/projects/eugtk) >so there is no need to go through the extra work of connecting to gtk-server, >unless you really want to for the educational experience of it. Right. My suggestion was intended only to simplify a common task like avoiding the need to dive into GTK bindings, using a simple standard stdin/out or TCP or else to reach the same results. Not really an educational experience, i'd say more the k.i.s.s. practical (maybe wrong) way of thinking of an unexperienced programmer like me. BTW: If I look at Glade as a sort of GUI designer, this becomes more appealing to me... Anyway this was just what it is: a simple mumbling suggestion :-) . Cheers MBianchi -= B E G I N =- X-EUFORUM: 20412 Date: 2008 May 5 13:26 From: MBianchi Subject: Re: Gtk-Server for Eu Michael J. Sabal wrote: ... snip > Euphoria already has GTK bindings,(http://sourceforge.net/projects/eugtk) > so there is no need to go through the extra work of connecting to gtk-server, > unless you really want to for the educational experience of it. Right. My suggestion was intended only to simplify a common task like avoiding the need to dive into GTK bindings, using a simple standard stdin/out or TCP or else to reach the same results. Not really an educational experience, i'd say more the k.i.s.s. practical (maybe wrong) way of thinking of an unexperienced programmer like me. BTW: If I look at Glade as a sort of GUI designer, this becomes more appealing to me... Anyway this was just what it is: a simple mumbling suggestion :-) . Cheers MBianchi P.S.: Sorry for posting this as a new thread instead of reply to. Please delete the wrong one. -= B E G I N =- X-EUFORUM: 20413 Date: 2008 May 5 13:30 From: Jeremy Cowgar Subject: Re: remainder() is not right Jeremy Cowgar wrote: > > I've added mod() to the standard library > > > global function mod(atom x, atom y) > return x - y * floor(x / y) > end function > > > The test cases all pass: > > > test_equal("mod() #1", 3573, mod(-27, 3600)) > test_equal("mod() #2", 3573, mod(-3627, 3600)) > test_equal("mod() #3", -27, mod(-3627, -3600)) > test_equal("mod() #4", -3573, mod(27, -3600)) > test_equal("mod() #5", 0, mod(10, 2)) > > > Should I add any other tests to test for any strange parameters? > Hm, I went to document the new mod() function and went to: http://en.wikipedia.org/wiki/Modulo_operation To get some more descriptive information and noticed that Euphoria is listed there in the language table as supporting modulo operator and that it's function name is remainder() So, what's up with that? Is it not correct? I see that it's listed as: Dividend while others are Divisor. Ada, for instance, has rem() which is Dividend and mod() which is Divisor. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20414 Date: 2008 May 5 13:39 From: Jeremy Cowgar Subject: Re: Roadmap for 4.0 I've created a roadmap wiki document: http://euwiki.ayo.biz/Roadmap -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20415 Date: 2008 May 5 13:42 From: Bernie Ryan Subject: Re: locale support? Jeremy Cowgar wrote: > > Ok, locale support now works on Windows and Linux. Please see my problem at > the end of this message. > > > include locale.e as l > include datetime.e as d > > d:datetime now > now = d:now() > > l:set("en_US") > printf(1, "%s, %s, %s\n", { > l:datetime("%A, %B %d %Y", now), > l:money(10928.2), > l:number(1029.35)}) > > > Output is: > > Sunday, May 4 2008, $10,928.20, 1,029.35 > > You can set any locale and the date language will change, the currency symbol, > the thousands and decimal point, etc... The best part is it uses OS dependent > locale data so we do not have to manage locale data, have to do no translations, > and Euphoria can now be set for any locale that a user happens to have installed. > > ======== > Problem > ======== > > Locale names are different on Linux and Windows. For instance, to get the locale > for United States English, on Windows you must: > > > l:set("English_United States") > > > however, under Linux you must: > > > l:set("en_US") > > > Creating a cross-walk may not be that easy but if we have to, it's still easier > than translating hundreds of locales to pure Euphoria. > > So. Any suggestions/thoughts? > > -- > Jeremy Cowgar > http://jeremy.cowgar.com global sequence LANG_US if platform() = 2 then LANG_US = "English_United States" elsif platform() = 3 then LANG_US = "en_US" end if Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20416 Date: 2008 May 5 13:42 From: MBianchi Subject: Re: Gtk-Server for Eu Jeremy Cowgar wrote: ...snip > Maybe a self promotion, but I've always enjoyed Iup, and I've wrapped it in Euphoria (IupEu): http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=iup > > -- > Jeremy Cowgar > http://jeremy.cowgar.com Thanks a lot for this link ! Cheers. MBianchi -= B E G I N =- X-EUFORUM: 20417 Date: 2008 May 5 13:54 From: Jeremy Cowgar Subject: Re: locale support? Bernie Ryan wrote: > > global sequence LANG_US > > if platform() = 2 then > LANG_US = "English_United States" > elsif platform() = 3 then > LANG_US = "en_US" > end if > > I'd hate to have each programmer have to manage the cross-walk though for each locale. On my Linux box there are 373 locales. So, inside of each platform() check, you would then have to choose between 373 different locales. Now, some of those have multiple encodings to them, such as ASCII and UTF-8. But still, it's in the range of 200 or so. I am unsure how many locales Windows has and really not even sure how to figure it out. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20418 Date: 2008 May 5 14:11 From: Jeremy Cowgar Subject: How to delete pages on EuWiki? I am browsing the euwiki and looking at the Resquested Functionalities. find_from and match_from are requested functionality and they have been added. I was going to remove the page, but see no way. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20419 Date: 2008 May 5 14:15 From: Jason Gade Subject: Re: locale support? http://www.cryer.co.uk/brian/windows/info_windows_locale_table.htm So, "en-US" doesn't work for Windows? I was looking around for locale info and from what I saw it should. Also it looks like msvcrt.dll does contain setlocale. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20420 Date: 2008 May 5 14:23 From: "Euler German" Subject: Re: remainder() is not right > On 5 May 2008 at 5:42, Jeremy Cowgar wrote (maybe snipped): > I've added mod() to the standard library > > > global function mod(atom x, atom y) > return x - y * floor(x / y) > end function > > > The test cases all pass: > > > test_equal("mod() #1", 3573, mod(-27, 3600)) > test_equal("mod() #2", 3573, mod(-3627, 3600)) > test_equal("mod() #3", -27, mod(-3627, -3600)) > test_equal("mod() #4", -3573, mod(27, -3600)) > test_equal("mod() #5", 0, mod(10, 2)) > > > Should I add any other tests to test for any strange parameters? > At http://en.wikipedia.org/wiki/Modulo_operation#Performance_issues it's mentioned a correlation between mod() of powers of 2 could be done as a bitwise AND, but this is too specific. Again, this is more a matter how it would "look" in C. Prior to 1990 C "%" operator was ambiguous but they make their mind since ISO 1999 C (I think). Best, Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com _| ----------------------------- _| Reply preferably to the list, _| or to the address above. Thx! -= B E G I N =- X-EUFORUM: 20421 Date: 2008 May 5 14:26 From: Jeremy Cowgar Subject: Re: locale support? Jason Gade wrote: > > http://www.cryer.co.uk/brian/windows/info_windows_locale_table.htm > > So, "en-US" doesn't work for Windows? I was looking around for locale info and > from what I saw it should. That's a nice list. en-us, en-US and en_US do not work. English, English_United States, English_United States.1252 all work. > Also it looks like msvcrt.dll does contain setlocale. Yes, I am using that currently for the setlocale implementation on Windows. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20422 Date: 2008 May 5 14:32 From: CChris Subject: Re: remainder() is not right Jeremy Cowgar wrote: > > Jeremy Cowgar wrote: > > > > I've added mod() to the standard library > > > > > > global function mod(atom x, atom y) > > return x - y * floor(x / y) > > end function > > > > > > The test cases all pass: > > > > > > test_equal("mod() #1", 3573, mod(-27, 3600)) > > test_equal("mod() #2", 3573, mod(-3627, 3600)) > > test_equal("mod() #3", -27, mod(-3627, -3600)) > > test_equal("mod() #4", -3573, mod(27, -3600)) > > test_equal("mod() #5", 0, mod(10, 2)) > > > > > > Should I add any other tests to test for any strange parameters? > > > > Hm, I went to document the new mod() function and went to: > > http://en.wikipedia.org/wiki/Modulo_operation > > To get some more descriptive information and noticed that Euphoria is listed > there in the language table as supporting modulo operator and that it's function > name is remainder() > > So, what's up with that? Is it not correct? I see that it's listed as: > > Dividend while others are Divisor. Ada, for instance, has rem() which is Dividend > and mod() which is Divisor. > > -- > Jeremy Cowgar > http://jeremy.cowgar.com The quote appears to apply to Eu v4.0, with rem() renamed as remainder(). I assume "Divisor" means: the result has the sign of the divisor when not null. CChris -= B E G I N =- X-EUFORUM: 20423 Date: 2008 May 5 14:35 From: Jeremy Cowgar Subject: Re: remainder() is not right CChris wrote: > > > Dividend while others are Divisor. Ada, for instance, has rem() which is Dividend > > and mod() which is Divisor. > > The quote appears to apply to Eu v4.0, with rem() renamed as remainder(). > I assume "Divisor" means: the result has the sign of the divisor when not null. > Chris, It's Ada that has rem() and mod(), another programming language. I was just referencing it as it seems to support both remainder() (euphoria name) and mod(). -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20424 Date: 2008 May 5 14:47 From: "Euler German" Subject: Re: remainder() is not right > On 5 May 2008 at 6:30, Jeremy Cowgar wrote (maybe snipped): > Hm, I went to document the new mod() function and went to: > > http://en.wikipedia.org/wiki/Modulo_operation > > To get some more descriptive information and noticed that Euphoria is > listed there in the language table as supporting modulo operator and > that it's function name is remainder() > > So, what's up with that? Is it not correct? I see that it's listed as: > > Dividend while others are Divisor. Ada, for instance, has rem() which > is Dividend and mod() which is Divisor. > If I got the idea right, this has to do with de *ability* to convert Euphoria code into C. The modulo operator in C doesn't behave exactly the same way depending of the compiler and hardware. Seems they "fixed" it after ISO 1999. In a 100% Euphoria world remainder() should suffice, but after translated into C would it produce the same result? Best, Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com _| ----------------------------- _| Reply preferably to the list, _| or to the address above. Thx! -= B E G I N =- X-EUFORUM: 20425 Date: 2008 May 5 14:59 From: c.k.lester Subject: Re: locale support? What about something like this: integer PLATFORM PLATFORM = platform() sequence languages languages = { { "English", {"", "English_US", "en_US" }} ... } l:set("English",languages[PLATFORM]) or from an ini file of similar format. -= B E G I N =- X-EUFORUM: 20426 Date: 2008 May 5 15:00 From: CChris Subject: Roadmap for 4.0: Other / 2 What would be the purpose and use for the "namespace" projected keword? I understood that this supplied namespace allows unambiguous access to a global symbol in the library, thus sparing the library user the need to use an include...as complete form. A convenience is hardly ever bad to have, granted. Now there is another issue which doesn't appear to be addressed, and which is, in a way, the reverse problem: -- mylib.e include myutils.e -- x=my_func() -- myutils.e global function my_func() return 0 end function my_func() had to be declared global, because it is used in mylib.e. Yet, it is not intended to be used outside the library, and is not documented in its interface as a result. And my_func() can hardly be moved to mylib.e for various reasons, among which cleaner code breakup. How can I prevent Joe D. User to inadvertently use the function in his app which includes mylib.e? Knowing that my_func() may well disappear or change name in the next version of mylib. If we don't want full fledged packaging, for the sake of simplicity or whatever (sigh), then at least let's have an extension to global, in the following way: global to function my_func() The effect of the modified declaration would be that the symbol cannot be accessed by an unqualified call outside its definition file, but only using the supplied namespace. should notexist as namespace, except if it is declared in a "namespace " directive in (any ancestor of) the definition file. Certainly not better than packaging, since Joe D. User could still use it (but less inadvertently), and the library writer has to type in a bunch of namespace qualifiers. Another variant would be a "restrict my_func() to " directive, with the same semantics. In both cases, it would make sense for the namespace to be a library namespace. In a nutshell, Eu lacks nutshells, ie data encapsulation. Thoughts? CChris -= B E G I N =- X-EUFORUM: 20427 Date: 2008 May 5 15:10 From: Greg Haberek Subject: Re: Gtk-Server for Eu Jules wrote: > > I don't need a GUI very often, but when I do I use EuWinGui (using Wine on Linux). > I've had a look at wxeuphoria, but the sheer size and complexity of it puts > me off and for my purposes it would be a sledge-hammer to crack a nut. > > Now if only Andrea Cini would write a "EuLinGui"... I'm not sure if Andrea is actively developing EuWinGUI anymore... I really think wxEuphoria is what we should be focusing on for GUI programming. It's got a lot going for it. -Greg -= B E G I N =- X-EUFORUM: 20428 Date: 2008 May 5 15:15 From: Jeremy Cowgar Subject: Re: Roadmap for 4.0: Other / 2 CChris wrote: > I understood that this supplied namespace allows unambiguous access to a global > symbol in the library, thus sparing the library user the need to use an include...as > complete form. A convenience is hardly ever bad to have, granted. > > Now there is another issue which doesn't appear to be addressed, and which is, > in a way, the reverse problem: > > -- mylib.e > include myutils.e > -- > x=my_func() > > -- myutils.e > global function my_func() > return 0 > end function > > So, my_func() had to be declared public, but you really do not want it public, you just wanted to access it from within your library. What if files with a declared namespace could access any function inside that namespace, regardless of it's location? That may break code, I am not sure. Example: -- myutils.e namespace mylib function my_func() return 0 end function -- mylib.e namespace mylib -- notice, same namespace x = my_func() -- acceptable global function hello() puts(1, "hello") end function -- prog.ex include mylib.e mylib:hello() -- good mylib:my_func() -- bad, parser error Now, I really am thinking outside of my understanding of how namespaces work internally and more specifically name resolution internally. After a few more tasks are done in the standard library, I really must spend some good, quality time in the interpreter code. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20429 Date: 2008 May 5 15:40 From: CChris Subject: Re: locale support? Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > http://www.cryer.co.uk/brian/windows/info_windows_locale_table.htm > > > > So, "en-US" doesn't work for Windows? I was looking around for locale info and > > from what I saw it should. > > That's a nice list. en-us, en-US and en_US do not work. English, English_United > States, English_United States.1252 all work. > > > Also it looks like msvcrt.dll does contain setlocale. > > Yes, I am using that currently for the setlocale implementation on Windows. > > -- > Jeremy Cowgar > http://jeremy.cowgar.com Why not: * convert the list linked above, or the one at http://msdn.microsoft.com/en-us/library/ms776260(VS.85).aspx into two maps, the common key eing the LCID; * Then, when user provides a string for a locale, look it up the appropriate map, chosen by a call to platform(). CChris -= B E G I N =- X-EUFORUM: 20430 Date: 2008 May 5 15:41 From: Matt Lewis Subject: Re: remainder() is not right Euler German wrote: > > If I got the idea right, this has to do with de *ability* to convert > Euphoria code into C. The modulo operator in C doesn't behave exactly > the same way depending of the compiler and hardware. Seems they > "fixed" it after ISO 1999. In a 100% Euphoria world remainder() > should suffice, but after translated into C would it produce the same > result? This wouldn't be an issue. If it's all euphoria, then, obviously, it would work the same. If it's implemented in the backend as part of the runtime, it would still use that same code, rather than simply calling a C runtime library function. Matt -= B E G I N =- X-EUFORUM: 20431 Date: 2008 May 5 15:47 From: Matt Lewis Subject: Re: Roadmap for 4.0: Other / 2 CChris wrote: > > > What would be the purpose and use for the "namespace" projected keword? > > I understood that this supplied namespace allows unambiguous access to a global > symbol in the library, thus sparing the library user the need to use an include...as > complete form. A convenience is hardly ever bad to have, granted. > > Now there is another issue which doesn't appear to be addressed, and which is, > in a way, the reverse problem: -- mylib.e include myutils.e -- x=my_func() -- myutils.e global function my_func() return 0 end function > In a nutshell, Eu lacks nutshells, ie data encapsulation. > > Thoughts? Agreed. I think the simplest solution would be to add an import directive, which works similarly to the include directive, except that globals from files included by mylib.e do not propagate to files that include mylib.e. This stops short of a full solution, however, because we might really want some stuff from myutils.e to be visible to users of mylib.e. In that case, the simplest solution is probably to introduce another scope, probably "export" to match the symmetry of "import." Then, any symbol declared as an export would not propagate through an import directive. Globals would still be globals. Matt -= B E G I N =- X-EUFORUM: 20432 Date: 2008 May 5 16:35 From: ChrisBurch3 Subject: Re: Roadmap for 4.0: Other / 2 Matt Lewis wrote: > > CChris wrote: > > > > > > What would be the purpose and use for the "namespace" projected keword? > > > > I understood that this supplied namespace allows unambiguous access to a global > > symbol in the library, thus sparing the library user the need to use an include...as > > complete form. A convenience is hardly ever bad to have, granted. > > > > Now there is another issue which doesn't appear to be addressed, and which is, > > in a way, the reverse problem: > > -- mylib.e > include myutils.e > -- > x=my_func() > > -- myutils.e > global function my_func() > return 0 > end function > > > > > > In a nutshell, Eu lacks nutshells, ie data encapsulation. > > > > Thoughts? > > Agreed. I think the simplest solution would be to add an import directive, > which works similarly to the include directive, except that globals from > files included by mylib.e do not propagate to files that include mylib.e. > > This stops short of a full solution, however, because we might really > want some stuff from myutils.e to be visible to users of mylib.e. In > that case, the simplest solution is probably to introduce another scope, > probably "export" to match the symmetry of "import." Then, any symbol > declared as an export would not propagate through an import directive. > Globals would still be globals. This sounds like an explanation of cricket http://en.wikipedia.org/wiki/Tea_towel_explanation_of_cricket Chris :-) > > Matt -= B E G I N =- X-EUFORUM: 20433 Date: 2008 May 5 17:21 From: Matt Lewis Subject: Re: Roadmap for 4.0: Other / 2 ChrisBurch3 wrote: > > This sounds like an explanation of cricket > http://en.wikipedia.org/wiki/Tea_towel_explanation_of_cricket Perhaps the most sensible thing I've ever read on the topic. Matt -= B E G I N =- X-EUFORUM: 20434 Date: 2008 May 5 17:53 From: Jeremy Cowgar Subject: Re: . or : for namespace? I hate to bring this topic back up, I removed my code from SVN (it committed as a comment) that supports the . namespace prefix in addition to :. However, when I did so, multiple people now have asked me why? I was not the originator of this idea, I just posted it here. So, the comments are from my changelog message stating the "debate of : and . is dead, removing . support comment" Question was, why is it dead? Now another comment about : vs. . was brought up to me stating, no one against the dot had a good reason, did they? So, I am going to answer that here and with comments that follow I hope to bring the discussion to a close. Previous arguments were summarized in my post: http://www.openeuphoria.org/EUforum/m20221.html Now, following up with that there was another, new complaint, against the . idea and that was by Mike and Matt agreed. I somewhat agree but would still be in favor of the . but, this is just something we need to work through until a final decision has been made. Their comment was that when the see a : in code that they wrote 6 months or 2 years ago that they will know it's a namespace and therefore the function is in another location. That they will be able to tell that right away. However, maybe in 2 years we will have dot'ed sequence access (whatever that will look like) and then you will not know without research if greeter.greeting = "Hello" is assigning a variable name greeting inside of the greeter namespace or if greeter is possibly a sequence. So, please read my prior post about the complaints against . and then the above and let's have another round of discussion please. If you are in favor or against it, please post your comments. Let me also point out that we are focusing a lot on the negatives and people who bring about points that are negative. There are many who want the . and think it's much clearer. Now, in the end we are all working together to make Euphoria better for us all. That's the goal, let's keep that in mind. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20435 Date: 2008 May 5 17:54 From: yuku Subject: Re: How to delete pages on EuWiki? I think only admins can delete pages. But should we delete it? -= B E G I N =- X-EUFORUM: 20436 Date: 2008 May 5 17:56 From: Jeremy Cowgar Subject: Re: How to delete pages on EuWiki? yuku wrote: > > I think only admins can delete pages. But should we delete it? Well, maybe not. I'll just put at the top that it's been implemented. I was going to do that at first, but then if doing that, it will still appear in the category for Requested Functionalities. Maybe we should create a new category "Added Functionalities" ? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20437 Date: 2008 May 5 18:03 From: "Euler German" Subject: Re: How to delete pages on EuWiki? > On 5 May 2008 at 7:12, Jeremy Cowgar wrote (maybe snipped): > I am browsing the euwiki and looking at the Resquested > Functionalities. find_from and match_from are requested functionality > and they have been added. I was going to remove the page, but see no > way. > Maybe this is what you are looking for: http://en.wikipedia.org/wiki/Wikipedia:Editing_FAQ#How_do_I_delete_a_p age.3F Best, Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com _| ----------------------------- _| Reply preferably to the list, _| or to the address above. Thx! -= B E G I N =- X-EUFORUM: 20438 Date: 2008 May 5 18:26 From: c.k.lester Subject: Re: . or : for namespace? Jeremy Cowgar wrote: > > Their comment was that when the see a : in code that they wrote 6 months or > 2 years ago that they will know it's a namespace and therefore the function > is in another location. That they will be able to tell that right away. However, > maybe in 2 years we will have dot'ed sequence access (whatever that will look > like) and then you will not know without research if greeter.greeting = "Hello" > is assigning a variable name greeting inside of the greeter namespace or if > greeter is possibly a sequence. This is a reasonable argument, but made moot when Matt finishes wxIDE (soon?), because when you hover over a variable or dotted identifier, it gives a tooltip telling you what exactly it is (namespace var, object, etc.) and where it is defined (my_lib.e, your_lib.e). Well, that was on the roadmap last time I looked. :D The argument FOR a dot is that it takes one simple keystroke with one finger, while the colon takes two fingers- that just sounded wrong. Plus, the dot looks nicer and doesn't disrupt code scanning. If the use of ':' was going to be significant, then I would say drop it and use the dot. But, since I suspect it won't be- or can somebody show different- keep the colon. Why not let the dot be a synonym? In the future, if it is ever to be used for structures/sequences, the interpreter only need do this: if find dot then if is namespace thingie then do namespace processing else do structure/sequence processing end if end if As you can see, I remain somewhat ambivalent. -= B E G I N =- X-EUFORUM: 20439 Date: 2008 May 5 18:35 From: yuku Subject: Still cannot compile 4.0 How do I compile 4.0 using watcom? I'm still getting errors like this. Using openwatcom 1.7a. compiling the front-end files... compiling the back-end files... linking all the files... Warning! W1008: graph.lib cannot open : No such file or directory Error! E2028: _16scientific_to_atom_ is a unspecified reference Error! E2028: _20intoptions_ is a unspecified reference Error! E2028: _21get_switches_ is a unspecified reference File scanner.obj(J:\operasi\rapideuphoria\source\scanner.c): unspecified symbol _16scientific_to_atom_ File backend.obj(J:\operasi\rapideuphoria\source\backend.c): unspecified symbol _20intoptions_ File backend.obj(J:\operasi\rapideuphoria\source\backend.c): unspecified symbol _21get_switches_ -= B E G I N =- X-EUFORUM: 20440 Date: 2008 May 5 18:35 From: Jeremy Cowgar Subject: Re: . or : for namespace? c.k.lester wrote: > > If the use of ':' was going to be significant, then I would say drop it and > use the dot. But, since I suspect it won't be- or can somebody show different- > keep the colon. > The use of : is going to ***greatly*** increase w/4.0 release, and it should. include map.e as map include datetime.e as dt include stack.e as sk map:map m dt:datetime dt1 sk:stack s m = map:new() dt1 = dt:new(2008, ...) s = sk:new(sk:FIFO) s = sk:push(s, 10) dt1 = dt:add(dt1, 10, dt:DAYS) m = map:put(m, "name", "John") puts(1, map:get(m, "name")) vs include map.e as map include datetime.e as dt include stack.e as sk map.map m dt.datetime dt1 sk.stack s m = map.new() dt1 = dt.new(2008, ...) s = sk.new(sk.FIFO) s = sk.push(s, 10) dt1 = dt.add(dt1, 10, dt.DAYS) m = map.put(m, "name", "John") puts(1, map.get(m, "name")) Other places you will use it also and once people start to see it's use and benefit in the standard library, their libraries will begin to use it as well, for instance a new DBI I am working on (PgSQL already working). -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20441 Date: 2008 May 5 18:39 From: Bernie Ryan Subject: Re: locale support? Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > http://www.cryer.co.uk/brian/windows/info_windows_locale_table.htm > > > > So, "en-US" doesn't work for Windows? I was looking around for locale info and > > from what I saw it should. > > That's a nice list. en-us, en-US and en_US do not work. English, English_United > States, English_United States.1252 all work. > > > Also it looks like msvcrt.dll does contain setlocale. > > Yes, I am using that currently for the setlocale implementation on Windows. > > -- Jeremy: You only need two strings for the English language standard library. One for Windows and one for Linux. Your standard libraries are only good for english. If a user is using MS windows in a different language then your complete standard library will have to be translated. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20442 Date: 2008 May 5 18:39 From: CChris Subject: Re: How to delete pages on EuWiki? yuku wrote: > > I think only admins can delete pages. But should we delete it? An alternative is to create an Obsolete category, and to move the page there by simply changing the Category link. It is possible that using the "move" tab and leaving a bank title may effectively delete the page, but I didn't try this. CChris -= B E G I N =- X-EUFORUM: 20443 Date: 2008 May 5 18:41 From: Jeremy Cowgar Subject: Re: locale support? Bernie Ryan wrote: > > You only need two strings for the English language standard library. > One for Windows and one for Linux. > Your standard libraries are only good for english. > If a user is using MS windows in a different language then your > complete standard library will have to be translated. > I'm not sure what you mean? The standard libraries will work in many, many languages. Some languages might might have to use UTF-8 or possibly UTF-16 encoding, but it should not be a big deal. What do you mean they will only work in English? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20444 Date: 2008 May 5 18:56 From: Bernie Ryan Subject: Re: locale support? Jeremy Cowgar wrote: > > Bernie Ryan wrote: > > > > You only need two strings for the English language standard library. > > One for Windows and one for Linux. > > Your standard libraries are only good for english. > > If a user is using MS windows in a different language then your > > complete standard library will have to be translated. > > > > I'm not sure what you mean? The standard libraries will work in many, many languages. > Some languages might might have to use UTF-8 or possibly UTF-16 encoding, but > it should not be a big deal. > > What do you mean they will only work in English? > > -- Jeremy: What about error messages, text in sequences, function/procedure names ? That is why Windows uses resource files they contain string tables that are compiled for different languages. Look at Igor's site: http://www.rapideuphoria.com/russian/index_r.htm Which is not in English. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20445 Date: 2008 May 5 19:01 From: c.k.lester Subject: About Date Time Thought some parties might be interested in this discussion: http://java.dzone.com/news/game-over-jdks-date-and-time-c -= B E G I N =- X-EUFORUM: 20446 Date: 2008 May 5 19:01 From: Jeremy Cowgar Subject: Re: locale support? Bernie Ryan wrote: > > > What about error messages Those are very few, and at that, there are many, many, many more that exist in Euphoria itself. Euphoria itself is not localized. > text in sequences That is what locale.e's po_load() and w() functions are for. It allows the programmer to localize their own application. > function/procedure names ? I'm not aware of any programming language that translates function names to new languages. In that area, it's still an English speaking world and it is a non-issue. > That is why Windows uses resource files they contain string tables > that are compiled for different languages. Yes. Euphoria has that now with .po files. .po is a very popular format for localization. There are many GUI based translation software packages to work with the .po file, or you can use a normal text editor for that task. > Look at Igor's site: Yup. That's not a problem with the new locale.e. Did you look at any of my examples? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20447 Date: 2008 May 5 19:02 From: c.k.lester Subject: Re: . or : for namespace? Jeremy Cowgar wrote: > c.k.lester wrote: > > If the use of ':' was going to be significant, then I would say drop it and > > use the dot. But, since I suspect it won't be- or can somebody show different- > > keep the colon. > The use of : is going to ***greatly*** increase w/4.0 release, and it should. So, when typing out all that code, didn't you like using the dot better than the colon? ;) > for instance a new DBI I am working on (PgSQL already working). That is awesome. I will definitely try some of that. :) -= B E G I N =- X-EUFORUM: 20448 Date: 2008 May 5 19:11 From: Matt Lewis Subject: Re: Still cannot compile 4.0 yuku wrote: > > How do I compile 4.0 using watcom? I'm still getting errors like this. > Using openwatcom 1.7a. > > compiling the front-end files... > compiling the back-end files... > linking all the files... > Warning! W1008: graph.lib cannot open : No such file or directory > Error! E2028: _16scientific_to_atom_ is a unspecified reference > Error! E2028: _20intoptions_ is a unspecified reference > Error! E2028: _21get_switches_ is a unspecified reference > File scanner.obj(J:\operasi\rapideuphoria\source\scanner.c): unspecified symbol > _16scientific_to_atom_ > File backend.obj(J:\operasi\rapideuphoria\source\backend.c): unspecified symbol > _20intoptions_ > File backend.obj(J:\operasi\rapideuphoria\source\backend.c): unspecified symbol > _21get_switches_ What did you type on the command line? Matt -= B E G I N =- X-EUFORUM: 20449 Date: 2008 May 5 19:15 From: Jeremy Cowgar Subject: Re: About Date Time c.k.lester wrote: > > Thought some parties might be interested in this discussion: > > http://java.dzone.com/news/game-over-jdks-date-and-time-c Thanks for the link. An interesting read. Here are some Euphoria 4.0 examples to accomplish the same thing discussed there: function isAfterPayDay(datetime dt) if dt[MONTH] = 2 then return dt[DAY] > 26 end if return dt[DAY] > 28 end function function daysToNewYear(datetime fromDate) return diffSeconds(fromDate, new(fromDate[YEAR]+1, 1, 1,0,0,0)) / 86400) end function function isRentalOverdue(datetime due) datetime n n = now() n = add(n, 2, DAYS) n = add(n, 12, HOURS) return compare(due, n) end function function getBirthMonthText(datetime dt) return format(dt, "%A") end function BTW... If you've not used Java's date API's, the guys there are right when they say " The existing classes are pretty bad—probably the worst APIs in the JDK. They're buggy, mutable, cumbersome, many bugs, ..." About intervals that they speak about. You can store intervals such as: constant integer INT_DAYS = 86400 integer ten_days = INT_DAYS * 10 add(date, ten_days, SECONDS) -- or add(date, 10, DAYS) Just a little heads up about the datetime support in 4.0 -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20450 Date: 2008 May 5 19:19 From: Jeremy Cowgar Subject: Re: . or : for namespace? c.k.lester wrote: > > Jeremy Cowgar wrote: > > c.k.lester wrote: > > > If the use of ':' was going to be significant, then I would say drop it and > > > use the dot. But, since I suspect it won't be- or can somebody show different- > > > keep the colon. > > The use of : is going to ***greatly*** increase w/4.0 release, and it should. > > So, when typing out all that code, didn't you like using the dot better > than the colon? ;) I am in favor of . ... Yes, typing that little amount of code out using : is cumbersome. I've had problems with my hands in the past and it was linked mainly to using the shift keys with my pinkies. I have foot pedals now for Control, Alternate and Shift but do not use them most of the time as even after much practice, they are not as fast. Just too much travel. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20451 Date: 2008 May 5 19:23 From: Matt Lewis Subject: PCRE I started playing around with PCRE today, to do some benchmarks. I compared it with using the wxEuphoria regex functions. Basically, I ran through wxeud.e looking for function/procedure names for building the lookup table that I use in wxIDE. I tried using CChris' EuRegExp.e. I got rid of the errors that Jeremy found previously, but it still wouldn't work. Here is the main regex that I used to search: "^[ \t]*(global[ \t]|)[ \t]*(procedure|function|type|euclass)[ \t]+([a-zA-Z][a-z_0-9A-Z]*)[ \t]*\\(" So I ran the wxEuphoria include file through this (>15,000 lines), substituting PCRE for wxEuphoria, and the results were impressive (looping 10x): wx: 2.49 pcre: 0.22 One possible reason for the speedup was the way I was returning the substring information, since it requires a wxWidgets call to get each substring. So I just cut all of that stuff out of the test, and I got: wx: 2.49 pcre: 0.22 So this can't be the issue. I've simply linked the interpreter dynamically to libpcre. For linux, I still suspect that this is the way to go. For Windows, we can't depend on pcre being around, so we'll have to statically link. Matt -= B E G I N =- X-EUFORUM: 20452 Date: 2008 May 5 19:41 From: "Euler German" Subject: Re: remainder() is not right > On 5 May 2008 at 8:41, Matt Lewis wrote (maybe snipped): > Euler German wrote: > > > > If I got the idea right, this has to do with de *ability* to convert > > Euphoria code into C. The modulo operator in C doesn't behave > > exactly the same way depending of the compiler and hardware. Seems > > they "fixed" it after ISO 1999. In a 100% Euphoria world remainder() > > should suffice, but after translated into C would it produce the > > same result? > > This wouldn't be an issue. If it's all euphoria, then, obviously, it > would work the same. If it's implemented in the backend as part of > the runtime, it would still use that same code, rather than simply > calling a C runtime library function. > > Matt > Maybe I didn't express myself clearly. What I mean is that an Euphoria program translated into C and compiled by a C compiler could produce different results depending on the C compiler and/or the hardware used. I was thinking on what Ricardo Forno said about it: More on the subject. In C, there are two ways to get an integer quotient: q = floor(a /(double)b); and q = (int)(a / (double)b); For negative "a", they give different results. Hope it make sense now. :) Best, Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 20453 Date: 2008 May 5 19:45 From: Matt Lewis Subject: Re: remainder() is not right Euler German wrote: > > Maybe I didn't express myself clearly. What I mean is that an > Euphoria program translated into C and compiled by a C compiler could > produce different results depending on the C compiler and/or the > hardware used. I was thinking on what Ricardo Forno said about it: > > > More on the subject. > In C, there are two ways to get an integer quotient: > q = floor(a /(double)b); > and > q = (int)(a / (double)b); > > For negative "a", they give different results. > I suppose this is theoretically true, but is anyone aware of differing implementations of remainder or mod or whatever we're talking about? There are only a handful of compilers that will currently build euphoria, so we've already got that situation if the C libraries differ. Matt -= B E G I N =- X-EUFORUM: 20454 Date: 2008 May 5 19:48 From: Jeremy Cowgar Subject: Re: PCRE Matt Lewis wrote: > > I started playing around with PCRE today, to do some benchmarks. I compared > it with using the wxEuphoria regex functions. > > wx: 2.49 > pcre: 0.22 > That's a substantial difference. What does wxEuphoria use for regular expressions? Are they part of wxWidgets? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20455 Date: 2008 May 5 19:52 From: Jeremy Cowgar Subject: Re: Still cannot compile 4.0 Can you please do a svn up. Then change to the source directory and type: wmake -f makefile.wat distclean wmake -f makefile.wat and see what happens. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20456 Date: 2008 May 5 20:15 From: yuku Subject: Re: Still cannot compile 4.0 Jeremy Cowgar wrote: > Can you please do a svn up. Then change to the source directory and type: > > wmake -f makefile.wat distclean > wmake -f makefile.wat > > and see what happens. Looks good. But wcc386 /bt=nt /mf /w0 /zq /j /zp4 /fp5 /fpi87 /5r /otimra /s -DESIMPLE_MALLOC .\intobj\intinit.c -fo=.\intobj\intinit.obj wcc386 /bt=nt /mf /w0 /zq /j /zp4 /fp5 /fpi87 /5r /otimra /s -DESIMPLE_MALLOC .\intobj\symtab_0.c -fo=.\intobj\symtab_0.obj wcc386 /bt=nt /mf /w0 /zq /j /zp4 /fp5 /fpi87 /5r /otimra /s -DESIMPLE_MALLOC .\intobj\wildcard.c -fo=.\intobj\wildcard.obj wcc386 /bt=nt /mf /w0 /zq /j /zp4 /fp5 /fpi87 /5r /otimra /s -DESIMPLE_MALLOC .\intobj\sequence.c -fo=.\intobj\sequence.obj Unable to open '.\intobj\sequence.c' -= B E G I N =- X-EUFORUM: 20457 Date: 2008 May 5 20:15 From: yuku Subject: Re: Still cannot compile 4.0 imakew. But I have modified it to include /dEOW switch. -= B E G I N =- X-EUFORUM: 20458 Date: 2008 May 5 20:27 From: Jeremy Cowgar Subject: Re: Still cannot compile 4.0 yuku wrote: > > Looks good. But > > wcc386 /bt=nt /mf /w0 /zq /j /zp4 /fp5 /fpi87 /5r /otimra /s -DESIMPLE_MALLOC > .\intobj\intinit.c -fo=.\intobj\intinit.obj > wcc386 /bt=nt /mf /w0 /zq /j /zp4 /fp5 /fpi87 /5r /otimra /s -DESIMPLE_MALLOC > .\intobj\symtab_0.c -fo=.\intobj\symtab_0.obj > wcc386 /bt=nt /mf /w0 /zq /j /zp4 /fp5 /fpi87 /5r /otimra /s -DESIMPLE_MALLOC > .\intobj\wildcard.c -fo=.\intobj\wildcard.obj > wcc386 /bt=nt /mf /w0 /zq /j /zp4 /fp5 /fpi87 /5r /otimra /s -DESIMPLE_MALLOC > .\intobj\sequence.c -fo=.\intobj\sequence.obj > Unable to open '.\intobj\sequence.c' Can you get on IRC and we can work through this problem in real time? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20459 Date: 2008 May 5 21:36 From: c.k.lester Subject: Parsing Challenge A call for help. I have the following HTML code:

YUI: CSS Grid Builder

Footer is here.
I need to parse (extract) the class and ID of each DIV so I can create database records based on the structure. I'm pretty sure there's a lib already available to help me do this in the shortest possible time, right? :) If not, maybe somebody with excellent parser coding skills can give a nice guy a little hand. or two. What I want to be able to do is take HTML code generated by the YUI Grids Builder and paste it into BBCMF so it will build the page for me/you/us. Thanks! -= B E G I N =- X-EUFORUM: 20460 Date: 2008 May 5 21:51 From: Matt Lewis Subject: Re: PCRE Jeremy Cowgar wrote: > > Matt Lewis wrote: > > > > I started playing around with PCRE today, to do some benchmarks. I compared > > it with using the wxEuphoria regex functions. > > > > wx: 2.49 > > pcre: 0.22 > > > > That's a substantial difference. What does wxEuphoria use for regular expressions? > Are they part of wxWidgets? Yes, it's built into wxWidgets. It uses Henry Spencer's Regex library. Matt -= B E G I N =- X-EUFORUM: 20461 Date: 2008 May 5 21:52 From: Jeremy Cowgar Subject: Re: Parsing Challenge Here's quick code w/little error checking, but it works fine on your example HTML. include sequence.e include search.e include file.e function get_attr(sequence data, sequence attr, integer start) integer stop, max_stop max_stop = find_from('>', data, start) start = match_from(attr & "=", data, start) if start = 0 or start > max_stop then return "" end if stop = find_any_from(" >", data, start) return trim(data[start+length(attr)+1..stop-1], "\"") end function sequence data, matches data = read_file("ex.html") matches = match_all(" It requires the new standard library, but you can grab search.e, sequence.e and file.e from http://rapideuphoria.svn.sourceforge.net/svnroot/rapideuphoria/trunk/include/ -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20462 Date: 2008 May 5 22:07 From: Derek Parnell Subject: Re: . or : for namespace? Jeremy Cowgar wrote: > Now, following up with that there was another, new complaint, against the . > idea and that was by Mike and Matt agreed. My original obection was much the same too, by the way. > Their comment was that when the see a : in code that they wrote 6 months or > 2 years ago that they will know it's a namespace and therefore the function > is in another location. That they will be able to tell that right away. However, > maybe in 2 years we will have dot'ed sequence access (whatever that will look > like) and then you will not know without research if greeter.greeting = "Hello" > is assigning a variable name greeting inside of the greeter namespace or if > greeter is possibly a sequence. The main purpose of a programming language is to help people read programs. The two important words are "read" and "people". > So, please read my prior post about the complaints against . and then the above > and let's have another round of discussion please. If you are in favor or against > it, please post your comments. Please retain ":" as the namespace delimiter. The colon provides an unambiguous visual clue for people reading source as to how they should understand the identifier preceding it. Remember that an intelligent editor is not the only way that source code will be presented to a person, so tooltips and colorization assists must not be assumed to be always present. Without knowledge gained from other arts of a source code file, the following statement is visually ambiguous... if foo.bar = 1 What is 'foo'? if foo:bar = 1 Now it is obvious that 'bar' is declared in another source file. The argument with respect to ease of typing can also be applied to other often used Euphoria syntax elements, such as the double-quote, tilde, dollar and brace-pair, not to mention the widely used '<', '>', '(', ')', and '%' characters. But that argument isn't actively used against these characters so why use it against ':'? -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20463 Date: 2008 May 5 22:28 From: Jeremy Cowgar Subject: Yay or Nay? Framed reference manual http://jeremy.cowgar.com/euphoria/index.htm I have not committed this to SVN yet. Would like to have some feedback. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20464 Date: 2008 May 5 22:35 From: Mike Subject: Re: . or : for namespace? Hey Jeremy, Jeremy Cowgar wrote: -- snip > Previous arguments were summarized in my post: > > http://www.openeuphoria.org/EUforum/m20221.html > > Now, following up with that there was another, new complaint, against the . > idea and that was by Mike and Matt agreed. I somewhat agree but would still > be in favor of the . but, this is just something we need to work through until > a final decision has been made. > > Their comment was that when the see a : in code that they wrote 6 months or > 2 years ago that they will know it's a namespace and therefore the function > is in another location. That they will be able to tell that right away. However, > maybe in 2 years we will have dot'ed sequence access (whatever that will look > like) and then you will not know without research if greeter.greeting = "Hello" > is assigning a variable name greeting inside of the greeter namespace or if > greeter is possibly a sequence. > > So, please read my prior post about the complaints against . and then the above > and let's have another round of discussion please. If you are in favor or against > it, please post your comments. > > Let me also point out that we are focusing a lot on the negatives and people > who bring about points that are negative. There are many who want the . and > think it's much clearer. Now, in the end we are all working together to make > Euphoria better for us all. That's the goal, let's keep that in mind. That's true. I personally think that . is clearer, that is, until dot notation becomes available for sequence access (or even, *structure* access, yeah..) and then we introduce ambiguities. Forget 2 years, or even 6 months, problems with one's own code will surface in mere weeks. Now, here is an example of how silly it can get: include file.x as b sequence a .. a.b.c What does this mean? it really means a . b:c !GASP! If the dot is used for namespaces, sequence access, also using dots, will be fraught with such perils. If there is to be *any* hope of using dot notation generally, I would really love to see someone try and explain away the above example. I am sure there will be people who would prefer to use . as namespace but they would also like to use . for sequence access. Insisting on the former will jeopardize the latter. or am I mistaken about this? regards, Mike -= B E G I N =- X-EUFORUM: 20465 Date: 2008 May 5 22:36 From: Greg Haberek Subject: Re: Yay or Nay? Framed reference manual Jeremy Cowgar wrote: > > http://jeremy.cowgar.com/euphoria/index.htm > > I have not committed this to SVN yet. Would like to have some feedback. Yay. I think it looks great. I'm not too keen on frames though. Perhaps a two-column DIV layout would work just as well? -Greg -= B E G I N =- X-EUFORUM: 20466 Date: 2008 May 5 22:40 From: Jason Gade Subject: Re: Yay or Nay? Framed reference manual Greg Haberek wrote: > > Jeremy Cowgar wrote: > > > > http://jeremy.cowgar.com/euphoria/index.htm > > > > I have not committed this to SVN yet. Would like to have some feedback. > > Yay. I think it looks great. I'm not too keen on frames though. Perhaps a two-column > DIV layout would work just as well? > > -Greg Agree -- columns good, frames bad. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20467 Date: 2008 May 5 22:41 From: Jeremy Cowgar Subject: Re: Yay or Nay? Framed reference manual Greg Haberek wrote: > > Yay. I think it looks great. I'm not too keen on frames though. Perhaps a two-column > DIV layout would work just as well? > Greg, I am no HTML/CSS guru. Can you make a div layout w/o fancy Javascript where the navigation div stays on the side, no matter how high or low you scroll in the docs? For instance, you can click on Language Manual, scroll down a substantial amount and with the frames, the navigation frame will still be right there at your finger tips. If there are other ways of doing this, I'm open for suggestions, but I think having the links there for quick access is the major benefit. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20468 Date: 2008 May 5 22:43 From: Bernie Ryan Subject: Re: Parsing Challenge c.k.lester wrote: > > A call for help. I have the following HTML code: > >
>
>

YUI: CSS Grid Builder

>
>
>
>
>
> >
>
>
>
> >
>
>
Footer is here.
>
>
> > I need to parse (extract) the class and ID of each DIV so I can create > database records based on the structure. I'm pretty sure there's a lib > already available to help me do this in the shortest possible time, right? :) > > If not, maybe somebody with excellent parser coding skills can give a nice > guy a little hand. or two. > > What I want to be able to do is take HTML code generated by the YUI Grids > Builder and paste it into BBCMF so it will build the page for me/you/us. > CK: Download mixedlib.e library in archive it has function for parsing. It's listed under Utility Library C-functions Then you can try this code which can be written in many different ways the library is very flexible. Note I am just using one function strtok here which is the same as that used in "C". include mixedlib.e integer fn fn = open("Doc.htm","rb") sequence buffer buffer = {} object line line = {} line = gets(fn) while sequence(line) do buffer &= line line = gets(fn) end while atom token sequence s token = strtok(sz(buffer), sz(" >")) while token do s = str2seq(token) if match("id=",s) or match("class=",s) then puts(1,str2seq(token)&"\n") end if token = strtok(0, sz(" >")) end while Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20469 Date: 2008 May 5 22:53 From: c.k.lester Subject: Re: Yay or Nay? Framed reference manual Jeremy Cowgar wrote: > > http://jeremy.cowgar.com/euphoria/index.htm > > I have not committed this to SVN yet. Would like to have some feedback. My feedback: nice! keep. -= B E G I N =- X-EUFORUM: 20470 Date: 2008 May 5 22:54 From: "Euler German" Subject: Re: . or : for namespace? > On 5 May 2008 at 15:07, Derek Parnell wrote (maybe snipped): > Without knowledge gained from other arts of a source code file, the > following statement is visually ambiguous... > > if foo.bar = 1 > > What is 'foo'? > > if foo:bar = 1 > > Now it is obvious that 'bar' is declared in another source file. > > The argument with respect to ease of typing can also be applied to > other often used Euphoria syntax elements, such as the double-quote, > tilde, dollar and brace-pair, not to mention the widely used '<', '>', > '(', ')', and '%' characters. But that argument isn't actively used > against these characters so why use it against ':'? > Derek's "disambiguation" made a point here. So, I'm about to change my vote for the dot. It was a conditional vote, anyway. ;) Best, Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 20471 Date: 2008 May 5 22:59 From: c.k.lester Subject: Re: . or : for namespace? Euler German wrote: > > > Derek's "disambiguation" made a point here. So, I'm about to change > my vote for the dot. It was a conditional vote, anyway. ;) What about cases that give us this: a.b:c:d.e.f:g.h = "WTF?" -= B E G I N =- X-EUFORUM: 20472 Date: 2008 May 5 23:15 From: ChrisBurch3 Subject: Re: . or : for namespace? Derek Parnell wrote: > > Jeremy Cowgar wrote: > > > Now, following up with that there was another, new complaint, against the . > > idea and that was by Mike and Matt agreed. > > My original obection was much the same too, by the way. > > > Their comment was that when the see a : in code that they wrote 6 months or > > 2 years ago that they will know it's a namespace and therefore the function > > is in another location. That they will be able to tell that right away. However, > > maybe in 2 years we will have dot'ed sequence access (whatever that will look > > like) and then you will not know without research if greeter.greeting = "Hello" > > is assigning a variable name greeting inside of the greeter namespace or if > > greeter is possibly a sequence. > > > The main purpose of a programming language is to help people read programs. > The two important words are "read" and "people". > > > So, please read my prior post about the complaints against . and then the above > > and let's have another round of discussion please. If you are in favor or against > > it, please post your comments. > > > Please retain ":" as the namespace delimiter. > > > The colon provides an unambiguous visual clue for people reading source as to > how they should understand the identifier preceding it. Remember that an intelligent > editor is not the only way that source code will be presented to a person, so > tooltips and colorization assists must not be assumed to be always present. > > Without knowledge gained from other arts of a source code file, the following > statement is visually ambiguous... > > if foo.bar = 1 > > What is 'foo'? > > if foo:bar = 1 > > Now it is obvious that 'bar' is declared in another source file. > > The argument with respect to ease of typing can also be applied to other often > used Euphoria syntax elements, such as the double-quote, tilde, dollar and brace-pair, > not to mention the widely used '<', '>', '(', ')', and '%' characters. > But that argument isn't actively used against these characters so why use it > against ':'? > I agree with this - keep : for namespace signalling Chris -= B E G I N =- X-EUFORUM: 20473 Date: 2008 May 5 23:18 From: ChrisBurch3 Subject: Re: Yay or Nay? Framed reference manual Frames - old fashioned but functional, useful, easy to maintain, dead easy to navigate. Keep it like this. Aye. Yay. Chris -= B E G I N =- X-EUFORUM: 20474 Date: 2008 May 5 23:18 From: Kat Subject: Re: Parsing Challenge c.k.lester wrote: > > A call for help. I have the following HTML code: > >
>
>

YUI: CSS Grid Builder

>
>
>
>
>
> >
>
>
>
> >
>
>
Footer is here.
>
>
> > I need to parse (extract) the class and ID of each DIV so I can create > database records based on the structure. I'm pretty sure there's a lib > already available to help me do this in the shortest possible time, right? :) > > If not, maybe somebody with excellent parser coding skills can give a nice > guy a little hand. or two. > > What I want to be able to do is take HTML code generated by the YUI Grids > Builder and paste it into BBCMF so it will build the page for me/you/us. > > Thanks! getxml() in strtok. Kat -= B E G I N =- X-EUFORUM: 20475 Date: 2008 May 5 23:22 From: Bernie Ryan Subject: Re: . or : for namespace? ChrisBurch3 wrote: > > Derek Parnell wrote: > > > > Jeremy Cowgar wrote: > > > > > Now, following up with that there was another, new complaint, against the . > > > idea and that was by Mike and Matt agreed. > > > > My original obection was much the same too, by the way. > > > > > Their comment was that when the see a : in code that they wrote 6 months or > > > 2 years ago that they will know it's a namespace and therefore the function > > > is in another location. That they will be able to tell that right away. However, > > > maybe in 2 years we will have dot'ed sequence access (whatever that will look > > > like) and then you will not know without research if greeter.greeting = "Hello" > > > is assigning a variable name greeting inside of the greeter namespace or if > > > greeter is possibly a sequence. > > > > > > The main purpose of a programming language is to help people read programs. > > The two important words are "read" and "people". > > > > > So, please read my prior post about the complaints against . and then the above > > > and let's have another round of discussion please. If you are in favor or against > > > it, please post your comments. > > > > > > Please retain ":" as the namespace delimiter. > > > > > > The colon provides an unambiguous visual clue for people reading source as to > > how they should understand the identifier preceding it. Remember that an intelligent > > editor is not the only way that source code will be presented to a person, so > > tooltips and colorization assists must not be assumed to be always present. > > > > Without knowledge gained from other arts of a source code file, the following > > statement is visually ambiguous... > > > > if foo.bar = 1 > > > > What is 'foo'? > > > > if foo:bar = 1 > > > > Now it is obvious that 'bar' is declared in another source file. > > > > The argument with respect to ease of typing can also be applied to other often > > used Euphoria syntax elements, such as the double-quote, tilde, dollar and brace-pair, > > not to mention the widely used '<', '>', '(', ')', and '%' characters. > > But that argument isn't actively used against these characters so why use it > > against ':'? > > > > I agree with this - keep : for namespace signalling > I agree with this - keep : for namespace signalling Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20476 Date: 2008 May 5 23:36 From: Jeremy Cowgar Subject: Re: Yay or Nay? Framed reference manual Greg Haberek wrote: > > Jeremy Cowgar wrote: > > > > http://jeremy.cowgar.com/euphoria/index.htm > > > > I have not committed this to SVN yet. Would like to have some feedback. > > Yay. I think it looks great. I'm not too keen on frames though. Perhaps a two-column > DIV layout would work just as well? I've updated the style a bit to make it more visually appealing. Prior to was just a let's see what happens. But, please, if you have an easy way to make the navigation column always visible, let me know. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20477 Date: 2008 May 5 23:56 From: jacques deschênes Subject: Re: Yay or Nay? Framed reference manual Firefox as no problem with frames so I don't, I vote Yay. Jeremy Cowgar wrote: > > http://jeremy.cowgar.com/euphoria/index.htm > > I have not committed this to SVN yet. Would like to have some feedback. > > -- > Jeremy Cowgar > http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20478 Date: 2008 May 6 0:20 From: Jeremy Cowgar Subject: SCGI, Euphoria, 9,000 requests a second I got SCGI working with EuNet. Here are benchmarks of a Hello World program: ---- CGI: Total transferred: 16620 bytes HTML transferred: 3800 bytes Requests per second: 795.23 [#/sec] (mean) Time per request: 1.258 [ms] (mean) Time per request: 1.258 [ms] (mean, across all concurrent requests) Transfer rate: 127.24 [Kbytes/sec] received ---- SCGI: Total transferred: 159943 bytes HTML transferred: 37278 bytes Requests per second: 8986.74 [#/sec] (mean) Time per request: 0.111 [ms] (mean) Time per request: 0.111 [ms] (mean, across all concurrent requests) Transfer rate: 1401.93 [Kbytes/sec] received ---- Now, here's the good part. This Hello World app is the app that your going to see the least performance increase on! Reason? It's tiny so not much parsing/startup time taken by Euphoria but more than that, once you get involved and have database connections, the CGI app has to connect/disconnect to/from the database every request. Not so with SCGI since it is stateful. So, when the application loads, you connect to the database, you then start listening for connections from the web server. When a connection comes in, you handle it, and then are back at the top of your loop again. No need to connect/disconnect. Oh, also, you can run many independent copies of your SCGI program not only on the same machine, but on multiple machines as it utilizes TCP/IP connections, thus, you can distribute the load, if you are by chance running a 100 million hit per day website :-) So, more on this later, but first, here are the two test programs benchmarked above: ---- hello.cgi puts(1, "Content-type: text/html\r\n\r\n") puts(1, "Hello World!") ---- hello.scgi sequence scgi_server atom sock scgi_server = scgi:new(3015) while 1 do sock = scgi:wait(scgi_server) scgi:puts(sock, "Content-type: text/html\r\n\r\n") scgi:puts(sock, "Hello World!") end while -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20479 Date: 2008 May 6 0:24 From: Marco Achury Subject: Re: Yay or Nay? Framed reference manual Looks great. I've checked the source of your index. I would change: Euphoria 4.0 Documentation <!-- THE CONTENTS AT MENU.HTM MUST TO BE REPEATED HERE !--> This way you will have great compatibility with any existing html browser, including text mode browsers (Lynx, Links, netrik, Freedos's htmlhelp system), speach system. Also a lot of browsers at palmtops, and cell phones don't support frames, and even some people would like to disable the frames. +-+-+-+-+-+-+-+ Marco A. Achury Caracas, Venezuela -= B E G I N =- X-EUFORUM: 20480 Date: 2008 May 6 0:30 From: Mike777 Subject: Re: Yay or Nay? Framed reference manual Jeremy Cowgar wrote: > > > http://jeremy.cowgar.com/euphoria/index.htm > > > > > > I have not committed this to SVN yet. Would like to have some feedback. Yay. While you are at it, can you take a look at the individual pages and ensure that they wrap? This one wraps: http://jeremy.cowgar.com/euphoria/overview.htm This one doesn't: http://jeremy.cowgar.com/euphoria/install.htm Mike -= B E G I N =- X-EUFORUM: 20481 Date: 2008 May 6 0:39 From: "Euler German" Subject: Re: . or : for namespace? > On 5 May 2008 at 15:59, c.k.lester wrote (maybe snipped): > Euler German wrote: > > > > > > Derek's "disambiguation" made a point here. So, I'm about to change > > my vote for the dot. It was a conditional vote, anyway. ;) > > What about cases that give us this: > > a.b:c:d.e.f:g.h = "WTF?" > Lousy coding? ;) Best, Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 20482 Date: 2008 May 6 0:52 From: Marco Achury Subject: Re: SCGI, Euphoria, 9,000 requests a second Sounds great, I have some questions: 1- This program is supossed to run 24/7 and your web hosting will not be happy with your program takes a big slice of the processing resources. (Of course, not problem if you run your own server.) There is a way to include some idle times to return control to the OS when there is not high trafic? 2- May this run on any web server? 3- Is SCGI the same as FastCGI? +-+-+-+-+-+-+-+ Marco A. Achury Caracas, Venezuela -= B E G I N =- X-EUFORUM: 20483 Date: 2008 May 6 0:54 From: "Euler German" Subject: Re: Yay or Nay? Framed reference manual > On 5 May 2008 at 17:30, Mike777 wrote (maybe snipped): > Yay. > > While you are at it, can you take a look at the individual pages and > ensure that they wrap? > > This one wraps: > > http://jeremy.cowgar.com/euphoria/overview.htm > > This one doesn't: > > http://jeremy.cowgar.com/euphoria/install.htm > Both wrap ok here (Firefox/WinXP SP2). Yay! -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 20484 Date: 2008 May 6 0:57 From: Mike777 Subject: Re: Yay or Nay? Framed reference manual Euler German wrote: > > > On 5 May 2008 at 17:30, Mike777 wrote (maybe snipped): > > > Yay. > > > > While you are at it, can you take a look at the individual pages and > > ensure that they wrap? > > > > This one wraps: > > > > http://jeremy.cowgar.com/euphoria/overview.htm > > > > This one doesn't: > > > > http://jeremy.cowgar.com/euphoria/install.htm > > > Both wrap ok here (Firefox/WinXP SP2). Yay! How big did you make the font? Go bigger. Bigger still. And then bigger. What do you get? Mike -= B E G I N =- X-EUFORUM: 20485 Date: 2008 May 6 1:03 From: Kat Subject: Re: Yay or Nay? Framed reference manual Mike777 wrote: > > Jeremy Cowgar wrote: > > > > http://jeremy.cowgar.com/euphoria/index.htm > > > > > > > > I have not committed this to SVN yet. Would like to have some feedback. > > Yay. > > While you are at it, can you take a look at the individual pages and ensure > that they wrap? > > This one wraps: > > http://jeremy.cowgar.com/euphoria/overview.htm > > This one doesn't: > > http://jeremy.cowgar.com/euphoria/install.htm > > Mike Mike, use Proxo to edit the
 tags, and add a space or 
at the '?' in the url: http://www.rapideuphoria.com/cgi-bin/guru.exu?refDoc=on&libDoc=on&otherDoc=on&keywords=euinc on the page. Kat -= B E G I N =- X-EUFORUM: 20486 Date: 2008 May 6 1:09 From: Marco Achury Subject: Re: Yay or Nay? Framed reference manual Mike777 wrote: > > While you are at it, can you take a look at the individual pages and ensure > that they wrap? > This one wraps: > http://jeremy.cowgar.com/euphoria/overview.htm > This one doesn't: > http://jeremy.cowgar.com/euphoria/install.htm > Mike Checking the source: The reason why install.html don't wrap is because the section about autoexec.bat defines a table, and the section about Uninstall Euphoria uses

We can change it this way:

How to manually edit autoexec.bat (WinME/98/95/3.1) 

  1. In the file c:\autoexec.bat add ...
  2. In the same autoexec.bat file ... Another comment: Is very important, but many web designers don't remember that google and other search engines are text browsers. If your web is not text friendly, your page will never get a good range in search engines. If you don't want to install Lynks, send an email to webpage at rumkin.com the subject must to be the url e.g.: http://jeremy.cowgar.com/euphoria/install.htm Left blank the message and send. You will receive an image of how a text browser will see will see your page. +-+-+-+-+-+-+-+ Marco A. Achury Caracas, Venezuela -= B E G I N =- X-EUFORUM: 20487 Date: 2008 May 6 1:16 From: Jeremy Cowgar Subject: Re: SCGI, Euphoria, 9,000 requests a second Marco Achury wrote: > > > Sounds great, I have some questions: > > 1- This program is supossed to run 24/7 and > your web hosting will not be happy with your > program takes a big slice of the processing > resources. (Of course, not problem if you run > your own server.) There is a way to include > some idle times to return control to the OS > when there is not high trafic? The application is sitting idle all the time, unless taking a request. It's a stand alone application. When it's not handling a request, the CPU usage taken by the application does not even register in top, it's listed as 0%. Any web host who lets you run FastCGI will also allow SCGI. Probably many cheap shared web hosting companies will allow neither. > 2- May this run on any web server? Not any, but the major ones have SCGI modules. > 3- Is SCGI the same as FastCGI? Not exactly. Same principal but SCGI is a much easier protocol to use, therefore, it has gained a substantial following. FastCGI is older though. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20488 Date: 2008 May 6 1:21 From: Jeremy Cowgar Subject: Re: Yay or Nay? Framed reference manual Mike777 wrote: > > How big did you make the font? Go bigger. Bigger still. And then bigger. > What do you get? > Wow, I had to go huge before it would start wrapping. I hope nobody ever reads web pages that large. http://jeremy.cowgar.com/snap/1210036625039796944.png It's not because of the PRE tag, it's because of the long link w/no spaces in it: http://www.rapideuphoria.com/cgi-bin/guru.exu?refDoc=on&libDoc=on&otherDoc=on&keywords=euinc -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20489 Date: 2008 May 6 1:23 From: Jeremy Cowgar Subject: Re: Yay or Nay? Framed reference manual Kat wrote: > > Mike, use Proxo to edit the
     tags, and add a space or 
    at the '?' > in the url: > http://www.rapideuphoria.com/cgi-bin/guru.exu?refDoc=on&libDoc=on&otherDoc=on&keywords=euinc > on the page. > I understand the URL is causing it to wrap, but say the URL didn't exist and the pre tags were causing it to wrap. Removing the pre tags and inserting br's instead would cause all examples to be badly formatted, possibly to the point of not being able to understand what's going on. Is that better than scrolling? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20490 Date: 2008 May 6 1:29 From: Kat Subject: Re: Yay or Nay? Framed reference manual Jeremy Cowgar wrote: > > Kat wrote: > > > > Mike, use Proxo to edit the
     tags, and add a space or 
    at the '?' > > in the url: > > http://www.rapideuphoria.com/cgi-bin/guru.exu?refDoc=on&libDoc=on&otherDoc=on&keywords=euinc > > on the page. > > > > I understand the URL is causing it to wrap, but say the URL didn't exist and > the pre tags were causing it to wrap. Removing the pre tags and inserting br's > instead would cause all examples to be badly formatted, possibly to the point > of not being able to understand what's going on. Is that better than scrolling? We already had a cure for this in a previous wordwrap thread. If you remove the url, the pre tags will cause it to stop wrapping. And yeas, Mike wants it to use bigger fonts. Kat -= B E G I N =- X-EUFORUM: 20491 Date: 2008 May 6 1:53 From: "Euler German" Subject: Re: Yay or Nay? Framed reference manual > On 5 May 2008 at 17:57, Mike777 wrote (maybe snipped): > How big did you make the font? Go bigger. Bigger still. And then > bigger. What do you get? > Mike, if I put THIS BIG, my neighbour two blocks away will be able to read my display without his glasses. This is beyond reasonable, IMO. Best & Good Night! Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 20492 Date: 2008 May 6 1:54 From: Mike Subject: Re: . or : for namespace? Hi CK, c.k.lester wrote: > > Euler German wrote: > > > > > > Derek's "disambiguation" made a point here. So, I'm about to change > > my vote for the dot. It was a conditional vote, anyway. ;) > > What about cases that give us this: > > a.b:c:d.e.f:g.h = "WTF?" Are you joking here..? No, that would never be, so... I think you made a mistake with "b:c:d" I'll assume it would have been "b:c.d" : binds more closely than . and is always only ever paired, never stacked, so, it's completely unambiguous as: a . b:c . d . e . f:g . h the alternatives using dotted namespace would be either : a [ b.c ] [ d ] [ e ] [ f.g ] [ h ] or : int tmp = b.c int tmp2 = f.g a . tmp . d . e . tmp2 . h regards, Mike -= B E G I N =- X-EUFORUM: 20493 Date: 2008 May 6 2:04 From: Kat Subject: Re: Yay or Nay? Framed reference manual Euler German wrote: > > > On 5 May 2008 at 17:57, Mike777 wrote (maybe snipped): > > > How big did you make the font? Go bigger. Bigger still. And then > > bigger. What do you get? > > > Mike, if I put THIS BIG, my neighbour two blocks away will be able to > read my display without his glasses. This is beyond reasonable, IMO. Nice to see you guys can still make fun of a disability. Or restrict the available technology to keep people out. Kat -= B E G I N =- X-EUFORUM: 20494 Date: 2008 May 6 2:56 From: Jeremy Cowgar Subject: Re: Yay or Nay? Framed reference manual Marco Achury wrote: > > This way you will have great compatibility with any existing > html browser, including text mode browsers (Lynx, Links, > netrik, Freedos's htmlhelp system), speach system. Also > a lot of browsers at palmtops, and cell phones don't support > frames, and even some people would like to disable the frames. > Hm. I only had links installed, but it supports frames just fine. I then installed lynx, and it does not support frames directly but allowed me to choose which frame I wanted to view. However, I did as you said with the noframes tags. Everyone seemed to like the new changes including Rob, so I committed the changes to SVN and this is how the 4.0 docs will look. There will more than likely be style issue fixes. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20495 Date: 2008 May 6 2:57 From: Kat Subject: Re: Yay or Nay? Framed reference manual Kat wrote: > > Euler German wrote: > > > > > On 5 May 2008 at 17:57, Mike777 wrote (maybe snipped): > > > > > How big did you make the font? Go bigger. Bigger still. And then > > > bigger. What do you get? > > > > > Mike, if I put THIS BIG, my neighbour two blocks away will be able to > > read my display without his glasses. This is beyond reasonable, IMO. > > Nice to see you guys can still make fun of a disability. Or restrict the available > technology to keep people out. Mike, these are the precious eucode lines that are not allowing you to see the help pages as you want: add_handler("pre", routine_id("tag_pre")) add_handler("/pre", routine_id("tag_end_pre")) in global procedure html_init() But i don't see how the code get to that point, or how the routine_id() are called, so i can't fix it. And considering how well my code is appreciated, poeple would fight against making it better anyhow. Changing the
     tags to something that isn't printed out in a browser, and adding the 
    tags would be trivial. Sorry. Kat -= B E G I N =- X-EUFORUM: 20496 Date: 2008 May 6 3:04 From: Jeremy Cowgar Subject: Re: Yay or Nay? Framed reference manual Kat wrote: > > Mike, these are the precious eucode lines that are not allowing you to see the > help pages as you want: > > > add_handler("pre", routine_id("tag_pre")) > add_handler("/pre", routine_id("tag_end_pre")) > > > in global procedure html_init() > > But i don't see how the code get to that point, or how the routine_id() are called, > so i can't fix it. And considering how well my code is appreciated, poeple would > fight against making it better anyhow. Changing the
     tags
    > to something that isn't printed out in a browser, and adding the 
    tags > would be trivial. Sorry. > Kat, please view docgen.e and doc.exw. docall.bat will allow you to test your changes. If you come up with a working solution that will keep source code formatted properly that I will insert your code into the document parsing system no problem. But the answer is not to just strip the pre tags, that will break more than it will fix. It's actually much more complicated than the two lines you've pasted, but it's not at all impossible. The two files I referenced should get you going. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20497 Date: 2008 May 6 3:21 From: Kat Subject: Re: Yay or Nay? Framed reference manual Jeremy Cowgar wrote: > > Kat wrote: > > > > Mike, these are the precious eucode lines that are not allowing you to see the > > help pages as you want: > > > > > > add_handler("pre", routine_id("tag_pre")) > > add_handler("/pre", routine_id("tag_end_pre")) > > > > > > in global procedure html_init() > > > > But i don't see how the code get to that point, or how the routine_id() are called, > > so i can't fix it. And considering how well my code is appreciated, poeple would > > fight against making it better anyhow. Changing the
     tags
    > > to something that isn't printed out in a browser, and adding the 
    tags > > would be trivial. Sorry. > > > > Kat, please view docgen.e and doc.exw. docall.bat will allow you to test your > changes. If you come up with a working solution that will keep source code formatted > properly that I will insert your code into the document parsing system no problem. > But the answer is not to just strip the pre tags, that will break more than > it will fix. It's actually much more complicated than the two lines you've pasted, > but it's not at all impossible. The two files I referenced should get you going. Let me rephrase: no. We discussed it in #Euphoria , no need to restate it all here, RobC would just delete the post. Kat -= B E G I N =- X-EUFORUM: 20498 Date: 2008 May 6 3:30 From: yuku Subject: Re: . or : for namespace? Mike wrote: > Now, here is an example of how silly it can get: > > include file.x as b > sequence a > .. > > a.b.c > > What does this mean? it really means a . b:c But what can that really mean? Does it mean that c is a constant in namespace b and a.b:c means the same as a[b:c] ? -= B E G I N =- X-EUFORUM: 20499 Date: 2008 May 6 3:38 From: Salix Subject: Re: Yay or Nay? Framed reference manual I am against frames. Other business: check the wildcard_match() reference on the http://jeremy.cowgar.com/euphoria/library.htm page. Regards, Salix -= B E G I N =- X-EUFORUM: 20500 Date: 2008 May 6 3:47 From: Mike Subject: Re: . or : for namespace? yuku wrote: > > Mike wrote: > > Now, here is an example of how silly it can get: > > > > include file.x as b > > sequence a > > .. > > > > a.b.c > > > > What does this mean? it really means a . b:c > > But what can that really mean? Does it mean that c is a constant in namespace > b It could be a constant or variable > and a.b:c means the same as a[b:c] ? Yes. The point was that it *could* (without further investigation) also be a:b [ c ] which is the whole point - nobody knows what's going on. Mike -= B E G I N =- X-EUFORUM: 20501 Date: 2008 May 6 3:57 From: Marco Achury Subject: Re: Yay or Nay? Framed reference manual I'm checking install.htx. The solution to eliminate the tables is not so simple. I would add at text.e , procedure text_init() a new tag to manage
      , that do the same as
        , but the
      • must to receive numeration. add_handler("ol", routine_id("tag_ol")) add_handler("/ol", routine_id("tag_end_ol")) The routine would be allmost the same as tag_ul. But tag_li must to be modified. Must to check if the last open list is
          or
            . If is
              then add the number. The last opened last must to be a filo stack. Numeration also may be a stack or global variable. text.e is very nice. With some more enhacements we can get a Lynx like text mode web browser portable to any platform! +-+-+-+-+-+-+-+ Marco A. Achury Caracas, Venezuela -= B E G I N =- X-EUFORUM: 20502 Date: 2008 May 6 4:16 From: c.k.lester Subject: Re: SCGI, Euphoria, 9,000 requests a second Jeremy Cowgar wrote: > > Not so with SCGI since it is stateful. Does this work with Apache? -= B E G I N =- X-EUFORUM: 20503 Date: 2008 May 6 4:29 From: Jeremy Cowgar Subject: Re: Yay or Nay? Framed reference manual Marco Achury wrote: > > I'm checking install.htx. The solution to eliminate > the tables is not so simple. > > I would add at text.e , procedure text_init() > a new tag to manage
                , that do the same as
                  , > but the
                • must to receive numeration. > > > add_handler("ol", routine_id("tag_ol")) > add_handler("/ol", routine_id("tag_end_ol")) > > > The routine would be allmost the same as tag_ul. > > But tag_li must to be modified. Must to check if the last open list > is
                    or
                      . If is
                        then add the number. > The last opened last must to be a filo stack. > Numeration also may be a stack or global variable. > Marco, If you can come up with some tags to help out, that would be fantastic. Thanks for looking into it! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20504 Date: 2008 May 6 4:29 From: Jeremy Cowgar Subject: Re: SCGI, Euphoria, 9,000 requests a second c.k.lester wrote: > > Jeremy Cowgar wrote: > > > > Not so with SCGI since it is stateful. > > Does this work with Apache? Yes, mod_scgi. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20505 Date: 2008 May 6 4:34 From: Jeremy Cowgar Subject: Re: Yay or Nay? Framed reference manual Salix wrote: > > I am against frames. > A few people have said that. Can you tell me why? Or tell me how the menu area can be always visible no matter where you are in the document, so I do not have to use frames? > Other business: check the wildcard_match() reference on the http://jeremy.cowgar.com/euphoria/library.htm > page. I looked but I am not sure what you want me to see. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20506 Date: 2008 May 6 4:39 From: c.k.lester Subject: Re: Yay or Nay? Framed reference manual Jeremy Cowgar wrote: > Salix wrote: > > Other business: check the wildcard_match() reference on the http://jeremy.cowgar.com/euphoria/library.htm > > page. > > I looked but I am not sure what you want me to see. It's a broken link for me. -= B E G I N =- X-EUFORUM: 20507 Date: 2008 May 6 4:40 From: Jason Gade Subject: Re: Yay or Nay? Framed reference manual I'm not /strongly/ against frames but I just don't like them. Probably because of bad memories from web browsers past. I'm okay with navigation that scrolls with the page. I've seen navigation do what you describe but I think it requires Javascript and I don't really know how to do it. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20508 Date: 2008 May 6 4:45 From: Jeremy Cowgar Subject: Re: Yay or Nay? Framed reference manual Jason Gade wrote: > > I'm okay with navigation that scrolls with the page. I've seen navigation do > what you describe but I think it requires Javascript and I don't really know > how to do it. > To me, the benefit of the new way I did things was that the navigation is always at your finger tips. w/o that, I'd just revert to what we had before. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20509 Date: 2008 May 6 4:45 From: Jeremy Cowgar Subject: Re: Yay or Nay? Framed reference manual c.k.lester wrote: > > Jeremy Cowgar wrote: > > Salix wrote: > > > Other business: check the wildcard_match() reference on the > http://jeremy.cowgar.com/euphoria/library.htm > > > page. > > > > I looked but I am not sure what you want me to see. > > It's a broken link for me. Hm, works for me. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20510 Date: 2008 May 6 4:49 From: Jason Gade Subject: Re: Yay or Nay? Framed reference manual Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > I'm okay with navigation that scrolls with the page. I've seen navigation do > > what you describe but I think it requires Javascript and I don't really know > > how to do it. > > > > To me, the benefit of the new way I did things was that the navigation is always > at your finger tips. w/o that, I'd just revert to what we had before. > > -- > Jeremy Cowgar > http://jeremy.cowgar.com It's at my fingertips regardless -- just a scrollbar or a page up or page down or home or end or spacebar away. Instead of changing focus and then scrolling. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20511 Date: 2008 May 6 4:54 From: Jason Gade Subject: Re: Yay or Nay? Framed reference manual Jeremy Cowgar wrote: > > c.k.lester wrote: > > > > Jeremy Cowgar wrote: > > > Salix wrote: > > > > Other business: check the wildcard_match() reference on the > > http://jeremy.cowgar.com/euphoria/library.htm > > > > page. > > > > > > I looked but I am not sure what you want me to see. > > > > It's a broken link for me. > > Hm, works for me. > > -- > Jeremy Cowgar > http://jeremy.cowgar.com The link http://jeremy.cowgar.com/euphoria/lib_pat.htm comes up 404. I think that's what he's talking about. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20512 Date: 2008 May 6 4:57 From: Mike777 Subject: Re: Yay or Nay? Framed reference manual Jeremy Cowgar wrote: > > Mike777 wrote: > > > > How big did you make the font? Go bigger. Bigger still. And then bigger. > > What do you get? > > > > Wow, I had to go huge before it would start wrapping. I hope nobody ever reads > web pages that large. Uh, we do. > http://jeremy.cowgar.com/snap/1210036625039796944.png > > It's not because of the PRE tag, it's because of the long link w/no spaces in > it: > > http://www.rapideuphoria.com/cgi-bin/guru.exu?refDoc=on&libDoc=on&otherDoc=on&keywords=euinc Yes, I can understand how a link will preclude wrapping. There seem to be other messages in this thread indicating that a long link will CAUSE wrapping. I can't "wrap" my head around that one. Not that I feel the need to explain, but I frequently scroll a page very large (should I say very, very large?) and then ratchet back until the text is just visible on one line for a majority of the page. It is the outliers that are the problem. If they wrap, great, I have learned to adjust. If they don't wrap, I must, MUST, ratchet back until the longest line is just visible and, frankly, that just isn't big enough for me to relax in my recliner. Oh, wait! Was I supposed to admit that? Mike -= B E G I N =- X-EUFORUM: 20513 Date: 2008 May 6 4:59 From: c.k.lester Subject: Re: Yay or Nay? Framed reference manual Jason Gade wrote: > > The link http://jeremy.cowgar.com/euphoria/lib_pat.htm comes > up 404. I think that's what he's talking about. Right. The link for wildcard_match() and wildcard_file() come up as broken links. http://jeremy.cowgar.com/euphoria/lib_pat.htm#wildcard_match http://jeremy.cowgar.com/euphoria/lib_pat.htm#wildcard_file -= B E G I N =- X-EUFORUM: 20514 Date: 2008 May 6 5:02 From: Mike777 Subject: Re: Yay or Nay? Framed reference manual Euler German wrote: > > > On 5 May 2008 at 17:57, Mike777 wrote (maybe snipped): > > > How big did you make the font? Go bigger. Bigger still. And then > > bigger. What do you get? > > > Mike, if I put THIS BIG, my neighbour two blocks away will be able to > read my display without his glasses. This is beyond reasonable, IMO. My specialty, I suppose. Mike -= B E G I N =- X-EUFORUM: 20515 Date: 2008 May 6 5:10 From: Mike777 Subject: Re: Yay or Nay? Framed reference manual Marco Achury wrote: > > Mike777 wrote: > > > > While you are at it, can you take a look at the individual pages and ensure > > that they wrap? > > This one wraps: > > http://jeremy.cowgar.com/euphoria/overview.htm > > This one doesn't: > > http://jeremy.cowgar.com/euphoria/install.htm > > Mike > > Checking the source: > The reason why install.html don't wrap is because the section about > autoexec.bat defines a table, and the section about Uninstall Euphoria uses
                        > 
                        > We can change it this way:
                        > 
                        > How to manually edit autoexec.bat (WinME/98/95/3.1) 
                        > 
                        > 

                        >

                          >
                        1. In the file c:\autoexec.bat add ...
                        2. >
                        3. In the same autoexec.bat file ... Marco, Thanks much. It appears to me that the second link (install) has indeed been changed as it seems to wrap now. I concur with the conclusion to not change the /pre formatting if it will in any way mess up things. However, if a simple change can be made to accommodate wrapping, then I'm all for it. Mike -= B E G I N =- X-EUFORUM: 20516 Date: 2008 May 6 5:12 From: Jeremy Cowgar Subject: Re: Yay or Nay? Framed reference manual c.k.lester wrote: > > Jason Gade wrote: > > > > The link http://jeremy.cowgar.com/euphoria/lib_pat.htm > comes > > up 404. I think that's what he's talking about. > > Right. The link for wildcard_match() and wildcard_file() come up as broken > links. > Ah! Ok. I was looking for spelling or formatting mistakes. Didn't even click the link! I recently moved the detail of those functions from the pattern matching to search category. I hated to have a category for two functions. I fixed and updated the site. Thanks for catching that and taking the time to explain it to my sleepy mind. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20517 Date: 2008 May 6 5:32 From: Kat Subject: Re: Yay or Nay? Framed reference manual Mike777 wrote: > > Jeremy Cowgar wrote: > > > > Mike777 wrote: > > > > > > How big did you make the font? Go bigger. Bigger still. And then bigger. > > > What do you get? > > > > > > > Wow, I had to go huge before it would start wrapping. I hope nobody ever reads > > web pages that large. > > Uh, we do. > > > http://jeremy.cowgar.com/snap/1210036625039796944.png > > > > It's not because of the PRE tag, it's because of the long link w/no spaces in > > it: > > > > http://www.rapideuphoria.com/cgi-bin/guru.exu?refDoc=on&libDoc=on&otherDoc=on&keywords=euinc > > Yes, I can understand how a link will preclude wrapping. There seem to be other > messages in this thread indicating that a long link will CAUSE wrapping. I > can't "wrap" my head around that one. > > Not that I feel the need to explain, but I frequently scroll a page very large > (should I say very, very large?) and then ratchet back until the text is just > visible on one line for a majority of the page. It is the outliers that are > the problem. If they wrap, great, I have learned to adjust. If they don't > wrap, I must, MUST, ratchet back until the longest line is just visible and, > frankly, that just isn't big enough for me to relax in my recliner. Oh, wait! > Was I supposed to admit that? > > Mike Well, i'm a bigger fool than i thought i was. Kat -= B E G I N =- X-EUFORUM: 20518 Date: 2008 May 6 6:07 From: don cole Subject: Re: Button Aesthetics Judith Evans wrote: > > don cole wrote: > > > > > > Hello, My fellow Euphorians, > > > > How can I make the text of a Button look like this: > > > > C > > l > > o > > s > > e > > > > Enter the caption as C\nl\no\ns\ne and in Properties OtherStyles check multiline. > > judith > > with IDE? > > > > Don Cole Upon further review I found that C\nl\no\ns\ne produces: C l o s e Of course C\nl\no\ns\n e fixed it Don Cole -= B E G I N =- X-EUFORUM: 20519 Date: 2008 May 6 6:58 From: Alex Caracatsanis Subject: Case Construct Is it too late to ask if Eu4.0 could be designed to implement a case-endcase construct to replace the succession of if-else-endif's we use currently? I would like to have that available, but regret that I'm not capable of coding it myself. Is anyone else interested in this? Cheers Alex Caracatsanis -= B E G I N =- X-EUFORUM: 20520 Date: 2008 May 6 6:59 From: yuku Subject: Re: . or : for namespace? > > > What does this mean? it really means a . b:c > > > > But what can that really mean? Does it mean that c is a constant in namespace > > b > > It could be a constant or variable > > > and a.b:c means the same as a[b:c] ? > > Yes. So what you mean is maybe sometime in the future, . can be used as a shorthand for [] ? So we will be able to do a = {10,20,30} a.2 = 50 print(a.3) ? -= B E G I N =- X-EUFORUM: 20521 Date: 2008 May 6 7:41 From: Alex Caracatsanis Subject: Re: tilde [FROM . or : for namespace?] Derek Parnell wrote: > > The argument with respect to ease of typing can also be applied to other often > used Euphoria syntax elements, such as the double-quote, tilde, dollar and brace-pair, > not to mention the widely used '<', '>', '(', ')', and '%' characters. Have I overlooked something? I've never used the tilde in Eu... What does it do? Alex Caracatsanis -= B E G I N =- X-EUFORUM: 20522 Date: 2008 May 6 9:02 From: Jules Subject: sets for sequence.e? First I'd like to say thanks to Jeremy for all his hard work on the standard library. If there is room for a few more functions, I find the following useful, and believe others would too. I suggest they would fit better in sequence.e rather than math.e. They are quite general and IMHO are not really "math" functions. The first one is a type. set ==> ensures that the variable is a sequence wherein each of its members only occurs once in the sequence union ==> s = union (s, s) returns the union of two given sets intersection ==> s = intersection (s, s) returns the intersection of two given sets diff ==> s = diff (s, s) returns the difference of the two given sets; i.e., the inverse of the union (with the intersection removed) is_subset ==> i = is_subset (s, s) returns T (1) if the first set is a subset of the second is_superset ==> i = is_superset (s, s) returns T (1) if the first set is a superset of the 2nd These are all from Rod Jackson's "set.e". But I suggest one more (not included in his library): mk-set ==> s = mk_set(s) returns a sequence with duplicate elements removed, so each of its members occurs only once in the sequence. -= B E G I N =- X-EUFORUM: 20523 Date: 2008 May 6 9:07 From: Dan Moyer Subject: Re: Yay or Nay? Framed reference manual I don't really see the need for frames for the manual, but once I found that I could expand the left-hand "menu" to read it all, or diminish it so that it took up only 1/4 inch blank space, I don't really mind it either. BTW, the link in the menu "Language Manual", should be "Reference Manual". Dan Moyer -= B E G I N =- X-EUFORUM: 20524 Date: 2008 May 6 9:19 From: Jules Subject: Re: Yay or Nay? Framed reference manual I vote Yay for the Framed reference manual. -= B E G I N =- X-EUFORUM: 20525 Date: 2008 May 6 9:25 From: CChris Subject: Re: . or : for namespace? Mike wrote: > > > Hey Jeremy, > > Jeremy Cowgar wrote: > > -- snip > > > Previous arguments were summarized in my post: > > > > http://www.openeuphoria.org/EUforum/m20221.html > > > > Now, following up with that there was another, new complaint, against the . > > idea and that was by Mike and Matt agreed. I somewhat agree but would still > > be in favor of the . but, this is just something we need to work through until > > a final decision has been made. > > > > Their comment was that when the see a : in code that they wrote 6 months or > > 2 years ago that they will know it's a namespace and therefore the function > > is in another location. That they will be able to tell that right away. However, > > maybe in 2 years we will have dot'ed sequence access (whatever that will look > > like) and then you will not know without research if greeter.greeting = "Hello" > > is assigning a variable name greeting inside of the greeter namespace or if > > greeter is possibly a sequence. > > > > So, please read my prior post about the complaints against . and then the above > > and let's have another round of discussion please. If you are in favor or against > > it, please post your comments. > > > > Let me also point out that we are focusing a lot on the negatives and people > > who bring about points that are negative. There are many who want the . and > > think it's much clearer. Now, in the end we are all working together to make > > Euphoria better for us all. That's the goal, let's keep that in mind. > > That's true. > > I personally think that . is clearer, that is, until dot notation becomes available > for sequence access (or even, *structure* access, yeah..) and then we introduce > ambiguities. Forget 2 years, or even 6 months, problems with one's own code > will surface > in mere weeks. > > Now, here is an example of how silly it can get: > > include file.x as b > sequence a > .. > > a.b.c > > What does this mean? it really means a . b:c > > !GASP! > > If the dot is used for namespaces, sequence access, also using dots, will be > fraught > with such perils. > > If there is to be *any* hope of using dot notation generally, I would really > love to > see someone try and explain away the above example. > > I am sure there will be people who would prefer to use . as namespace but they > would also > like to use . for sequence access. Insisting on the former will jeopardize the > latter. > > or am I mistaken about this? > > > regards, > Mike I'm not getting your point. A namespace delineates a chunk of code (currently, that must be an entire file (sigh)) in which some identifiers are. In structured access for sequence, the structure type delineates a chunk of code (the field list declaration) in which some identifiers are. Why does the difference matter? CChris -= B E G I N =- X-EUFORUM: 20526 Date: 2008 May 6 9:38 From: CChris Subject: Re: Yay or Nay? Framed reference manual Jeremy Cowgar wrote: > > http://jeremy.cowgar.com/euphoria/index.htm > > I have not committed this to SVN yet. Would like to have some feedback. > > -- > Jeremy Cowgar > http://jeremy.cowgar.com Yay for frames. Please remove any reference to ed, it will put many potential users, used to Eclipse, Visual Studio, Notepa++ and such, off. We are no longer in 1993. Make it part of the stanard librry if you wish. Please review the "24 reasons" list. Again, we are no longer in 1993, and some of the arguments there are outdated. As far as the debugger is concerned, anyone who ever used a modern debugger will disagree with the statements. This list is a credibility liability as it stands. Perhaps a third of it is still valid, hardly more. CChris -= B E G I N =- X-EUFORUM: 20527 Date: 2008 May 6 10:11 From: CChris Subject: Re: sets for sequence.e? Jules wrote: > > First I'd like to say thanks to Jeremy for all his hard work on the standard > library. If there is room for a few more functions, I find the following useful, > and believe others would too. I suggest they would fit better in sequence.e > rather than math.e. They are quite general and IMHO are not really "math" functions. > > The first one is a type. > > set ==> ensures that the variable is a sequence wherein > > each of its members only occurs once in the sequence > > union ==> s = union (s, s) > > returns the union of two given sets > > > intersection ==> s = intersection (s, s) > > returns the intersection of two given sets > > > diff ==> s = diff (s, s) > > returns the difference of the two given sets; i.e., > > the inverse of the union (with the intersection removed) > > > is_subset ==> i = is_subset (s, s) > > returns T (1) if the first set is a subset of the second > > > is_superset ==> i = is_superset (s, s) > > returns T (1) if the first set is a superset of the 2nd > > These are all from Rod Jackson's "set.e". But I suggest one more (not included > in his library): > > mk-set ==> s = mk_set(s) > returns a sequence with duplicate elements removed, so > each of its members occurs only once in the sequence. There is also http://oedoc.free.fr/Fichiers/ESL/sets.zip It's quite more complete, as it handles maps between sets and composition laws. It was laid out and documented for inclusion in the ESL framework. But, if there is interest, I can edit the ESL stuff out. CChris -= B E G I N =- X-EUFORUM: 20528 Date: 2008 May 6 12:32 From: Jeremy Cowgar Subject: Re: sets for sequence.e? CChris wrote: > > > There is also > http://oedoc.free.fr/Fichiers/ESL/sets.zip > > It's quite more complete, as it handles maps between sets and composition laws. > It was laid out and documented for inclusion in the ESL framework. But, if there > is interest, I can edit the ESL stuff out. > Chris, If you would like to do that, thanks! Maybe it should be a new include, set.e and not part of sequence.e -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20529 Date: 2008 May 6 12:43 From: Derek Parnell Subject: Re: tilde [FROM . or : for namespace?] Alex Caracatsanis wrote: > > Derek Parnell wrote: > > > > The argument with respect to ease of typing can also be applied to other often > > used Euphoria syntax elements, such as the double-quote, tilde, dollar and brace-pair, > > not to mention the widely used '<', '>', '(', ')', and '%' characters. > > Have I overlooked something? I've never used the tilde in Eu... What does it > do? LOL ... sorry, I meant ampersand ... the tilde does the same thing but in another language (the D programming language). -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20530 Date: 2008 May 6 12:49 From: Jeremy Cowgar Subject: Manual Content (was: Yay or Nay? Framed reference manual) CChris wrote: > > Please remove any reference to ed, it will put many potential users, used to > Eclipse, Visual Studio, Notepa++ and such, off. We are no longer in 1993. Make > it part of the stanard librry if you wish. > > Please review the "24 reasons" list. Again, we are no longer in 1993, and some > of the arguments there are outdated. As far as the debugger is concerned, anyone > who ever used a modern debugger will disagree with the statements. This list > is a credibility liability as it stands. Perhaps a third of it is still valid, > hardly more. > I was only formatting/organizing data, I was not planning on changing data. I also saw several references that were out of date. Also, with the new standard library, probably some new things should be addressed in the manual. Is there someone who would want to help in this area? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20531 Date: 2008 May 6 12:55 From: Jeremy Cowgar Subject: Re: Manual Content (was: Yay or Nay? Framed reference manual) Jeremy Cowgar wrote: > > I was only formatting/organizing data, I was not planning on changing data. > I also saw several references that were out of date. Also, with the new standard > library, probably some new things should be addressed in the manual. > > Is there someone who would want to help in this area? > Oh, also, if your not up to altering/editing content, there is other work to do in the manuals. Currently, in the source .htx files for the manuals, there are many places that include styled tags. I would love to get rid of all styled tags and use a stylesheet for all styling. Font tags setting size and color are all through the system, others setting face type, etc... These should all be changed into div's or span's with an appropriate class descriptor. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20532 Date: 2008 May 6 13:04 From: Mike Subject: Re: . or : for namespace? CChris wrote: > > Mike wrote: > > -- snip > > Now, here is an example of how silly it can get: > > > > include file.x as b > > sequence a > > .. > > > > a.b.c > > > > What does this mean? it really means a . b:c > > > > !GASP! > > > > If the dot is used for namespaces, sequence access, also using dots, will be > > fraught > > with such perils. > > > > If there is to be *any* hope of using dot notation generally, I would really > > love to > > see someone try and explain away the above example. > > > > I am sure there will be people who would prefer to use . as namespace but they > > would also > > like to use . for sequence access. Insisting on the former will jeopardize the > > latter. > > > > or am I mistaken about this? > > > > > > regards, > > Mike > > I'm not getting your point. > > A namespace delineates a chunk of code (currently, that must be an entire file > (sigh)) in which some identifiers are. > In structured access for sequence, the structure type delineates a chunk of > code (the field list declaration) in which some identifiers are. > > Why does the difference matter? > > CChris It potentially attracts major obsfucation, eg: a.b.c.d could mean.. a[b][c][d] or a:b[c][d] or a[b:c][d] or a[b][c:d] or a:b[c:d] It is true that, technically, such a system could work because the compiler has enough info to figure it all out. But, we're not machines. This example assumes that we are accessing Euphoria sequences and that we really want to have the freedom to put namespace references anywhere in the dot-chain, not just a single one right at the head of the dot-chain. And even then, ambiguity remains, eg.. a.b.c.d could mean.. a[b][c][d] or a:b[c][d] However, things appear less problematic for future genuine (C) structures, because, as you point out, the field declarations are specified. Nevertheless, there may be instances where it would be useful to mix structure fields and normal variables (which may include namespaced references) along the same dot-chain. Some structures contain arrays. Wouldn't it great to be able to iterate over such a thing using a for loop? Eg: struct complex double real double img end struct struct any list complex[256] end struct any ptr = address() for i = 1 to 256 do ptr.i.real = whatever_real() ptr.i.img = 0.0 end for So, basically we have : obsfucation OR lack of freedom + nice looking vs clarity + freedom - looks (the freedom referred to is a future freedom affected by design decisions being made now) regards, Mike PS: I hope my examples are clear enough -= B E G I N =- X-EUFORUM: 20533 Date: 2008 May 6 13:18 From: Marco Achury Subject: Re: Yay or Nay? Framed reference manual I agree documentation with frames unsing This will give compatibility with any browser, even cell phones. I don't want javascript code there. +-+-+-+-+-+-+-+ Marco A. Achury Caracas, Venezuela -= B E G I N =- X-EUFORUM: 20534 Date: 2008 May 6 13:19 From: Michael J. Sabal <m_sabal at yahoo?c?m> Subject: Re: Yay or Nay? Framed reference manual [snip all] Jeremy, The HTML looks really nice, regardless of whether you're using frames or div. Having all the hyperlinks makes it easy to find what you're looking for, too. But, is it possible to also have a plain text version of the docs? When I'm using ed.ex, a lot of times it's easier to just ESC-C and ESC-F to get the part of the document I'm looking for, and have both parts on the screen at the same time without fussing over rearranging and aligning a browser and text editor, or having the ALT-TAB and memorize for a few seconds what I need. It's just a productivity thing. Every time I have to touch the mouse, it goes down. -= B E G I N =- X-EUFORUM: 20535 Date: 2008 May 6 13:20 From: CChris <christian.cuvier at agri?u?ture.gouv.fr> Subject: Re: sets for sequence.e? Jeremy Cowgar wrote: > > CChris wrote: > > > > > > There is also > > <a href="http://oedoc.free.fr/Fichiers/ESL/sets.zip">http://oedoc.free.fr/Fichiers/ESL/sets.zip</a> > > > > It's quite more complete, as it handles maps between sets and composition laws. > > It was laid out and documented for inclusion in the ESL framework. But, if there > > is interest, I can edit the ESL stuff out. > > > > Chris, > > If you would like to do that, thanks! Maybe it should be a new include, set.e > and not part of sequence.e > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Ok. Also, I'll have to oduce a doc using the Eu sandards, since currently the include is self-documenting using EuDoc by D. Newhall. I'll do this when win32lib 0.70.4a is released, like 10 days from now. CChris -= B E G I N =- X-EUFORUM: 20536 Date: 2008 May 6 13:24 From: Alex Caracatsanis <SunPsych at NCab?e.com.au> Subject: Re: tilde [FROM . or : for namespace?] - END Derek Parnell wrote: > > I meant ampersand ... the tilde does the same thing but in another > language (the D programming language). No worries Derek - sweet. Alex -= B E G I N =- X-EUFORUM: 20537 Date: 2008 May 6 13:24 From: Jeremy Cowgar <jeremy at c?w?ar.com> Subject: Re: Yay or Nay? Framed reference manual Michael J. Sabal wrote: > > [snip all] > Jeremy, > The HTML looks really nice, regardless of whether you're using frames or > div. Having all the hyperlinks makes it easy to find what you're looking for, > > too. But, is it possible to also have a plain text version of the docs? > When I'm using ed.ex, a lot of times it's easier to just ESC-C and ESC-F to > get the part of the document I'm looking for, and have both parts on the > screen at the same time without fussing over rearranging and aligning a > browser and text editor, or having the ALT-TAB and memorize for a few seconds > what I need. It's just a productivity thing. Every time I have to touch the > > mouse, it goes down. Yes, plain text docs are still generated w/no problem. I was just updating the HTML organization and appearance. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20538 Date: 2008 May 6 13:30 From: CChris <christian.cuvier at agri?ultu?e.gouv.fr> Subject: Re: . or : for namespace? Mike wrote: > > CChris wrote: > > > > Mike wrote: > > > > -- snip > > > Now, here is an example of how silly it can get: > > > > > > include file.x as b > > > sequence a > > > .. > > > > > > a.b.c > > > > > > What does this mean? it really means <drum roll> a . b:c > > > > > > !GASP! > > > > > > If the dot is used for namespaces, sequence access, also using dots, will be > > > fraught > > > with such perils. > > > > > > If there is to be *any* hope of using dot notation generally, I would really > > > love to > > > see someone try and explain away the above example. > > > > > > I am sure there will be people who would prefer to use . as namespace but they > > > would also > > > like to use . for sequence access. Insisting on the former will jeopardize the > > > latter. > > > > > > or am I mistaken about this? > > > > > > > > > regards, > > > Mike > > > > I'm not getting your point. > > > > A namespace delineates a chunk of code (currently, that must be an entire file > > (sigh)) in which some identifiers are. > > In structured access for sequence, the structure type delineates a chunk of > > code (the field list declaration) in which some identifiers are. > > > > Why does the difference matter? > > > > CChris > > It potentially attracts major obsfucation, eg: > > a.b.c.d could mean.. > > a[b][c][d] or a:b[c][d] or a[b:c][d] or a[b][c:d] or a:b[c:d] > > It is true that, technically, such a system could work because the compiler > has > enough info to figure it all out. But, we're not machines. > > This example assumes that we are accessing Euphoria sequences and that we really > want to have the freedom to put namespace references anywhere in the dot-chain, > not just a single one right at the head of the dot-chain. And even then, ambiguity > remains, eg.. > > a.b.c.d could mean.. > > a[b][c][d] or a:b[c][d] > > > However, things appear less problematic for future genuine (C) structures, because, > as you point out, the field declarations are specified. Nevertheless, there > may be > instances where it would be useful to mix structure fields and normal variables > (which may include namespaced references) along the same dot-chain. Some structures > contain arrays. Wouldn't it great to be able to iterate over such a thing using > a > for loop? Eg: > > struct complex > double real > double img > end struct > > struct any > list complex[256] > end struct > > any ptr = address() > > for i = 1 to 256 do > ptr.i.real = whatever_real() > ptr.i.img = 0.0 > end for > > > So, basically we have : > > obsfucation OR lack of freedom + nice looking > Where? Namespaces are not that many. Do you mean you don't know which identifier is a namespace? Really? CChris > vs > > clarity + freedom - looks > > > (the freedom referred to is a future freedom affected by design decisions being > made now) > > regards, > Mike > > PS: I hope my examples are clear enough -= B E G I N =- X-EUFORUM: 20539 Date: 2008 May 6 13:40 From: Marco Achury <achury at cantv.?et> Subject: Re: Manual Content (was: Yay or Nay? Framed reference manual) Jeremy Cowgar wrote: > Oh, also, if your not up to altering/editing content, there is other work to > do in the manuals. Currently, in the source .htx files for the manuals, there > are many places that include styled tags. I would love to get rid of all styled > tags and use a stylesheet for all styling. Font tags setting size and color > are all through the system, others setting face type, etc... These should all > be changed into div's or span's with an appropriate class descriptor. If you use style sheet will be a lot more complicated to create the .doc files. +-+-+-+-+-+-+-+ Marco A. Achury Caracas, Venezuela -= B E G I N =- X-EUFORUM: 20540 Date: 2008 May 6 14:18 From: c.k.lester <euphoric at ?klester.?om> Subject: Re: Parsing Challenge Kat wrote: > > getxml() in strtok. How would I handle the divs with class and id attributes? Is something like the following valid? s = getxml("<div","/",0) -= B E G I N =- X-EUFORUM: 20541 Date: 2008 May 6 14:19 From: Jeremy Cowgar <jeremy at c?wgar?com> Subject: Re: Manual Content (was: Yay or Nay? Framed reference manual) Marco Achury wrote: > > If you use style sheet will be a lot more complicated to create the .doc files. > The .doc files actually strip all HTML tags, they are not dependent upon the HTML styling. So, it should have no effect on the output of the .doc files. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20542 Date: 2008 May 6 14:20 From: c.k.lester <euphoric at ckle?ter.co?> Subject: Re: Parsing Challenge Jeremy Cowgar wrote: > > Here's quick code w/little error checking, but it works fine on your example > HTML. Jeremy, using your code, how would I determine the hierarchy of the tags (parents and children)? -= B E G I N =- X-EUFORUM: 20543 Date: 2008 May 6 14:21 From: c.k.lester <euphoric at c??ester.com> Subject: Re: Parsing Challenge Bernie Ryan wrote: > > Download mixedlib.e library in archive it has function for > parsing. Bernie, same question for you. :) How would I determine the hierarchy of the tags (parents, children)? I need to know the nesting in order to build a database of the child/parent structure. -= B E G I N =- X-EUFORUM: 20544 Date: 2008 May 6 14:23 From: Jeremy Cowgar <jeremy at cowg?r.co?> Subject: Compiling 4.0 Tutorial I made a tutorial on the Wiki on how to compile 4.0 on your own machine for a few people in IRC. It explains compiling on Windows. http://euwiki.ayo.biz/CompilingEuphoriaFourOh It should take you from scratch, no compiler, no Euphoria, no SVN and in the end have a working 4.0 install. I say it in the wiki page, and I'll say it here. 4.0 is under very active development, it has not been released even as an alpha. API will change and bugs WILL exist. On the wiki page, I have a "Why?" and "Why not?" section about why to install or why not to install 4.0 :-D -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20545 Date: 2008 May 6 14:31 From: Jeremy Cowgar <jeremy at cow??r.com> Subject: Re: Parsing Challenge c.k.lester wrote: > > Jeremy Cowgar wrote: > > > > Here's quick code w/little error checking, but it works fine on your example > > HTML. > > Jeremy, using your code, how would I determine the hierarchy of the tags > (parents and children)? You didn't tell us you needed that :-) You may want to check out stack.e in 4.0 and push onto the stack when a new div is hit, and pop off the stack when a /div is hit. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20546 Date: 2008 May 6 14:39 From: Jeremy Cowgar <jeremy at c??gar.com> Subject: Re: . or : for namespace? CChris wrote: > > > Where? > Namespaces are not that many. Do you mean you don't know which identifier is > a namespace? Really? This is a very good point. Who is going to make a structure that looks like: <eucode> a.b.c.d.e = "John" </eucode> If you do, you deserve to be confused when you go back and look at your code. Here's a realistic example: <eucode> include datetime.e as dt struct emp emp.name.last = "Doe" emp.name.first = "John" emp.age = 35 emp.dob = dt.new(1965, 10, 5, 0, 0, 0) </eucode> Anyone can create a convoluted example such as: <eucode> a.b.c:d.o.z.a.z.x.i.o:g = 12 </eucode> but who's going to do that? Fact of the matter is your going to use the same namespaces all the time. For instance: <eucode> include stack.e as sk include map.e as map include datetime.e as dt include set.e as set </eucode> This all seems pretty easy to me. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20547 Date: 2008 May 6 14:40 From: Shawn Pringle <shawn.pringle at ?mail.com> Subject: Re: Parsing Challenge The better question is how can you include and call perl modules from EUPHORIA? It probably is less work then reimplementing one or two perl modules in EUPHORIA. Shawn Pringle -= B E G I N =- X-EUFORUM: 20548 Date: 2008 May 6 15:15 From: Kat <KAT12 at ?oosahs?net> Subject: Re: Parsing Challenge c.k.lester wrote: > > Kat wrote: > > > > getxml() in strtok. > > How would I handle the divs with class and id attributes? Is something like > the following valid? > > s = getxml("<div","/",0) The short answer is "no", but mostly because getxml() was written when these tags had no parameter fields like <div id="doc3" class="yui-t2">. And you don't care about the contents of <div*<div> anyhow, and i don't want to stop everything right now and recode it (possibly breaking code that works as is) to handle params, so... The resulting answer to the problem becomes use parses() in strtok.e v3, which isn't released (but see below). In it, do result = parses(yourhtmlfile,"<div") and the start of each nested sequence in result ({"","","",etc}) will be the parameters of the <div*> tag, plus extra stuff you can ignore. I do this for finding "href" all day now. For your example, the first seq will be: " id="doc3" class="yui-t2">\n " the 2nd one will be: " id="hd">\n " etc, and you use a for loop = 1 to length(result) to get params = result[loop][1..match(">",result[loop])-1] This way, you can spec which tag name, <div*, <table*, <etc* that you want the param list for, as well as which one, result[x]. If the file does not start with the tag you are looking for, then obviously the first param list for that tag starts at result[2]. <eucode> global function find_alls(sequence sep, sequence text) -- Kat July 9 2005 -- return a list of all indexes where what is found in s sequence list, found atom place, step, whatlen -- place must be atom for "while" line trace(1) list = {} for loop = 1 to length(sep) do place = match(sep[loop],text) while place do found = text[place..place+length(sep[loop])-1] list = append(list,{place,found}) text[place] = ' ' place = match(sep[loop],text) end while end for list = strtoksort(list) return list end function ------------------------------------------------------------------ global function parses(sequence s, sequence c) -- Kat July 9 2005 atom lenc, index sequence parsed, where object junk atom keep , ci if equal(s,"") then return "" end if if equal(c,"") then return "" end if keep = 0 ci = 0 if sequence(c) and length(c) = 2 then if match("i",c[1]) then ci = 1 end if if match("k",c[1]) then keep = 1 end if if ci or keep then c = c[2] end if end if if (length(c) >= length(s)) then return "" end if parsed = {} lenc = length(c) if ci then where = find_allsci(c,s) else where = find_alls(c,s) end if if keep then if where[1][1] = 1 then lastkeep = 2 else lastkeep = 1 end if end if where = {{1,""}} & where & {{length(s)+1,""}} trace(1) if equal(where,"") then return{s} end if if keep then for loop = 2 to length(where)-1 do lastseparators = lastseparators & {where[loop][2]} end for for loop = 1 to length(where)-1 do parsed = parsed & { s[where[loop][1]+length(where[loop][2])..where[loop+1][1]-1] } --& {where[loop+1][2]} --if loop = length(where)-2 then exit end if end for else for loop = 1 to length(where)-1 do parsed &= {s[where[loop][1]+length(where[loop][2])..where[loop+1][1]-1]} end for end if return parsed end function --parses() </eucode> Add the global vars and such as needed, and remove the trace(1), etc.. Yep, July 9, 2005. I been holding onto it, not wanting to get flamed for releasing it ever since then. Kat -= B E G I N =- X-EUFORUM: 20549 Date: 2008 May 6 16:23 From: Mike777 <anon4321 at ?mail.c?m> Subject: Re: Yay or Nay? Framed reference manual Kat wrote: > > Mike777 wrote: > > > > Jeremy Cowgar wrote: > > > > > > Mike777 wrote: > > > > > > > > How big did you make the font? Go bigger. Bigger still. And then bigger. > > > > What do you get? > > > > > > > > > > Wow, I had to go huge before it would start wrapping. I hope nobody ever reads > > > web pages that large. > > > > Uh, we do. > > > > > <a href="http://jeremy.cowgar.com/snap/1210036625039796944.png">http://jeremy.cowgar.com/snap/1210036625039796944.png</a> > > > > > > It's not because of the PRE tag, it's because of the long link w/no spaces in > > > it: > > > > > > <a href="http://www.rapideuphoria.com/cgi-bin/guru.exu?refDoc=on&libDoc=on&otherDoc=on&keywords=euinc">http://www.rapideuphoria.com/cgi-bin/guru.exu?refDoc=on&libDoc=on&otherDoc=on&keywords=euinc</a> > > > > Yes, I can understand how a link will preclude wrapping. There seem to be other > > messages in this thread indicating that a long link will CAUSE wrapping. I > > can't "wrap" my head around that one. > > > > Not that I feel the need to explain, but I frequently scroll a page very large > > (should I say very, very large?) and then ratchet back until the text is just > > visible on one line for a majority of the page. It is the outliers that are > > the problem. If they wrap, great, I have learned to adjust. If they don't > > wrap, I must, MUST, ratchet back until the longest line is just visible and, > > frankly, that just isn't big enough for me to relax in my recliner. Oh, wait! > > Was I supposed to admit that? > > > > Mike > > Well, i'm a bigger fool than i thought i was. Aren't we all? My point is and remains that accessibility is enough reason to traverse this path. Any one individual's infirmities (or lack thereof) do not create the need (or alleviate it). Mike -= B E G I N =- X-EUFORUM: 20550 Date: 2008 May 6 17:07 From: Matt Lewis <matthewwalkerlewis at g?a?l.com> Subject: Re: . or : for namespace? CChris wrote: > > Mike wrote: > > > > So, basically we have : > > > > obsfucation OR lack of freedom + nice looking > > > > Where? > Namespaces are not that many. Do you mean you don't know which identifier is > a namespace? Really? And 640K should be enough for anyone. Seriously, you can't imagine a case where there might be a namespace and a variable whose names collide? While we're at it, why don't we get rid of parentheses and just use square brackets everywhere? <eucode> puts[1, "Hello, world!\n"] </eucode> Matt -= B E G I N =- X-EUFORUM: 20551 Date: 2008 May 6 17:32 From: Mike777 <anon4321 at g?ail?com> Subject: win32Lib - newUIObj bug? I am using Judith's IDE. I establish my main Windows through the IDE. All other controls are built using newUIObj. It doesn't appear to me that the id's of the defined windows are available to the newUIObj procedure. When I set trace on and find myself in that procedure, when I type a ? and then enter the name of a window, I get a message saying that it is undefined. In my program, when I get to the Owner portion of the newUIObj procedure at around line 2081 of w32forms.ew I find that none of my window variables are available to set the parent. The parent is therefore set to be zero, and I end up with a race condition when the program executes the CreateEx function at around line 2400. My line numbers may not be exact because I've peppered the procedure at the moment with message_boxes. When I force the lOwner variable value to be "110" with the following code, the createex works just fine: if compare(lData,"MySpecialWindow") = 0 then lOwner = 110 end if Is it a bug that the newUIObj routine doesn't seem to be able to execute the: lOwner = getNameId(w32trim(lData)) line and get back a valid id (it always returns zero)? Thanks Mike -= B E G I N =- X-EUFORUM: 20552 Date: 2008 May 6 17:57 From: Jeremy Cowgar <jeremy at co?gar.c?m> Subject: Re: . or : for namespace? Matt Lewis wrote: > > And 640K should be enough for anyone. Seriously, you can't imagine a case > where there might be a namespace and a variable whose names collide? > That should err out, right? <eucode> include misc.e as m sequence m m = 10 </eucode> a name is expected here sequence m -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20553 Date: 2008 May 6 19:40 From: Matt Lewis <matthewwalkerlewis at g?ai?.com> Subject: Re: . or : for namespace? Jeremy Cowgar wrote: > > Matt Lewis wrote: > > > > And 640K should be enough for anyone. Seriously, you can't imagine a case > > where there might be a namespace and a variable whose names collide? > > > > That should err out, right? > > <eucode> > include misc.e as m > > sequence m > m = 10 > </eucode> > > a name is expected here > sequence m No, because this doesn't look like a namespace. But if we assume that we can use a dot for sequence access: <eucode> include foo.e as m integer m, n m = 1 n = 3 sequence s s = { {1,2,3,4}, {5,6,7,8}, {9,10,11,12} } ? s.m -- {1,2,3,4} ? s.m:n -- {5,6,7,8} ? s.m.n -- either {5,6,7,8} *or* 3 -- foo.e global integer n n = 2 </eucode> So, what does s.m.n mean? It could mean either s[1][3] or s[2]. I suppose that we could disallow using a fully qualified reference with the dot notation. Frankly, I'm not big on this sort of dot notation, either. I don't see anything wrong with using square brackets. I think the dot notation would be best reserved for implementing some sort of structured access/OO. Matt -= B E G I N =- X-EUFORUM: 20554 Date: 2008 May 6 19:43 From: Greg Haberek <ghaberek at gm?il.?om> Subject: wxCaret Matt, I added the routines for wxCaret to wxEuphoria.cpp. I hope I did it right this time, everything compiled fine. <eucode> object WXEUAPI new_wxCaret( object params ) { int parent = get_int( params, 1 ); int x = get_int( params, 2 ); int y = get_int( params, 3 ); wxCaret * caret = new wxCaret( ((wxWindow*) parent), x, y ); return BOX_INT( caret ); } object WXEUAPI get_caret_blink_time( int caret ) { return ((wxCaret*) caret)->GetBlinkTime(); } object WXEUAPI get_caret_position( int caret ) { wxPoint pos = ((wxCaret*) caret)->GetPosition(); s1_ptr ret = NewS1(2); ret->base[1] = pos.x; ret->base[2] = pos.y; return MAKE_SEQ(ret); } object WXEUAPI get_caret_size( int caret ) { wxSize size = ((wxCaret*) caret)->GetSize(); s1_ptr ret = NewS1(2); ret->base[1] = size.GetWidth(); ret->base[2] = size.GetHeight(); return MAKE_SEQ(ret); } object WXEUAPI get_caret_window( int caret ) { return BOX_INT( ((wxCaret*) caret)->GetWindow() ); } void WXEUAPI hide_caret( int caret ) { ((wxCaret*) caret)->Hide(); } object WXEUAPI caret_isok( int caret ) { return ((wxCaret*) caret)->IsOk(); } object WXEUAPI caret_isvisible( int caret ) { return ((wxCaret*) caret)->IsVisible(); } void WXEUAPI move_caret( int caret, int x, int y ) { ((wxCaret*) caret)->Move( x, y ); } void WXEUAPI set_caret_blink_time( int caret, int milliseconds ) { ((wxCaret*) caret)->SetBlinkTime( milliseconds ); } void WXEUAPI set_caret_size( int caret, int width, int height ) { ((wxCaret*) caret)->SetSize( width, height ); } void WXEUAPI show_caret( int caret ) { ((wxCaret*) caret)->Show( true ); } </eucode> Here are the exports: EXPORT new_wxCaret=_new_wxCaret EXPORT caret_isok=_caret_isok EXPORT caret_isvisible=_caret_isvisible EXPORT get_caret_blink_time=_get_caret_blink_time EXPORT get_caret_position=_get_caret_position EXPORT get_caret_size=_get_caret_size EXPORT get_caret_window=_get_caret_window EXPORT hide_caret=_hide_caret EXPORT move_caret=_move_caret EXPORT set_caret_blink_time=_set_caret_blink_time EXPORT set_caret_size=_set_caret_size EXPORT show_caret=_show_caret Have you ever looked at a word so many times, you're not sure if it's a word anymore? All I see is "caret, caret, caret caret..." I'm getting hungry! :-p -Greg -= B E G I N =- X-EUFORUM: 20555 Date: 2008 May 6 20:08 From: Jeremy Cowgar <jeremy at cow?ar?com> Subject: Re: . or : for namespace? Matt Lewis wrote: > > > That should err out, right? > > > > <eucode> > > include misc.e as m > > > > sequence m > > m = 10 > > </eucode> > > > > a name is expected here > > sequence m > > No, because this doesn't look like a namespace. Matt, The above *does* err out. That error message is pasted from the actual output of that program. > But if we assume that we can use a dot for sequence access: > <eucode> > include foo.e as m > > integer m, n > m = 1 > n = 3 > sequence s > s = { {1,2,3,4}, {5,6,7,8}, {9,10,11,12} } > > ? s.m -- {1,2,3,4} > ? s.m:n -- {5,6,7,8} > ? s.m.n -- either {5,6,7,8} *or* 3 > > -- foo.e > global integer n > n = 2 > </eucode> This will not work. m is a namespace, you cannot have integer m, and that's current code. Now, also, please see my post: http://www.openeuphoria.org/EUforum/m20548.html That will address the above example a little more. > So, what does s.m.n mean? It could mean either s[1][3] or s[2]. I > suppose that we could disallow using a fully qualified reference with the > dot notation. Frankly, I'm not big on this sort of dot notation, either. > I don't see anything wrong with using square brackets. > > I think the dot notation would be best reserved for implementing some sort > of structured access/OO. > Let's dive into the example. Let's say we do have dotted structure access. What is it going to access? In your example above: <eucode> ? s.m:n -- {5,6,7,8} </eucode> When reading this with . for structure and : for namespace. "s" is a variable of some sort. Now, a variable can contain a namespace? That doesn't make sense. You are accessing a variable, so inside the structure, there can be multiple "n" variables that you have to prefix them with a namespace? That would mean: <eucode> ? s.m:n -- {5,6,7,8} ? s.n:n -- {6,7,8,9} ? s.l:n -- {7,8,9,10} </eucode> How will that actually work? I'm not certain it makes sense to even allow that to work. How you you define the structure s? <eucode> struct s s = { namespace m { n, o, p }, namespace n { n, o, p }, namespace o { n, o, p } } </eucode> And if you could do that, I think it's a terrible thing. What purpose could it possibly solve? I may be totally wrong. If so, please give me an example. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20556 Date: 2008 May 6 20:21 From: Matt Lewis <matthewwalkerlewis at ?mail.com> Subject: Re: wxCaret Greg Haberek wrote: > > Matt, > > I added the routines for wxCaret to wxEuphoria.cpp. I hope I did it right > this time, everything compiled fine. It compiled? Ship it! <eucode> object WXEUAPI new_wxCaret( object params ) { int parent = get_int( params, 1 ); int x = get_int( params, 2 ); int y = get_int( params, 3 ); wxCaret * caret = new wxCaret( ((wxWindow*) parent), x, y ); return BOX_INT( caret ); } </eucode> Looks good, except that you also need to deref and sequence that's passed. You can use wxDerefDS if you know it's a double or a sequence, and wxDeRef if it's an atom that might be an integer: wxDeRefDS( params ); wxDeRef( params ); You can actually make these calls at the top of the function. wxEuphoria won't dereference these (they always have a refcount of at least 2 or 3 by the time wxEuphoria sees it). Euphoria will free it after control returns from the call. If you don't do this, you'll end up leaking memory. I added you as a developer to the project, so go ahead and make those changes and commit... Matt -= B E G I N =- X-EUFORUM: 20557 Date: 2008 May 6 20:29 From: Mike Sywensky <michaelsy at yahoo?com> Subject: Re: wxEditor Project Greg Haberek wrote: > > > As a change of pace, I'm starting to host some of my projects on SourceForge. > My goal is to get others involved with my projects, so that many of my ideas > can get off the ground. Otherwise, I seem to start projects on my own only to > have them fizzle out as I lose interest. > > The first project of this is wxEditor. With Pete having dropped off the face > of the planet (and Edita with him), and Euphoria 4.0 on the horizon, I figured > I'd strike while the iron's hot. I just registered the project, so it's still > in pending status. I'll collect the code I have so far and get it posted once > the project's approved. > > <a href="http://sourceforge.net/projects/wxeditor/">http://sourceforge.net/projects/wxeditor/</a> > > > Matt... this means I (we?) need to get wxStyledTextControl working. My efforts > have been rather fruitless, and I just end up mangling C++ code in hopes I'll > get something working. Right now, wxEditor operates as a basic text editor with > multiple tabs, using wxNotebook and wxTextCtrl. I'd like to get the syntax highlighting > working from the get-go. I see that as a major benefit to a code editor. > > > -Greg I've been thinking about creating an editor as well and checked out your code yesterday. Very nice! What has stopped me is the same issue you have... no real editor component. From what I read, wxSTC uses a pretty old version of scintilla. It may make more sense to wrap wxScintilla instead, although the only Windows compiler supported is Visual C++. If you are limiting the scope of the editor to Euphoria, either component would do, but I was planning on targeting SQL as well, since for me they go hand in hand. This would require unicode support, which (I believe) wxSTC does not have. If someone figures out how to compile wxScintilla using watcom, I would be willing to help wrap it. -= B E G I N =- X-EUFORUM: 20558 Date: 2008 May 6 20:35 From: Greg Haberek <ghaberek at ?mai?.com> Subject: Re: wxEditor Project Mike Sywensky wrote: > > I've been thinking about creating an editor as well and checked out your code > yesterday. Very nice! > > What has stopped me is the same issue you have... no real editor component. > > From what I read, wxSTC uses a pretty old version of scintilla. It may make > more sense > to wrap wxScintilla instead, although the only Windows compiler supported is > Visual C++. > > If you are limiting the scope of the editor to Euphoria, either component would > do, but > I was planning on targeting SQL as well, since for me they go hand in hand. > This would > require unicode support, which (I believe) wxSTC does not have. > > If someone figures out how to compile wxScintilla using watcom, I would be willing > to > help wrap it. I'm in the process of adding caret support to wxEuphoria. From there, I'll hopefully mock up my own editor component. I may try to use Pete's Edita as an overall model, since his editor is written from scratch in ARWEN. I'd prefer not to limit wxEditor to Euphoria. If I've got my own control layed out, I could easily adapt it to any type of syntax highlighting. -Greg -= B E G I N =- X-EUFORUM: 20559 Date: 2008 May 6 20:35 From: Jeremy Cowgar <jeremy at cow?ar.co?> Subject: Re: ed problem Jules wrote: > > Well, I'm making some progress on this, Both the location of the file and it's > MIME type are affecting whether ed crashes or not. If I try to save a file of > of MIME type text/x-vhdl AND it's in the eu directory, ed prompts me to convert > the file and doesn't crash (the same file will crash ed if trying to save it > when it's NOT in the eu directory). BUT, another file (which IS in the eu directory) > and is of MIME type text/plain, WILL crash ed. Both files have the .exw file > extension. Because of this, I decided to use ed today in Linux. I've been using it all day today w/o an issue. I created some DOS files and when I go to save, it asks about line endings and I have no problem with it. I've created them both inside and outside the eu dir (EUDIR I assume is what you mean?). How do you set the mime-type of a file? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20560 Date: 2008 May 6 21:15 From: Matt Lewis <matthewwalkerlewis at g?ai?.com> Subject: Re: . or : for namespace? Jeremy Cowgar wrote: > > The above *does* err out. That error message is pasted from the actual output > of that program. That's what I get for not testing. Thinking about it, though, it does make sense, because the namespace is a symbol in the same scope as m. > Now, also, please see my post: > > http://www.openeuphoria.org/EUforum/m20548.html > > That will address the above example a little more. I think you meant m20546? Unless you've changed your name... > > > So, what does s.m.n mean? It could mean either s[1][3] or s[2]. I > > suppose that we could disallow using a fully qualified reference with the > > dot notation. Frankly, I'm not big on this sort of dot notation, either. > > I don't see anything wrong with using square brackets. > > > > I think the dot notation would be best reserved for implementing some sort > > of structured access/OO. > > > > Let's dive into the example. Let's say we do have dotted structure access. What > is it going to access? In your example above: > > <eucode> > ? s.m:n -- {5,6,7,8} > </eucode> > > When reading this with . for structure and : for namespace. > > "s" is a variable of some sort. Now, a variable can contain a namespace? That > doesn't make sense. You are accessing a variable, so inside the structure, there > can be multiple "n" variables that you have to prefix them with a namespace? > That would mean: There's a lot to hash out about what dotted access might mean. Some have used a dot as syntactic sugar for enclosing something within square brackets. I don't think that's a good idea. I was just using namespaces to qualify the subscripts. So, I retract the error argument, since it's already an error. But I still think the distinctiveness of : vs . is enough to keep the : for namespaces. Matt -= B E G I N =- X-EUFORUM: 20561 Date: 2008 May 6 21:15 From: don cole <doncole at pacbell??et> Subject: Re: . or : for namespace? Matt Lewis wrote: > > CChris wrote: > > > > Mike wrote: > > > > > > So, basically we have : > > > > > > obsfucation OR lack of freedom + nice looking > > > > > > > Where? > > Namespaces are not that many. Do you mean you don't know which identifier is > > a namespace? Really? > > And 640K should be enough for anyone. Seriously, you can't imagine a case > where there might be a namespace and a variable whose names collide? > > While we're at it, why don't we get rid of parentheses and just use square > brackets everywhere? > <eucode> > puts[1, "Hello, world!\n"] > </eucode> > Matt s="[hello world]\n" puts[1,s[1..$-1]] Seems this would cause some confusion somewhere. Maybe in the interpeter. Don Cole -= B E G I N =- X-EUFORUM: 20562 Date: 2008 May 6 21:17 From: Matt Lewis <matthewwalkerlewis at gma?l.?om> Subject: Re: wxEditor Project Greg Haberek wrote: > > I'm in the process of adding caret support to wxEuphoria. From there, I'll hopefully > mock up my own editor component. I may try to use Pete's Edita as an overall > model, since his editor is written from scratch in ARWEN. > > I'd prefer not to limit wxEditor to Euphoria. If I've got my own control layed > out, I could easily adapt it to any type of syntax highlighting. I agree. My plan was to use Kate's syntax files, so from the get-go, I'd have a lot of stuff to work with. Matt -= B E G I N =- X-EUFORUM: 20563 Date: 2008 May 6 21:29 From: Jeremy Cowgar <jeremy at cowgar.?o?> Subject: Re: . or : for namespace? Matt Lewis wrote: > > > I think you meant m20546? Unless you've changed your name... > Ops, your right. Didn't mean to take credit for Kat's post :-) http://www.openeuphoria.org/EUforum/m20546.html What do you think? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20564 Date: 2008 May 6 21:58 From: Larry Miller <larrymiller at saskte?.n?t> Subject: Faster peek_ustring() function This is a faster peek_ustring() function than that in machine.e on SourceForge <eucode> global function peek_ustring(atom addr) atom ptr ptr = addr while peek2u(ptr) do ptr += 2 end while return peek2u({addr, (ptr - addr) / 2}) end function </eucode> Larry Miller -= B E G I N =- X-EUFORUM: 20565 Date: 2008 May 6 22:30 From: Mike <vulcan at wi?.?o.nz> Subject: Re: . or : for namespace? CChris wrote: > > Mike wrote: > > > > CChris wrote: > > > > > > Mike wrote: > > > > -- snip > > So, basically we have : > > > > obsfucation OR lack of freedom + nice looking > > > > Where? > Namespaces are not that many. Do you mean you don't know which identifier is > a namespace? Really? > > CChris Yes. And you don't either. Noone does. That's the point. I know that you're smart enough to _quickly_ figure out what's going on but not all of us are so gifted. And I don't think we should have to be. I read somewhere that about 70% of programming is maintenance rather than just coding. So, it is important to easily comprehend program texts. Jeremy (correctly) predicts that namespaces will become much more common. Defining the . instead of : as the namespace operator now, will make it impossible to later avoid confusing references if the . is then used for sequence access. It should be pointed out that by having different operators, we can preserve the unwritten assumption that the number of nesting levels should correspond to the number of nesting operators. There are good semantic benefits to keeping : as namespace operator. The only advantage for using . is that it is nicer looking. I have yet to see advocates of . present an argument stronger than that. Think I'm full of horse droppings? Well, you're welcome to prove me wrong. regards, Mike -= B E G I N =- X-EUFORUM: 20566 Date: 2008 May 6 22:56 From: Jeremy Cowgar <jeremy at cowgar?co?> Subject: Re: . or : for namespace? Mike wrote: > > > Yes. And you don't either. Noone does. That's the point. > Please comment on my post: http://www.openeuphoria.org/EUforum/m20546.html > There are good semantic benefits to keeping : as namespace operator. The only > advantage for using . is that it is nicer looking. I have yet to see advocates > of . present an argument stronger than that. > > Think I'm full of horse droppings? Well, you're welcome to prove me wrong. : blends right in with text, that's why others have not adopted it. lik:this. lik.this does not. Why do other languages that have the . as the namespace, class, struct delimiter not have problems? We can look at history and tell this is not going to be a problem. No sense in trying to predict the future. Preiod is more natural, easier to read for scanning and easier for typing. But please, comment on my post that I referred to above. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20567 Date: 2008 May 7 1:32 From: Derek Parnell <ddparnell at ?igpond.co?> Subject: Re: . or : for namespace? Jeremy Cowgar wrote: > Please comment on my post: > > <a href="http://www.openeuphoria.org/EUforum/m20546.html">http://www.openeuphoria.org/EUforum/m20546.html</a> > : blends right in with text, that's why others have not adopted it. lik:this. > lik.this does not. Your examples have demonstrated to me that the selection between '.' and ':' is somewhat governed by one's opinion of what is aesethically pleasing. You feel that '.' stands out more in text. I feel that ':' stands out more. Who is right and does it really matter? > Why do other languages that have the . as the namespace, class, > struct delimiter not have problems? We can look at history and > tell this is not going to be a problem. No sense in trying to > predict the future. Your assertion that these languages do not have problems with using '.' instead of something else may not be so cut and dried. I use the D programming language and it uses '.' to delimit the use of 'namespace' identifiers. This overloading of the '.' does cause problems. It places restrictions on the compiler about how to interpret identifier references and adds a bit of mental overhead for readers of the code to work out am I looking at a 'package' reference or a class/struct reference or a property reference. Without knowing the details of other parts of the source (which may be in other files) it can be difficult, and in some cases impossible, to be sure. For example: foo.bar.qwe(somevalue); Does 'foo' refer to a module, class, struct, or property? Does 'foo.bar' refer to a package, class, struct, or property? If we could write foo.bar:qwe(somevalue); we would know *immediately* that 'qwe' is a function defined in the package 'foo.bar' (which means it is in the file called "foo/bar.d"). > Preiod is more natural, easier > to read for scanning and easier for typing. In your opinion, unless you have some empirical results of appropriate studies to show otherwise. > But please, comment on my post that I referred to above. Sure ... <eucode> include datetime.e as dt struct emp emp.name.last = "Doe" emp.name.first = "John" emp.age = 35 emp.dob = dt:new(1965, 10, 5, 0, 0, 0) </eucode> is so much nicer to read now ;-) -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20568 Date: 2008 May 7 2:00 From: Jeremy Cowgar <jeremy at cow?a?.com> Subject: Decision on . or : Derek Parnell wrote: > You feel that '.' stands out more in text. I feel that ':' stands out more. > Who is right and does it really matter? The only reason it matters is because . was brought up in favor from many people, discussion started and no final decision was made. I am just trying to exhaust the discussion so a final decision can be made and we are not talking over this same topic two years from now. Some may think I am pushing quite a bit, but I am just wanting final resolution. If we are to get anywhere with Euphoria, we have to start making decisions. Not discuss a topic until one side is tired an retreats for a bit. It seems that those on IRC and others who have talked w/me about the . instead of : have had their say and have no further arguments. We have heard mainly from those opposing the . in favor of : ... I am going to step aside and I would like to propose that anyone who wishes for the . over the : speak up on this post. If no viable arguments exist for . over : in one weeks time, then we close the discussion and : stays. This is the first time I've called for a vote in this manner, so if anyone thinks it is unfair, please speak up as well. All I know is we need to come to a decision some time :-) -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20569 Date: 2008 May 7 2:22 From: Derek Parnell <ddparnell at ?igpond?com> Subject: Re: Decision on . or : Jeremy Cowgar wrote: > This is the first time I've called for a vote in this manner, so if anyone thinks it is unfair, please > speak up as well. All I know is we need to come to a decision some time :-) I think you are doing a wonderful job and I applaud the approach you are taking. I'm sure there are some rough edges to it but overall I think you are going about things the right way. Well done, Jeremy. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20570 Date: 2008 May 7 2:31 From: Kat <KAT12 at c?osah?.net> Subject: Re: Decision on . or : Derek Parnell wrote: > > Jeremy Cowgar wrote: > > > This is the first time I've called for a vote in this manner, so if anyone > thinks it is unfair, please</font></i> > > speak up as well. All I know is we need to come to a decision some time :-) > > I think you are doing a wonderful job and I applaud the approach you are taking. > I'm sure there are some rough edges to it but overall I think you are going > about things the right way. Well done, Jeremy. Ditto. Kat -= B E G I N =- X-EUFORUM: 20571 Date: 2008 May 7 2:32 From: c.k.lester <euphoric at cklest?r.?om> Subject: Re: Decision on . or : Kat wrote: > Derek Parnell wrote: > > I think you are doing a wonderful job and I applaud the approach you are taking. > > I'm sure there are some rough edges to it but overall I think you are going > > about things the right way. Well done, Jeremy. > Ditto. Ditto. :) -= B E G I N =- X-EUFORUM: 20572 Date: 2008 May 7 2:38 From: yuku <yuku at i?itek.com> Subject: Re: Decision on . or : Jeremy Cowgar wrote: > We have heard mainly from those opposing the . in favor of : ... I am going > to step aside and I would like to propose that anyone who wishes for the . over > the : speak up on this post. If no viable arguments exist for . over : in one > weeks time, then we close the discussion and : stays. Hehe then I will speak up here for voting for the dot. Remember that we will use namespace crazier than ever due to the new stdlib. Maybe about a third to half of the lines will have keywords with namespacing. Another approach is we enable both . and : then deprecate one of them on the next major version (Eu 5.0). In PHP 4, to get a character from a string [] can be used. But in PHP 5 [] is deprecated (but can be used) and {} is encouraged to be used. However people still uses [] so in PHP 6 the {} is deprecated and [] is encouraged back :D So if we enable : and . for Eu 4, we can see which is more used and deprecate one of them in Eu 5. How do you think? -= B E G I N =- X-EUFORUM: 20573 Date: 2008 May 7 2:40 From: Jason Gade <jaygade at yah??.com> Subject: Re: Decision on . or : c.k.lester wrote: > > Kat wrote: > > Derek Parnell wrote: > > > I think you are doing a wonderful job and I applaud the approach you are taking. > > > I'm sure there are some rough edges to it but overall I think you are going > > > about things the right way. Well done, Jeremy. > > Ditto. > > Ditto. :) Ditto. :-D -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20574 Date: 2008 May 7 2:47 From: Jason Gade <jaygade at ?aho?.com> Subject: Re: Decision on . or : I was originally in favor of '.' over ':' (especially with allowing both but deprecating ':'). Having read many well-though-out comments, however, I move my vote to retaining ':'. Euphoria may never get objects or "structured" sequences. And even if it does, I stay on the side of removing ambiguity in the source. The argument that reading and maintaining source trumps ease of typing are very convincing. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20575 Date: 2008 May 7 2:51 From: c.k.lester <euphoric at ckl?ster.c?m> Subject: Re: Decision on . or : Jason Gade wrote: > > I was originally in favor of '.' over ':' (especially with allowing both but > deprecating ':'). > > Having read many well-though-out comments, however, I move my vote to retaining > ':'. Euphoria may never get objects or "structured" sequences. And even if it > does, I stay on the side of removing ambiguity in the source. > > The argument that reading and maintaining source trumps ease of typing are very > convincing. I was going to say this but you said it better. So, ditto. :) -= B E G I N =- X-EUFORUM: 20576 Date: 2008 May 7 2:54 From: yuku <yuku at ?k?tek.com> Subject: Re: Faster peek_ustring() function Larry Miller wrote: > This is a faster peek_ustring() function than that in machine.e on SourceForge > > <eucode> > global function peek_ustring(atom addr) > atom ptr > ptr = addr > while peek2u(ptr) do > ptr += 2 > end while > > return peek2u({addr, (ptr - addr) / 2}) > end function > </eucode> What a smart solution! Thanks! I have updated it and committed it to the SVN. But I do not know how to put author in the source code so I didn't put your name. -= B E G I N =- X-EUFORUM: 20577 Date: 2008 May 7 3:16 From: Shawn Pringle <shawn.pringle at gmail.?o?> Subject: Re: Decision on . or : Jeremy Cowgar wrote: > > We have heard mainly from those opposing the . in favor of : ... I am going > to step aside and I would like to propose that anyone who wishes for the . over > the : speak up on this post. If no viable arguments exist for . over : in one > weeks time, then we close the discussion and : stays. > Ya!!! :) The IRC meeting was something I by chance heard about. The meeting was announced in a post a few minutes before the meeting started. I think the group of EUPHORIA programmers at the IRC meeting was not representative to those who post on the forums. There were only six people in the meeting and most seemed relatively new at EUPHORIA. It seems to me, that people who come from a python, C++ or Java background look at EUPHORIA's ':' delimiter and namespace and say 'how strange.' To me, it is okay if EUPHORIA is different. Rob wants to let EUPHORIA grow into something more. We could add all kinds of C++ kinds of things to EUPHORIA, and keep changing it until will we have a non-ANSI compliant C++ compiler or we could add features that do not exist in the other languages with a little imagination. The least interesting thing we can do is to change the syntax to look more like java, python or c++. Finally, I have to agree that a volunteer who has enough time on their hands to think about changing ':' to '.' could be an aggregator. He could take all the message contents and make a document about various threads that includes other people's point of view so we do not keep asking the same questions after so many months. We ask everyone to read the "mutate EUPHORIA article" in the wiki page before asking or proposing changes. Shawn Pringle -= B E G I N =- X-EUFORUM: 20578 Date: 2008 May 7 3:30 From: Kat <KAT12 at ?oo?ahs.net> Subject: Re: Decision on . or : Shawn Pringle wrote: <snip> > We ask everyone to read > the "mutate EUPHORIA article" in the wiki page before asking or proposing changes. Got url? Kat -= B E G I N =- X-EUFORUM: 20579 Date: 2008 May 7 3:36 From: Shawn Pringle <shawn.pringle at g?ail.?om> Subject: message_box() [Re: Yay or Nay? Framed reference manual] Jeremy Cowgar wrote: > > Greg, I am no HTML/CSS guru. Can you make a div layout w/o fancy Javascript > where the navigation div stays on the side, no matter how high or low you scroll > in the docs? For instance, you can click on Language Manual, scroll down a substantial > amount and with the frames, the navigation frame will still be right there at > your finger tips. > > If there are other ways of doing this, I'm open for suggestions, but I think > having the links there for quick access is the major benefit. > I hated frames because it complicates pages; and it doesn't allow them to be searchable (through google). Javascript is a lot more complicated than frames and the tree like structure makes it very easy to find routines you are looking for and more importantly to discover routines you didn't know existed that are related to the topic you open. Yay for frames! You did a good job. However, the routine message_box( ) doesn't belong C-interface. Jeremy and I don't think it belongs to any existing category in the docs that's why it hasn't been moved. It's nuts to create a new category for one function only. So, are there any suggestions from the users out there? -= B E G I N =- X-EUFORUM: 20580 Date: 2008 May 7 3:38 From: Shawn Pringle <shawn.pringle at gmail?c?m> Subject: Re: Decision on . or : Kat wrote: > > Shawn Pringle wrote: > > <snip> > > > We ask everyone to read > > the "mutate EUPHORIA article" in the wiki page before asking or proposing changes. > > Got url? > > Kat The bad news first all the relavant content of this thread needs to be merged into a summary and put up before you can read it. I can host a site for static content if someone wants to summarize it. Shawn Pringle -= B E G I N =- X-EUFORUM: 20581 Date: 2008 May 7 4:07 From: Mike Sywensky <michaelsy at yaho?.c?m> Subject: Re: Still cannot compile 4.0 Jeremy Cowgar wrote: > > yuku wrote: > > > > Looks good. But > > > > wcc386 /bt=nt /mf /w0 /zq /j /zp4 /fp5 /fpi87 /5r /otimra /s -DESIMPLE_MALLOC > > .\intobj\intinit.c -fo=.\intobj\intinit.obj > > wcc386 /bt=nt /mf /w0 /zq /j /zp4 /fp5 /fpi87 /5r /otimra /s -DESIMPLE_MALLOC > > .\intobj\symtab_0.c -fo=.\intobj\symtab_0.obj > > wcc386 /bt=nt /mf /w0 /zq /j /zp4 /fp5 /fpi87 /5r /otimra /s -DESIMPLE_MALLOC > > .\intobj\wildcard.c -fo=.\intobj\wildcard.obj > > wcc386 /bt=nt /mf /w0 /zq /j /zp4 /fp5 /fpi87 /5r /otimra /s -DESIMPLE_MALLOC > > .\intobj\sequence.c -fo=.\intobj\sequence.obj > > Unable to open '.\intobj\sequence.c' > > Can you get on IRC and we can work through this problem in real time? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Was this ever resolved? I am having the same issue. -= B E G I N =- X-EUFORUM: 20582 Date: 2008 May 7 4:35 From: Marco Achury <achury at can?v.n?t> Subject: Re: message_box() [Re: Yay or Nay? Framed reference manual] Shawn Pringle wrote: > I hated frames because it complicates pages; and it doesn't allow them to be > searchable (through google). The frames well used must not to stop search engines. Jeremy has include links to all pages at <noframes> section, this way the search robot will follow those links and will explore all the pages. +-+-+-+-+-+-+-+ Marco A. Achury Caracas, Venezuela -= B E G I N =- X-EUFORUM: 20583 Date: 2008 May 7 7:51 From: CChris <christian.cuvier at ag?icul?ure.gouv.fr> Subject: Re: . or : for namespace? Matt Lewis wrote: > > CChris wrote: > > > > Mike wrote: > > > > > > So, basically we have : > > > > > > obsfucation OR lack of freedom + nice looking > > > > > > > Where? > > Namespaces are not that many. Do you mean you don't know which identifier is > > a namespace? Really? > > And 640K should be enough for anyone. Seriously, you can't imagine a case > where there might be a namespace and a variable whose names collide? > I can. I'd suggest removing the possibility for a variable, a routine and a namespace to bear the same name. Would this actually break stuff? It can, but does it? > While we're at it, why don't we get rid of parentheses and just use square > brackets everywhere? > <eucode> > puts[1, "Hello, world!\n"] > </eucode> > Matt Because we should be able, some day, to ask for value(the_string)[2]. CChris -= B E G I N =- X-EUFORUM: 20584 Date: 2008 May 7 7:52 From: ChrisBurch2 <crylex at ?reeuk.co?uk> Subject: Re: Decision on . or : Hi Jeremy - yes you are doing a good job,even though all of us may not agree with you (or anyone else for that matter) I vote to keep the : and not use the . . _Personally_ I don't like namespaces (although that may change), and will probably write a stdlib wrapper for my own personal use, using underscore notatation so that I don't have too think about it too much. However keep up the good work. Chris -= B E G I N =- X-EUFORUM: 20585 Date: 2008 May 7 8:18 From: CChris <christian.cuvier at agricul?ure.go?v.fr> Subject: Re: win32Lib - newUIObj bug? Mike777 wrote: > > I am using Judith's IDE. I establish my main Windows through the IDE. All > other controls are built using newUIObj. > > It doesn't appear to me that the id's of the defined windows are available to > the newUIObj procedure. When I set trace on and find myself in that procedure, > when I type a ? and then enter the name of a window, I get a message saying > that it is undefined. > > In my program, when I get to the Owner portion of the newUIObj procedure at > around line 2081 of w32forms.ew I find that none of my window variables are > available to set the parent. The parent is therefore set to be zero, and I > end up with a race condition when the program executes the CreateEx function > at around line 2400. My line numbers may not be exact because I've peppered > the procedure at the moment with message_boxes. > > When I force the lOwner variable value to be "110" with the following code, > the createex works just fine: > > if compare(lData,"MySpecialWindow") = 0 then > lOwner = 110 > end if > > Is it a bug that the newUIObj routine doesn't seem to be able to execute the: > > lOwner = getNameId(w32trim(lData)) > > line and get back a valid id (it always returns zero)? > > Thanks > > Mike I just ran the rebar.exw demo, and that line 2083 returns quite a few nonzero values, as you can check by adding "?lOwner" to it.. I think I need to see some code sample of yours. CChris -= B E G I N =- X-EUFORUM: 20586 Date: 2008 May 7 9:15 From: Pete Stoner <stoner.pete at gm?il.c?m> Subject: Re: Decision on . or : c.k.lester wrote: > > Jason Gade wrote: > > > > I was originally in favor of '.' over ':' (especially with allowing both but > > deprecating ':'). > > > > Having read many well-though-out comments, however, I move my vote to retaining > > ':'. Euphoria may never get objects or "structured" sequences. And even if it > > does, I stay on the side of removing ambiguity in the source. > > > > The argument that reading and maintaining source trumps ease of typing are very > > convincing. > > I was going to say this but you said it better. > > So, ditto. :) I vote for : PeteS -= B E G I N =- X-EUFORUM: 20587 Date: 2008 May 7 9:15 From: Pete Stoner <stoner.pete at gma?l.?om> Subject: Re: Decision on . or : c.k.lester wrote: > > Kat wrote: > > Derek Parnell wrote: > > > I think you are doing a wonderful job and I applaud the approach you are taking. > > > I'm sure there are some rough edges to it but overall I think you are going > > > about things the right way. Well done, Jeremy. > > Ditto. > > Ditto. :) Hear Hear! :) -= B E G I N =- X-EUFORUM: 20588 Date: 2008 May 7 11:50 From: CChris <christian.cuvier at agricu?ture.g?uv.fr> Subject: Re: message_box() [Re: Yay or Nay? Framed reference manual] Shawn Pringle wrote: > > Jeremy Cowgar wrote: > > > > > Greg, I am no HTML/CSS guru. Can you make a div layout w/o fancy Javascript > > where the navigation div stays on the side, no matter how high or low you scroll > > in the docs? For instance, you can click on Language Manual, scroll down a substantial > > amount and with the frames, the navigation frame will still be right there at > > your finger tips. > > > > If there are other ways of doing this, I'm open for suggestions, but I think > > having the links there for quick access is the major benefit. > > > > I hated frames because it complicates pages; and it doesn't allow them to be > searchable (through google). Javascript is a lot more complicated than frames > and the tree like structure makes it very easy to find routines you are looking > for and more importantly to discover routines you didn't know existed that are > related to the topic you open. > > Yay for frames! You did a good job. > > However, the routine message_box( ) doesn't belong C-interface. Jeremy and > I > don't think it belongs to any existing category in the docs that's why it hasn't > been moved. It's nuts to create a new category for one function only. So, > are there any suggestions from the users out there? messsage_box() prompts the user for soùething, and, as a cosequence, shold be in the same category as prompt_number() or prompt_string(), whatever that category is. Where is value_from()() documented btw? I'd suggest spinning a new Interactive I/O category from the current File and device I/O off. There would go: pronpt_number mrompt_string message_box get_key wait_key ? (since it prints to stdout only) and perhaps whatever should be under Mouse support currently, in which case the latter category would disappear. I say "should" because the link from reference index page to Mouse support goes to the OS category listing. Also, I'd spin all crash_* entries from Machine level interface, an put that under either OS or a new Runtime Control category. CChris -= B E G I N =- X-EUFORUM: 20589 Date: 2008 May 7 12:16 From: Shawn Pringle <shawn.pringle at gmail.c?m> Subject: Re: message_box() category yay or nay? CChris wrote: > > I'd suggest spinning a new Interactive I/O category from the current File and > device I/O off. There would go: > pronpt_number > mrompt_string > message_box > get_key > wait_key > ? (since it prints to stdout only) > and perhaps whatever should be under Mouse support currently, in which case > the latter category would disappear. > > I say "should" because the link from reference index page to Mouse support goes > to the OS category listing. > > Also, I'd spin all crash_* entries from Machine level interface, an put that > under either OS or a new Runtime Control category. > > CChris Putting these routines in an Interactive category allows us to discover these functions. I didn't know about those other routines. That's why I never used them. Shawn Pringle -= B E G I N =- X-EUFORUM: 20590 Date: 2008 May 7 12:27 From: Jeremy Cowgar <jeremy at ?owgar?com> Subject: Re: Still cannot compile 4.0 Mike Sywensky wrote: > Was this ever resolved? I am having the same issue. Yes, however... Right this instant, Matt and I are adding regular expression support and trunk is a tad unstable. So depending on when you last did a svn up, it may/may not work. We do our very best to leave the repo in a working state, but this was a rather large addition w/some build changes on multiple platforms. I will let you know when the repo is stable again. It shouldn't be too long. Now, if you have not updated since about May 6, 10PM EST, then your probably OK. I wrote a tutorial on compiling 4.0 on the wiki and posted the link here: http://www.openeuphoria.org/EUforum/m20544.html -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20591 Date: 2008 May 7 12:30 From: "Euler German" <eulerg at gmail.com> Subject: Re: Decision on . or : > On 6 May 2008 at 19:51, c.k.lester wrote (maybe snipped): > Jason Gade wrote: > > > > I was originally in favor of '.' over ':' (especially with allowing both but > > deprecating ':'). > > > > Having read many well-though-out comments, however, I move my vote to retaining > > ':'. Euphoria may never get objects or "structured" sequences. And even if it > > does, I stay on the side of removing ambiguity in the source. > > > > The argument that reading and maintaining source trumps ease of typing are very > > convincing. > > I was going to say this but you said it better. > > So, ditto. :) > Same here. And you are doing an awesome job, Jeremy. You have my bowing. -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 20592 Date: 2008 May 7 12:33 From: Jeremy Cowgar <jeremy at ?owgar.?om> Subject: Re: Decision on . or : Shawn Pringle wrote: > > The IRC meeting was something I by chance heard about. The meeting was announced > in a post a few minutes before the meeting started. It was actually posted a day in advanced. When the meeting started, I posted a message again letting everyone know it started. But, you are right, a day notice was not enough. However, the meeting was prefixed with the fact that this is the first time, not much notice was given and that the meeting was in no way binding, that it was more of a trial run. > I think the group of EUPHORIA > programmers at the IRC meeting was not representative to those who post on the > > forums. There were only six people in the meeting and most seemed relatively > new > at EUPHORIA. It seems to me, that people who come from a python, C++ or Java > > background look at EUPHORIA's ':' delimiter and namespace and say 'how strange.' I do not think this is the case. The people who were speaking about . were long time Euphoria programmers. > The least interesting thing we can do is to change the syntax to look more like > java, python or c++. The goal was not to change it to look like another language. > Finally, I have to agree that a volunteer who has enough time on their hands > to think about changing ':' to '.' could be an aggregator. He could take all > > the message contents and make a document about various threads that includes > other people's point of view so we do not > keep asking the same questions after so many months. We ask everyone to read > the "mutate EUPHORIA article" in the wiki page before asking or proposing changes. The discussion had to start to even know the pros/cons. Also, who has time? To change : or a . is a 10 second job in the backend. That's no time requirement. All it needed was discussion, which it got. Now, I said I was not going to talk about . any more, and I am not. The statements above were to justify the steps taken prior to and after the irc meeting in question. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20593 Date: 2008 May 7 12:37 From: CChris <christian.cuvier at a?r?culture.gouv.fr> Subject: Re: message_box() category yay or nay? Shawn Pringle wrote: > > CChris wrote: > > > > I'd suggest spinning a new Interactive I/O category from the current File and > > device I/O off. There would go: > > pronpt_number > > mrompt_string > > message_box > > get_key > > wait_key > > ? (since it prints to stdout only) > > and perhaps whatever should be under Mouse support currently, in which case > > the latter category would disappear. > > > > I say "should" because the link from reference index page to Mouse support goes > > to the OS category listing. > > > > Also, I'd spin all crash_* entries from Machine level interface, an put that > > under either OS or a new Runtime Control category. > > > > CChris > > Putting these routines in an Interactive category allows us to discover these > functions. I didn't know about those other routines. That's why I never > used them. > > > Shawn Pringle I forgot to mention that fre_console() is misplaced under C Interface. I'd put it in Interactive I/O as well, although OS is a reasonable choice too. CChris -= B E G I N =- X-EUFORUM: 20594 Date: 2008 May 7 12:46 From: Matt Lewis <matthewwalkerlewis at gm?il?com> Subject: Re: Still cannot compile 4.0 Mike Sywensky wrote: > > Was this ever resolved? I am having the same issue. How are you trying to build it? Please specify exactly what you're typing at the command line. Matt -= B E G I N =- X-EUFORUM: 20595 Date: 2008 May 7 13:52 From: CChris <christian.cuvier at agric?lture.gou?.fr> Subject: More about the docs 1/ As I mentioned before, value_from() is not listed under Sequence manipulation, where it is a companion to value(). The entry is in the page, but there's no link to it from the reference index page. 2/ Sorry, but I still find the doc for find_any() too thin (plus a grammar mistake - it's instead of its). My suggestion for the description: Finds any element from s1 in s2. The least index in s2 at which a match takes place is returned, if any. Otherwise, 0 is returned. 3/ The entries for rfind and friends appear in the docs, but there is no link to them from the Search category page. CChris -= B E G I N =- X-EUFORUM: 20596 Date: 2008 May 7 14:05 From: CChris <christian.cuvier at agriculture.go?v.fr> Subject: Requests for sequence.e and search.e 1/ apply_func(sequence s,integer rid) Applies the function rid is the routine_id() of to the sequence s, and returns the result. The order in which element are acted upon is implementation dependent. The function must take an integer (the index) and anobject (the current value), and returns the new value for the requested element. Notionally, it could be implemented as: <eucode> global function apply_func(sequence s,integer rid) for i=1 to length(s) do s[i]=call_func(rid,{i,s[i]}) end for return s end function </eucode> 2/ apply_proc(sequence s,integer rid) Sam as apply_func(), but rid is the routne_id of a procedure instaed. 3/ find_using(integer rid,sequence s) Returns the smallest index such that call_func(rid,{i,s[i]}) returns a nonzero value. 3'/ find_using_from(), rfind_usin() and rfind_using_from(). They would all be best implemented in an include file. CChris -= B E G I N =- X-EUFORUM: 20597 Date: 2008 May 7 14:07 From: c.k.lester <euphoric at cklest?r.?om> Subject: Re: message_box() [Re: Yay or Nay? Framed reference manual] CChris wrote: > > I'd suggest spinning a new Interactive I/O category from the current File and > device I/O off. There would go: > pronpt_number > mrompt_string > message_box > get_key > wait_key > ? (since it prints to stdout only) I'd call this stuff "user interface." -= B E G I N =- X-EUFORUM: 20598 Date: 2008 May 7 14:11 From: Bernie Ryan <xotron at bluefro?.co?> Subject: Re: Decision on . or : I VOTE FOR : Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20599 Date: 2008 May 7 14:30 From: Jeremy Cowgar <jeremy at co?gar.co?> Subject: Re: message_box() [Re: Yay or Nay? Framed reference manual] c.k.lester wrote: > > CChris wrote: > > > > I'd suggest spinning a new Interactive I/O category from the current File and > > device I/O off. There would go: > > pronpt_number > > mrompt_string > > message_box > > get_key > > wait_key > > ? (since it prints to stdout only) > > I'd call this stuff "user interface." I think I like "Interactive I/O" better. I would be afraid that "User Interface" would make people think they can make dialogs, menus, text widgets, etc... -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20600 Date: 2008 May 7 14:34 From: Jeremy Cowgar <jeremy at cow?a?.com> Subject: Doc Changes There are a lot of doc changes spread through a few threads. Keep them coming, however, if you can, post them here. Now, I will go back and make a list of the changes in the few threads I am speaking of, however, C.K. Lester is working on making the documentation easier to maintain, XHTML compliant, styled with CSS. At the same time, making the text docs better as well. So, since there are other things to do, I'm going to let him work for a bit on the docs. I'll store up the changes and then make them all in one run. Thanks for the help w/the reviewing the documentation. Documenting is my least favorite thing to do. By everyone reviewing them we can make it better for us all. In fact, may I ask for help? Is there anyone who is a good writer who would be willing to work on documentation a bit? It's not hard and can be done with a standard text editor on Windows or Linux/FreeBSD. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20601 Date: 2008 May 7 15:04 From: CChris <christian.cuvier at agr?culture?gouv.fr> Subject: Re: Doc Changes Jeremy Cowgar wrote: > > There are a lot of doc changes spread through a few threads. Keep them coming, > however, if you can, post them here. > > Now, I will go back and make a list of the changes in the few threads I am speaking > of, however, C.K. Lester is working on making the documentation easier to maintain, > XHTML compliant, styled with CSS. At the same time, making the text docs better > as well. > > So, since there are other things to do, I'm going to let him work for a bit > on the docs. I'll store up the changes and then make them all in one run. > > Thanks for the help w/the reviewing the documentation. Documenting is my least > favorite thing to do. By everyone reviewing them we can make it better for us > all. > > In fact, may I ask for help? Is there anyone who is a good writer who would > be willing to work on documentation a bit? It's not hard and can be done with > a standard text editor on Windows or Linux/FreeBSD. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I can do that, although a native english speaker might be more appropriate for the job. CChris PS I started hacking at sets.e for inclusion in the stdlib. Some minor code rewrites have taken place. Also, I need to see what is the general policy about errors: crash or return forbidden value? This applies to functions, procedures obviously have fewer options. Unless... see next post. -= B E G I N =- X-EUFORUM: 20602 Date: 2008 May 7 15:07 From: CChris <christian.cuvier at agricult??e.gouv.fr> Subject: Exceptions What I consider missing in Eu is some mechanism to resume after error is agreed upon and implemented. I think Eifel's system is a little too clean and rigid, while Basic's is flexible but not clean. In Eiffel: my_routine(args)[:return type] is -- skipping pre/postconditions do -- code goes here, skipped local var section <optional> rescue -- rescue code </optional> end The rescue code can only do three things: * restart the routines, using the reserved word retry; * return normally after ensuring a stable, consistent state for the system * fail, by not handling the exception, or throwing a different one. In Basic, there are diretives like on error go to <line> on error resume on error next which are pretty self explanatory. I'd suggest mixing the two, by using Eiffel's scheme and adding a resume_next and retry_statement keywords. retry would be renamed retry_routine. It would crash in top level code. CChris -= B E G I N =- X-EUFORUM: 20603 Date: 2008 May 7 15:17 From: Mike Sywensky <michaelsy at yaho?.?om> Subject: Re: Still cannot compile 4.0 Matt Lewis wrote: > > Mike Sywensky wrote: > > > > Was this ever resolved? I am having the same issue. > > How are you trying to build it? Please specify exactly what you're typing > at the command line. > > Matt I used the tutorial that Jeremy wrote, so I typed wmake -f makefile.wat at the command line. It is installed on my home machine, so I can't troubleshoot until I go home tonight. -= B E G I N =- X-EUFORUM: 20604 Date: 2008 May 7 15:25 From: Jeremy Cowgar <jeremy at co?gar.co?> Subject: Re: Still cannot compile 4.0 Mike Sywensky wrote: > > I used the tutorial that Jeremy wrote, so I typed wmake -f makefile.wat at the > command line. > > It is installed on my home machine, so I can't troubleshoot until I go home > tonight. Key things are: Make sure eu-3.1 is in your path. Make sure EUDIR is pointing to your new eu-4.0 install. If you previously tried to build with an incorrect EUDIR, then it's very possible that files were generated from your 3.1's include directory, which will not work when compiling 4.0. To remedy this problem, run wmake -f makefile.wat distclean ... I found out on IRC that distclean does not work on Windows 98 or 95 due do rmdir missing a /S switch. If you are on Windows 98 or 95, please remove these directories manually from the source directory: backobj, intobj, libobj and transobj. This will clear all generated .c file. If you still have problems, I can try to help in real time on irc. (irc.freenode.net #euphoria). -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20605 Date: 2008 May 7 15:53 From: Jeremy Cowgar <jeremy at c?wgar.?om> Subject: Re: Still cannot compile 4.0 > We do our very best to leave the repo in a working state, but this was a rather > large addition w/some build changes on multiple platforms. I will let you know > when the repo is stable again. It shouldn't be too long. > It's compilable again. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20606 Date: 2008 May 7 15:57 From: OtterDad <otter at f?ll-moo?.com> Subject: Re: Decision on . or : Jeremy Cowgar wrote: > I do not think this is the case. The people who were speaking about . were long > time Euphoria programmers. i take "long time Euphoria programmers" as a compliment and vote for : Yours, OtterDad Don't sweat it -- it's not real life. It's only ones and zeroes. Gene Spafford -= B E G I N =- X-EUFORUM: 20607 Date: 2008 May 7 16:20 From: Greg Haberek <ghaberek at gm?i?.com> Subject: Re: wxCaret Matt Lewis wrote: > > Greg Haberek wrote: > > > > Matt, > > > > I added the routines for wxCaret to wxEuphoria.cpp. I hope I did it right > > this time, everything compiled fine. > > It compiled? Ship it! > > Matt Bah! I compile it with Watcom and everything looks fine, but when I drop the new DLL in %EUDIR%\BIN, I get "Could not open wxEuphoria library. Press enter to abort." Why is this not working? I even recompiled wxWidgets again to be sure. It still doesn't work. Everything looks fine when I open libwxeu.dll in Dependency Walker. -Greg -= B E G I N =- X-EUFORUM: 20608 Date: 2008 May 7 16:21 From: Bernie Ryan <xotron at bl?ef?og.com> Subject: Re: Doc Changes Jeremy Cowgar wrote: > > There are a lot of doc changes spread through a few threads. Keep them coming, > however, if you can, post them here. > > Now, I will go back and make a list of the changes in the few threads I am speaking > of, however, C.K. Lester is working on making the documentation easier to maintain, > XHTML compliant, styled with CSS. At the same time, making the text docs better > as well. > > So, since there are other things to do, I'm going to let him work for a bit > on the docs. I'll store up the changes and then make them all in one run. > > Thanks for the help w/the reviewing the documentation. Documenting is my least > favorite thing to do. By everyone reviewing them we can make it better for us > all. > > In fact, may I ask for help? Is there anyone who is a good writer who would > be willing to work on documentation a bit? It's not hard and can be done with > a standard text editor on Windows or Linux/FreeBSD. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Don't forget to update the keyword.e file which is missing words like ' as ' Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20609 Date: 2008 May 7 16:55 From: CChris <christian.cuvier at agricu?ture.gouv.f?> Subject: Suggested implementation of mod() Computing mod(x,y)=x-y*floor(x/y) is notionally correct, but numerically wrong: <eucode> ?1e20-1.7*floor(1e20/1.7) ?remainder(1e20,1.7) ?machine_func(26,0) </eucode> The two displayed real numbers should agree, since both operands are positive. Yet, one gets: 0 1.689469706 Since 10 is not divisible by 17, which is a prime number, the first result cannot ever be correct. The issue is not so much that 1.7 isn't exactly represented in hardware. The roundoff error which results from substracting two large numbers from one another is much bigger, as the results show. mod() must be built-in, like remainder(). Adjusting mod() from remainder() is slower, but at least the results will be numerically correct. Btw, the correct answer is 0.9. The Windows calulator displays the correct result, using the Mod function. CChris -= B E G I N =- X-EUFORUM: 20610 Date: 2008 May 7 18:10 From: Jeremy Cowgar <jeremy at cowgar.??m> Subject: Crash or return forbidden value? CChris posed the question. I always have a tough time with this one. I can give a few examples: 1. Open a file that does not exist. Well, the user may wish to try a different file. Error code. 2. Connect to a database server fails. Error code, as you may have given incorrect login credentials by user input and want to prompt the user for the username/password again. 3. Requesting an out of bounds index for a given sequence. Crash. This tends to be a programmers fault, not a users fault. The methods find_from, rfind_from, etc... do this. Now, translate that into a set of rules? Hm. Any thoughts? There seems to be some theme going on of "testing the waters" vs. "do this just as I say", but I'm not sure. This is a good topic, thanks Chris for posing the question. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20611 Date: 2008 May 7 19:15 From: Mike777 <anon4321 at g?a?l.com> Subject: Re: win32Lib - newUIObj bug? CChris wrote: > > Mike777 wrote: > > > > I am using Judith's IDE. I establish my main Windows through the IDE. All > > other controls are built using newUIObj. > > > > It doesn't appear to me that the id's of the defined windows are available to > > the newUIObj procedure. When I set trace on and find myself in that procedure, > > when I type a ? and then enter the name of a window, I get a message saying > > that it is undefined. > > > > In my program, when I get to the Owner portion of the newUIObj procedure at > > around line 2081 of w32forms.ew I find that none of my window variables are > > available to set the parent. The parent is therefore set to be zero, and I > > end up with a race condition when the program executes the CreateEx function > > at around line 2400. My line numbers may not be exact because I've peppered > > the procedure at the moment with message_boxes. > > > > When I force the lOwner variable value to be "110" with the following code, > > the createex works just fine: > > > > if compare(lData,"MySpecialWindow") = 0 then > > lOwner = 110 > > end if > > > > Is it a bug that the newUIObj routine doesn't seem to be able to execute the: > > > > lOwner = getNameId(w32trim(lData)) > > > > line and get back a valid id (it always returns zero)? > > > > Thanks > > > > Mike > > I just ran the rebar.exw demo, and that line 2083 returns quite a few nonzero > values, as you can check by adding "?lOwner" to it.. > I think I need to see some code sample of yours. Thanks for the quick reply. It doesn't surprise me that the rebar.exw demo doesn't hit the nail on the head. There are (at least) two characteristics of my routine which are not present in that very short demo. First, I am attempting to create tab controls directly off of a window control. That is, the window control is the parent to the tab control. The rebar demo doesn't build any tab controls. Second, I am doing so after destroying a previously built tab control. Again, no destroy commands are found in rebar. I end up with a race condition when the CreateEx is executed when attempting to (re) create the tab control after the first time around was destroyed. The first time around it is named myTabControl1, the second time myTabControl2, etc. If I force the parent to be the id of the Window the CreateEx which is supposed to build the tab control runs without fail. Since I'm using newUIObj directly there is quite a bit of code that goes into creating the string that is passed to newUIObj. But the result is a loop that does the following: 1. Add a tab control to the window 2. Add tab index to tab control 3. Add a series of controls to the tab index 4. Destroy the tab control (which theoretically should destroy the tab index and all of the controls on the tab index) 5. Add a tab control to the window Step five gives me a race condition on the CreateEx even though it uses the exact same text that was used in step 1, except the name of the control would have a "2" in it where it previously had a "1" (e.g., myTabControl2). Step file does not give me a race condition on the CreateEx if I force the parent to be the IDNo of the window. I'm not terribly good at reducing the code down to a manageable level in order to replicate the problem. But if the above isn't enough I'll certainly give it a shot. My next step is to go through the CreateEx routine and attempt to find the code where the loop is. So far, I've found that the loop exists because the variable SP is set to 2, then 3, then back to 2. It has to do with the stack. The idStack is changing between {3,113,90,34,0,0,0,0,0,0} and {3,113,110,34,0,0,0,0,0,0}. When we get to the pushSelf procedure the value of the third element is changed as indicated and SP changes to 3. The corresponding popSelf changes SP back to 2. Don't know whether the above helps at all. Thanks again. Mike -= B E G I N =- X-EUFORUM: 20612 Date: 2008 May 7 19:33 From: c.k.lester <euphoric at c?lester.co?> Subject: Re: win32Lib - newUIObj bug? Mike777 wrote: > > > Since I'm using newUIObj directly there is quite a bit of code that goes into > creating the string that is passed to newUIObj. But the result is a loop that > does the following: > > 1. Add a tab control to the window > 2. Add tab index to tab control > 3. Add a series of controls to the tab index > 4. Destroy the tab control (which theoretically should destroy the tab index > and all of the controls on the tab index) > 5. Add a tab control to the window I hope we get to see this program someday. :) -= B E G I N =- X-EUFORUM: 20613 Date: 2008 May 7 20:28 From: Bernie Ryan <xotron at bluefrog.?o?> Subject: Re: Crash or return forbidden value? Jeremy Cowgar wrote: > > CChris posed the question. I always have a tough time with this one. I can give > a few examples: > > 1. Open a file that does not exist. Well, the user may wish to try a different > file. Error code. Ask user if they want to create the file. > > 2. Connect to a database server fails. Error code, as you may have given incorrect > login credentials by user input and want to prompt the user for the username/password > again. > Connecting to a database should start out asking the user to login, therefore the user would know their login failed. > 3. Requesting an out of bounds index for a given sequence. Crash. This tends > to be a programmers fault, not a users fault. The methods find_from, rfind_from, > etc... do this. The programmer should be doing any necessary bounds checking ? > > Now, translate that into a set of rules? Hm. Any thoughts? There seems to be > some theme going on of "testing the waters" vs. "do this just as I say", but > I'm not sure. > > This is a good topic, thanks Chris for posing the question. > > -- Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20614 Date: 2008 May 7 20:45 From: Mike777 <anon4321 at gma?l?com> Subject: Re: win32Lib - newUIObj bug? c.k.lester wrote: > > Mike777 wrote: > > > > > > Since I'm using newUIObj directly there is quite a bit of code that goes into > > creating the string that is passed to newUIObj. But the result is a loop that > > does the following: > > > > 1. Add a tab control to the window > > 2. Add tab index to tab control > > 3. Add a series of controls to the tab index > > 4. Destroy the tab control (which theoretically should destroy the tab index > > and all of the controls on the tab index) > > 5. Add a tab control to the window > > I hope we get to see this program someday. :) This particular piece I'm working on right now is what might be called a mini-IDE in the context of a visual editor for the newUIObj instructions. That is why I'm in a position of having to remove controls and put them back. That is, I don't want to just move a control on the screen, I really want to delete it and re-paint it from scratch so that I'm sure the command is actually working. I'm not sure I will ever have the time to make it publishable, since right now it uses hardcoded names for many of the files and presumes a directory structure that I'm sure nobody else has or would want. But I really need this tool because hand editing a 2000 line text file to change the layout of a particular screen is getting quite tedious. Mike -= B E G I N =- X-EUFORUM: 20615 Date: 2008 May 7 21:28 From: Bernie Ryan <xotron at b?u?frog.com> Subject: Re: win32Lib - newUIObj bug? Mike777 wrote: > > c.k.lester wrote: > > > > Mike777 wrote: > > > > > > > > > Since I'm using newUIObj directly there is quite a bit of code that goes into > > > creating the string that is passed to newUIObj. But the result is a loop that > > > does the following: > > > > > > 1. Add a tab control to the window > > > 2. Add tab index to tab control > > > 3. Add a series of controls to the tab index > > > 4. Destroy the tab control (which theoretically should destroy the tab index > > > and all of the controls on the tab index) > > > 5. Add a tab control to the window > > > > I hope we get to see this program someday. :) > > This particular piece I'm working on right now is what might be called a mini-IDE > in the context of a visual editor for the newUIObj instructions. That is why > I'm in a position of having to remove controls and put them back. That is, > I don't want to just move a control on the screen, I really want to delete it > and re-paint it from scratch so that I'm sure the command is actually working. > > I'm not sure I will ever have the time to make it publishable, since right now > it uses hardcoded names for many of the files and presumes a directory structure > that I'm sure nobody else has or would want. > > But I really need this tool because hand editing a 2000 line text file to change > the layout of a particular screen is getting quite tedious. > Mike: Have you thought of keeping your controls in a Euphoria Database ? Then you could create the screen file by selectively reading in your controls. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20616 Date: 2008 May 7 21:32 From: Mike777 <anon4321 at gmai?.?om> Subject: Re: win32Lib - newUIObj bug? Bernie Ryan wrote: > > Mike777 wrote: > > But I really need this tool because hand editing a 2000 line text file to change > > the layout of a particular screen is getting quite tedious. > > > > Mike: > > Have you thought of keeping your controls in a Euphoria Database ? > > Then you could create the screen file by selectively reading > > in your controls. Thanks for the suggestion, Bernie. It has, indeed, crossed my mind. I think I need to get the basics working first, though, including the editing feature (which I'm working on now) before I upgrade the backend, so to speak. mike -= B E G I N =- X-EUFORUM: 20617 Date: 2008 May 7 21:44 From: Jerry Story <story.jerry at gmail?c?m> Subject: Re: Crash or return forbidden value? Jeremy Cowgar wrote: > > CChris posed the question. I always have a tough time with this one. I can give > a few examples: > > 1. Open a file that does not exist. Well, the user may wish to try a different > file. Error code. That depends on whether the file is opened for writing or for reading. The tradition is that if the file is opened for writing and it doesn't exist, then it is created; and if it is opened for reading and it doesn't exist, then a -1 or something is returned. Perhaps I misunderstand the question. -= B E G I N =- X-EUFORUM: 20618 Date: 2008 May 7 22:01 From: CChris <christian.cuvier at agricultu?e?gouv.fr> Subject: Re: win32Lib - newUIObj bug? Mike777 wrote: > > CChris wrote: > > > > Mike777 wrote: > > > > > > I am using Judith's IDE. I establish my main Windows through the IDE. All > > > other controls are built using newUIObj. > > > > > > It doesn't appear to me that the id's of the defined windows are available to > > > the newUIObj procedure. When I set trace on and find myself in that procedure, > > > when I type a ? and then enter the name of a window, I get a message saying > > > that it is undefined. > > > > > > In my program, when I get to the Owner portion of the newUIObj procedure at > > > around line 2081 of w32forms.ew I find that none of my window variables are > > > available to set the parent. The parent is therefore set to be zero, and I > > > end up with a race condition when the program executes the CreateEx function > > > at around line 2400. My line numbers may not be exact because I've peppered > > > the procedure at the moment with message_boxes. > > > > > > When I force the lOwner variable value to be "110" with the following code, > > > the createex works just fine: > > > > > > if compare(lData,"MySpecialWindow") = 0 then > > > lOwner = 110 > > > end if > > > > > > Is it a bug that the newUIObj routine doesn't seem to be able to execute the: > > > > > > lOwner = getNameId(w32trim(lData)) > > > > > > line and get back a valid id (it always returns zero)? > > > > > > Thanks > > > > > > Mike > > > > I just ran the rebar.exw demo, and that line 2083 returns quite a few nonzero > > values, as you can check by adding "?lOwner" to it.. > > I think I need to see some code sample of yours. > > Thanks for the quick reply. > > It doesn't surprise me that the rebar.exw demo doesn't hit the nail on the head. > There are (at least) two characteristics of my routine which are not present > in that very short demo. > > First, I am attempting to create tab controls directly off of a window control. > That is, the window control is the parent to the tab control. The rebar demo > doesn't build any tab controls. > > Second, I am doing so after destroying a previously built tab control. Again, > no destroy commands are found in rebar. > > I end up with a race condition when the CreateEx is executed when attempting > to (re) create the tab control after the first time around was destroyed. The > first time around it is named myTabControl1, the second time myTabControl2, > etc. > > If I force the parent to be the id of the Window the CreateEx which is supposed > to build the tab control runs without fail. > > Since I'm using newUIObj directly there is quite a bit of code that goes into > creating the string that is passed to newUIObj. But the result is a loop that > does the following: > > 1. Add a tab control to the window > 2. Add tab index to tab control > 3. Add a series of controls to the tab index > 4. Destroy the tab control (which theoretically should destroy the tab index > and all of the controls on the tab index) > 5. Add a tab control to the window > > Step five gives me a race condition on the CreateEx even though it uses the > exact same text that was used in step 1, except the name of the control would > have a "2" in it where it previously had a "1" (e.g., myTabControl2). > > Step file does not give me a race condition on the CreateEx if I force the parent > to be the IDNo of the window. > > I'm not terribly good at reducing the code down to a manageable level in order > to replicate the problem. > > But if the above isn't enough I'll certainly give it a shot. > > My next step is to go through the CreateEx routine and attempt to find the code > where the loop is. So far, I've found that the loop exists because the variable > SP is set to 2, then 3, then back to 2. It has to do with the stack. The idStack > is changing between {3,113,90,34,0,0,0,0,0,0} and {3,113,110,34,0,0,0,0,0,0}. > When we get to the pushSelf procedure the value of the third element is changed > as indicated and SP changes to 3. The corresponding popSelf changes SP back > to 2. > > Don't know whether the above helps at all. > > Thanks again. > > Mike If I got it right: * at step 3, you create controls with the initial tab control as parent. So, the last parent newUIObj() knows about is that tab control. * at step 4, you destroy it. newUIObj() has no way to know. You may have done it by calling the API, or another process did it; * at step 5, you create a tab control without giving a parent. So the parent is the destroyed tab control, its id is either invalid or, from getNameId(), 0. Create the second tab control (step 5) with an explicit OWNER= directive. It makes sense that you have to tell newUIObj() that the world had changed between two contiguous calls. Did I miss anything else? CChris -= B E G I N =- X-EUFORUM: 20619 Date: 2008 May 7 22:05 From: CChris <christian.cuvier at ag??culture.gouv.fr> Subject: Re: Crash or return forbidden value? Bernie Ryan wrote: > > Jeremy Cowgar wrote: > > > > CChris posed the question. I always have a tough time with this one. I can give > > a few examples: > > > > 1. Open a file that does not exist. Well, the user may wish to try a different > > file. Error code. > > Ask user if they want to create the file. > > > > > 2. Connect to a database server fails. Error code, as you may have given incorrect > > login credentials by user input and want to prompt the user for the username/password > > again. > > > > Connecting to a database should start out asking the user to login, > > therefore the user would know their login failed. > > > 3. Requesting an out of bounds index for a given sequence. Crash. This tends > > to be a programmers fault, not a users fault. The methods find_from, rfind_from, > > etc... do this. > > The programmer should be doing any necessary bounds checking ? > Why do it twice, since the backend always cjecks? There should be some sort of runtime warning, because it may be a program bug. But if the only point is to exit a loop when there is nothing left to process, let's use the logic built into the interpreter, rather than duplicationg it. CChris > > > > Now, translate that into a set of rules? Hm. Any thoughts? There seems to be > > some theme going on of "testing the waters" vs. "do this just as I say", but > > I'm not sure. > > > > This is a good topic, thanks Chris for posing the question. > > > > -- > > > Bernie > > My files in archive: > WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API > > Can be downloaded here: > <a href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a> -= B E G I N =- X-EUFORUM: 20620 Date: 2008 May 7 22:33 From: Mike777 <anon4321 at gma?l.co?> Subject: Re: win32Lib - newUIObj bug? CChris wrote: > > Mike777 wrote: > > > > CChris wrote: > > > > > > Mike777 wrote: > > > > > > > > I am using Judith's IDE. I establish my main Windows through the IDE. All > > > > other controls are built using newUIObj. > > > > > > > > It doesn't appear to me that the id's of the defined windows are available to > > > > the newUIObj procedure. When I set trace on and find myself in that procedure, > > > > when I type a ? and then enter the name of a window, I get a message saying > > > > that it is undefined. > > > > > > > > In my program, when I get to the Owner portion of the newUIObj procedure at > > > > around line 2081 of w32forms.ew I find that none of my window variables are > > > > available to set the parent. The parent is therefore set to be zero, and I > > > > end up with a race condition when the program executes the CreateEx function > > > > at around line 2400. My line numbers may not be exact because I've peppered > > > > the procedure at the moment with message_boxes. > > > > > > > > When I force the lOwner variable value to be "110" with the following code, > > > > the createex works just fine: > > > > > > > > if compare(lData,"MySpecialWindow") = 0 then > > > > lOwner = 110 > > > > end if > > > > > > > > Is it a bug that the newUIObj routine doesn't seem to be able to execute the: > > > > > > > > lOwner = getNameId(w32trim(lData)) > > > > > > > > line and get back a valid id (it always returns zero)? > > > > > > > > Thanks > > > > > > > > Mike > > > > > > I just ran the rebar.exw demo, and that line 2083 returns quite a few nonzero > > > values, as you can check by adding "?lOwner" to it.. > > > I think I need to see some code sample of yours. > > > > Thanks for the quick reply. > > > > It doesn't surprise me that the rebar.exw demo doesn't hit the nail on the head. > > There are (at least) two characteristics of my routine which are not present > > in that very short demo. > > > > First, I am attempting to create tab controls directly off of a window control. > > That is, the window control is the parent to the tab control. The rebar demo > > doesn't build any tab controls. > > > > Second, I am doing so after destroying a previously built tab control. Again, > > no destroy commands are found in rebar. > > > > I end up with a race condition when the CreateEx is executed when attempting > > to (re) create the tab control after the first time around was destroyed. The > > first time around it is named myTabControl1, the second time myTabControl2, > > etc. > > > > If I force the parent to be the id of the Window the CreateEx which is supposed > > to build the tab control runs without fail. > > > > Since I'm using newUIObj directly there is quite a bit of code that goes into > > creating the string that is passed to newUIObj. But the result is a loop that > > does the following: > > > > 1. Add a tab control to the window > > 2. Add tab index to tab control > > 3. Add a series of controls to the tab index > > 4. Destroy the tab control (which theoretically should destroy the tab index > > and all of the controls on the tab index) > > 5. Add a tab control to the window > > > > Step five gives me a race condition on the CreateEx even though it uses the > > exact same text that was used in step 1, except the name of the control would > > have a "2" in it where it previously had a "1" (e.g., myTabControl2). > > > > Step file does not give me a race condition on the CreateEx if I force the parent > > to be the IDNo of the window. > > > > I'm not terribly good at reducing the code down to a manageable level in order > > to replicate the problem. > > > > But if the above isn't enough I'll certainly give it a shot. > > > > My next step is to go through the CreateEx routine and attempt to find the code > > where the loop is. So far, I've found that the loop exists because the variable > > SP is set to 2, then 3, then back to 2. It has to do with the stack. The idStack > > is changing between {3,113,90,34,0,0,0,0,0,0} and {3,113,110,34,0,0,0,0,0,0}. > > When we get to the pushSelf procedure the value of the third element is changed > > as indicated and SP changes to 3. The corresponding popSelf changes SP back > > to 2. > > > > Don't know whether the above helps at all. > > > > Thanks again. > > > > Mike > > If I got it right: > * at step 3, you create controls with the initial tab control as parent. Slight modification. I create controls that have the tab index as the parent. The tab control is the grandparent (parent to the tab index). The main window is the great-grandparent. MySpecialWindow --- myTabControl1 ------myTabIndex1 ---------myGroup1 ------------myGroup1Option1 ------------myGroup1Option2 ------------myGroup1Edit1 ---------myEditControl1 ---------myGroup2 ------------myGroup2Option1 ------------myGroup2Option2 ------------myGroup2Edit1 > So, > the last parent newUIObj() knows about is that tab control. The last "parent" that newUIObj knows about is the last parent of the last control inserted into the tab page (tab index). In fact, I might have 2 groups on the tab page, each of which have 2 options (checkboxes or radiouttons) and a multi-line edit control. If all I'm interested in is the last parent, it can be two or more levels down from the tab control being deleted. > * at step 4, you destroy it. newUIObj() has no way to know. You may have > done > it by calling the API, or another process did it; As mentioned below, I could (should?) have provided you with an example line so you would see that it is destroyed using win32Lib's destroy command. destroy(getNameId("myTabControl1")) > * at step 5, you create a tab control without giving a parent. So the parent > is the destroyed tab control, its id is either invalid or, from getNameId(), > 0. Again, the actual line would have shown that I am giving it an explicit parent: newUIObj("TabControl,myTabControl2,myTabControl2,0,0,1200,950,parent=MySpecialWindow") > Create the second tab control (step 5) with an explicit OWNER= directive. ? > It makes sense that you have to tell newUIObj() that the world had changed > between two contiguous calls. I certainly agree and I have always done that. > Did I miss anything else? Depends on your point of view. I think so, but then again I was probably too cryptic. You certainly missed what I didn't provide (how could you not have?). In other words, if I had shown you the precise coding you would have immediately seen that my newUIObj command includes parent=MySpecialWindow so I already have an explicit equivalent to OWNER=. I had thought I implied that with my coding in my initial post: if compare(lData,"MySpecialWindow") = 0 then in that lData does, in fact, have "MySpecialWindow" as its value so when the parent portion of the routine is executed my test for that "works" and I can insert 110 as the owner. I remain baffled why, at that very moment, a getNameId("MySpecialWindow") returns 0 when I know it is 110. I know the mechanics of *how* it returns zero: it is because MySpecialWindow (the name of the window) returns a Not Defined on the trace window. Whereas other times through the same routine (newUIObj) getNameId("MySpecialWindow") will return 110. With the IDE, the main windows are all built when the program is initialized and the id's are set from that point forward. I thought. Thanks for sticking with me on this one. I know it is a tough one to hunt down. Mike -= B E G I N =- X-EUFORUM: 20621 Date: 2008 May 7 22:36 From: Bernie Ryan <xotron at bluefr?g.com> Subject: Re: Crash or return forbidden value? CChris wrote: > > > Why do it twice, since the backend always cjecks? There should be some sort > of runtime warning, because it may be a program bug. But if the only point is > to exit a loop when there is nothing left to process, let's use the logic built > into the interpreter, rather than duplicationg it. > CChris: Checking a sequence ony reports that a sequence is out of bounds; It is worthless it only gives a message that a sequence of a length 999 using an index of 1000 failed. NO mention of which sequence caused the error. IF you look at the ex.err to see what sequence failed, it prints out all long sequences chopped off with ... How is this usefull. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20622 Date: 2008 May 7 22:49 From: Kat <KAT12 at coo?ahs.?et> Subject: Re: Crash or return forbidden value? Bernie Ryan wrote: > > Jeremy Cowgar wrote: > > > > CChris posed the question. I always have a tough time with this one. I can give > > a few examples: > > > > 1. Open a file that does not exist. Well, the user may wish to try a different > > file. Error code. > > Ask user if they want to create the file. Correct, no crash, open() returns an error code and the app deals with it. > > > > 2. Connect to a database server fails. Error code, as you may have given incorrect > > login credentials by user input and want to prompt the user for the username/password > > again. > > > > Connecting to a database should start out asking the user to login, > > therefore the user would know their login failed. > > > 3. Requesting an out of bounds index for a given sequence. Crash. This tends > > to be a programmers fault, not a users fault. The methods find_from, rfind_from, > > etc... do this. > > The programmer should be doing any necessary bounds checking ? I am always testing for if sequence() if length() if length() > index if index > 0 etc etc. when in my opinion, Eu could be more tolerant and return logical results: s = "qwerty" a = 12 return s[11] -- returns "" return s[1..45] -- returns s return s[-1] -- returns "" if s then -- this works if a = s then -- cannot possibly be true, but don't crash! etc. Kat -= B E G I N =- X-EUFORUM: 20623 Date: 2008 May 7 23:03 From: Jeremy Cowgar <jeremy at ?owgar.co?> Subject: Re: Doc Changes There are changes in the way documents are going to be generated. The end result is going to be better documentation for us all. Chris, please refrain for just a little bit (a day or so) from updating the docs as the structure is changing quite a bit for the better. Chris, can you send me an email in regards to this? I cannot get an email through to you for some reason. Everyone should thank CK Lester for taking this job on. It's a huge job and he's doing a great job. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20624 Date: 2008 May 7 23:10 From: Mike777 <anon4321 at gmai?.co?> Subject: Trace window - active? I'm pretty sure that this can't be done, but I thought I would at least ask. When the trace window is displayed I can interrogate any variable by typing the question mark, the name of the variable and hitting enter. If the value isn't already displayed in the bottom portion of the window, it will then be displayed. So far, so good. Is there any way to interactively modify the value of a variable? For example, it would be quite nice if I could type ? SP=2 to change the value SP to 2 so that I could test various continuations. This sort of "active" debug window exists in many of the Microsoft Office applications (Access, Excel), so I've grown quite fond of it over the years. But I suspect the answer is that it can't be done. Mike -= B E G I N =- X-EUFORUM: 20625 Date: 2008 May 7 23:59 From: CChris <christian.cuvier at agric?l?ure.gouv.fr> Subject: Using localisation Localisation also governs how characters in the 128-255 range are turned to lower or upper case. As a result, perhaps replacing, under Windows, lower() and upper() by ansiLower() and ansiUpper() as defined in win32lib.ew (provided by R. Stowasser). I'd suggest using the code for ansiLower() as the body of lower(). Under Linux/BSD, I don't know if the same functionality is available. Under DOS, there is support for proper capitalisation too. It is implemented in the interpreter in dos_compare() for the purpose of comparing file names. lowr() or upper() should (at least could) turn ä to A¨and back, for instance. CChris -= B E G I N =- X-EUFORUM: 20626 Date: 2008 May 8 0:28 From: Jeremy Cowgar <jeremy at co?g?r.com> Subject: New mailing list for SVN commits There is a new read-only mailing list for anyone interested in seeing the SVN commit log messages and diff's go by as developers of Euphoria add new code. No discussion will be on the list. Just for those that are interested. You can join the list: http://lists.sourceforge.net/lists/listinfo/rapideuphoria-commits -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20627 Date: 2008 May 8 0:30 From: Matt Lewis <matthewwalkerlewis at gmai?.c?m> Subject: Re: Crash or return forbidden value? CChris wrote: > > Bernie Ryan wrote: > > > > > 3. Requesting an out of bounds index for a given sequence. Crash. This tends > > > to be a programmers fault, not a users fault. The methods find_from, rfind_from, > > > etc... do this. > > > > The programmer should be doing any necessary bounds checking ? > > > > Why do it twice, since the backend always cjecks? There should be some sort > of runtime warning, because it may be a program bug. But if the only point > is to exit a loop when there is nothing left to process, let's use the > logic built into the interpreter, rather than duplicationg it. Maybe we're thinking about widely different things, but I can't figure out what you mean here. But maybe you want to check, because it tells you some data is bad. That doesn't mean that you have to crash, just that you should stop processing, or whatever. Can you explain what you mean here? Matt -= B E G I N =- X-EUFORUM: 20628 Date: 2008 May 8 4:47 From: gshingles <gshingles at gmail??om> Subject: Re: Decision on . or : Jeremy Cowgar wrote: > > Derek Parnell wrote: > > You feel that '.' stands out more in text. I feel that ':' stands out more. > > Who is right and does it really matter? > ... > This is the first time I've called for a vote in this manner, so if anyone thinks it is unfair, please > speak up as well. All I know is we need to come to a decision some time :-) What about '..', it will keep the dot camp happy, and the colon camp will be happy if they tilt their head to the side. Seriously, just joking. I don't mind either way. I use . in Python and :: in Perl namespacing. It still takes me 10 minutes to stop putting semicolons at the end of each statement in Euphoria :). Your brain adapts to whichever language you are writing in, so whatever conventions are used come back to you and become second nature after a while. Gary -= B E G I N =- X-EUFORUM: 20629 Date: 2008 May 8 6:15 From: Kat <KAT12 at coosahs.n??> Subject: eunet mods Eunet now has (not released yet): data = eunet_get_recvheader("set-cookie") puts(1,data[2]&"\n") -- puts the cookie value data = eunet_get_recvheader(3) puts(1,data[1]&" "&data[2]&"\n") -- in this case, puts the headername and server software name What else does it need (keeping in mind it's a web interface, not a webpage manager, not an irc bot, and not a firewall)? Kat -= B E G I N =- X-EUFORUM: 20630 Date: 2008 May 8 6:27 From: Kat <KAT12 at coo?ahs?net> Subject: Re: Trace window - active? Mike777 wrote: > > I'm pretty sure that this can't be done, but I thought I would at least ask. > When the trace window is displayed I can interrogate any variable by typing > the question mark, the name of the variable and hitting enter. If the value > isn't already displayed in the bottom portion of the window, it will then be > displayed. > > So far, so good. > > Is there any way to interactively modify the value of a variable? For example, > it would be quite nice if I could type > > ? SP=2 > > to change the value SP to 2 so that I could test various continuations. This > sort of "active" debug window exists in many of the Microsoft Office applications > (Access, Excel), so I've grown quite fond of it over the years. > > But I suspect the answer is that it can't be done. > > Mike I asked for this years ago too. Kat -= B E G I N =- X-EUFORUM: 20631 Date: 2008 May 8 9:30 From: CChris <christian.cuvier at a?ricultur?.gouv.fr> Subject: Re: Crash or return forbidden value? Matt Lewis wrote: > > CChris wrote: > > > > Bernie Ryan wrote: > > > > > > > 3. Requesting an out of bounds index for a given sequence. Crash. This tends > > > > to be a programmers fault, not a users fault. The methods find_from, rfind_from, > > > > etc... do this. > > > > > > The programmer should be doing any necessary bounds checking ? > > > > > > > Why do it twice, since the backend always cjecks? There should be some sort > > of runtime warning, because it may be a program bug. But if the only point > > is to exit a loop when there is nothing left to process, let's use the > > logic built into the interpreter, rather than duplicationg it. > > Maybe we're thinking about widely different things, but I can't figure out > what you mean here. But maybe you want to check, because it tells you some > data is bad. That doesn't mean that you have to crash, just that you should > stop processing, or whatever. Can you explain what you mean here? > > Matt Various algorithms end simply when there is nothing left to do. This usually corresponds to either an empty slice - this is not a problem and needs be tested for anyway -, an invalid slice or an out of bounds sequence index (typically 0 or length(s)+1). In such cases, the invalid condition simply marks the end of the validity span of some computation. The processed data may or may not be bad. Currently, the interpreter always checks the validity of any index or slice, and errors out whenever a test fails. My point is: there is no need to duplicate the testing made by the interpreter, and it should do the testing. Just allow RTFatal() to do something smarter, like skipping the call or branching to some place. This would make the user code more efficient (no duplicate tests) and cleaner, as part of the error handling will simply be in the backand, where it is already. CChris -= B E G I N =- X-EUFORUM: 20632 Date: 2008 May 8 9:51 From: CChris <christian.cuvier at agricult?r?.gouv.fr> Subject: insert(sequence st,sequence what,integer index) I would suggest changing the logic of insert(), or add a newer insert() and rename the current one insert_slice(). There are two ways to insert a sequence into another: as an element or as a slice. Currently, insert() does the latter, and no routine in the stdlib does the former. I'd suggest this: 1/ Rename insert() to insert_slice(). Perhaps add to documentation that the length of the new sequence is length(st)+length(what), with atoms of length 1. 2/ Add a new insert() thus coded: <eucode> global function insert(sequence st, object what, integer index) if index > length(st) then return append(st, what) elsif index <= 1 then return prepend(what, st) end if -- there should be a builtin for the following two statement, -- as they needlessly create a new sequence instead of simply shifting -- in-place the elements of st, with all the refs and derefs. st &= 0 st[i+1..$] = st[i..$-1] st[i] = what return st end function </eucode> The length of the new sequence is always length(st)+1. Note the change from "=1" to "<=1", it should apply to the current insert() as well. When what is an atom, insert() and insert_slice() are equivalent. insert({1,2,3},{0'0},2)={1,{0,0},2,3} insert_slice({1,2,3},{0,0},2}={1,0,0,2,3} Another alternative would be to keep insert() as it is now, and coin a new name for the routine that inserts as an element. I couldn't find a satisfactory one. CChris -= B E G I N =- X-EUFORUM: 20633 Date: 2008 May 8 10:22 From: CChris <christian.cuvier at agricu??ure.gouv.fr> Subject: mid(s,x,-1) Why is -1 a special case? This is not documented. I'd expect a sequence of length -1 to be as empty as if it was of length 0 or -2. CChris -= B E G I N =- X-EUFORUM: 20634 Date: 2008 May 8 10:23 From: Kenneth Rhodes <ken_rhodes30436 at yah?o.?om> Subject: Re: insert(sequence st,sequence what,integer index) CChris wrote: > > Another alternative would be to keep insert() as it is now, and coin a new name > for the routine that inserts as an element. I couldn't find a satisfactory one. > > CChris Why not insert_element()? Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.0 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 20635 Date: 2008 May 8 10:24 From: CChris <christian.cuvier at agricultu?e.gouv?fr> Subject: remove({0,1,2,3},{2,0}) returns {0,1,0,1,2,3} Is it a bug or a feature? CChris -= B E G I N =- X-EUFORUM: 20636 Date: 2008 May 8 11:30 From: CChris <christian.cuvier at agricultu?e.?ouv.fr> Subject: Re: insert(sequence st,sequence what,integer index) Kenneth Rhodes wrote: > > CChris wrote: > > > > Another alternative would be to keep insert() as it is now, and coin a new name > > for the routine that inserts as an element. I couldn't find a satisfactory one. > > > > CChris > > Why not insert_element()? > > > Ken Rhodes > Folding at Home: <a href="http://folding.stanford.edu/">http://folding.stanford.edu/</a> > 100% MicroSoft Free > SuSE Linux 10.0 > No AdWare, SpyWare, or Viruses! > Life is Good, :-) Lengthy. I just thought about "shoehorn". It inserts /what/ by squeezing it into as little space as possible, ie 1 element. CChris -= B E G I N =- X-EUFORUM: 20637 Date: 2008 May 8 11:34 From: Jeremy Cowgar <jeremy at cowgar?co?> Subject: stack.e changes Chris, I tried to email you but I must not have a correct email address for you. But some of the unit tests for stack are now failing after the latest commit. Before committing, can you please cd tests exwc all.ex and make sure the tests still pass? the dup() and pop() for FIFO fail now. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20638 Date: 2008 May 8 11:37 From: Jeremy Cowgar <jeremy at co?gar?com> Subject: Re: insert(sequence st,sequence what,integer index) CChris wrote: > > I would suggest changing the logic of insert(), or add a newer insert() and > rename the current one insert_slice(). > Chris, This sounds fine. I see you've been committing good changes/fixes to svn, can you just commit this one too? Thanks! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20639 Date: 2008 May 8 11:38 From: Jeremy Cowgar <jeremy at ?owgar.co?> Subject: Re: insert(sequence st,sequence what,integer index) Oh! On new functions that are not yet documented that you add, can you please add on top of the function -- TODO: document Also, if they do not have any unit tests, make it: -- TODO: test, document -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20640 Date: 2008 May 8 11:40 From: Jeremy Cowgar <jeremy at c?wg?r.com> Subject: Re: mid(s,x,-1) CChris wrote: > > Why is -1 a special case? This is not documented. I'd expect a sequence of length > -1 to be as empty as if it was of length 0 or -2. > It should be documented, it's a useful feature. -1 means 1 from the end, -2 means 2 from the end, -3 means 3 from the end. 0 means the end (since in mid we cannot have $). So, if it is <= 0, it goes into a different index calculation. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20641 Date: 2008 May 8 11:41 From: Jeremy Cowgar <jeremy at cowga?.c?m> Subject: Re: remove({0,1,2,3},{2,0}) returns {0,1,0,1,2,3} CChris wrote: > > Is it a bug or a feature? > Looks like a bug to me. I am going to write a new post next about adding/editing the standard library. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20642 Date: 2008 May 8 11:42 From: Shawn Pringle <shawn.pringle at gmai??com> Subject: Re: Crash or return forbidden value? CChris wrote: > > Currently, the interpreter always checks the validity of any index or slice, > and errors out whenever a test fails. > > My point is: there is no need to duplicate the testing made by the interpreter, > and it should do the testing. Just allow RTFatal() to do something smarter, > like skipping the call or branching to some place. This would make the user > code more efficient (no duplicate tests) and cleaner, as part of the error handling > will simply be in the backand, where it is already. > > CChris What you are talking about here is building an Exception system into the interpreter. It would be analogous to try/throw/catch and Exceptions like in Java or C++. Perhaps exceptions could be less invasive than adding C++ syntax if say some new builtin routines such as a register_exception_routine were added. Routines that are passed to that function would get called in case of exceptions. There would have to be a special return mechanism for these functions. They could return to the offending routine's caller. You can put in some kind of side effect like syntax keyword: onexception (s[6] = 4) { .. } On the other hand, perhaps compiled code could remove the second check after an if statement. s[6] = 5 -- check is done to make sure s is a sequence and 6 is a valid index if sequence(s) and length(s) > 7 then s[6] = 5 -- no check is made to make sure s is a sequence for the -- the user did it. Additionally 7 and 6 are constants -- so index checking could be eliminated at compile time -- too. end if Shawn Pringle -= B E G I N =- X-EUFORUM: 20643 Date: 2008 May 8 11:57 From: Jeremy Cowgar <jeremy at cow?ar.co?> Subject: Adding to or Updating the standard library When adding to or updating the standard library, there are few things which we should all do consistently. #1... When altering the standard library at any time, the unit tests should be run to ensure things still work after your changes. If not, they should be fixed before committing. #2... When fixing a bug in the standard library, a unit test should first be created that exposes the bug. Unit tests should be run that that test should fail. The bug should then be fixed and the unit test should start working. #3... When adding a new function, we need an easy way to track it's status on two elements, 1. Has it been tested? 2. Has it been documented? So, What I've done from the start was added a comment to the top of any function that has 1 or more of these things not done: -- TODO: document, test Choose which one, or both needs to be done. However, when adding a function to the standard library, it should really be tested before being committed. Please take this step serious. #4.... (again) run unit tests. To run unit tests on Linux/FreeBSD cd $EUDIR/tests exu all.ex To run unit tests on Windows cd %EUDIR%\tests exwc all.ex -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20644 Date: 2008 May 8 12:09 From: Jeremy Cowgar <jeremy at cowgar?com> Subject: Re: Crash or return forbidden value? Shawn Pringle wrote: > > What you are talking about here is building an Exception system into the > interpreter. It would be analogous to try/throw/catch and Exceptions like > in Java or C++. Perhaps exceptions could be less invasive than adding C++ > syntax if say some new builtin routines such as a register_exception_routine > were added. The problem with this is the exception routine knows nothing about what function function caused the problem. You could pass a function name, error, etc... but that still does not help. Nor does it give the ability to recover from anything. For instance: <eucode> function exception_handler(sequence name, sequence msg, integer error) ... end function regisert_handler(...) fname = "abc.txt" f = open(fname, "r") -- abc.txt does not exist, lets say </eucode> Now, what is exception_handler suppose to do? It does not know if the app can recover or how it should recover. However, take this example: <eucode> try f = open(fname, "r") catch ex if ex[CODE] = ERR_FILE_NOT_EXIST then f = open(fname, "w") puts(f, "# File created today\n") else crash("Could not handle exception: %i %s", {ex[CODE], ex[MSG]}) end if end try </eucode> So... that takes more coding, but it's useful and can do something about the exception. Sure, the example was not that good as we can handle that now, but that's the idea. Ok, an exception system will take a lot of planning and a lot of work. What we are trying to solve right now what error condition should return an error code and what error condition should cause a crash? Many times in Euphoria code, I see ? 1/0 which the programmer feels is an error that cannot be recovered from, therefore causes a crash to terminate Euphoria with a ex.err file. We now have a better way of doing that in 4.0. You can: <eucode> crash("Fatal error I cannot recover from. Error in hard drive: %s", {hard_drive_name}) </eucode> So, this keeps a true stack trace, the user is given a realistic error message (not a divide by zero message), etc... But, the question is, when to use crash() vs. return an error code. For instance, when opening a file if it does not exist an error code is returned vs. s="Hello" ? s[500] ... an index out of bounds causes a crash. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20645 Date: 2008 May 8 12:19 From: CChris <christian.cuvier at agricult?re.gouv.fr> Subject: Re: Crash or return forbidden value? Shawn Pringle wrote: > > CChris wrote: > > > > Currently, the interpreter always checks the validity of any index or slice, > > and errors out whenever a test fails. > > > > My point is: there is no need to duplicate the testing made by the interpreter, > > and it should do the testing. Just allow RTFatal() to do something smarter, > > like skipping the call or branching to some place. This would make the user > > code more efficient (no duplicate tests) and cleaner, as part of the error handling > > will simply be in the backand, where it is already. > > > > CChris > > What you are talking about here is building an Exception system into the > interpreter. Exactly. In an earlier post, I was showing how Eiffel does it - simpler, but less flexible. It would be analogous to try/throw/catch and Exceptions like > in Java or C++. Perhaps exceptions could be less invasive than adding C++ > syntax if say some new builtin routines such as a register_exception_routine > were added. Routines that are passed to that function would get called > in case of exceptions. There would have to be a special return mechanism > for these functions. They could return to the offending routine's caller. Either the calling statement (retry) or the next one. Both have separate uses. > > You can put in some kind of side effect like syntax keyword: > onexception (s[6] = 4) { > .. > } > > > On the other hand, perhaps compiled code could remove the second check > after an if statement. > > s[6] = 5 -- check is done to make sure s is a sequence and 6 is a valid index > > if sequence(s) and length(s) > 7 then > s[6] = 5 -- no check is made to make sure s is a sequence for the > -- the user did it. Additionally 7 and 6 are constants > -- so index checking could be eliminated at compile time > -- too. > end if > > Shawn Pringle CChris -= B E G I N =- X-EUFORUM: 20646 Date: 2008 May 8 12:29 From: Jeremy Cowgar <jeremy at ?ow?ar.com> Subject: Re: eunet mods Kat wrote: > > What else does it need (keeping in mind it's a web interface, not a webpage > manager, not an irc bot, and not a firewall)? > Great! One problem I am having with it is eu with the eunet_recv(). If I pass MSG_DONTWAIT to it, then it returns right away and with no data received, in Linux, it returns: {11, ""} then when data is received, it returns "Data". So, in my check on Linux, I have to check result[1] != 11 (we have data). Now on windows, it returns a different code. I think it was 10025, but I am not certain. So, on windows I have to perform a different check. It should probably define it's own error codes and map in the cross-platform functions, to eunet's errors so programmers can simply: result[1] = NO_DATA and it will work on Windows or Linux/FreeBSD. i.e. If it's cross platform, it should work on either platform w/no changes or special handling on either platform. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20647 Date: 2008 May 8 12:44 From: Shawn Pringle <shawn.pringle at gmail.c??> Subject: Re: Crash or return forbidden value? We shouldn't assume anything about the system outside of EUPHORIA. Files and DLLs may or may not exist. They return dummy data (that is the term I learned for 'forbidden values' ). However, when the programmer user tries to index data that isn't assigned(variable has no value error) or doesn't exist(index error) then this shows a big problem in the code and what happens next if we allow this is the code will crash later continuing to do unsensible things or worse: corrupt a user's data file. For example, we do assume that if the programmer EUPHORIA code writes d[D_NAME] he knows this works and under no circumstances does he want dummy data. Even if d is not a valid dir() entry. Suppose you code: d = dir("\foo") and then try to use d[D_NAME]. If you have a small number of files you will get an error. The programmer has not coded what he has intended. If there are at least D_NAME files in \foo then as soon the programmer passes d[D_NAME] into open() the program will die. I know this is rather subjective, but I think the implementation of open is a sensible balance between dummy values vs. crashing. If the expression is not sensible, crash. If it is sensible but not valid in the system outside (the OS, the Internet) return dummy. For example: open_dll returns dummy -1. Here is a sample program I would write demonstrating how I set things up: include joy.e as joy print(1, joy:min( {5,3} ) ) -- prints 5 print(1, joy:min( 5 ) ) -- error min takes a sequence print(1, joy:min({}) ) -- runtime error since min({}) -- has no mathematical meaning in real numbers. (Don't tell me about infinity) Some people would have a min such that min({}) returns -1000000000 but to me min({}) shouldn't be a defined value. Shawn Pringle -= B E G I N =- X-EUFORUM: 20648 Date: 2008 May 8 12:45 From: CChris <christian.cuvier at agriculture?gouv?fr> Subject: Re: mid(s,x,-1) Jeremy Cowgar wrote: > > CChris wrote: > > > > Why is -1 a special case? This is not documented. I'd expect a sequence of length > > -1 to be as empty as if it was of length 0 or -2. > > > > It should be documented, it's a useful feature. -1 means 1 from the end, -2 means > 2 from the end, -3 means 3 from the end. 0 means the end (since in mid we cannot > have $). So, if it is <= 0, it goes into a different index calculation. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> This reply seems to imply that the third parameter to mid() is the end of the slice. But it is not - or the docs are wrong. Letting slice(s,start,-1) return s(start..$-1] is useful, granted. I'd suggest changing mid() and its current docs so that mid(s,start,-2) means the same as mid(s,start,length(s)-2). Here would be the code: <eucode> global function mid(sequence st, atom start, atom len) if len<0 then len += length(st) if len<0 then crash("mid(): len was %d and should be greater than %d.",{len-length(st),-length(st)}) end if end if if start > length(st) or len=0 then return "" end if if start<1 then start=1 end if if start+len-1 > length(st) then return st[start..$] elsif len+start-1 < 0 then return "" else return st[start..len+start-1] end if end function </eucode> Moved testing for start<0 upstream, as return st[start..whatever] would usually fail. Thoughts? CChris CChris -= B E G I N =- X-EUFORUM: 20649 Date: 2008 May 8 12:50 From: Jeremy Cowgar <jeremy at cowgar?co?> Subject: Re: mid(s,x,-1) CChris wrote: > > > This reply seems to imply that the third parameter to mid() is the end of the > slice. But it is not - or the docs are wrong. Letting slice(s,start,-1) return > s(start..$-1] is useful, granted. Oh! My mind must be going. Indeed, I was speaking of slice :-) > I'd suggest changing mid() and its current docs so that > mid(s,start,-2) means the same as mid(s,start,length(s)-2). Yes, that's much better. The code you showed would be fine. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20650 Date: 2008 May 8 13:10 From: CChris <christian.cuvier at agriculture?gouv?fr> Subject: Current implementation of exp() is faulty. <eucode> include machine.e include math.e ?atom_to_float64(power(E,20.0)) ?atom_to_float64 (485165195.409790277969106830541540558684638988944847254353610800315977996142709740165979850652747349447833789438961) ?atom_to_float64(power(E,12.0)) ?atom_to_float64( 162754.7914190039208080052048984867831702092844787207704435562481385967708355437387292882419094316843) ?atom_to_float64(power(E,10.0)) ?atom_to_float64( 22026.46579480671651695790064528424436635351261855678107423542635522520281857079257519912096816452590) ?atom_to_float64(power(E,8.0)) ?atom_to_float64( 2980.957987041728274743592099452888673755967939132835702208963530387730725173367530157371871490018139) ?atom_to_float64(power(E,6.0)) ?atom_to_float64( 403.4287934927351226083871805433882796058998973571292026139671883251511806339934983051788866512126648) ?atom_to_float64(power(E,5.0)) ?atom_to_float64( 148.4131591025766034211155800405522796234876675938789890467528451109120648209585760796884094598990211) ?machine_func(26,0) </eucode> Results: {253,231,104,139,8,235,188,65} {3,232,104,139,8,235,188,65} {152,124,211,84,22,222,3,65} {154,124,211,84,22,222,3,65} {93,5,149,207,157,130,213,64} {97,5,149,207,157,130,213,64} {108,12,71,125,234,73,167,64} {110,12,71,125,234,73,167,64} {141,192,144,86,220,54,121,64} {142,192,144,86,220,54,121,64} {142,51,112,153,56,141,98,64} {142,51,112,153,56,141,98,64} So, discrepancies start showing up for values of the argument as small as 6, or even smaller. The pasted strings in the code were obtained from Mathematica 5.5 asking for 100 decimal digits of precision. That's way more than hardware can hold. Suggestion for a more proper implemntation: exp(x)= (x<=5) ? power(x,E) : a=log(2) n=floor(x/a) x=remainder(x,a) return exp(x)*power(2,n) Not tested yet, but must be better. If you look at the past discussions about math.e (in 2006 or 2007), you'll see that I had already warned against this problem. Also, some useful constants were posted there, which may seem worth being included in math.e. CChris -= B E G I N =- X-EUFORUM: 20651 Date: 2008 May 8 13:26 From: Jeremy Cowgar <jeremy at c?wgar.c?m> Subject: Re: Current implementation of exp() is faulty. Are my expected values in the unit tests wrong as the unit tests pass. To get the values for the test, I used Python and took the values they reported and plugged them into the unit test. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20652 Date: 2008 May 8 13:37 From: CChris <christian.cuvier at agricul?ur?.gouv.fr> Subject: Re: stack.e changes Jeremy Cowgar wrote: > > Chris, > > I tried to email you but I must not have a correct email address for you. But > some of the unit tests for stack are now failing after the latest commit. Before > committing, can you please > > cd tests > exwc all.ex > > and make sure the tests still pass? the dup() and pop() for FIFO fail now. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Use oedoc hat free doubt fr as email, but I don't look at it in real time. Problem is that dup() is not documented. I assumed that dup() means: push the value pushed last. And in that case, the stack should be {30,30,20,10}, not {30,20,10,10}. If it was meant to duplicate the top of stack rather, then the test is right and my change is not. The pop() test fails because of the discrepancy for dup(). CChris -= B E G I N =- X-EUFORUM: 20653 Date: 2008 May 8 13:40 From: Jason Gade <jaygade at yahoo.co?> Subject: Re: Crash or return forbidden value? My take on this is that it is entirely context-dependent, since Euphoria does not have an exception system and is unlikely to get one any time soon. Some cases, such as has been mentioned with open() either create a new file or return with -1 which is known to be an invalid file handle. Other functions/procedures should return error values if it makes sense to do so and if it is possible (that is, there is an error value that is recognized as such and not as a valid return value). For functions and procedures that will definitely crash given erroneous input, it is the responsibility of the programmer to validate the input before calling the function/procedure. Basically, status quo ante. Unless and until some form of exception system has been designed. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20654 Date: 2008 May 8 13:44 From: Jeremy Cowgar <jeremy at c?wgar.co?> Subject: Re: stack.e changes CChris wrote: > > > Problem is that dup() is not documented. > I assumed that dup() means: push the value pushed last. And in that case, the > stack should be {30,30,20,10}, not {30,20,10,10}. > If it was meant to duplicate the top of stack rather, then the test is right > and my change is not. The pop() test fails because of the discrepancy for dup(). > dup() should duplicate top(). dup() could be as simple as: dup() = push(top()) I would keep the length() check in dup() so a meaningful error message can result in it's misuse. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20655 Date: 2008 May 8 13:50 From: CChris <christian.cuvier at agricul?ure.g?uv.fr> Subject: Re: Current implementation of exp() is faulty. Jeremy Cowgar wrote: > > Are my expected values in the unit tests wrong as the unit tests pass. To get > the values for the test, I used Python and took the values they reported and > plugged them into the unit test. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I don't understand either of the two tests. Why rounding the returned value? Using atom_to_float64() and the parser built in the interpreter is much better. Don't compare strings, so that you avoid more false negatives. This had already hit you about deg2rad iirc. The arguments you used (2 and 2.3) are in the range where power(x,E) returns the proper value. Try x=10 without rounding. CChris -= B E G I N =- X-EUFORUM: 20656 Date: 2008 May 8 13:59 From: Jason Gade <jaygade at y?hoo.?om> Subject: Re: Current implementation of exp() is faulty. If you are testing for exact equality, why use atom_to_float64 at all? You are still getting parsing errors when you do. Have you tried using Matt's scientific.e library? I think that has a more accurate parser. A better solution would be to use C or Python to get your expected values and store them in a file. The actual value, not a string representation. And then the unit test would open that file and compare the Euphoria output to the contents of the file. Or your C/Python test harness could do the equivalent of atom_to_float64() and store the byte values as a readable Euphoria sequence and then you could compare that or cut/paste the values directly into your unit test. But when you do "?atom_to_float64 (485165195.40979027796910683054154055868463898894484725435361080031597799614270974016 5979850652747349447833789438961)" in your source code, you will get precision errors due to the limitations of the parser. It becomes an apples and oranges comparison instead of apples and apples. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20657 Date: 2008 May 8 14:18 From: Jeremy Cowgar <jeremy at cowg?r?com> Subject: Re: Current implementation of exp() is faulty. CChris wrote: > > > I don't understand either of the two tests. Why rounding the returned value? > Using atom_to_float64() and the parser built in the interpreter is much better. > Don't compare strings, so that you avoid more false negatives. This had already > hit you about deg2rad iirc. > The arguments you used (2 and 2.3) are in the range where power(x,E) returns > the proper value. Try x=10 without rounding. > From the deg2rad discussion, it was suggested that I not use atom_to_float64, and when I tried to, I got figures slightly off. It couldn't make it match any way I did it except by placing it into a string, however, what I placed into the string was the same result I was getting from Python. Thus, I think they are right, or python is wrong too. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20658 Date: 2008 May 8 14:24 From: CChris <christian.cuvier at agr?culture.gouv?fr> Subject: Re: Current implementation of exp() is faulty. </snipped> > But when you do "?atom_to_float64 > (485165195.40979027796910683054154055868463898894484725435361080031597799614270974016 > 5979850652747349447833789438961)" in your source code, you will get precision > errors due to the limitations of the parser. It becomes an apples and oranges > comparison instead of apples and apples. > > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. Didn't Matt incorporate his parsing improvements to the interpreter? At any rate, the value provided corresponds to nearly 300 bits of precision. Even if the lowest 50 are wrong (overly pessimistic), only 17 digits would be wrong, and the parser should retrieve the exact same value, since a double only stores 53 bits. CChris -= B E G I N =- X-EUFORUM: 20659 Date: 2008 May 8 14:28 From: Jason Gade <jaygade at y?hoo.c?m> Subject: Re: Current implementation of exp() is faulty. Here's an excerpt from Matt's scientific.e documentation: "This library evaluates scientific notation to the highest level of precision possible using Euphoria atoms. An atom can have up to 16 digits of precision. A number represented by scientific notation could contain up to 17 digits. The 17th supplied digit may have an effect upon the value of the atom due to rounding errors in the calculations. This doesn't mean that if the 17th digit is 5 or higher, you should include it. The calculations are much more complicated, because a decimal fraction has to be converted to a binary fraction, and there's not really a one-to-one correspondence between the decimal digits and the bits in the resulting atom. The 18th or higher digit, however, will never have an effect on the resulting atom. " Of course, the item of interest is "there's not really a one-to-one correspondence between the decimal digits and the bits in the resulting atom." Converting from binary representation to a string is a pretty good compromise. Converting from string to a binary representation will almost always give you errors. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20660 Date: 2008 May 8 14:28 From: CChris <christian.cuvier at ?griculture.gou?.fr> Subject: Re: Adding to or Updating the standard library Jeremy Cowgar wrote: > > When adding to or updating the standard library, there are few things which > we should all do consistently. > > #1... When altering the standard library at any time, the unit tests should > be run to ensure things still work after your changes. If not, they should be > fixed before committing. > > #2... When fixing a bug in the standard library, a unit test should first be > created that exposes the bug. Unit tests should be run that that test should > fail. The bug should then be fixed and the unit test should start working. > > #3... When adding a new function, we need an easy way to track it's status on > two elements, 1. Has it been tested? 2. Has it been documented? So, What I've > done from the start was added a comment to the top of any function that has > 1 or more of these things not done: > > -- TODO: document, test > > Choose which one, or both needs to be done. > > However, when adding a function to the standard library, it should really be > tested before being committed. Please take this step serious. > > #4.... (again) run unit tests. > > To run unit tests on Linux/FreeBSD > > cd $EUDIR/tests > exu all.ex > > To run unit tests on Windows > > cd %EUDIR%\tests > exwc all.ex > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Two questions: 1/ How to unit-test that something should crash? 2/ There are three folders related to documentation: doc, html and htx. Is it proper to only modify the .htx file, as the other two will be generated anyway? How would this procedure fit into ck's reworking the doc format? CChris -= B E G I N =- X-EUFORUM: 20661 Date: 2008 May 8 14:31 From: Jason Gade <jaygade at yaho??com> Subject: Re: Current implementation of exp() is faulty. CChris wrote: > Didn't Matt incorporate his parsing improvements to the interpreter? > At any rate, the value provided corresponds to nearly 300 bits of precision. > Even if the lowest 50 are wrong (overly pessimistic), only 17 digits would be > wrong, and the parser should retrieve the exact same value, since a double only > stores 53 bits. > > CChris I've already replied to this, but the main thing is that from atom to string representation there is a many-to-one correlation. That is, several binary representations differing only in the least significant bits will translate into one string representation. I'm trying to think of the mathematical term for it, but basically that means that the function is not reversible since you necessarily lose some information in the conversion and therefore the function cannot be inverted. Even Matt's scientific.e has limits to parsing precision between decimal/string representation and the actual binary representation of a calculated number. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20662 Date: 2008 May 8 14:37 From: Jeremy Cowgar <jeremy at c?wgar.?om> Subject: Re: Adding to or Updating the standard library CChris wrote: > Two questions: > 1/ How to unit-test that something should crash? I have not solved that yet. Let me work on that now. > 2/ There are three folders related to documentation: doc, html and htx. Is it > proper to only modify the .htx file, as the other two will be generated anyway? doc and html are generated from the .htx. > How would this procedure fit into ck's reworking the doc format? It's the same process, however, the .htx structure has greatly changed. Until it's done (next few days), I would, unfortunately, just add a comment to the function that it needs documented. Any example you see in the current htx/ folder is going to change and not by a small amount either, a huge change. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20663 Date: 2008 May 8 15:11 From: CChris <christian.cuvier at agricu?ture.gou?.fr> Subject: Re: Current implementation of exp() is faulty. Jason Gade wrote: > > CChris wrote: > > Didn't Matt incorporate his parsing improvements to the interpreter? > > At any rate, the value provided corresponds to nearly 300 bits of precision. > > Even if the lowest 50 are wrong (overly pessimistic), only 17 digits would be > > wrong, and the parser should retrieve the exact same value, since a double only > > stores 53 bits. > > > > CChris > > I've already replied to this, but the main thing is that from atom to string > representation there is a many-to-one correlation. That is, several binary representations > differing only in the least significant bits will translate into one string > representation. > > I'm trying to think of the mathematical term for it, but basically that means > that the function is not reversible since you necessarily lose some information > in the conversion and therefore the function cannot be inverted. > > Even Matt's scientific.e has limits to parsing precision between decimal/string > representation and the actual binary representation of a calculated number. > > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. What I was trying to explain is that it is not a problem. The reason why it is not a problem is that the many variants of a string that will convert to the same single 8-byte sequence start with the same digits, usually the first 17 or 18, bar exceptional cases like 0.99999999999999999999999999999999999999 and 1.0. Since the strings I pasted into my code are way longer than that, the imprecision should be largely beyond what the parser will ever process. As a result, in spite of your point, it should return the proper 8-byte sequence. In order to eliminate the exceptional cases mentioned above, I also tried values that are not integers, and either fully or not representable as a double. The discrepancies remain. CChris -= B E G I N =- X-EUFORUM: 20664 Date: 2008 May 8 15:29 From: Jason Gade <jaygade at ya?oo.co?> Subject: Re: Current implementation of exp() is faulty. CChris wrote: > What I was trying to explain is that it is not a problem. > The reason why it is not a problem is that the many variants of a string that > will convert to the same single 8-byte sequence start with the same digits, > usually the first 17 or 18, bar exceptional cases like 0.99999999999999999999999999999999999999 > and 1.0. You've got this backwards: the parser will only parse the first 17 decimal characters into exactly *one* 64-bit double value. However, going from a 64-bit double value to a string of digits, more than one 64-bit value will match up to the same string of 16 digits. > Since the strings I pasted into my code are way longer than that, the imprecision > should be largely beyond what the parser will ever process. As a result, in > spite of your point, it should return the proper 8-byte sequence. > > In order to eliminate the exceptional cases mentioned above, I also tried values > that are not integers, and either fully or not representable as a double. The > discrepancies remain. > > CChris After the first 17 digits it doesn't matter and anything more is just noise. The value is not refined further, even if it could be. I quote Matt again: "The 18th or higher digit, however, will never have an effect on the resulting atom." And: "there's not really a one-to-one correspondence between the decimal digits and the bits in the resulting atom." -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20665 Date: 2008 May 8 15:32 From: Greg Haberek <ghaberek at ?mail.com> Subject: Re: wxCaret Greg Haberek wrote: > > > Bah! I compile it with Watcom and everything looks fine, but when I drop the > new DLL in %EUDIR%\BIN, I get "Could not open wxEuphoria library. Press enter > to abort." > > Why is this not working? I even recompiled wxWidgets again to be sure. It still > doesn't work. Everything looks fine when I open libwxeu.dll in Dependency Walker. I checked out the SVN source and got the wxCaret routines into that wxEuphora.cpp, and the functions into exports.lbc. The SVN source compiles and works correctly (unlike my downloaded source). However, I'm missing "stringhash.e" which is used by wrap.exw. Where do I get this? I can't find it in the Archive. -Greg -= B E G I N =- X-EUFORUM: 20666 Date: 2008 May 8 16:15 From: CChris <christian.cuvier at agriculture?gouv.fr> Subject: Re: Current implementation of exp() is faulty. Jason Gade wrote: > > CChris wrote: > > What I was trying to explain is that it is not a problem. > > The reason why it is not a problem is that the many variants of a string that > > will convert to the same single 8-byte sequence start with the same digits, > > usually the first 17 or 18, bar exceptional cases like 0.99999999999999999999999999999999999999 > > and 1.0. > > You've got this backwards: the parser will only parse the first 17 decimal characters > into exactly *one* 64-bit double value. However, going from a 64-bit double > value to a string of digits, more than one 64-bit value will match up to the > same string of 16 digits. > > > Since the strings I pasted into my code are way longer than that, the imprecision > > should be largely beyond what the parser will ever process. As a result, in > > spite of your point, it should return the proper 8-byte sequence. > > > > In order to eliminate the exceptional cases mentioned above, I also tried values > > that are not integers, and either fully or not representable as a double. The > > discrepancies remain. > > > > CChris > > After the first 17 digits it doesn't matter and anything more is just noise. > The value is not refined further, even if it could be. > > > I quote Matt again: > "The 18th or higher digit, however, will never have an effect on the resulting > atom." > > And: > > "there's not really a one-to-one correspondence between the decimal digits and > the bits in the resulting atom." > > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. Both quootes are right, but we still don't understand each other. The pasted in strings come from a professional software specialised in maths computations, not from anything written in Euphoria. So I'm sure most of the digits there are not noise. To guard against any cutoff effect, I requested many more digits than should matter to compute a double. As I said, that way, even if the last few were noise, it wouldn't matter. All relevant digits are guaranteed. Which Euphoria parser are you talking about? Neither get() nor value() are invoked. When exwc.exe reads "atom_to_float64(1565146.159101750457681234), it uses an internal routine, called my_sscanf() in source\scanner.e, which turns a string into atoms. This routine does not check how many decimal places are given. But indeed, the 18th digit will very rarely matter at all. I tried the implementation I suggested, but it is closer to the exact value only for x>=10 or slightly below. For x greater than say 20, it is almost good. CChris -= B E G I N =- X-EUFORUM: 20667 Date: 2008 May 8 16:27 From: Jeremy Cowgar <jeremy at cowg?r.com> Subject: Revision 417 -- tests are broke Chris, I did an SVN up and the tests do not run any more due to a syntax error, missing an ending paren in two places. Then when I run the tests, functions that previously worked no longer work. Can you please run the unittests before committing? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20668 Date: 2008 May 8 16:27 From: Jason Gade <jaygade at yahoo.?om> Subject: Re: Current implementation of exp() is faulty. CChris wrote: > Both quootes are right, but we still don't understand each other. > > The pasted in strings come from a professional software specialised in maths > computations, not from anything written in Euphoria. So I'm sure most of the > digits there are not noise. Heh. Yes, we are not understanding one another! :) Yes, I know you are using Mathemetica, right? I'm not saying that the digits *from Mathematica* are noise. I'm saying is that they are noise as an input, not as an output. > To guard against any cutoff effect, I requested > many more digits than should matter to compute a double. > As I said, that way, even if the last few were noise, it wouldn't matter. All > relevant digits are guaranteed. > > Which Euphoria parser are you talking about? > Neither get() nor value() are invoked. > When exwc.exe reads "atom_to_float64(1565146.159101750457681234), it uses an > internal routine, called my_sscanf() in source\scanner.e, which turns a string > into atoms. This routine does not check how many decimal places are given. But > indeed, the 18th digit will very rarely matter at all. I could be talking about any parser. The error is still there. > > I tried the implementation I suggested, but it is closer to the exact value only > for x>=10 or slightly below. For x greater than say 20, it is almost good. > > CChris Here's the problem: You use Mathematica to calculate a value, which it does using an arbitrary precision and who knows how the number is stored internally. Then you print out that number which is now in a decimal representation as represented by a string of ASCII characters. Then you take said string of ASCII characters and, using Euphoria (value(), get(), my_sscanf() doesn't matter) and convert those ASCII characters back to a binary representation of a number. This becomes your "expect" value. Within the program under test, first a number is converted from ASCII to a binary representation. Then some operations are performed on that binary representation (raising e to some power, say). Now, this binary representation can differ by several least significant bits from your expect value because of parsing precision errors. But if you converted from double to ASCII and then printed out the decimal representation, it should match the first 16 significant figures of your expect string. I don't have Euphoria handy right now, but if we are still miscommunicating then I'll try an experiment later and post the results. Basically, take a number with 17 significant figures. Use atom_to_float64() to get the byte representation of it. Change the least significant bits by some number, say 1 or 2 or 4 or 8 or whatever. Then use float64_to_atom() and then print out the number and compare to your original number. Maybe I'm wrong. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20669 Date: 2008 May 8 16:42 From: Jason Gade <jaygade at ?ah?o.com> Subject: Re: Current implementation of exp() is faulty. Oh, and just to clarify: Matt's comments come from his scientific.e library in the archive, which contains its own number parse routines that I believe are more accurate than the one built into the interpreter parser. I believe they would still suffer from conversion errors, just not as pronounced. Again, I'll have to experiment later. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20670 Date: 2008 May 8 16:48 From: Jeremy Cowgar <jeremy at cowgar.??m> Subject: Re: Revision 417 -- tests are broke Jeremy Cowgar wrote: > > Chris, > > I did an SVN up and the tests do not run any more due to a syntax error, missing > an ending paren in two places. > > Then when I run the tests, functions that previously worked no longer work. > > Can you please run the unittests before committing? > Ok, after fixing the syntax errors in the unittests, I looked at the results. The functions are returning incorrect values. So, my subject is not correct. The tests are not broke, the functions are. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20671 Date: 2008 May 8 16:49 From: Jason Gade <jaygade at yaho?.com> Subject: Re: Current implementation of exp() is faulty. CChris wrote: > Results: > {253,231,104,139,8,235,188,65} > {3,232,104,139,8,235,188,65} > {152,124,211,84,22,222,3,65} > {154,124,211,84,22,222,3,65} > {93,5,149,207,157,130,213,64} > {97,5,149,207,157,130,213,64} > {108,12,71,125,234,73,167,64} > {110,12,71,125,234,73,167,64} > {141,192,144,86,220,54,121,64} > {142,192,144,86,220,54,121,64} > {142,51,112,153,56,141,98,64} > {142,51,112,153,56,141,98,64} You can see what I'm saying right here in your output -- the differences are in the least significant bits (the first element or two of the sequence). Try converting these byte sequences to numbers and then print out the decimal representation of them and see if they match. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20672 Date: 2008 May 8 17:36 From: CChris <christian.cuvier at agricu?ture.gouv?fr> Subject: Re: Revision 417 -- tests are broke Jeremy Cowgar wrote: > > Jeremy Cowgar wrote: > > > > Chris, > > > > I did an SVN up and the tests do not run any more due to a syntax error, missing > > an ending paren in two places. > > > > Then when I run the tests, functions that previously worked no longer work. > > > > Can you please run the unittests before committing? > > > > Ok, after fixing the syntax errors in the unittests, I looked at the results. > The functions are returning incorrect values. So, my subject is not correct. > The tests are not broke, the functions are. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Running the unit tests means the interpreter should choose the right include files, and it must be the the right interpreter as well. EUING and EUDIR normally take care, but changing them under Windows is a pain (need to reboot the machine). Is anything like configuration files that override the environment working? btw, which routines don't return as expected? CChris -= B E G I N =- X-EUFORUM: 20673 Date: 2008 May 8 17:50 From: Jeremy Cowgar <jeremy at c?wgar.c?m> Subject: Re: Revision 417 -- tests are broke CChris wrote: > > Running the unit tests means the interpreter should choose the right include > files, and it must be the the right interpreter as well. EUING and EUDIR normally You have to test functions before committing though! How do you know if they work? For instance, some things added were missing a ending paren. Please do not commit without testing. The repo has been broke for some time now. Other people working on functions for standard library (me right now, but in the future others as well) cannot really proceed because unit testing is broke, etc... We must do our best to keep the repo in a working order. There will always be times when we commit something that doesn't work on accident or that has a serious flaw we did not detect, but it should not be because we didn't test what we've changed. > Is anything like configuration files that override the environment working? No, but the way I do it is pretty easy (I think). I have: C:\EUPHORIA C:\EUPHORIA31 -or- C:\EUPHORIA40 I then have two batch files: eu40.bat eu31.bat eu40.bat simply: 1. renames C:\EUPHORIA to C:\EUPHORIA31 2. renames C:\EUPHORIA40 to C:\EUPHORIA eu31.bat simply: 1. renames C:\EUPHORIA to C:\EUPHORIA40 2. renames C:\EUPHORIA31 to C:\EUPHORIA I then keep: SET EUDIR=C:\EUPHORIA SET PATH=C:\EUPHORIA\BIN;%PATH% > btw, which routines don't return as expected? Well, that's hard to say because I only get a few bad returns before Euphoria crashes. regex.e: failed: search_replace() #1. expected: "the ABC ran ABC" but got: { 116't', 104'h', 101'e', 32' ', "ABC", 32' ', 114'r', 97'a', 110'n', 32' ', "ABC" } failed: search_replace_user() #1. expected: "the dog ran up" but got: { 116't', 104'h', 101'e', 32' ', "dog", 32' ', 114'r', 97'a', 110'n', 32' ', "up" } sequence.e: failed: split_adv() single sequence delimiter. expected: { "while 1 ", " end while ", "" } but got: { "while 1 ", "", " en", " while ", "", "" } Then I get: /opt/euphoria/include/sequence.e:103 in function remove() type_check failure, start is 1.5 ... called from ./t_sequence.e:56 --> See ex.err Can you please fix these mistakes and then run the unit tests to make sure they are working again and commit the fixes? To run the unit tests takes about 3 seconds and to run them, you: C:\ > cd C:\EUPHORIA\TESTS C:\EUPHORIA\TESTS > exwc all.ex -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20674 Date: 2008 May 8 18:19 From: "Euler German" <eulerg at gmail.com> Subject: Re: Trace window - active? > On 7 May 2008 at 23:27, Kat wrote (maybe snipped): > Mike777 wrote: > > > > I'm pretty sure that this can't be done, but I thought I would at > > least ask. When the trace window is displayed I can interrogate any > > variable by typing the question mark, the name of the variable and > > hitting enter. If the value isn't already displayed in the bottom > > portion of the window, it will then be displayed. > > > > So far, so good. > > > > Is there any way to interactively modify the value of a variable? > > For example, it would be quite nice if I could type > > > > ? SP=2 > > > > to change the value SP to 2 so that I could test various > > continuations. This sort of "active" debug window exists in many of > > the Microsoft Office applications (Access, Excel), so I've grown > > quite fond of it over the years. > > > > But I suspect the answer is that it can't be done. > > > > Mike > I really don't see why not. It would be very handy indeed. Maybe now that source code is open a clever soul could help. BTW, does J=FCrgen L=FCthje sill fiddling here? > I asked for this years ago too. > Along with 'goto' IIRC. ;-) > Kat > Best, Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 20675 Date: 2008 May 8 18:28 From: CChris <christian.cuvier at agricul?ure.gouv.?r> Subject: Re: Revision 417 -- tests are broke Jeremy Cowgar wrote: > > CChris wrote: > > > > Running the unit tests means the interpreter should choose the right include > > files, and it must be the the right interpreter as well. EUING and EUDIR normally > > You have to test functions before committing though! How do you know if they > work? For instance, some things added were missing a ending paren. Please do > not commit without testing. The repo has been broke for some time now. Other > people working on functions for standard library (me right now, but in the future > others as well) cannot really proceed because unit testing is broke, etc... > > We must do our best to keep the repo in a working order. There will always be > times when we commit something that doesn't work on accident or that has a serious > flaw we did not detect, but it should not be because we didn't test what we've > changed. > > > Is anything like configuration files that override the environment working? > > No, but the way I do it is pretty easy (I think). I have: > > C:\EUPHORIA > C:\EUPHORIA31 -or- C:\EUPHORIA40 > > I then have two batch files: > > eu40.bat > eu31.bat > > eu40.bat simply: > > 1. renames C:\EUPHORIA to C:\EUPHORIA31 > 2. renames C:\EUPHORIA40 to C:\EUPHORIA > > eu31.bat simply: > > 1. renames C:\EUPHORIA to C:\EUPHORIA40 > 2. renames C:\EUPHORIA31 to C:\EUPHORIA > > I then keep: > > SET EUDIR=C:\EUPHORIA > SET PATH=C:\EUPHORIA\BIN;%PATH% > > > btw, which routines don't return as expected? > > Well, that's hard to say because I only get a few bad returns before Euphoria > crashes. > > regex.e: > failed: search_replace() #1. expected: "the ABC ran ABC" but got: { > 116't', > 104'h', > 101'e', > 32' ', > "ABC", > 32' ', > 114'r', > 97'a', > 110'n', > 32' ', > "ABC" > } > failed: search_replace_user() #1. expected: "the dog ran up" but got: { > 116't', > 104'h', > 101'e', > 32' ', > "dog", > 32' ', > 114'r', > 97'a', > 110'n', > 32' ', > "up" > } > sequence.e: > failed: split_adv() single sequence delimiter. expected: { > "while 1 ", > " end while ", > "" > } but got: { > "while 1 ", > "", > " en", > " while ", > "", > "" > } > > Then I get: > > /opt/euphoria/include/sequence.e:103 in function remove() > type_check failure, start is 1.5 > > ... called from ./t_sequence.e:56 > > --> See ex.err > > > Can you please fix these mistakes and then run the unit tests to make sure they > are working again and commit the fixes? To run the unit tests takes about 3 > seconds and to run them, you: > > C:\ > cd C:\EUPHORIA\TESTS > C:\EUPHORIA\TESTS > exwc all.ex > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> The issue with split_adv() had occurred while I was testing, but I no longer get it. Adding ?split_adv("while 1 do end while do","do",0,0)?1/0 to sequence.e and running it (under 3.1), I get the expected result as shown in t_sequence.e. Guess I'll have to do the rename trick to keep going, including for compiling 4.0 (intoptions, get_switches and three other unknown refs at link time). CChris Running -= B E G I N =- X-EUFORUM: 20676 Date: 2008 May 8 18:28 From: c.k.lester <euphoric at cklest?r.co?> Subject: Re: Adding to or Updating the standard library Jeremy Cowgar wrote: > It's the same process, however, the .htx structure has greatly changed. Until > it's done (next few days), I would, unfortunately, just add a comment to the > function that it needs documented. I update before every commit, so go ahead and make whatever changes you want, CC... No need to wait, I think. -= B E G I N =- X-EUFORUM: 20677 Date: 2008 May 8 18:32 From: Jeremy Cowgar <jeremy at c?wgar.co?> Subject: Re: Revision 417 -- tests are broke CChris wrote: > > Guess I'll have to do the rename trick to keep going, including for compiling > 4.0 (intoptions, get_switches and three other unknown refs at link time). > Do you have 4.0? I've been able to help get 4.0 compiling on a few other peoples machines via IRC. If you are having problems with those undefined vars/functions or whatever, I can help on IRC get that resolved. irc.freenode.net #euphoria -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20678 Date: 2008 May 8 18:46 From: abec <cccompany at gmail?com> Subject: win32lib getLVAllText() Hi all, Returns an extra empty element. e.g. if there are 2 colums, 1 has "John" and the other has "Major", getLVAllText() returns {"John","Major",{}} Abec -= B E G I N =- X-EUFORUM: 20679 Date: 2008 May 8 18:50 From: CChris <christian.cuvier at agricult?re.gou?.fr> Subject: Re: Revision 417 -- tests are broke Jeremy Cowgar wrote: > > CChris wrote: > > > > Guess I'll have to do the rename trick to keep going, including for compiling > > 4.0 (intoptions, get_switches and three other unknown refs at link time). > > > > Do you have 4.0? I've been able to help get 4.0 compiling on a few other peoples > machines via IRC. If you are having problems with those undefined vars/functions > or whatever, I can help on IRC get that resolved. > > irc.freenode.net #euphoria > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I'm told that "It works!". Happy, but not quite... CChris -= B E G I N =- X-EUFORUM: 20680 Date: 2008 May 8 20:02 From: Jeremy Cowgar <jeremy at cowga?.c?m> Subject: Re: Revision 417 -- tests are broke CChris wrote: > > I'm told that "It works!". Happy, but not quite... > I'm not sure I follow. I did an svn up and the same tests still fail. Are you talking about the compile worked? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20681 Date: 2008 May 8 20:23 From: Mike777 <anon4321 at g??il.com> Subject: Re: win32Lib - newUIObj bug? CChris: I've got the trace window up and can give you any information about whatever variables you want to see, if that will help narrow this down. I'm on IRC if you have the time to chat real time. The trace is definitely in an infinite loop within creeateex. Thanks Mike Mike777 wrote: > > CChris wrote: > > > > Mike777 wrote: > > > > > > CChris wrote: > > > > > > > > Mike777 wrote: > > > > > > > > > > I am using Judith's IDE. I establish my main Windows through the IDE. All > > > > > other controls are built using newUIObj. > > > > > > > > > > It doesn't appear to me that the id's of the defined windows are available > to</font></i> > > > > > the newUIObj procedure. When I set trace on and find myself in that procedure, > > > > > when I type a ? and then enter the name of a window, I get a message saying > > > > > that it is undefined. > > > > > > > > > > In my program, when I get to the Owner portion of the newUIObj procedure > at</font></i> > > > > > around line 2081 of w32forms.ew I find that none of my window variables are > > > > > available to set the parent. The parent is therefore set to be zero, and > I </font></i> > > > > > end up with a race condition when the program executes the CreateEx function > > > > > at around line 2400. My line numbers may not be exact because I've peppered > > > > > the procedure at the moment with message_boxes. > > > > > > > > > > When I force the lOwner variable value to be "110" with the following code, > > > > > the createex works just fine: > > > > > > > > > > if compare(lData,"MySpecialWindow") = 0 then > > > > > lOwner = 110 > > > > > end if > > > > > > > > > > Is it a bug that the newUIObj routine doesn't seem to be able to execute > the:</font></i> > > > > > > > > > > lOwner = getNameId(w32trim(lData)) > > > > > > > > > > line and get back a valid id (it always returns zero)? > > > > > > > > > > Thanks > > > > > > > > > > Mike > > > > > > > > I just ran the rebar.exw demo, and that line 2083 returns quite a few nonzero > > > > values, as you can check by adding "?lOwner" to it.. > > > > I think I need to see some code sample of yours. > > > > > > Thanks for the quick reply. > > > > > > It doesn't surprise me that the rebar.exw demo doesn't hit the nail on the head. > > > There are (at least) two characteristics of my routine which are not present > > > in that very short demo. > > > > > > First, I am attempting to create tab controls directly off of a window control. > > > That is, the window control is the parent to the tab control. The rebar demo > > > doesn't build any tab controls. > > > > > > Second, I am doing so after destroying a previously built tab control. Again, > > > no destroy commands are found in rebar. > > > > > > I end up with a race condition when the CreateEx is executed when attempting > > > to (re) create the tab control after the first time around was destroyed. The > > > first time around it is named myTabControl1, the second time myTabControl2, > > > etc. > > > > > > If I force the parent to be the id of the Window the CreateEx which is supposed > > > to build the tab control runs without fail. > > > > > > Since I'm using newUIObj directly there is quite a bit of code that goes into > > > creating the string that is passed to newUIObj. But the result is a loop that > > > does the following: > > > > > > 1. Add a tab control to the window > > > 2. Add tab index to tab control > > > 3. Add a series of controls to the tab index > > > 4. Destroy the tab control (which theoretically should destroy the tab index > > > and all of the controls on the tab index) > > > 5. Add a tab control to the window > > > > > > Step five gives me a race condition on the CreateEx even though it uses the > > > exact same text that was used in step 1, except the name of the control would > > > have a "2" in it where it previously had a "1" (e.g., myTabControl2). > > > > > > Step file does not give me a race condition on the CreateEx if I force the parent > > > to be the IDNo of the window. > > > > > > I'm not terribly good at reducing the code down to a manageable level in order > > > to replicate the problem. > > > > > > But if the above isn't enough I'll certainly give it a shot. > > > > > > My next step is to go through the CreateEx routine and attempt to find the code > > > where the loop is. So far, I've found that the loop exists because the variable > > > SP is set to 2, then 3, then back to 2. It has to do with the stack. The idStack > > > is changing between {3,113,90,34,0,0,0,0,0,0} and {3,113,110,34,0,0,0,0,0,0}. > > > When we get to the pushSelf procedure the value of the third element is changed > > > as indicated and SP changes to 3. The corresponding popSelf changes SP back > > > to 2. > > > > > > Don't know whether the above helps at all. > > > > > > Thanks again. > > > > > > Mike > > > > If I got it right: > > * at step 3, you create controls with the initial tab control as parent. > > Slight modification. I create controls that have the tab index as the parent. > The tab control is the grandparent (parent to the tab index). The main window > is the great-grandparent. > > MySpecialWindow > --- myTabControl1 > ------myTabIndex1 > ---------myGroup1 > ------------myGroup1Option1 > ------------myGroup1Option2 > ------------myGroup1Edit1 > ---------myEditControl1 > ---------myGroup2 > ------------myGroup2Option1 > ------------myGroup2Option2 > ------------myGroup2Edit1 > > > So, > > the last parent newUIObj() knows about is that tab control. > > The last "parent" that newUIObj knows about is the last parent of the last > control inserted into the tab page (tab index). In fact, I might have 2 groups > on the tab page, each of which have 2 options (checkboxes or radiouttons) and > a multi-line edit control. If all I'm interested in is the last parent, it > can be two or more levels down from the tab control being deleted. > > > * at step 4, you destroy it. newUIObj() has no way to know. You may have > > done > > it by calling the API, or another process did it; > > As mentioned below, I could (should?) have provided you with an example line > so you would see that it is destroyed using win32Lib's destroy command. > > destroy(getNameId("myTabControl1")) > > > * at step 5, you create a tab control without giving a parent. So the parent > > is the destroyed tab control, its id is either invalid or, from getNameId(), > > 0. > > Again, the actual line would have shown that I am giving it an explicit parent: > > newUIObj("TabControl,myTabControl2,myTabControl2,0,0,1200,950,parent=MySpecialWindow") > > > > Create the second tab control (step 5) with an explicit OWNER= directive. ? > > It makes sense that you have to tell newUIObj() that the world had changed > > between two contiguous calls. > > I certainly agree and I have always done that. > > > Did I miss anything else? > > Depends on your point of view. I think so, but then again I was probably too > cryptic. You certainly missed what I didn't provide (how could you not have?). > In other words, if I had shown you the precise coding you would have immediately > seen that my newUIObj command includes parent=MySpecialWindow so I already have > an explicit equivalent to OWNER=. > > I had thought I implied that with my coding in my initial post: > > if compare(lData,"MySpecialWindow") = 0 then > > in that lData does, in fact, have "MySpecialWindow" as its value so when the > parent portion of the routine is executed my test for that "works" and I can > insert 110 as the owner. I remain baffled why, at that very moment, a getNameId("MySpecialWindow") > returns 0 when I know it is 110. I know the mechanics of *how* it returns zero: > it is because MySpecialWindow (the name of the window) returns a Not Defined > on the trace window. Whereas other times through the same routine (newUIObj) > getNameId("MySpecialWindow") will return 110. > > With the IDE, the main windows are all built when the program is initialized > and the id's are set from that point forward. I thought. > > Thanks for sticking with me on this one. I know it is a tough one to hunt down. > > Mike -= B E G I N =- X-EUFORUM: 20682 Date: 2008 May 8 21:05 From: CChris <christian.cuvier at agricultur?.g?uv.fr> Subject: Re: Revision 417 -- tests are broke At revision 424: All tests for sequence.e and search.e pass under Eu 3.1.1 . I cannot yet compile Eu 4.0 under WinXP, OpenWatcom 1.7, getting these errors, already reported iirc: linking all the files... Warning! W1008: cannot open graph.lib : No such file or directory Error! E2028: _4wildcard_file_ is an undefined reference Error! E2028: _18scientific_to_atom_ is an undefined reference Error! E2028: _22intoptions_ is an undefined reference Error! E2028: _23get_switches_ is an undefined reference Error! E2028: compile_pcre_ is an undefined reference Error! E2028: exec_pcre_ is an undefined reference file file.obj(C:\EUPHORIA\source\file.c): undefined symbol _4wildcard_file_ file scanner.obj(C:\EUPHORIA\source\scanner.c): undefined symbol _18scientific_t o_atom_ file backend.obj(C:\EUPHORIA\source\backend.c): undefined symbol _22intoptions_ file backend.obj(C:\EUPHORIA\source\backend.c): undefined symbol _23get_switches _ file be_machine.obj(C:\EUPHORIA\source\be_machine.c): undefined symbol compile_p cre_ file be_machine.obj(C:\EUPHORIA\source\be_machine.c): undefined symbol exec_pcre _ irc.freenode.net displays a page saying "It works!" Good to know, but not quite functional... CChris -= B E G I N =- X-EUFORUM: 20683 Date: 2008 May 8 21:15 From: CChris <christian.cuvier at ag?icu?ture.gouv.fr> Subject: Re: win32Lib - newUIObj bug? getNameId() was changed in 70.4a. Please paste this to replace the current body of getNameId(), and tell me if it gets you going: <eucode> global function getNameId(sequence pName) integer p pName=makeStandardName(pName) p=find(pName, ctrl_Name) if p=0 then return 0 end if while not validId(p) do p=find_from(pName, ctrl_Name,p+1) if p=0 then return 0 end if end while return p end function </eucode> CChris -= B E G I N =- X-EUFORUM: 20684 Date: 2008 May 8 21:23 From: Jeremy Cowgar <jeremy at cowgar.?om> Subject: Re: Revision 417 -- tests are broke Chris, I noticed in r424, that the change log message is: Now all tests pass for sequence.e and search.e under Eu3.1 Do you have 4.0 installed? It really does not matter if the 4.0 libs pass in 3.1. It may not pass in 4.0 due to internal changes or, for instance, requiring 4.0 internal features. We really need to test 4.0 with 4.0. Do you have it installed? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20685 Date: 2008 May 8 21:27 From: Jeremy Cowgar <jeremy at c?w?ar.com> Subject: Re: Revision 417 -- tests are broke CChris wrote: > > > irc.freenode.net displays a page saying "It works!" Good to know, but not quite > functional... > Huh that's strange. However, you do not need to connect via a web browser. You need to use an IRC client. mirc for windows is a nice one, or you can connect via: http://www.rapideuphoria.com/chatroom.html That will get you in too. Please come and we will get your problems figured out w/4.0 compiling. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20686 Date: 2008 May 8 21:27 From: CChris <christian.cuvier at ag?icul?ure.gouv.fr> Subject: Re: win32lib getLVAllText() abec wrote: > > Hi all, > Returns an extra empty element. e.g. if there are 2 colums, 1 has "John" and > > the other has "Major", getLVAllText() returns {"John","Major",{}} > > Abec In getLVItemText(), in win32lib.ew, find the lines: <eucode> elsif atom(column) then text = append(text, "") end if </eucode> and make the test as <eucode> elsif atom(column) and column > 0 then end if </eucode> If this is the problem, it's a very old bug (code was there in v57.1). CChris -= B E G I N =- X-EUFORUM: 20687 Date: 2008 May 8 21:29 From: Jeremy Cowgar <jeremy at cow?ar.?om> Subject: Re: Revision 417 -- tests are broke CChris wrote: > > > At revision 424: > All tests for sequence.e and search.e pass under Eu 3.1.1 . > stack.e still fails but the others are cleared up, yay! Thanks. stack.e: failed: FIFO dup(). expected: {1,30,20,10,10} but got: {1,30,30,20,10} failed: FIFO pop() #1. expected: {1,30,20} but got: {1,30,30} -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20688 Date: 2008 May 8 21:32 From: don cole <doncole at p?cbell.?et> Subject: Layers to Tabs Hello everybody, I have 2 Layers set up in IDE. How can I make Tabs out of them? Don Cole -= B E G I N =- X-EUFORUM: 20689 Date: 2008 May 8 21:33 From: CChris <christian.cuvier at a??iculture.gouv.fr> Subject: Re: Revision 417 -- tests are broke Jeremy Cowgar wrote: > > CChris wrote: > > > > > > At revision 424: > > All tests for sequence.e and search.e pass under Eu 3.1.1 . > > > > stack.e still fails but the others are cleared up, yay! Thanks. > > stack.e: > failed: FIFO dup(). expected: {1,30,20,10,10} but got: {1,30,30,20,10} > failed: FIFO pop() #1. expected: {1,30,20} but got: {1,30,30} > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> As I mentioned earlier, it depends on whether dup() is supposed to duplicate the last pushed value or the top(). I don't remember you replied to this. The second failure is caused by the same issue, since the stack is not in the expected shape. CChris PS: Looks like a test for the tests is needed :-) -= B E G I N =- X-EUFORUM: 20690 Date: 2008 May 8 21:36 From: Jeremy Cowgar <jeremy at cowg?r?com> Subject: Re: Revision 417 -- tests are broke CChris wrote: > > > As I mentioned earlier, it depends on whether dup() is supposed to duplicate > the last pushed value or the top(). I don't remember you replied to this. > The second failure is caused by the same issue, since the stack is not in the > expected shape. > > CChris > PS: Looks like a test for the tests is needed :-) http://www.openeuphoria.org/EUforum/m20654.html :-) dup() should duplicate the top item. Whenever working with a stack, almost everything happens to the top item. swap() for instance, swaps the top item with the one below it. drop() (pop()) removes the top item, etc... -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20691 Date: 2008 May 8 21:41 From: Jeremy Cowgar <jeremy at cowga??com> Subject: Re: Revision 417 -- tests are broke CChris wrote: > PS: Looks like a test for the tests is needed :-) Well, about unit testing. When the author writes a new function, he/she writes a tests to ensure it's working like they think it should. If a change is made and that test no longer works, then it should be assumed that since it's in the repo that the author gave it's functionality his/her stamp of approval. So, that means that it's working according to their spec of how it should work. Now, as you found in a couple of places, maybe their spec was wrong. If you think it was but are unsure, then you should contact them about it and ask, why is it doing it like this. In a few today that you found, it was clear the spec (or name) was a tad off, so fixing it is good. So, I do not think a test needs to be made for the tests, we just need to ensure that the tests are run and continue to pass and if not, figure out why. For instance, right now the document generation uses the new 4.0 stack (it is, after all the 4.0 doc generator). Luckily it uses the FILO stack, otherwise, CK lester would have been out of business today because the stack is broke. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20692 Date: 2008 May 8 21:52 From: CChris <christian.cuvier at agr?culture.go?v.fr> Subject: Re: Revision 417 -- tests are broke Jeremy Cowgar wrote: > > CChris wrote: > > > > > > As I mentioned earlier, it depends on whether dup() is supposed to duplicate > > the last pushed value or the top(). I don't remember you replied to this. > > The second failure is caused by the same issue, since the stack is not in the > > expected shape. > > > > CChris > > PS: Looks like a test for the tests is needed :-) > > <a href="http://www.openeuphoria.org/EUforum/m20654.html">http://www.openeuphoria.org/EUforum/m20654.html</a> > > :-) > > dup() should duplicate the top item. Whenever working with a stack, almost everything > happens to the top item. swap() for instance, swaps the top item with the one > below it. drop() (pop()) removes the top item, etc... > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Ok, reverting the changes to stack.e then. CChris -= B E G I N =- X-EUFORUM: 20693 Date: 2008 May 8 22:10 From: Jeremy Cowgar <jeremy at co?gar.co?> Subject: Re: Revision 417 -- tests are broke CChris wrote: > > > Ok, reverting the changes to stack.e then. > push() acts differently depending on type of stack... FIFO = First in first out or FILO = First in last out. So, since push alters which end of the stack items are added to, that allows functions like dup(), top(), at(), swap() all to work the same way regardless of stack type. BTW... Just SVN up'ed 636 tests run, 636 passed, 0 failed, 100% success Yay! Yay! Yay! Thanks! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20694 Date: 2008 May 8 22:15 From: Mike777 <anon4321 at gma??.com> Subject: Re: win32Lib - newUIObj bug? CChris wrote: > > getNameId() was changed in 70.4a. Please paste this to replace the current body > of getNameId(), and tell me if it gets you going: > <eucode> > global function getNameId(sequence pName) > integer p > > pName=makeStandardName(pName) > p=find(pName, ctrl_Name) > if p=0 then > return 0 > end if > while not validId(p) do > p=find_from(pName, ctrl_Name,p+1) > if p=0 then > return 0 > end if > end while > return p > end function > </eucode> I wanted to take the time to do this, although I sort of knew it wouldn't help. At the point in CreateEx that the program attempts to assign the parent, it has the value for the parent per the token (MySpecialWindow) but when I interrogate the trace window for the values of all of my windows, they are not there. Hence, getNameId("avariablethatdoesnotexist") will always return a zero. Something appears to be wrong with my scoping (which is truly bizarre), because at this point, no matter how explicitly I set the Owner in the newUIObj instruction, the createEx routine won't be able to assign the parent if the ids are just not there. I'm going to run this again and go through the procedure in detail for a control where the parent IS set properly. I'll post after that. Thanks for trying. Mike -= B E G I N =- X-EUFORUM: 20695 Date: 2008 May 8 22:53 From: Mike777 <anon4321 at gmai?.?om> Subject: Re: win32Lib - newUIObj bug? An interim report here: I have found that using the trace window is fundamentally inconsistent with the message_box function. It, in itself, creates an infinite loop. I need to eliminate that loop before I can get back to the main issue at hand. Mike Mike777 wrote: > > CChris wrote: > > > > getNameId() was changed in 70.4a. Please paste this to replace the current body > > of getNameId(), and tell me if it gets you going: > > <eucode> > > global function getNameId(sequence pName) > > integer p > > > > pName=makeStandardName(pName) > > p=find(pName, ctrl_Name) > > if p=0 then > > return 0 > > end if > > while not validId(p) do > > p=find_from(pName, ctrl_Name,p+1) > > if p=0 then > > return 0 > > end if > > end while > > return p > > end function > > </eucode> > > I wanted to take the time to do this, although I sort of knew it wouldn't help. > At the point in CreateEx that the program attempts to assign the parent, it > has the value for the parent per the token (MySpecialWindow) but when I interrogate > the trace window for the values of all of my windows, they are not there. Hence, > getNameId("avariablethatdoesnotexist") will always return a zero. > > Something appears to be wrong with my scoping (which is truly bizarre), because > at this point, no matter how explicitly I set the Owner in the newUIObj instruction, > the createEx routine won't be able to assign the parent if the ids are just > not there. > > I'm going to run this again and go through the procedure in detail for a control > where the parent IS set properly. > > I'll post after that. > > Thanks for trying. > > Mike -= B E G I N =- X-EUFORUM: 20696 Date: 2008 May 8 23:52 From: Jason Gade <jaygade at yahoo?com> Subject: Re: New mailing list for SVN commits Jeremy Cowgar wrote: > > There is a new read-only mailing list for anyone interested in seeing the SVN > commit log messages and diff's go by as developers of Euphoria add new code. > No discussion will be on the list. Just for those that are interested. > > You can join the list: > > <a href="http://lists.sourceforge.net/lists/listinfo/rapideuphoria-commits">http://lists.sourceforge.net/lists/listinfo/rapideuphoria-commits</a> > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I'm getting administrator requests in my email box for this, requesting that I approve postings. But I don't have an administrator password for the list and I'm not sure if I want to moderate that list regardless. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20697 Date: 2008 May 9 0:21 From: Jeremy Cowgar <jeremy at co?gar?com> Subject: Re: New mailing list for SVN commits Jason Gade wrote: > > I'm getting administrator requests in my email box for this, requesting that > I approve postings. But I don't have an administrator password for the list > and I'm not sure if I want to moderate that list regardless. > Jason, I'm sorry about that. Didn't mean to configure it that way. Were they just for Chris this morning? I didn't have it setup right and it was denying Chris's commits. I didn't mean for that to happen, or for everyone to get admin messages. I fixed the problem with entering Chris's email incorrectly in the allowed posts from SVN/SourceForge. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20698 Date: 2008 May 9 0:41 From: Jason Gade <jaygade at ?ahoo.c?m> Subject: Re: New mailing list for SVN commits Thanks, I had ones for Christian and for c.k. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20699 Date: 2008 May 9 1:15 From: Mike777 <anon4321 at g?ail.c?m> Subject: Re: win32Lib - newUIObj bug? CChris met me on IRC and after a few pecks on the keyboard was able to determine that it was, as expected, PBKAC. Although thoroughly aware of the issue, instead of setting BOTH the name and caption to the same string ("MySpecialWindow") I had set the name to "MySpecialWindow" but I had set the caption to "Design Window". It is much better practice to initially establish the controls (windows included) with the name and the caption set to the same thing. One can reset the caption in Code without changing the internals of the system. I am aware of this issue (I've actually ranted about it, IIRC), so it clearly was PBKAC on this one. Thanks to CChris for helping me track it down. Mike Mike777 wrote: > > An interim report here: I have found that using the trace window is fundamentally > inconsistent with the message_box function. It, in itself, creates an infinite > loop. I need to eliminate that loop before I can get back to the main issue > at hand. > > Mike > > Mike777 wrote: > > > > CChris wrote: > > > > > > getNameId() was changed in 70.4a. Please paste this to replace the current body > > > of getNameId(), and tell me if it gets you going: > > > <eucode> > > > global function getNameId(sequence pName) > > > integer p > > > > > > pName=makeStandardName(pName) > > > p=find(pName, ctrl_Name) > > > if p=0 then > > > return 0 > > > end if > > > while not validId(p) do > > > p=find_from(pName, ctrl_Name,p+1) > > > if p=0 then > > > return 0 > > > end if > > > end while > > > return p > > > end function > > > </eucode> > > > > I wanted to take the time to do this, although I sort of knew it wouldn't help. > > At the point in CreateEx that the program attempts to assign the parent, it > > has the value for the parent per the token (MySpecialWindow) but when I interrogate > > the trace window for the values of all of my windows, they are not there. Hence, > > getNameId("avariablethatdoesnotexist") will always return a zero. > > > > Something appears to be wrong with my scoping (which is truly bizarre), because > > at this point, no matter how explicitly I set the Owner in the newUIObj instruction, > > the createEx routine won't be able to assign the parent if the ids are just > > not there. > > > > I'm going to run this again and go through the procedure in detail for a control > > where the parent IS set properly. > > > > I'll post after that. > > > > Thanks for trying. > > > > Mike -= B E G I N =- X-EUFORUM: 20700 Date: 2008 May 9 2:01 From: Matt Lewis <matthewwalkerlewis at gma?l?com> Subject: Re: Current implementation of exp() is faulty. CChris wrote: > > <eucode> > include machine.e > include math.e > ?atom_to_float64(power(E,20.0)) > ?atom_to_float64 > (485165195.409790277969106830541540558684638988944847254353610800315977996142709740165979850652747349447833789438961) > ?atom_to_float64(power(E,12.0)) > ?atom_to_float64( > 162754.7914190039208080052048984867831702092844787207704435562481385967708355437387292882419094316843) > ?atom_to_float64(power(E,10.0)) > ?atom_to_float64( > 22026.46579480671651695790064528424436635351261855678107423542635522520281857079257519912096816452590) > ?atom_to_float64(power(E,8.0)) > ?atom_to_float64( > 2980.957987041728274743592099452888673755967939132835702208963530387730725173367530157371871490018139) > ?atom_to_float64(power(E,6.0)) > ?atom_to_float64( > 403.4287934927351226083871805433882796058998973571292026139671883251511806339934983051788866512126648) > ?atom_to_float64(power(E,5.0)) > ?atom_to_float64( > 148.4131591025766034211155800405522796234876675938789890467528451109120648209585760796884094598990211) > ?machine_func(26,0) > </eucode> > > Results: > {253,231,104,139,8,235,188,65} > {3,232,104,139,8,235,188,65} > {152,124,211,84,22,222,3,65} > {154,124,211,84,22,222,3,65} > {93,5,149,207,157,130,213,64} > {97,5,149,207,157,130,213,64} > {108,12,71,125,234,73,167,64} > {110,12,71,125,234,73,167,64} > {141,192,144,86,220,54,121,64} > {142,192,144,86,220,54,121,64} > {142,51,112,153,56,141,98,64} > {142,51,112,153,56,141,98,64} > > > So, discrepancies start showing up for values of the argument as small as 6, > or even smaller. Are you certain that it's the implementation of exp and not the parsing of floating point? You're way beyond the precision that the current floating point scanner can handle. Try changing to scientific notation. I just added E+0 to all of your ridiculously precise numbers, and here's what I got: {251,231,104,139,8,235,188,65} {4,232,104,139,8,235,188,65} {151,124,211,84,22,222,3,65} {154,124,211,84,22,222,3,65} {92,5,149,207,157,130,213,64} {96,5,149,207,157,130,213,64} {107,12,71,125,234,73,167,64} {110,12,71,125,234,73,167,64} {141,192,144,86,220,54,121,64} {143,192,144,86,220,54,121,64} {142,51,112,153,56,141,98,64} {143,51,112,153,56,141,98,64} Frankly, I have idea how close to Mathematica's result these are. You never told us what those answers were. Matt -= B E G I N =- X-EUFORUM: 20701 Date: 2008 May 9 2:04 From: Matt Lewis <matthewwalkerlewis at gmai?.com> Subject: Re: Current implementation of exp() is faulty. Jason Gade wrote: > > Here's an excerpt from Matt's scientific.e documentation: > <snip> Yes. Also, it's only currently used for scientific notation encountered. It should be fairly easy to make it parse all floating point, though this would slow things down a little. Not sure where the sweet spot would be (i.e., when do we lose precision in the current "naive" algorithm). Matt -= B E G I N =- X-EUFORUM: 20702 Date: 2008 May 9 2:15 From: Matt Lewis <matthewwalkerlewis at g?ai?.com> Subject: Re: Current implementation of exp() is faulty. CChris wrote: > > > Which Euphoria parser are you talking about? > Neither get() nor value() are invoked. > When exwc.exe reads "atom_to_float64(1565146.159101750457681234), it uses an > internal routine, called my_sscanf() in source\scanner.e, which turns a > string into atoms. This routine does not check how many decimal places are > given. But indeed, the 18th digit will very rarely matter at all. Only for very small values of vary rare. :) Somewhat like the very large values of 2 that yield 2 + 2 = 5. In fact, my_sscanf usually doesn't make it as far as that before going off course. It's fine for a few digits, and I'm not sure where it starts losing it (and it probably depends on the number) but I think it rarely makes it through all 17. As I recall, I started looking at binary fractions, and converted them to decimal representations. Or maybe the other way around. Either way, when you look at something whose first non-zero is in the 18th digit of precision, you need at least 54 bits to represent it. Since we never have more than 53, anything after 17 just doesn't matter. And sometimes, the 17th doesn't matter either. Matt -= B E G I N =- X-EUFORUM: 20703 Date: 2008 May 9 2:17 From: Matt Lewis <matthewwalkerlewis at g??il.com> Subject: Re: Revision 417 -- tests are broke CChris wrote: > > > Running the unit tests means the interpreter should choose the right include > files, and it must be the the right interpreter as well. EUING and EUDIR normally Are you running 95 or 98? Even there, you should be able to set variables in a shell, right? > Is anything like configuration files that override the environment working? It should be. There should probably be an euinc.conf in the tests directory that includes something like this: ../include Since that should be the relative path to the include directory. Matt -= B E G I N =- X-EUFORUM: 20704 Date: 2008 May 9 2:25 From: Matt Lewis <matthewwalkerlewis at gm?il.c?m> Subject: Re: Revision 417 -- tests are broke CChris wrote: > > > At revision 424: > All tests for sequence.e and search.e pass under Eu 3.1.1 . > > I cannot yet compile Eu 4.0 under WinXP, OpenWatcom 1.7, getting these errors, > already reported iirc: <snip> This is only slightly helpful. What did you do to get these? What you probably want to do is: > wmake -f makefile.wat interpreter ...or, if you want it to build all windows stuff: > wmake -f makefile.wat winall The top of the makefile has comments to tell you different targets and parameters that can be passed. Matt -= B E G I N =- X-EUFORUM: 20705 Date: 2008 May 9 3:02 From: abec <cccompany at gmai??com> Subject: Re: win32lib getLVAllText() Thanks Chris it did the trick. Abec -= B E G I N =- X-EUFORUM: 20706 Date: 2008 May 9 5:15 From: Jeremy Cowgar <jeremy at cowg?r?com> Subject: Re: Revision 417 -- tests are broke Matt Lewis wrote: > > CChris wrote: > > > > > > At revision 424: > > All tests for sequence.e and search.e pass under Eu 3.1.1 . > > > > I cannot yet compile Eu 4.0 under WinXP, OpenWatcom 1.7, getting these errors, > > already reported iirc: > > <snip> > > This is only slightly helpful. What did you do to get these? What you > probably want to do is: > Matt, I've been able to help everyone who has come to IRC build 4.0. No one has been unable to build. What I've found is EUDIR and/or EUINC env vars are set wrong causing the .c files generated from a few include\ files to be incorrect. For instance, wildcard.e use to include upper() and lower(), but now sequence.e does. The Makefiles look for sequence.c in intobj (and others) but if generated off old 3.1 builds, sequence.c will not exist. Once the EUDIR and EUINC vars are set correctly, no one has had a problem building. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20707 Date: 2008 May 9 8:06 From: CChris <christian.cuvier at agric?lture.gouv.fr> Subject: Re: Current implementation of exp() is faulty. Matt Lewis wrote: > > CChris wrote: > > > > <eucode> > > include machine.e > > include math.e > > ?atom_to_float64(power(E,20.0)) > > ?atom_to_float64 > > (485165195.409790277969106830541540558684638988944847254353610800315977996142709740165979850652747349447833789438961) > > ?atom_to_float64(power(E,12.0)) > > ?atom_to_float64( > > 162754.7914190039208080052048984867831702092844787207704435562481385967708355437387292882419094316843) > > ?atom_to_float64(power(E,10.0)) > > ?atom_to_float64( > > 22026.46579480671651695790064528424436635351261855678107423542635522520281857079257519912096816452590) > > ?atom_to_float64(power(E,8.0)) > > ?atom_to_float64( > > 2980.957987041728274743592099452888673755967939132835702208963530387730725173367530157371871490018139) > > ?atom_to_float64(power(E,6.0)) > > ?atom_to_float64( > > 403.4287934927351226083871805433882796058998973571292026139671883251511806339934983051788866512126648) > > ?atom_to_float64(power(E,5.0)) > > ?atom_to_float64( > > 148.4131591025766034211155800405522796234876675938789890467528451109120648209585760796884094598990211) > > ?machine_func(26,0) > > </eucode> > > > > Results: > > {253,231,104,139,8,235,188,65} > > {3,232,104,139,8,235,188,65} > > {152,124,211,84,22,222,3,65} > > {154,124,211,84,22,222,3,65} > > {93,5,149,207,157,130,213,64} > > {97,5,149,207,157,130,213,64} > > {108,12,71,125,234,73,167,64} > > {110,12,71,125,234,73,167,64} > > {141,192,144,86,220,54,121,64} > > {142,192,144,86,220,54,121,64} > > {142,51,112,153,56,141,98,64} > > {142,51,112,153,56,141,98,64} > > > > > > So, discrepancies start showing up for values of the argument as small as 6, > > or even smaller. > > Are you certain that it's the implementation of exp and not the parsing > of floating point? You're way beyond the precision that the current > floating point scanner can handle. Try changing to scientific notation. > I just added E+0 to all of your ridiculously precise numbers, and here's > what I got: > > {251,231,104,139,8,235,188,65} > {4,232,104,139,8,235,188,65} > {151,124,211,84,22,222,3,65} > {154,124,211,84,22,222,3,65} > {92,5,149,207,157,130,213,64} > {96,5,149,207,157,130,213,64} > {107,12,71,125,234,73,167,64} > {110,12,71,125,234,73,167,64} > {141,192,144,86,220,54,121,64} > {143,192,144,86,220,54,121,64} > {142,51,112,153,56,141,98,64} > {143,51,112,153,56,141,98,64} > > > Frankly, I have idea how close to Mathematica's result these are. You > never told us what those answers were. > > Matt I thought I did.... The pasted value for exp(x) is obtained by ealuating N[Exp[x],100] . When x is not an integer, it must be entered in fractional form. Otherwise, Mathematica is aware of the roundoff errors and only returns like 6 or 7 decimal places. exp(some fraction) can be computed at any precision as a rational approximation. The process is simply tedious by hand, so I didn't check directly. CChris -= B E G I N =- X-EUFORUM: 20708 Date: 2008 May 9 9:51 From: Judith Evans <camping at ?cew?.net> Subject: Re: Layers to Tabs don cole wrote: > > Hello everybody, > > I have 2 Layers set up in IDE. How can I make Tabs out of them? > > Don Cole I'm wanting to understand why you want to do this. Is it the case that you dropped controls on the layer(s) and later wished you had first dropped a TabControl in the layer and added your controls to it's TabItems? judith -= B E G I N =- X-EUFORUM: 20709 Date: 2008 May 9 13:57 From: don cole <doncole at pacb?ll.net> Subject: Re: Layers to Tabs Judith Evans wrote: > > don cole wrote: > > > > Hello everybody, > > > > I have 2 Layers set up in IDE. How can I make Tabs out of them? > > > > Don Cole > > I'm wanting to understand why you want to do this. > > Is it the case that you dropped controls on the layer(s) and later wished you > had first dropped a TabControl in the layer and added your controls to it's > TabItems? > > judith Yes, that's exactly what happened. I just figured out I might not have to do this. If I figure out setLayerVisible() I'm working on that now. I think I'm doing something wrong in MayUseSetLayer I'm still studying this. Don Cole -= B E G I N =- X-EUFORUM: 20710 Date: 2008 May 9 16:04 From: Bernie Ryan <xotron at bluef??g.com> Subject: Attention Pete Eberlein question about asm.e Your new asm.e that is on your web site will not compile any JMP instruction. It says on site that you have modified it to correct a problem with jumping to far. A JMP instruction just returns a UNKNOWN INSTRUCTION ERROR. The download file name is asm050424.zip Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20711 Date: 2008 May 9 16:56 From: Mike Sywensky <michaelsy at yahoo?c?m> Subject: Re: wxCaret Greg Haberek wrote: > > Greg Haberek wrote: > > > > > > Bah! I compile it with Watcom and everything looks fine, but when I drop the > > new DLL in %EUDIR%\BIN, I get "Could not open wxEuphoria library. Press enter > > to abort." > > > > Why is this not working? I even recompiled wxWidgets again to be sure. It still > > doesn't work. Everything looks fine when I open libwxeu.dll in Dependency Walker. > > I checked out the SVN source and got the wxCaret routines into that wxEuphora.cpp, > and the functions into exports.lbc. The SVN source compiles and works correctly > (unlike my downloaded source). > > However, I'm missing "stringhash.e" which is used by wrap.exw. Where do I get > this? I can't find it in the Archive. > > -Greg I found stringhash.e by googling for it. Once you copy the file, wrap.exw will work. -= B E G I N =- X-EUFORUM: 20712 Date: 2008 May 9 17:02 From: Mike Sywensky <michaelsy at yah??.com> Subject: Addition to wxEuphoria Matt, I wrapped the wxAboutDialog. It is not the most useful addition, but I wanted to try something simple before I try to tackle something more complex. On my copy, I tacked it to the end of wxDialog.cpp. <eucode> object WXEUAPI new_wxAboutDialogInfo(object params) { wxAboutDialogInfo * aboutInfo = new wxAboutDialogInfo(); return BOX_INT( aboutInfo ); } void WXEUAPI about_dlg_add_artist(int info, object person) { ((wxAboutDialogInfo*)info)->AddArtist( get_string( person ) ); wxDeRefDS( person ); } void WXEUAPI about_dlg_add_developer(int info, object person) { ((wxAboutDialogInfo*)info)->AddDeveloper( get_string( person ) ); wxDeRefDS( person ); } void WXEUAPI about_dlg_add_doc_writer(int info, object person) { ((wxAboutDialogInfo*)info)->AddDocWriter( get_string( person ) ); wxDeRefDS( person ); } void WXEUAPI about_dlg_add_translator(int info, object person) { ((wxAboutDialogInfo*)info)->AddTranslator( get_string( person ) ); wxDeRefDS( person ); } void WXEUAPI about_dlg_set_copyright(int info, object copyright) { ((wxAboutDialogInfo*)info)->SetCopyright( get_string( copyright ) ); wxDeRefDS( copyright ); } void WXEUAPI about_dlg_set_description(int info, object desc) { ((wxAboutDialogInfo*)info)->SetDescription( get_string( desc ) ); wxDeRefDS( desc ); } void WXEUAPI about_dlg_set_icon(int info, int icon) { wxIcon ico = *((wxIcon*)icon); ((wxAboutDialogInfo*)info)->SetIcon( ico); } void WXEUAPI about_dlg_set_license(int info, object license) { ((wxAboutDialogInfo*)info)->SetLicense( get_string( license ) ); wxDeRefDS( license ); } void WXEUAPI about_dlg_set_name(int info, object name) { ((wxAboutDialogInfo*)info)->SetLicense( get_string( name ) ); wxDeRefDS( name ); } void WXEUAPI about_dlg_set_version(int info, object version) { ((wxAboutDialogInfo*)info)->SetVersion( get_string( version ) ); wxDeRefDS( version ); } void WXEUAPI about_dlg_set_web_site(int info, object params) { /* --/li /b url --/li /b desc = wxEmptyString SetWebSite(const wxString& url, const wxString& desc = wxEmptyString) */ int len = ((s1_ptr)SEQ_PTR(params))->length; wxString desc = wxEmptyString; if (len == 2) { desc = get_string( params, 2); } else ((wxAboutDialogInfo*)info)->SetWebSite( get_string( params, 1), desc ); wxDeRefDS( params ); } void WXEUAPI about_dlg_show(int info) { wxAboutBox( *((wxAboutDialogInfo*)info) ); } </eucode> I also have the exports, updated wxeud.e, and a sample program. Let me know if you would like me to email it to you. -= B E G I N =- X-EUFORUM: 20713 Date: 2008 May 9 20:05 From: Bernie Ryan <xotron at bl?efrog.c?m> Subject: Re: Attention Pete Eberlein question about asm.e Bernie Ryan wrote: > > > Your new asm.e that is on your web site will not compile > > any JMP instruction. It says on site that you have modified it to > > correct a problem with jumping to far. > > A JMP instruction just returns a UNKNOWN INSTRUCTION ERROR. > > The download file name is asm050424.zip > The error occurs when I try to jmp over any storage like the following : jmp exit data1: dd 0 data2: dd 0 exit: ret Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20714 Date: 2008 May 10 12:58 From: irv mullins <irvm at ell?j?y.com> Subject: Re: Case Construct I'm surprised no one has answered this. Perhaps everyone here has been using Eu so long, they no longer remember how useful such a construct can be. -= B E G I N =- X-EUFORUM: 20715 Date: 2008 May 10 13:09 From: Jeremy Cowgar <jeremy at cowgar.?o?> Subject: Re: Case Construct irv mullins wrote: > > > I'm surprised no one has answered this. > Perhaps everyone here has been using Eu so long, they > no longer remember how useful such a construct can be. Hm, I do program in C as well. A case construct is very handy. I just don't know the backend of the interpreter enough to implement such a construct. Anyone else who knows the interpreter internals better? Is this is a huge change or a debated change? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20716 Date: 2008 May 10 14:00 From: Kat <KAT12 at coosa??.net> Subject: Re: Case Construct irv mullins wrote: > > > I'm surprised no one has answered this. > Perhaps everyone here has been using Eu so long, they > no longer remember how useful such a construct can be. I asked for case too. I implemented it in mirc with goto. You can do it in ooeu with goto. This is prolly why it isn't in Eu. Good luck. Kat -= B E G I N =- X-EUFORUM: 20717 Date: 2008 May 10 15:15 From: Matt Lewis <matthewwalkerlewis at gmail?c?m> Subject: Re: Case Construct Jeremy Cowgar wrote: > > irv mullins wrote: > > > > > > I'm surprised no one has answered this. > > Perhaps everyone here has been using Eu so long, they > > no longer remember how useful such a construct can be. > > Hm, I do program in C as well. A case construct is very handy. I just don't > know the backend of the interpreter enough to implement such a construct. > > Anyone else who knows the interpreter internals better? Is this is a huge change > or a debated change? I think it could probably be implemented in the front end only, using existing IL codes. It might be more efficient, however, to introduce new IL... Matt -= B E G I N =- X-EUFORUM: 20718 Date: 2008 May 10 15:15 From: Matt Lewis <matthewwalkerlewis at ?m?il.com> Subject: Re: Addition to wxEuphoria Mike Sywensky wrote: > > I also have the exports, updated wxeud.e, and a sample program. Let me know > if you would like me to email it to you. Yes, please do. Matt -= B E G I N =- X-EUFORUM: 20719 Date: 2008 May 10 15:39 From: Mike777 <anon4321 at ?ma?l.com> Subject: Previous control I have two separate top-level windows. I want window 2 to be aware of what the last control that was touched on window 1 was. Is there an easy way for a command button on window2 to interrogate "something" and find out what control has the focus on window1? The reason I'm asking is that the controls are being built with newUIObj and therefore they depend on user input at the time. I have been successful at registering a callback for check boxes and radio buttons, but I have not been able to make a callback work for other controls (edit boxes and combo boxes, mostly). If I could make the callback work for all controls that can have focus, I would have no problem manipulating a global variable for inter-window communication. So, either way would work for me (1: make the callback work for edit and combo boxes; 2: find some other way to send information (or retrieve information)). Here is my code for the callback that works for check boxes and radio buttons: global procedure MyCheckClick (integer self, integer event, sequence params) -- previousCheckBox is a global variable, so I always know what the last -- checkbox (or radio button) that was clicked was previousCheckBox = self end procedure procedure AppCallback(integer self, integer event, sequence params) sequence mySeq mySeq = getIdName(self) -- All of my checkboxes have names that begin with "chk" -- All of my radioboxes have names that begin with "opt" if event = w32HGetHandler and compare("Click",params[1][1..5]) = 0 and ((compare(mySeq[1..3],"chk") = 0) or (compare(mySeq[1..3],"opt") = 0)) then returnValue(routine_id("MyCheckClick")) end if end procedure prevValue = setCallback(routine_id("AppCallback")) I suppose the edit boxes and combo boxes don't really have a Click event, so I'm supposed to use a different event for w32HGetHandler. Any guidance would be appreciated. Thanks Mike -= B E G I N =- X-EUFORUM: 20720 Date: 2008 May 10 15:45 From: jacques deschênes <desja at glob?trotter.?et> Subject: iupeu and fedora 7 I'm trying iupeu under fedora 7 (in colinux session) but It doesn't work because libiup.so doesn't load. fedora 7 use 2.6.12 kernel so I downloaded precompiled libraries for 2.6 kernel, and installed all .a and .so files in /usr/lib/ What is the problem? Jacques Deschênes. P.S. under windows all iupeu examples runs without any problem. -= B E G I N =- X-EUFORUM: 20721 Date: 2008 May 10 15:55 From: Jeremy Cowgar <jeremy at cow?ar.co?> Subject: Re: iupeu and fedora 7 jacques deschênes wrote: > I'm trying iupeu under fedora 7 (in colinux session) but It doesn't work because > libiup.so doesn't load. fedora 7 use 2.6.12 kernel so I downloaded precompiled > libraries for 2.6 kernel, and installed all .a and .so files in /usr/lib/ > What is the problem? It is probably missing a dependency, most likely OpenMotif. The current version of Iup (2.6) uses Motif on Linux. The next version which should be out in 2 months uses either Motif or GTK on Linux. You can also use GTK on Windows, if you wish. I have not used Iup on Redhat, I've used it on ArchLinux and Debian. But my guess is installing OpenMotif will solve your problems. If you still have problems, feel free to post here or jump on irc and maybe we can work through it. irc.freenode.net channel #euphoria > P.S. under windows all iupeu examples runs without any problem. Great! I have made many additions to Iup. I've made some new include files such as iupeu.e that makes working with Iup much easier yet. I have not committed it to SVN yet as it still needs a bit of work for naming consistency. I've also been working on a DBI interface, and have made an option include, iupeudb.e which makes the list based controls DBI aware. Anyway, some good things coming for Iup and DBI. Just working on Euphoria right this instant. I'll soon wrap those other two items up and get a new Iup out. (DBI is not related to Iup, it is a different project all together). -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20722 Date: 2008 May 10 16:09 From: Bernie Ryan <xotron at bluefr?g.com> Subject: Re: iupeu and fedora 7 jacques deschênes wrote: > > > I'm trying iupeu under fedora 7 (in colinux session) but It doesn't work because > libiup.so doesn't load. fedora 7 use 2.6.12 kernel so I downloaded precompiled > libraries for 2.6 kernel, and installed all .a and .so files in /usr/lib/ > What is the problem? > > Jacques Deschênes. > P.S. under windows all iupeu examples runs without any problem. Jacques: If you read this web page it may be help full to you. http://www.ibm.com/developerworks/linux/library/l-shobj/ Installing shared libraries does not always create the SO LINK NAME that a program is looking for. So you may need to create a link. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20723 Date: 2008 May 10 16:37 From: ChrisBurch2 <crylex at freeuk.co.u?> Subject: Re: iupeu and fedora 7 Hi Do this cd /usr/lib ldd ./libiup.so install any librariries it says it can't find Chris -= B E G I N =- X-EUFORUM: 20724 Date: 2008 May 10 16:54 From: Jeremy Cowgar <jeremy at ?owgar.com> Subject: Re: iupeu and fedora 7 ChrisBurch2 wrote: > > > Hi > > Do this > > cd /usr/lib > ldd ./libiup.so > > install any librariries it says it can't find > Hm. If you would, can you post here what you had to install? We can add that to the wiki so others do not have to have the same hassle you did. Thanks! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20725 Date: 2008 May 10 17:17 From: ChrisBurch2 <crylex at fr?euk?co.uk> Subject: Re: iupeu and fedora 7 Hi Sorry, can't remember, I just used YAST to search for the libraries, and installed them there. (YAST is the SuSE set up tool, so won't be applicable to Red Hat). My downloads folder most recent entries contains the the libcd (cd library), which I may or may not have installed. Chris -= B E G I N =- X-EUFORUM: 20726 Date: 2008 May 10 17:22 From: Jeremy Cowgar <jeremy at cowga?.?om> Subject: Re: iupeu and fedora 7 ChrisBurch2 wrote: > > Hi > > Sorry, can't remember, I just used YAST to search for the libraries, and installed > them there. (YAST is the SuSE set up tool, so won't be applicable to Red Hat). > > My downloads folder most recent entries contains the the libcd (cd library), > > which I may or may not have installed. > hehe. I wasn't very clear in my message. I meant if jacques deschênes could let us know what was required on RedHat. Sorry, should have been more clear. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20727 Date: 2008 May 10 18:45 From: Michael J. Sabal <m_sabal at ya?oo?com> Subject: Re: Case Construct irv mullins wrote: > > > I'm surprised no one has answered this. > Perhaps everyone here has been using Eu so long, they > no longer remember how useful such a construct can be. Forgive me for asking, but what benefit does case offer over elsif other than saving a handful of keystrokes? -= B E G I N =- X-EUFORUM: 20728 Date: 2008 May 10 19:36 From: irv mullins <irvm at elli?ay.c?m> Subject: Re: Case Construct Michael J. Sabal wrote: > > irv mullins wrote: > > > > > > I'm surprised no one has answered this. > > Perhaps everyone here has been using Eu so long, they > > no longer remember how useful such a construct can be. > > Forgive me for asking, but what benefit does case offer over elsif other than > saving a handful of keystrokes? MUCH clearer code (and probably faster when it is implemented correctly) -= B E G I N =- X-EUFORUM: 20729 Date: 2008 May 10 19:36 From: Michael J. Sabal <m_sabal at ?ahoo?com> Subject: Flaming and IRC I tend to avoid IRC for the same reason I avoid a lot of places on the 'net. If anyone in this community has an issue with code I've submitted for public use, I would appreciate such issues be posted here on this list or on the appropriate SourceForge tracker. I especially do not appreciate hearing about vague complaints by rumor of side-channel discussions. I'm not going to agree with everything the community decides, nor is the community always going to agree with me; but unless comments are directed constructively in the correct forum, the only result will be someone getting offended, which is most certainly counterproductive. As an advertisement, anyone who wants to sign up as an active developer in Sourceforge for eunet or eugtk is eagerly invited to do so. -= B E G I N =- X-EUFORUM: 20730 Date: 2008 May 10 20:15 From: Jeremy Cowgar <jeremy at cow?a?.com> Subject: Re: Flaming and IRC Michael J. Sabal wrote: > > I tend to avoid IRC for the same reason I avoid a lot of places on the 'net. > > If anyone in this community has an issue with code I've submitted for public > use, I would appreciate such issues be posted here on this list or on the > appropriate SourceForge tracker. I especially do not appreciate hearing about > vague complaints by rumor of side-channel discussions. I'm not going to agree > with everything the community decides, nor is the community always going to > agree with me; but unless comments are directed constructively in the correct > forum, the only result will be someone getting offended, which is most certainly > counterproductive. Mike, I am trying to very actively promote IRC for the great benefits it has allowing developers to talk with each other. I was CC'd on the email you are responding to and I replied to your email and the one reporting the issue telling you about the situation. I do not wish to discuss it here in public, but there was NO flaming anywhere. A lot of peoples problems have been solved in #euphoria now and it's a good tool. On #euphoria nothing has been said bad about EuNet. Discussions of problems and possible solutions were discussed as there was an active developer on #euphoria talking about it. I still have the conversation in my IRC client that I can scroll back and email you the entire conversation. I will do that now. Please read it. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20731 Date: 2008 May 10 21:03 From: Matt Lewis <matthewwalkerlewis at ?mail.c?m> Subject: Re: Case Construct Michael J. Sabal wrote: > > Forgive me for asking, but what benefit does case offer over elsif other than > saving a handful of keystrokes? A C-style case statement also offers fall through: <eucode> switch foo do case bar: -- do stuff exit case special_baz -- do stuff, then continue with normal baz case baz -- do baz stuff exit default -- do stuff end switch </eucode> Matt -= B E G I N =- X-EUFORUM: 20732 Date: 2008 May 10 21:11 From: CChris <christian.cuvier at agric?ltu?e.gouv.fr> Subject: Re: Previous control Mike777 wrote: > > I have two separate top-level windows. I want window 2 to be aware of what > the last control that was touched on window 1 was. Is there an easy way for > a command button on window2 to interrogate "something" and find out what control > has the focus on window1? > > The reason I'm asking is that the controls are being built with newUIObj and > therefore they depend on user input at the time. > > I have been successful at registering a callback for check boxes and radio buttons, > but I have not been able to make a callback work for other controls (edit boxes > and combo boxes, mostly). > > If I could make the callback work for all controls that can have focus, I would > have no problem manipulating a global variable for inter-window communication. > > So, either way would work for me (1: make the callback work for edit and combo > boxes; 2: find some other way to send information (or retrieve information)). > > Here is my code for the callback that works for check boxes and radio buttons: > > global procedure MyCheckClick (integer self, integer event, sequence params) > -- previousCheckBox is a global variable, so I always know what the last > -- checkbox (or radio button) that was clicked was > previousCheckBox = self > end procedure > > procedure AppCallback(integer self, integer event, sequence params) > sequence mySeq > mySeq = getIdName(self) > -- All of my checkboxes have names that begin with "chk" > -- All of my radioboxes have names that begin with "opt" > if event = w32HGetHandler and > compare("Click",params[1][1..5]) = 0 and > ((compare(mySeq[1..3],"chk") = 0) > or (compare(mySeq[1..3],"opt") = 0)) then > returnValue(routine_id("MyCheckClick")) > end if > end procedure > prevValue = setCallback(routine_id("AppCallback")) > > I suppose the edit boxes and combo boxes don't really have a Click event, so > I'm supposed to use a different event for w32HGetHandler. > > Any guidance would be appreciated. > > Thanks > > Mike Why not simply add an w32HGotFocus event handler to all the controls you are interested in? The common handler would save in a variable you define the id of the control for which it is called (or stack them if you need more), and then you retrieve them. Doesn't work? CChris -= B E G I N =- X-EUFORUM: 20733 Date: 2008 May 10 21:15 From: Kat <KAT12 at coosahs?ne?> Subject: Re: Flaming and IRC Jeremy Cowgar wrote: > > Michael J. Sabal wrote: > > > > I tend to avoid IRC for the same reason I avoid a lot of places on the 'net. > > > > If anyone in this community has an issue with code I've submitted for public > > use, I would appreciate such issues be posted here on this list or on the > > appropriate SourceForge tracker. I especially do not appreciate hearing about > > vague complaints by rumor of side-channel discussions. I'm not going to agree > > with everything the community decides, nor is the community always going to > > agree with me; but unless comments are directed constructively in the correct > > forum, the only result will be someone getting offended, which is most certainly > > counterproductive. > > Mike, > > I am trying to very actively promote IRC for the great benefits it has allowing > developers to talk with each other. I was CC'd on the email you are responding > to and I replied to your email and the one reporting the issue telling you about > the situation. I do not wish to discuss it here in public, but there was NO > flaming anywhere. The flaming was done against eubot, the same sort of flames which stopped me from releasing strtok v3 8 years ago and caused me to delete all code for the last best release of eubot years ago. The same put-offs that got me to stop writing Eu code at all for several years. The same code that allowed eubot to make and keep simultaneous tcp connections and data coherent, consistent, and available at any time, was to be lifted out and placed (with appropriate changes allowing for protocol) into eunet. Until i was informed it was too much overhead, and an ugly hack to make windows do *nix stuff. And it had been deleted from eubot by the flamer, who went on to say his version didn't work as i advertised. > A lot of peoples problems have been solved in #euphoria now and it's a good > tool. I agree. > On #euphoria nothing has been said bad about EuNet. Discussions of problems > and possible solutions were discussed as there was an active developer on #euphoria > talking about it. Not about eunet as it was currently released, as far as i know. Only what i was doing right then to allow multiple connections. There were no solutions suggested by the flamer. What i was at the keyboard doing for eunet right then was being put down. The code didn't make it into a release of eunet by me, i deleted it as undesireable, ugly, a hack. So Michael Sabal's version of eunet is still "clean" as the flamer wants it. I have never been considered an "active developer" of anything in the "eu community", merely a occasional contributor and full time troublemaker (see: goto). > I still have the conversation in my IRC client that I can scroll back and email > you the entire conversation. I will do that now. Please read it. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Kat -= B E G I N =- X-EUFORUM: 20734 Date: 2008 May 10 21:30 From: CChris <christian.cuvier at ag?iculture.g?uv.fr> Subject: Re: Case Construct Matt Lewis wrote: > > Michael J. Sabal wrote: > > > > Forgive me for asking, but what benefit does case offer over elsif other than > > saving a handful of keystrokes? > > A C-style case statement also offers fall through: > <eucode> > switch foo do > case bar: > -- do stuff > exit > case special_baz > -- do stuff, then continue with normal baz > > case baz > -- do baz stuff > exit > > default > -- do stuff > end switch > </eucode> > Matt Right. And, if e want, we can get it to process ranges, like in: <eucode> select(some_expr()) case -1,2: do_this() exit case 3 thru 6: do_preparations() default: the_real_stuff() end select </eucode> I think that all it saves, apart from the keystrokes, is parsing the various elsif statements. It can be implemented in the front end, but as usual without much of a performance gain. It was argued that a select statement winds up coded as a REP SCASB to get the branch address position in a table, then a JMP dword [EDI+some_offset]. Problem is that predicting these branches is difficult for the CPU, cache misses will be the rule, and they are more and more expensive as the pipeline of Intel CPUs lengthens. If correct (which I didn't assess by direct testing), then the select statement would have been useful with say the early Pentiums, but less so now. This said, I would vote for it if it can be implemented more efficiently. It makes code clearer, and the fall through is sometimes useful. CChris -= B E G I N =- X-EUFORUM: 20735 Date: 2008 May 10 21:43 From: jacques deschênes <desja at glob?t?otter.net> Subject: Re: iupeu and fedora 7 Using the suggestion of Chris, it showed me that libXm.so.3 was missing searching the internet I found it be part of openmotif so Jeremy was right. But pirut didn't display any open motif in is list of installable package but there was a lesstif 0.95.xx which one was said to be a clone of openmotif so I installed it. But that package as no libXm.so.3 but a libXm.so.2 searching the internet I found in a forum that I could solve the issue by creating a symlink like this: ln -s /usr/lib/libXm.so.2 /usr/lib/libXm.so.3 This seem to solve the issue partly. Well iupeu.e can at least load libiup.so but no one of the examples run properly. Some crash, others display a window but that window is completely unresponsive. Maybe lesstif is incompatible with iup. I'll try to find an rpm of openmotif to install it. Thanks to all of you for your quick replies. Jacques Deschênes Jeremy Cowgar wrote: > > ChrisBurch2 wrote: > > > > Hi > > > > Sorry, can't remember, I just used YAST to search for the libraries, and installed > > them there. (YAST is the SuSE set up tool, so won't be applicable to Red Hat). > > > > My downloads folder most recent entries contains the the libcd (cd library), > > > > which I may or may not have installed. > > > > hehe. I wasn't very clear in my message. I meant if jacques deschênes could > let us know what was required on RedHat. Sorry, should have been more clear. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> -= B E G I N =- X-EUFORUM: 20736 Date: 2008 May 10 21:57 From: Jeremy Cowgar <jeremy at cow?ar?com> Subject: Re: iupeu and fedora 7 jacques deschênes wrote: > > This seem to solve the issue partly. Well iupeu.e can at least load libiup.so > but no one of the examples run properly. Some crash, others display a window > but that window is completely unresponsive. Maybe lesstif is incompatible with > iup. I'll try to find an rpm of openmotif to install it. > I should have warned you about that because the first time I used Iup, I made the same mistake only to pull my hair out. lesstiff is a clone but in many ways uncompatable :-/ You will need openmotif. > Thanks to all of you for your quick replies. You're welcome. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20737 Date: 2008 May 10 23:19 From: Michael J. Sabal <m_sabal at ya?o?.com> Subject: Re: Flaming and IRC After receiving a couple comments privately, I think I should clarify my intentions. If you want to flame me, be an adult and do so directly, not via someone else. IRC is a tool as any other. Jeremy is trying to establish its use for real time development and discussion, and I want to go on record saying I fully support his decision and efforts to make it so. From both a high-level and nitty-gritty perspective, it may very well be the best place to hash out one's thoughts on the direction the language, or a specific section of code, might take. I personally believe, however, (all caveats apply) that the reporting of specific issues may be better handled through the avenues I suggested earlier, as the time it takes to compose a longer message gives the poster greater opportunity to compose his/her thoughts before clicking "Send." A real-time tool often has the tendency of getting people "shooting from the hip" as it were, especially when the discussion gets heated. These are merely my own observations, and all views expressed are not necessarily those of the management. Since I personally do not frequent IRC, I am requesting, as I said earlier, that any bugs, issues, concerns, complaints, comments, suggestions, flames, etc. related to code I have submitted to the community be posted either on EuForum or on the appropriate SourceForge tracker. I hope that clears up any further misunderstanding. -= B E G I N =- X-EUFORUM: 20738 Date: 2008 May 10 23:52 From: jacques deschênes <desja at globe??otter.net> Subject: Re: iupeu and fedora 7 I finally succeed to install openmotif 2.3.0 (tried and older version but didn't work). here the procedure for fedora 7 1) download http://download.fedora.redhat.com/pub/fedora/linux/core/updates/5/i386/openmotif-2.3.0-0.1.9.3.i386.rpm 2) rpm --nodeps -ivh openmotif-2.3.0-0.1.9.3.i386.rpm 3) ln -s /usr/lib/libXm.so.4.0.0 /usr/lib/libXm.so.3 examples that works: clock.ew getfilename.ew gettext.ew hello.ew getcolor.ew getlist.ew rot13.ew examples that fail: imagelib.ew (missing iupimagelib.e) addressbook.ew (display a windows with: "could not open or create database) Jacques Deschênes Jeremy Cowgar wrote: > > jacques deschênes wrote: > > > > This seem to solve the issue partly. Well iupeu.e can at least load libiup.so > > but no one of the examples run properly. Some crash, others display a window > > but that window is completely unresponsive. Maybe lesstif is incompatible with > > iup. I'll try to find an rpm of openmotif to install it. > > > > I should have warned you about that because the first time I used Iup, I made > the same mistake only to pull my hair out. lesstiff is a clone but in many ways > uncompatable :-/ > > You will need openmotif. > > > Thanks to all of you for your quick replies. > > You're welcome. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> -= B E G I N =- X-EUFORUM: 20739 Date: 2008 May 11 0:11 From: Jeremy Cowgar <jeremy at cowga??com> Subject: Re: iupeu and fedora 7 jacques deschênes wrote: > > I finally succeed to install openmotif 2.3.0 (tried and older version but didn't > work). > > examples that works: Great! Thanks for posting this and being the first to give IupEu a try on RedHat. I'll add your info to the wiki so others do not have to go through the hassle you did. > examples that fail: > imagelib.ew (missing iupimagelib.e) > addressbook.ew (display a windows with: "could not open or create database) Hm. I do not know how iupimagelib.e got left out of the .zip file. You can get it directly here: http://jeremy.cowgar.com/svn/iupeu/trunk/include/iupimagelib.e As for the Address Book not creating the database, weird. It is using EDS. I just tried removing the database from my examples directory and running it, it was created fine (ArchLinux). I then went to Windows and it worked also. Is there a permissions problem? It's simple and just creates the database in the current directory. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20740 Date: 2008 May 11 0:19 From: Jeremy Cowgar <jeremy at cowga?.?om> Subject: Re: Flaming and IRC Michael J. Sabal wrote: > > After receiving a couple comments privately, I think I should clarify my > intentions. > > Jeremy is trying to establish its use for real time development and > discussion, and I want to go on record saying I fully support his decision > and efforts to make it so. From both a high-level and nitty-gritty > perspective, it may very well be the best place to hash out > one's thoughts on the direction the language, or a specific section > of code, might take. I personally believe, however, (all caveats apply) > that the reporting of specific issues may be better handled through > the avenues I suggested earlier, as the time it takes to compose a > longer message gives the poster greater opportunity to compose > his/her thoughts before clicking "Send." A real-time tool often has > the tendency of getting people "shooting from the hip" as it were, > especially when the discussion gets heated. These are merely my own > observations, and all views expressed are not necessarily those of > the management. Thank you. And from these same private comments, I learned that Mike was right. I was searching for the wrong thing in the log. There were a few statements that were inappropriate. No communication medium is perfect, however, what we all need to remember is we are all on the same team! We all program in Euphoria and exist here for the mutual benefit of each other. Happy Coding! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20741 Date: 2008 May 11 0:46 From: Jason Gade <jaygade at ?ahoo.co?> Subject: Re: Flaming and IRC Since I've never used Euphoria IRC, I never realized that we had a problem with flaming. I mean, this mailing list has to be about the tamest spot on the Internet that I hang out. Well, with the exception of a few individuals who are many years gone from here. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20742 Date: 2008 May 11 0:52 From: Jeremy Cowgar <jeremy at ??wgar.com> Subject: Re: Flaming and IRC Jason Gade wrote: > > Since I've never used Euphoria IRC, I never realized that we had a problem with > flaming. I mean, this mailing list has to be about the tamest spot on the Internet > that I hang out. > I've been there more than 3 weeks, my computer was hardly disconnected during that time, this is the first incident. I would hardly call it a problem. It was not nice, but not a problem. Where there are people there will be conflict. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20743 Date: 2008 May 11 1:29 From: c.k.lester <euphoric at ck?ester.?om> Subject: Re: Flaming and IRC Jason Gade wrote: > > Since I've never used Euphoria IRC, I never realized that we had a problem with > flaming. I mean, this mailing list has to be about the tamest spot on the Internet > that I hang out. YOU SHUT YOUR MOUTH!!!!11!11 Oh, "tamest." Sorry. -= B E G I N =- X-EUFORUM: 20744 Date: 2008 May 11 1:34 From: Jason Gade <jaygade at yaho?.co?> Subject: Re: Flaming and IRC c.k.lester wrote: > > Jason Gade wrote: > > > > Since I've never used Euphoria IRC, I never realized that we had a problem with > > flaming. I mean, this mailing list has to be about the tamest spot on the Internet > > that I hang out. > > YOU SHUT YOUR MOUTH!!!!11!11 > > Oh, "tamest." Sorry. Heh. Now that's funny. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20745 Date: 2008 May 11 2:30 From: Shawn Pringle <shawn.pringle at gma?l.?om> Subject: Re: Adding to or Updating the standard library Jeremy Cowgar wrote: > > CChris wrote: > > > Two questions: > > 1/ How to unit-test that something should crash? > > I have not solved that yet. Let me work on that now. > Testing if something crashes requires re-thinking the way we think of program control. For my executable memory allocator, allocate_code() I wrote a test that first tries to run code allocated by allocate_code() and then tries the same with allocate(). For allocate() in particular, I made a global flag variable and a crash_routine handler. The global flag is set to true, when we want it to intercept a crash and say something like: "code executed from memory using allocate caused an exception and as it should." When the flag is set to false the the handler returns 0 and no success message is printed and EUPHORIA calls the other handlers if applicable. I set the global flag before executing the code that is supposed to cause the exception and then I clear the flag afterwards. After clearing the flag an error message is printed, for it means that the crash routine wasn't executed. At this point though, the mainline of the program is in a crash handler! In the case of allocate_code(), we do not want to see an exception. So, in this cause the crash handler prints a message saying the test has failed and then terminates the program. After calling code on allocate_code that could cause an exception (if there is a bug) it prints a success message. The program flow reminds me of goto from BASIC. <eucode> -- Test the system for : include xalloc.e as dep include joy.e as joy function isspace( integer x ) return find( x, "\t \n" ) end function integer log log = open( "wordwrap.txt", "w" ) function visual_slice( joy:string_of_atoms s, integer i1, integer i2, integer line_length ) integer c, m1, m2 c = 0 m1 = -1 m2 = -1 for i3 = 1 to length(s) do if s[i3] = '\n' then c += line_length elsif s[i3] = '\t' then c += 8 else c += 1 end if if m1 = -1 then if c > i1 then m1 = c-1 elsif c = i1 then m1 = c end if end if if m2 = -1 then if c > i2 then m2 = c-1 else m2 = c end if end if if m2 != -1 then exit end if end for return s[m1..m2] end function -- word_wrap function: Please do not pass strings with TAB characters function word_wrap( joy:string_of_integers s, integer line_length ) sequence lines sequence haystack integer whitelocation lines = {} while length(s) do haystack = s[1..joy:min({length(s),line_length})] puts( log, "haystack = "&haystack&10 ) if length(s) <= line_length then lines = append( lines, s ) s = "" else -- if no spaces Grab line_length of it -- if '\n' grab the first one, or the last ' ' -- whichever comes first. whitelocation = joy:min( {max({length(s),line_length}) + 1} & joy:remove_0s( { find( '\n', haystack ), joy:rfind( ' ', haystack ) } ) ) puts( log, "s[1..whitelocation-1]=" & s[1..whitelocation-1] & 10 ) lines = append( lines, s[1..whitelocation-1] ) flush(log) if whitelocation+1 > length(s)+1 then s = "" else s = s[whitelocation+1..length(s)] end if end if end while return joy:join( "\n", lines ) end function object line procedure PETC() puts(1,"Press Enter to Continue") line = gets(0) puts(1,10) end procedure integer calling_memfunction calling_memfunction = 0 function print_failure(object x) if calling_memfunction then puts( 1, word_wrap( "We have found that the xalloc.e routines do not really make memory executable.\n", 80 ) ) puts( 1, word_wrap( "This conclusively tells us that there is a bug in the allocate_code() function. Please let me know about this: Email me at shawn.pringle at gmail.com", 80 ) ) puts( 1, "Test result for allocate_code: FAILURE\n" ) PETC() abort(0) end if return 0 end function integer calling_dmemfunction calling_dmemfunction = 0 function dep_is_enabled(object x) if calling_dmemfunction then puts(1, word_wrap( "The code allocated with allocate(), however raised an exception and it SHOULD. Therefore D.E.P. is enabled for the interpreter you used for this test on your system. This means, your system is configured correctly to test allocate_code and that allocate_code works properly.\n", 80 ) ) puts(1, "Test result for allocate_code: SUCCESS!\n" ) PETC() abort(0) end if return 0 end function atom code_space, data_space sequence multiply_code atom rexec, rdata atom x,y object void -- machine code taken from callmach.ex multiply_code = { -- int argument is at stack offset +4, double is at +8 #DB, #44, #24, #04, -- fild dword ptr +4[esp] #DC, #4C, #24, #08, -- fmul qword ptr +8[esp] #C2, #0C - 4 * (platform()=LINUX), #00 -- ret C -- pop 12 (or 8) bytes -- off the stack } crash_routine(routine_id("print_failure")) crash_routine(routine_id("dep_is_enabled")) code_space = dep:allocate_code(multiply_code) data_space = allocate(length(multiply_code)) poke( data_space, multiply_code ) rexec = define_c_func("", code_space, {C_INT, C_DOUBLE}, C_DOUBLE) rdata = define_c_func("", data_space, {C_INT, C_DOUBLE}, C_DOUBLE ) x = 7 y = 8.5 puts( 1, word_wrap( "We will now call a machine code function using memory marked as executable.\n", 80 ) ) PETC() calling_memfunction = 1 void = c_func(rexec, {x, y}) calling_memfunction = 0 printf(1, word_wrap( "The code allocated with allocate_code() was called without an exception being raised.\nThe function allocate_code() works as it should.\n", 80 ), {} ) puts(1, "\n\n" ) puts(1, word_wrap( "We will now call a machine code function without using memory marked as executable. This should cause an exception.\n", 80 ) ) PETC() function ifthenelse( integer condition, sequence s1, object x2 ) if condition then return s1 else return x2 end if end function calling_dmemfunction = 1 void = c_func(rdata, {x,y}) calling_dmemfunction = 0 printf(1, word_wrap( "The code allocated with allocate() was also called " & "without an exception being "& "raised. This means your system has no DEP for this interpreter " & " and these tests are " & "inconclusive. " & "You need to enable DEP in both your pre-OS hardware configuration screen" & " at " & "boot up and your Operating system. "& "You probably can get into the hardware by pressing the delete key at boot up. "& ifthenelse( platform() = WIN32, "In Windows XP, you can find the configuration for "& "hardware DEP by first, opening Control_Panel, next from there opening "& "System, after that clicking the Advanced_Tab, and next clicking the Performance button and "& "finally clicking the Data execution Prevention tab. " & "There you can choose the option for enabling DEP for all processes.", "")& ifthenelse( platform() = LINUX, "In Linux, you will need to download some kernel patches to allow, "& "this to work.", "" ) & ifthenelse( platform() = DOS32, "In DOS, there is no way to enable hardware DEP.", "" )&"\n", 80) , {} ) close(log) puts(1, "Test result for allocate_code: INCONCLUSIVE!\n" ) PETC() </eucode> Shawn Pringle -= B E G I N =- X-EUFORUM: 20746 Date: 2008 May 11 2:46 From: jacques deschênes <desja at glo?etro?ter.net> Subject: Re: iupeu and fedora 7 I downloaded imagelib.e and imagelib.ew is now working. I delete addressbook.edb that was already existing and addressbook.ew created a new one and now it works fine. by the way I downloaded CD5 for open watcom 1.5 I have open watcom 1.7 installed but I don't have any idea how to convert the *.lib files into DLL. I would be ready to wrap the CD5 library if I had the dll working. thanks again. jacques deschenes Jeremy Cowgar wrote: > > jacques deschênes wrote: > > > > I finally succeed to install openmotif 2.3.0 (tried and older version but didn't > > work). > > > > examples that works: > > Great! Thanks for posting this and being the first to give IupEu a try on RedHat. > I'll add your info to the wiki so others do not have to go through the hassle > you did. > > > examples that fail: > > imagelib.ew (missing iupimagelib.e) > > addressbook.ew (display a windows with: "could not open or create database) > > Hm. I do not know how iupimagelib.e got left out of the .zip file. You can get > it directly here: > > <a href="http://jeremy.cowgar.com/svn/iupeu/trunk/include/iupimagelib.e">http://jeremy.cowgar.com/svn/iupeu/trunk/include/iupimagelib.e</a> > > As for the Address Book not creating the database, weird. It is using EDS. I > just tried removing the database from my examples directory and running it, > it was created fine (ArchLinux). I then went to Windows and it worked also. > Is there a permissions problem? It's simple and just creates the database in > the current directory. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> -= B E G I N =- X-EUFORUM: 20747 Date: 2008 May 11 5:37 From: Jeremy Cowgar <jeremy at cow?ar.co?> Subject: Re: iupeu and fedora 7 jacques deschênes wrote: > > I downloaded imagelib.e and imagelib.ew is now working. > I delete addressbook.edb that was already existing and addressbook.ew created > a new one and now it works fine. Ok. Maybe SVN corrupted the edb file. That's one thing I didn't try. I'll remove the edb file from SVN and I'll make AddressBook add a few dummy records during create. > by the way I downloaded CD5 for open watcom 1.5 I have open watcom 1.7 installed > but I don't have any idea how to convert the *.lib files into DLL. I would be > ready to wrap the CD5 library if I had the dll working. OOOooooo! That would be FANTASTIC! I can give you SVN access to you can commit to SVN. From: http://www.tecgraf.puc-rio.br/iup/en/download_tips.html You can download different types of files for different libs associated with Iup. There are some files named such as: cd5_0_Win32_dll_lib.zip which should get you the already compiled dll files. That's what I do for windows. Much easier than compiling the project for windows. Send me an email with a username and password, and I will create an SVN account for you. Thank you! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20748 Date: 2008 May 11 9:43 From: Jeremy Cowgar <jeremy at ?owgar.com> Subject: New keyword added: continue Continue has been added to Euphoria SVN. Continue is Exit's sibling. <eucode> for i = 1 to length(lines) do if length(lines[i]) = 0 or lines[i][1] = '#' then continue -- start loop at next iteration end if -- You know the line has data and is not a comment line -- process the line end for </eucode> -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20749 Date: 2008 May 11 9:46 From: CChris <christian.cuvier at agriculture.?ou?.fr> Subject: Re: New keyword added: continue Jeremy Cowgar wrote: > > Continue has been added to Euphoria SVN. Continue is Exit's sibling. > > <eucode> > for i = 1 to length(lines) do > if length(lines[i]) = 0 or lines[i][1] = '#' then > continue -- start loop at next iteration > end if > > -- You know the line has data and is not a comment line > -- process the line > end for > </eucode> > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> This one was sorely needed! Thanks! CChris -= B E G I N =- X-EUFORUM: 20750 Date: 2008 May 11 10:29 From: Derek Parnell <ddparnell at bi?pond?com> Subject: Re: New keyword added: continue Jeremy Cowgar wrote: > > Continue has been added to Euphoria SVN. Continue is Exit's sibling. But I seriously hope it is going to be renamed to something a lot more natural such as 'next'. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20751 Date: 2008 May 11 11:46 From: Salix <salix at freemai?.?u> Subject: Re: New keyword added: continue > Jeremy Cowgar wrote: > > Continue has been added to Euphoria SVN. Continue is Exit's sibling. Oh, at last! Thanks! But I agree with Derek and I'd prefer a more natural such as 'next'. Regards, Salix -= B E G I N =- X-EUFORUM: 20752 Date: 2008 May 11 11:54 From: CChris <christian.cuvier at agric?lt?re.gouv.fr> Subject: Re: New keyword added: continue Salix wrote: > > > Jeremy Cowgar wrote: > > > Continue has been added to Euphoria SVN. Continue is Exit's sibling. > > Oh, at last! Thanks! > > But I agree with Derek and I'd prefer a more natural such as 'next'. > > Regards, > > Salix Me too, antd that's how it's named in Æ. But naming discussions are so ... , well, that I won't care how it gets eventually named, as long as it stays in the language. CChris -= B E G I N =- X-EUFORUM: 20753 Date: 2008 May 11 12:04 From: CChris <christian.cuvier at agri?ulture.gou?.fr> Subject: can_add() and linear() I'd suggest two additions to sequence.e, which I hope will appear pretty natural: <eucode> global function can_add(object a,object b) -- Determines whether a+b would crash the interpreter. -- Returns 1 if addition possible, else 0. if atom(a) or atom(b) then return 1 end if if length(a)!=length(b) then return 0 end if for i=1 to length(a) do if not can_add(a[i],b[i]) then return 0 end if end for return 1 end function global funtion linear(object start,object increment,integer count) -- Returns 0 on failure, or a sequence of count objects. -- The first one is start, and the whole sequence is a linear progrssion using increment. sequence result if count<0 or not can_add(start,increment) then return 0 end if result=repeat(start,count) for i=2 to count do start+=increment result[i]=start end for return result end function </eucode> The latter might go to math.e just as well, but for its dependency on can_add(). CChris -= B E G I N =- X-EUFORUM: 20754 Date: 2008 May 11 12:16 From: CChris <christian.cuvier at agriculture.gouv?f?> Subject: Re: sets for sequence.e? Jeremy Cowgar wrote: > > CChris wrote: > > > > > > There is also > > <a href="http://oedoc.free.fr/Fichiers/ESL/sets.zip">http://oedoc.free.fr/Fichiers/ESL/sets.zip</a> > > > > It's quite more complete, as it handles maps between sets and composition laws. > > It was laid out and documented for inclusion in the ESL framework. But, if there > > is interest, I can edit the ESL stuff out. > > > > Chris, > > If you would like to do that, thanks! Maybe it should be a new include, set.e > and not part of sequence.e > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Done, though I may wish to add a few more unit tests. As usual, the tests themselves had way more problems than the code they tested. There is no .htx documentation yet, but it is in sets.e and would simply need to move from here to there with some format tags. I'm not sure I have time to do that next week (53 entries). What's best? CChris -= B E G I N =- X-EUFORUM: 20755 Date: 2008 May 11 12:19 From: CChris <christian.cuvier at ?gricul?ure.gouv.fr> Subject: Search EuForum glitch Rob/Junko: Could you add 2008 to the list of years available to start searching? When scrolling down the listbox, the last one I get is 2007. CChris -= B E G I N =- X-EUFORUM: 20756 Date: 2008 May 11 12:22 From: Jeremy Cowgar <jeremy at cowg?r.?om> Subject: Re: sets for sequence.e? CChris wrote: > > > Done, though I may wish to add a few more unit tests. As usual, the tests themselves > had way more problems than the code they tested. That may be but it's vital that unit tests exist, for instance, it caught quite a bit last change. One function was changed, and that function was tested with a sample app and it worked. However, all the other functions that relied upon the changed function began to fail. > There is no .htx documentation yet, but it is in sets.e and would simply need > to move from here to there with some format tags. I'm not sure I have time to > do that next week (53 entries). Really? 53 new functions? > What's best? Please put a -- TODO: document At the beginning of each function that is a global and then commit. Before functions go into SVN, they should be unit tested, however, not necessarily documented. But, we must have an easy way to see which ones are not documented. An undocumented function is one that does not exist to the public. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20757 Date: 2008 May 11 13:03 From: Jeremy Cowgar <jeremy at cowg?r.?om> Subject: Naming of "continue" We can name it whatever. I do not really care, what I like is the functionality :-) The reason I choose continue was due to familiarity. Most languages that have such a keyword call it continue. I can see where either would work... i.e. continue -- at top of loop next -- next loop iteration But, taken literally, what do either really mean? continue -- execution? continue -- with next token? or next -- token? next -- statement? So, after thinking about it, I felt neither was a perfect name, but continue had on it's side name recognition. Neither was self evident but at least most people know what continue is. Other languages that have a next keyword are usually part of the for loop: for 1 to 10 do print "Hello" next They are not put mid block, but are the same thing as our end for or end do. Oh, I also did some research and I found several uses of function name next() for iterating through lists, tokens, etc... Other possible names I came up with are: repeat, again, hm... tried to come up with others with no luck. Out of: continue, next, repeat, again ... I think repeat or again makes much more sense than continue or next. Here are definitions: continue v 1: continue a certain state, condition, or activity; "Keep on working!"; "We continued to work into the night"; "Keep smiling"; "We went on working until well past midnight" 4: move ahead; travel onward in time or space; "We proceeded towards Washington"; "She continued in the direction of the hills"; "We are moving ahead in time now" next adj 1: nearest in space or position; immediately adjoining without intervening space; "had adjacent rooms"; "in the next room"; "the person sitting next to me"; "our rooms were side by side" [syn: adjacent, side by side(p)] 3: immediately following in time or order; "the following day"; "next in line"; "the next president"; "the next item on the list" [syn: following] repeat n : an event that repeats; "the events today were a repeat of yesterday's" [syn: repetition] v 1: to say, state, or perform again; "She kept reiterating her request" [syn: reiterate, ingeminate, iterate, restate, retell] 2: make or do or perform again; "He could never replicate his brilliant performance of the magic trick" [syn: duplicate, reduplicate, double, replicate] 3: happen or occur again; "This is a recurring story" [syn: recur] 4: to say again or imitate; "followers echoing the cries of their leaders" [syn: echo] 5: do over; "They would like to take it over again" [syn: take over] 6: repeat an earlier theme of a composition [syn: reprise, reprize, recapitulate] again adv : anew; "she tried again"; "they rehearsed the scene again" [syn: once again, once more, over again] 1. once more; another time; anew; in addition: Will you spell your name again, please? 2. in an additional case or instance; moreover; besides; furthermore. 3. on the other hand: It might happen, and again it might not. 4. back; in return; in reply: to answer again. 5. to the same place or person: to return again. Notice a few: next #1, #4 (there were other definitions that did not apply at all to us, same as other words, so I did not include them). repeat #2, #3, #5. Again did not have a good definition on dict.org, so I got it from dictionary.com... again #1, #4 So, if we were to change from continue and loose the familiarity of it, I would vote for repeat or again, not next. next has all the same problems as continue, plus it is used in other languages as a keyword that does something different, and it's a common function name. Thoughts? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20758 Date: 2008 May 11 13:47 From: Robert Craig <rds at ?apidE?phoria.com> Subject: Re: Search EuForum glitch CChris wrote: > Rob/Junko: > Could you add 2008 to the list of years available to start searching? When scrolling > down the listbox, the last one I get is 2007. OK, thanks for pointing that out. It's fixed now. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com -= B E G I N =- X-EUFORUM: 20759 Date: 2008 May 11 13:59 From: Bernie Ryan <xotron at blu?f?og.com> Subject: Re: New keyword added: continue I'd prefer a more natural such as 'next'. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20760 Date: 2008 May 11 14:24 From: Derek Parnell <ddparnell at big?on?.com> Subject: Re: Naming of "continue" Jeremy Cowgar wrote: > > We can name it whatever. I do not really care, what I like is the functionality :-) I too like the functionality, but the name is also important. I vote for 'next'. I think of it in terms of 'iterations'. 'next' (iteration) to me strongly suggests that the current iteration ceases to execute and control is immediately given to the next iteration of the loop, using the next value of the index/counter. 'continue' (iteration) suggest that the current iteration continues executing. 'repeat' (iteration) suggest that the current iteration is repeated using the same index value. 'again' (iteration) is identical to 'repeat'. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20761 Date: 2008 May 11 14:46 From: Jeremy Cowgar <jeremy at ?owgar.?om> Subject: Re: Naming of "continue" Derek Parnell wrote: > > I think of it in terms of 'iterations'. > > 'next' (iteration) to me strongly suggests that the current iteration ceases > to execute and control is immediately given to the next iteration of the loop, > using the next value of the index/counter. > > 'continue' (iteration) suggest that the current iteration continues executing. > > 'repeat' (iteration) suggest that the current iteration is repeated using the > same index value. > > 'again' (iteration) is identical to 'repeat'. > I was thinking more about it and common uses of the words that we may already use. For instance, a CD player. A CD player on repeat mode will do as you say, repeat the same song over and over. Continuous will loop from 1st song on CD to last, then start again at the first. There is no again. But speaking in terms of iterations, I think you are right, next makes the most sense in that context. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20762 Date: 2008 May 11 14:58 From: Arthur Crump <arthur.crump at ?tlw?rld.com> Subject: Re: New keyword added: continue Just another vote for 'next' rather than 'continue' in a for statement. I am old enough to remember when 'next' was the end of a for statement instead of the much better 'end for' used now, but I think the proposal is a better use of .next' Arthur Crump, Cheshire, UK. ---------------------------- Derek Parnell wrote: > > Jeremy Cowgar wrote: > > > > Continue has been added to Euphoria SVN. Continue is Exit's sibling. > > > But I seriously hope it is going to be renamed to something a lot more natural > such as 'next'. > > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20763 Date: 2008 May 11 15:28 From: Les Rogers <selgor1 at verizonmail??om> Subject: BEZIER CURVES Hi I am working on a Bezier Curve Program. I have the curve !!! Cannot make it "rotate" Any Help ?? -= B E G I N =- X-EUFORUM: 20764 Date: 2008 May 11 15:38 From: Mike Sywensky <michaelsy at yah?o.com> Subject: Re: New keyword added: continue Arthur Crump wrote: > > Just another vote for 'next' rather than 'continue' in a for statement. > > I am old enough to remember when 'next' was the end of a for statement > instead of the much better 'end for' used now, but I think the proposal > is a better use of .next' > > Arthur Crump, Cheshire, UK. > > ---------------------------- > Derek Parnell wrote: > > > > Jeremy Cowgar wrote: > > > > > > Continue has been added to Euphoria SVN. Continue is Exit's sibling. > > > > > > But I seriously hope it is going to be renamed to something a lot more natural > > such as 'next'. > > > > > > -- > > Derek Parnell > > Melbourne, Australia > > Skype name: derek.j.parnell Although it may not make as much sense for someone learing euphoria as a first language, I imagine most people are not using it as a first language. My guess is most people are coming from other languages such as VB or C. 'continue' is what is used by both languages. That is my vote. -= B E G I N =- X-EUFORUM: 20765 Date: 2008 May 11 16:02 From: Jeremy Cowgar <jeremy at cowgar.??m> Subject: Re: New keyword added: continue Mike Sywensky wrote: > > Although it may not make as much sense for someone learing euphoria as a first > language, I imagine most people are not using it as a first language. > > My guess is most people are coming from other languages such as VB or C. 'continue' > is what is used by both languages. That is my vote. I just went to the computer language shootout and looked at the more popular languages there. I suppose a more detailed study could be done via the TIBOE language index, but here are my findings: python = continue c = continue vb = continue d = continue basic = continue pascal = continue php = continue perl = next javascript = continue tcl = continue I agree after conversations here, looking in dictionary and comparing to other devices, that next makes sense, but most people who program do not program in one language, thus, similarity to a degree is good. But the choice between continue, next, repeat, again or whatever else may come up is not a huge deal to me personally. I am forced to use a few different languages and have to adapt to minor nuances like this all the time, so... before making any changes to the naming, I would like to hear more feedback from others who have not spoken yet about the topic. For me to change continue to next or whatever is about a 10-15 minute job for me, not a big deal and can be done at any time, so I am going to no act quickly, but let there be some more discussion. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20766 Date: 2008 May 11 16:15 From: Bernie Ryan <xotron at bluefr?g?com> Subject: Re: New keyword added: continue NEXT takes the least amount of typing. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20767 Date: 2008 May 11 16:15 From: Bernie Ryan <xotron at blue?r?g.com> Subject: Re: BEZIER CURVES which OS DOS WINDOWS LINUX ??? Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20768 Date: 2008 May 11 16:27 From: c.k.lester <euphoric at ckl??ter.com> Subject: Re: New keyword added: continue Jeremy Cowgar wrote: > > I agree after conversations here, looking in dictionary and comparing to other > devices, that next makes sense, but most people who program do not program in > one language, thus, similarity to a degree is good. I vote for 'next.' I think VBA uses next and I use VBA at work. -= B E G I N =- X-EUFORUM: 20769 Date: 2008 May 11 16:35 From: ChrisBurch3 <crylex at gm?il.co?> Subject: Re: BEZIER CURVES Les Rogers wrote: > > > Hi > > I am working on a Bezier Curve Program. > > I have the curve !!! > > Cannot make it "rotate" > > Any Help ?? Try rotating your head 90 degrees either to the left or right - lot easier than writing nasty algorithms. The point of rotation should be a line drawn roughly from the bcak of your neck to the throat (I would use ventral and dorsal, but this is a computing forum) Oh, and remember to look at the screen while doing it. Happy rotating! Chris -= B E G I N =- X-EUFORUM: 20770 Date: 2008 May 11 16:37 From: Jeremy Cowgar <jeremy at c?wgar.co?> Subject: Re: New keyword added: continue c.k.lester wrote: > I vote for 'next.' I think VBA uses next and I use VBA at work. VBA does not use next as a continue. It uses next as a end for... for int i = 1 to 10 ' do some code here next To implement continue in VBA you use goto... for int i = 1 to 10 if i = 5 goto continue ' do some code continue: ' Label right next to the end of the for loop next So, next in Euphoria would conflict totally w/your next in VBA. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20771 Date: 2008 May 11 16:40 From: c.k.lester <euphoric at ckleste??com> Subject: Re: New keyword added: continue Jeremy Cowgar wrote: > c.k.lester wrote: > > I vote for 'next.' I think VBA uses next and I use VBA at work. > VBA does not use next as a continue. It uses next as a end for... Well, you can see I never use a continue construct. :D I still like 'next' better because it's more appropriate and I only have to type 4 letters instead of 8. That's a 50% increase in efficiency. -= B E G I N =- X-EUFORUM: 20772 Date: 2008 May 11 16:45 From: CChris <christian.cuvier at agriculture?gouv.?r> Subject: Re: Naming of "continue" Jeremy Cowgar wrote: > > We can name it whatever. I do not really care, what I like is the functionality :-) > > The reason I choose continue was due to familiarity. Most languages that have > such a keyword call it continue. I can see where either would work... i.e. > > continue -- at top of loop > next -- next loop iteration > > But, taken literally, what do either really mean? > > continue -- execution? > continue -- with next token? > > or > > next -- token? > next -- statement? > > So, after thinking about it, I felt neither was a perfect name, but continue > had on it's side name recognition. Neither was self evident but at least most > people know what continue is. Other languages that have a next keyword are usually > part of the for loop: > > for 1 to 10 do > print "Hello" > next > > They are not put mid block, but are the same thing as our end for or end do. > > Oh, I also did some research and I found several uses of function name next() > for iterating through lists, tokens, etc... > > Other possible names I came up with are: > > repeat, again, hm... tried to come up with others with no luck. > > Out of: continue, next, repeat, again ... I think repeat or again makes much > more sense than continue or next. Here are definitions: > > continue > v 1: continue a certain state, condition, or activity; "Keep on > working!"; "We continued to work into the night"; "Keep > smiling"; "We went on working until well past midnight" > 4: move ahead; travel onward in time or space; "We proceeded > towards Washington"; "She continued in the direction of > the hills"; "We are moving ahead in time now" > > next > adj 1: nearest in space or position; immediately adjoining without > intervening space; "had adjacent rooms"; "in the next > room"; "the person sitting next to me"; "our rooms > were side by side" [syn: adjacent, side by side(p)] > 3: immediately following in time or order; "the following day"; > "next in line"; "the next president"; "the next item on > the list" [syn: following] > > repeat > n : an event that repeats; "the events today were a repeat of > yesterday's" [syn: repetition] > v 1: to say, state, or perform again; "She kept reiterating her > request" [syn: reiterate, ingeminate, iterate, restate, > retell] > 2: make or do or perform again; "He could never replicate his > brilliant performance of the magic trick" [syn: duplicate, > reduplicate, double, replicate] > 3: happen or occur again; "This is a recurring story" [syn: recur] > 4: to say again or imitate; "followers echoing the cries of > their leaders" [syn: echo] > 5: do over; "They would like to take it over again" [syn: take > over] > 6: repeat an earlier theme of a composition [syn: reprise, reprize, > recapitulate] > > again > adv : anew; "she tried again"; "they rehearsed the scene again" > [syn: once again, once more, over again] > 1. once more; another time; anew; in addition: Will you spell your name again, > please? > 2. in an additional case or instance; moreover; besides; furthermore. > 3. on the other hand: It might happen, and again it might not. > 4. back; in return; in reply: to answer again. > 5. to the same place or person: to return again. > > Notice a few: next #1, #4 (there were other definitions that did not apply at > all to us, same as other words, so I did not include them). repeat #2, #3, #5. > Again did not have a good definition on dict.org, so I got it from dictionary.com... > again #1, #4 > > So, if we were to change from continue and loose the familiarity of it, I would > vote for repeat or again, not next. next has all the same problems as continue, > plus it is used in other languages as a keyword that does something different, > and it's a common function name. > > Thoughts? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> The problem I see with repeat is that, in Pascal/Ada, it starts a loop with exit test at the end, equivalent to the do ... while construct in C. Euphoria doesn't have it, it would be convenient, I think, even though you can always emulate it as <eucode> while 1 do --... if exit_condition() then exit end if end while </eucode> which would be more easily coded as <eucode> repeat --... -- until exit_condition() </eucode> again means: the _same_ thing another time. I'd use it to repeat the last iteration, without testing or incrementing, ie something as much the same as the current iteration. I called it retry. CChris -= B E G I N =- X-EUFORUM: 20773 Date: 2008 May 11 16:46 From: yuku <yuku at ikitek.co?> Subject: Re: New keyword added: continue 'next' is more likely to be used as a variable name - linked list node's next - next entry - next coming input so i vote for 'continue'. -= B E G I N =- X-EUFORUM: 20774 Date: 2008 May 11 17:04 From: Matt Lewis <matthewwalkerlewis at gmai?.?om> Subject: Re: New keyword added: continue Mike Sywensky wrote: > > Although it may not make as much sense for someone learing euphoria as a first > language, I imagine most people are not using it as a first language. > > My guess is most people are coming from other languages such as VB or C. 'continue' > is what is used by both languages. That is my vote. I've used both 'continue' and 'next'. Either one is fine by me. Matt -= B E G I N =- X-EUFORUM: 20775 Date: 2008 May 11 17:06 From: Matt Lewis <matthewwalkerlewis at gmail.??m> Subject: Re: New keyword added: continue c.k.lester wrote: > > Jeremy Cowgar wrote: > > c.k.lester wrote: > > > I vote for 'next.' I think VBA uses next and I use VBA at work. > > VBA does not use next as a continue. It uses next as a end for... > > Well, you can see I never use a continue construct. :D > > I still like 'next' better because it's more appropriate and I only have to > type 4 letters instead of 8. That's a 50% increase in efficiency. And let's be honest here, folks, CK needs all the help he can get... Matt -= B E G I N =- X-EUFORUM: 20776 Date: 2008 May 11 17:15 From: CChris <christian.cuvier at ag?icult?re.gouv.fr> Subject: Re: sets for sequence.e? Jeremy Cowgar wrote: > > CChris wrote: > > > > > > There is no .htx documentation yet, but it is in sets.e and would simply need > > to move from here to there with some format tags. I'm not sure I have time to > > do that next week (53 entries). > > Really? 53 new functions? > Yep: * binary search (1) * sets: ** construction (2) ** elements (4) ** parts (4) ** basic operations (4) * maps ** construction (3) ** properties (3) ** direct mapping (3) ** reverse mapping (3) ** operations (4) * products (7) * operations, ie binary ops: ** construction (2) ** properties(2) ** units (7) ** other (4) If you downloaded stes.zip, the summary is in sets_spec.txt. I'll email it if needed. I thought graph handling would be better in a separate lib, which would clearly use this one. Nothing written so fa about it. CChris -= B E G I N =- X-EUFORUM: 20777 Date: 2008 May 11 17:55 From: Jason Gade <jaygade at y?hoo.c?m> Subject: Re: New keyword added: continue Matt Lewis wrote: > > Mike Sywensky wrote: > > > > Although it may not make as much sense for someone learing euphoria as a first > > language, I imagine most people are not using it as a first language. > > > > My guess is most people are coming from other languages such as VB or C. 'continue' > > is what is used by both languages. That is my vote. > > I've used both 'continue' and 'next'. Either one is fine by me. > > Matt I prefer continue, I think, for reasons that others have mentioned -- existing use of "next" as an identifier. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20778 Date: 2008 May 11 17:58 From: c.k.lester <euphoric at ck?ester.?om> Subject: Re: New keyword added: continue Matt Lewis wrote: > c.k.lester wrote: > > I still like 'next' better because it's more appropriate and I only have to > > type 4 letters instead of 8. That's a 50% increase in efficiency. > And let's be honest here, folks, CK needs all the help he can get... Amen to that! -= B E G I N =- X-EUFORUM: 20779 Date: 2008 May 11 22:15 From: don cole <doncole at p?cbell.?et> Subject: Re: BEZIER CURVES ChrisBurch3 wrote: > > Les Rogers wrote: > > > > > > Hi > > > > I am working on a Bezier Curve Program. > > > > I have the curve !!! > > > > Cannot make it "rotate" > > > > Any Help ?? > > Try rotating your head 90 degrees either to the left or right - lot easier > than writing nasty algorithms. The point of rotation should be a line drawn > roughly from the bcak of your neck to the throat (I would use ventral and > dorsal, but this is a computing forum) > > Oh, and remember to look at the screen while doing it. > > Happy rotating! > > Chris You could stick one finger in your mouth and one finger .......Ah, you know the rest of it. In all seriousness why not draw the curve to a pixmap and rotate that with win32dib. Don Cole -= B E G I N =- X-EUFORUM: 20780 Date: 2008 May 11 22:17 From: Derek Parnell <ddparnell at bigpo?d.com> Subject: Re: New keyword added: continue Mike Sywensky wrote: > Although it may not make as much sense for someone > learing euphoria as a first language, ... or still make sense after years of usage. > I imagine most people are not using it as a first language. ... and yet there are a lot of people who are actually using Eu as a first-ish language. > My guess is most people are coming from other languages such as VB or C. What is this 'C' thing you speak of and what has Victoria Bitter got to do with programming? ;-) -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20781 Date: 2008 May 11 22:28 From: Jeremy Cowgar <jeremy at c?w?ar.com> Subject: Re: New keyword added: continue Derek Parnell wrote: > > ... and yet there are a lot of people who are actually using Eu as a first-ish > language. And by teaching the continue, we are not doing them a dis-service. Most programmers today are going to be multi-lingual. Not all, but most. Please see the post: http://www.openeuphoria.org/EUforum/m20765.html Which lists a few languages that I researched. I found 1 that uses next, and it is perl, but it has a rather complex looping interface such as a continue block that contains next, last, redo and retry. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20782 Date: 2008 May 11 22:35 From: Derek Parnell <ddparnell at bigpond??om> Subject: Re: BEZIER CURVES Les Rogers wrote: > I am working on a Bezier Curve Program. > Cannot make it "rotate" > Any Help ?? Sure, and by the way I have a problem with a program I'm working on too. Can you fix that for me? But seriously folks ... The very first problem you have here is that you haven't given us anything to work on ... We can't see your code. We can't see what it *is* doing. We can't see the messages, if any, you are getting. We can't see what specific efforts you have made to resolve it yourself. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20783 Date: 2008 May 11 22:37 From: Derek Parnell <ddparnell at b?gp?nd.com> Subject: Re: New keyword added: continue Jeremy Cowgar wrote: I suppose a more detailed study could be done via the TIBOE > language index, but here are my findings: > > python = continue > c = continue > vb = continue > d = continue > basic = continue > pascal = continue > php = continue > perl = next > javascript = continue > tcl = continue But aren't we supposed to be learning from the mistakes of the past? -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20784 Date: 2008 May 11 22:47 From: Jeremy Cowgar <jeremy at co?gar?com> Subject: Debug Block? I was looking through the feature requests on the SF.net page trying to clean things up. A lot of old suggestions exist, some of which were already implemented, so I closed them. Anyway, I ran across a feature request by CK Lester and figured I would bring his suggestion to the forum for discussion so we can either implement (do not think it would be hard) or clear the suggestion. No reason to have it sit there in limbo for no reason. Keep in mind, I am just brining this to peoples attention. It's not my idea, although, I think it's a good one. http://sourceforge.net/tracker/index.php?func=detail&aid=1771686&group_id=182827&atid=902785 He is basically suggesting the ability to remove debug code in the final copies of your Euphoria source. His suggestion is instead of: <eucode> --- code if DEBUG then printf(1, "Loop var is %d\n", {loopVar}) end if --- code </eucode> which would be included in your final code, therefore causing extra processing for no reason (has to check DEBUG condition). His idea is that a debug statement be added: <eucode> with debug --- code . printf(1, "Loop var is %d\n", {loopVar}) --- code </eucode> His suggestion was any line starting with a . would be debug code. Thus, when with debug or without debug is in the source code, the lines starting with . would not even be emitted to the final versions of your Euphoria programmer, thus, debug code would cause no slow down in your final version of your app. I also thought possibly instead of . you could: <eucode> with debug debug printf(1, "Loop var is %d\n", {loopVar}) -- more debug code end debug </eucode> Over all I do not see any bad side effects, only benefits, but wanted to get your input. I do think a more defined block, such as debug ... end debug would make the source code a bit cleaner and more easily understood, but everyone can go read CK's feature request on the SF URL listed above. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20785 Date: 2008 May 11 23:07 From: Jeremy Cowgar <jeremy at cow?ar?com> Subject: Re: New keyword added: continue Derek Parnell wrote: > > But aren't we supposed to be learning from the mistakes of the past? > Hm. #1, I'm not entirely sure continue is a mistake. #2, there is nothing inherently evil about continue and tradition should carry quite a bit of weight in this area. If there was a major flaw, then we should learn but I'm not seeing a huge flaw. Again, please understand, I'm just playing the "devils advocate" trying to promote a healthy debate about it. That's how we will do a service to Euphoria, however, I *think* I am on the side of continue, but am waffling. However, the debate is far from over. I do think it's possible, that if we choose next, in the future we may look back on things and treat the decision of going to next as one of those things in the past we should learn a lesson from. Another thought that just came to my mind is there is great talk about being able to embed Euphoria into C and use Euphoria as a scripting language to extend existing C applications. If that happens, we will have more and more C programmers using Euphoria. Thus, that should bear a *little* (probably not a lot) weight in the decision of next/continue. Probably what we should do is collect pro's and con's, then create a summary of those on the wiki. Then reference the wiki and make a decision. So, any pro's and con's out there people want to have recorded that has not already been said? For continue, pros: 1. standard cons: 1. what does it mean? For next, pros: 1. meaning is clearer (next iteration) cons: 1. use is common in variable names or function names (i.e. any iterator, list, database connection, etc...) 2. not standard or traditional 3. conflicts with other common languages such as basic, VBA, ASP (yes, all Microsoft). -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20786 Date: 2008 May 12 1:46 From: Derek Parnell <ddparnell at bigpo?d?com> Subject: Re: Debug Block? Jeremy Cowgar wrote: > I think it's a good one. Me too. It would be similar to the D Programming Language's facility... debug { ... statements ... } Some points to consider: If we use some 'block' syntax, the block needs to be able to span routines as well as statements, in order to comment out routines just used for debugging. Eg. debug procedure Logger(sequence text) -- write text to logging file. end procedure end debug or even ... debug include stddebug.e as dbg dbg:init("My App", "/var/debug.log", "append") end debug If we use the line prefix style of syntax, then I suggest a double dot, which is analogous with the double dash for comments. It also visually stands out more. .. include stddebug.e as dbg .. dbg:init("My App", "/var/debug.log", "append") Also, some way of turning it off/on from the command line instead of having to edit source code, should be considered. e.g. exu myapp.e --eu:debug=on Finally, to borrow from D language, we could support debug variations. debug(stage1) dbg:log("Beginning Stage 1") vLimit = 1 end debug debug(stage2) dbg:log("Beginning Stage 2") vLimit = 25 end debug and invoked by ... ex myapp.e --eu:debug=stage1 -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20787 Date: 2008 May 12 1:56 From: Kat <KAT12 at coosahs.n??> Subject: Re: New keyword added: continue Derek Parnell wrote: > > Jeremy Cowgar wrote: > I suppose a more detailed study could be done via the TIBOE > > language index, but here are my findings: > > > > python = continue > > c = continue > > vb = continue > > d = continue > > basic = continue > > pascal = continue > > php = continue > > perl = next > > javascript = continue > > tcl = continue > > But aren't we supposed to be learning from the mistakes of the past? Yeas, all these extra words, meaning different things to different people, when "goto" is so clear and direct and simple. <sigh> Kat -= B E G I N =- X-EUFORUM: 20788 Date: 2008 May 12 1:56 From: Jason Gade <jaygade at y?hoo.c?m> Subject: Re: Debug Block? I haven't read the entire proposal in detail, but wouldn't "with debug" and "without debug" be more consistent with the way we currently do things? It's an instruction to the interpreter, like "with trace" etc. instead of another kind of construct. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20789 Date: 2008 May 12 3:11 From: "Euler German" <eulerg at gmail.com> Subject: Re: New keyword added: continue > On 11 May 2008 at 3:29, Derek Parnell wrote (maybe snipped): > Jeremy Cowgar wrote: > > > > Continue has been added to Euphoria SVN. Continue is Exit's sibling. > > > But I seriously hope it is going to be renamed to something a lot more > natural such as 'next'. > Why not "loop"? -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 20790 Date: 2008 May 12 3:11 From: "Euler German" <eulerg at gmail.com> Subject: Re: Flaming and IRC > On 10 May 2008 at 18:34, Jason Gade wrote (maybe snipped): > > Jason Gade wrote: > > > > > > Since I've never used Euphoria IRC, I never realized that we had a > > > problem with flaming. I mean, this mailing list has to be about > > > the tamest spot on the Internet that I hang out. > > > > YOU SHUT YOUR MOUTH!!!!11!11 > > > > Oh, "tamest." Sorry. > > Heh. Now that's funny. > Duh, didn't catch the joke... -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 20791 Date: 2008 May 12 4:15 From: Derek Parnell <ddparnell at bi?pond.c?m> Subject: Re: Flaming and IRC Euler German wrote: > > > On 10 May 2008 at 18:34, Jason Gade wrote (maybe snipped): > > > > Jason Gade wrote: > > > > > > > > Since I've never used Euphoria IRC, I never realized that we had a > > > > problem with flaming. I mean, this mailing list has to be about > > > > the tamest spot on the Internet that I hang out. > > > > > > YOU SHUT YOUR MOUTH!!!!11!11 > > > > > > Oh, "tamest." Sorry. > > > > Heh. Now that's funny. > > > > Duh, didn't catch the joke... He mistook "tamest" to read "lamest" and was offended by the assertion that Euphoria IRC was the LAMEST spot on the internet. The phrase "lame" meaning in this context a place that is used by boring and/or stupid people etc... -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20792 Date: 2008 May 12 4:20 From: c.k.lester <euphoric at c?lester.?om> Subject: Re: Flaming and IRC Derek Parnell wrote: > Euler German wrote: > > Duh, didn't catch the joke... > He mistook "tamest" to read "lamest"... I *pretended* to mistake "tamest" to read "lamest..." I was joking around and just wanted a reason to use ALLCAPS!!!11!!1! :) -= B E G I N =- X-EUFORUM: 20793 Date: 2008 May 12 4:50 From: Jason Gade <jaygade at ya?oo?com> Subject: Re: Flaming and IRC Derek Parnell wrote: > > Euler German wrote: > > > > > On 10 May 2008 at 18:34, Jason Gade wrote (maybe snipped): > > > > > > Jason Gade wrote: > > > > > > > > > > Since I've never used Euphoria IRC, I never realized that we had a > > > > > problem with flaming. I mean, this mailing list has to be about > > > > > the tamest spot on the Internet that I hang out. > > > > > > > > YOU SHUT YOUR MOUTH!!!!11!11 > > > > > > > > Oh, "tamest." Sorry. > > > > > > Heh. Now that's funny. > > > > > > > Duh, didn't catch the joke... > > He mistook "tamest" to read "lamest" and was offended by the assertion that > Euphoria IRC was the LAMEST spot on the internet. The phrase "lame" meaning > in this context a place that is used by boring and/or stupid people etc... c.k.lester wrote: > > Derek Parnell wrote: > > Euler German wrote: > > > Duh, didn't catch the joke... > > He mistook "tamest" to read "lamest"... > > I *pretended* to mistake "tamest" to read "lamest..." I was joking around and > just wanted a reason to use ALLCAPS!!!11!!1! :) You know they say that if you have to explain a joke it's just not funny any more. :-) -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20794 Date: 2008 May 12 10:21 From: CChris <christian.cuvier at agr?culture.go?v.fr> Subject: Re: Debug Block? Jeremy Cowgar wrote: > > I was looking through the feature requests on the SF.net page trying to clean > things up. A lot of old suggestions exist, some of which were already implemented, > so I closed them. Anyway, I ran across a feature request by CK Lester and figured > I would bring his suggestion to the forum for discussion so we can either implement > (do not think it would be hard) or clear the suggestion. No reason to have it > sit there in limbo for no reason. Keep in mind, I am just brining this to peoples > attention. It's not my idea, although, I think it's a good one. > > <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=1771686&group_id=182827&atid=902785">http://sourceforge.net/tracker/index.php?func=detail&aid=1771686&group_id=182827&atid=902785</a> > > He is basically suggesting the ability to remove debug code in the final copies > of your Euphoria source. His suggestion is instead of: > > <eucode> > --- code > if DEBUG then > printf(1, "Loop var is %d\n", {loopVar}) > end if > --- code > </eucode> > > which would be included in your final code, therefore causing extra processing > for no reason (has to check DEBUG condition). His idea is that a debug statement > be added: > > <eucode> > with debug > > --- code > . printf(1, "Loop var is %d\n", {loopVar}) > --- code > </eucode> > > His suggestion was any line starting with a . would be debug code. Thus, when > with debug or without debug is in the source code, the lines starting with . > would not even be emitted to the final versions of your Euphoria programmer, > thus, debug code would cause no slow down in your final version of your app. > > I also thought possibly instead of . you could: > > <eucode> > with debug > > debug > printf(1, "Loop var is %d\n", {loopVar}) > -- more debug code > end debug > </eucode> > > Over all I do not see any bad side effects, only benefits, but wanted to get > your input. I do think a more defined block, such as debug ... end debug would > make the source code a bit cleaner and more easily understood, but everyone > can go read CK's feature request on the SF URL listed above. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I certainly vote for it, in the debug ... end debug form. As far as I remember, there are only 4 routines in emit.e that would need to be guarded by an "if not DEBUG then" statement. At least in the 3.1 source. So it is definitely not hard to do. I would expect thie sith/sithout debug directive to behave like similar ones, ie the status flag is saved when a new include file starts being parsed, and restored when that parsing is complete. CChris -= B E G I N =- X-EUFORUM: 20795 Date: 2008 May 12 10:27 From: CChris <christian.cuvier at agricultur?.?ouv.fr> Subject: Re: New keyword added: continue Add to the pros for next that it is shorter to type. Symmetrically, a con for continue is its being longer. CChris -= B E G I N =- X-EUFORUM: 20796 Date: 2008 May 12 10:37 From: CChris <christian.cuvier at agricultur?.go?v.fr> Subject: Re: New keyword added: continue Euler German wrote: > > > On 11 May 2008 at 3:29, Derek Parnell wrote (maybe snipped): > > > Jeremy Cowgar wrote: > > > > > > Continue has been added to Euphoria SVN. Continue is Exit's sibling. > > > > > > But I seriously hope it is going to be renamed to something a lot more > > natural such as 'next'. > > > > Why not "loop"? > > -- > _ > _| euler f german > _| sete lagoas, mg, brazil > _| efgerman{AT}gmail{DOT}com > Good catch. However, if we are to add a loop construct that tests at the end (a do ... while or repeat ... until loop), then, as we couldn't use repeat nor do, loop would be the natural choice. This is why I keep thinking "next" is a little better, but not by much. CChris -= B E G I N =- X-EUFORUM: 20797 Date: 2008 May 12 12:07 From: Kat <KAT12 at coo?a?s.net> Subject: Re: New keyword added: continue Why? Here's how you use one keyword instead of six: <eucode> --repeat until :repeat x -= 1 if x > 12 then goto repeat end if -- case atom fred, a, d fred = 45 a = 1 d = 44 goto x puts(1,x&" is not covered") goto caseend :1 puts(1,"it's 1!") goto caseend :34 puts(1,"wow, 34!") :"Sam" puts(1,"you got Sam!" goto caseend :a+d puts(1,"Yep, fred is 45!") goto caseend :caseend -- continue, retry, restart, and next :restart for loop = 1 to 12 do :retry -- code if test = failed then goto retry end if if thistest = failed then goto restart end if if bored = true then goto next end if if done then goto demoend end if -- code :next end for :demoend </eucode> You know exactly where each "goto" lands, each :target can be in your own native language, and OOEU prooves it can be done. It's ONE word. It's so SIMPLE. Kat -= B E G I N =- X-EUFORUM: 20798 Date: 2008 May 12 12:18 From: ChrisBurch2 <crylex at freeu?.co.u?> Subject: Re: New keyword added: continue Kat wrote: <snip> > You know exactly where each "goto" lands, each :target can be in your own native > language, and OOEU prooves it can be done. It's ONE word. It's so SIMPLE. > > Kat Yes, but then I wouldn't have so much fun reading the reams of stuff generated over one word :-) Chris -= B E G I N =- X-EUFORUM: 20799 Date: 2008 May 12 13:29 From: Jeremy Cowgar <jeremy at cowgar.c?m> Subject: Re: New keyword added: continue Kat wrote: > > Why? > Here's how you use one keyword instead of six: > > <eucode> > > --repeat until > :repeat > x -= 1 > if x > 12 then goto repeat end if > > > -- case > atom fred, a, d > fred = 45 > a = 1 > d = 44 > > goto x > puts(1,x&" is not covered") goto caseend > :1 puts(1,"it's 1!") goto caseend > :34 puts(1,"wow, 34!") > :"Sam" puts(1,"you got Sam!" goto caseend > :a+d puts(1,"Yep, fred is 45!") goto caseend > :caseend > > -- continue, retry, restart, and next > :restart > for loop = 1 to 12 do > :retry > -- code > if test = failed then goto retry end if > if thistest = failed then goto restart end if > if bored = true then goto next end if > if done then goto demoend end if > -- code > :next > end for > :demoend > > </eucode> The above code is not entirely correct or as simple as it seems. Let's start with the case statement. I think a case statement would a much better choice. Why? What if you want two case statements, either nested or in the same function in different sections that answer both to the integer 1 ? <eucode> goto x :1 puts "One!\n" :2 puts "Two!\n" :caseend goto y :1 puts "One!\n" -- invalid already used :2 puts "Two!\n" -- invalid already used :caseend -- invalid already used </eucode> The for loop with next, retry, exit, restart, etc... First to program might be a bit of a chore because on the keywords "end for" the stack is cleaned up, temp variables cleared, etc... A direct goto out of the for loop w/o hitting an end for would leave the internals dirty. It should be able to detect that it went out of the loop and then clean up, but it's not as easy as pushing adding a label and going to a label in the backend as you would think. #2 with the for loop, it suffers the same fate as the case statement. Sure, on the first for loop you can use :retry, :end, :next, :restart, but then on subsequent for loops in the same context (in top level or inside a function), you would have to get creative in your naming... :end2, :next2, :restart2, etc... Then have 1 for loop that is nested in another, and then later in the function you add a new for loop. Then, as time goes on, you add a for loop at the beginning of the function. Now, your first for loop is named :end3, :restart3, and your second is just :end, :restart, etc... and an inner is :restart3, etc... It begins to get pretty confusing. So, while I personally think a goto statement is a good thing, I do not think it is a replacement for exit, continue and a case statement. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20800 Date: 2008 May 12 13:34 From: Jeremy Cowgar <jeremy at ?owgar.c?m> Subject: Goto? Kat has brought up the subject of Goto and while we are talking about 4.0 and new keywords, let's just talk about this one too. I have mixed emotions about it. Goto in some situations can be a very valuable construct but it can also be a construct that novice programmers can really get in trouble with causing hours of unnecessary debugging. So, I guess the real decision is does Euphoria take a stand at trying to protect the programmer from writing bad code or does it provide to them power and if the programmer wishes to shoot himself with it, they can. I know this will be a controversial subject. All I am doing is the same thing I've done with things in the past. Raise the subject and let's talk about it. Since it is controversial, let's not get upset. All we are doing is talking about it. Let's not revert to name calling, yelling or getting upset. It's just a talk about goto. There is an existing wiki page that you may wish to read before commenting. I am unsure of it's original author: http://euwiki.ayo.biz/Goto -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20801 Date: 2008 May 12 13:50 From: Jason Gade <jaygade at ya?oo.co?> Subject: Re: New keyword added: continue For me, the word "continue" (or "next" or "exit" or whatever) makes the context far more clear when trying to understand the code. I've seen very few uses of goto that can't easily be expressed in a better way in a high-level language. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20802 Date: 2008 May 12 13:54 From: Jason Gade <jaygade at y?h?o.com> Subject: Re: Goto? Jeremy Cowgar wrote: > > Kat has brought up the subject of Goto and while we are talking about 4.0 and > new keywords, let's just talk about this one too. > > I have mixed emotions about it. Goto in some situations can be a very valuable > construct but it can also be a construct that novice programmers can really > get in trouble with causing hours of unnecessary debugging. > > So, I guess the real decision is does Euphoria take a stand at trying to protect > the programmer from writing bad code or does it provide to them power and if > the programmer wishes to shoot himself with it, they can. > > I know this will be a controversial subject. All I am doing is the same thing > I've done with things in the past. Raise the subject and let's talk about it. > Since it is controversial, let's not get upset. All we are doing is talking > about it. Let's not revert to name calling, yelling or getting upset. It's just > a talk about goto. > > There is an existing wiki page that you may wish to read before commenting. > I am unsure of it's original author: > > <a href="http://euwiki.ayo.biz/Goto">http://euwiki.ayo.biz/Goto</a> > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I don't think it's "protecting the programmer from writing bad code" as much as it is "protecting the maintainer from maintaining bad code". Yes, I'm relying on Derek Parnell's argument that a piece of code's human readability is very important. I mean, if we all wanted to shoot ourselves in the foot we might as well keep using C. :-) -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20803 Date: 2008 May 12 14:11 From: Bernie Ryan <xotron at bluefrog?co?> Subject: Re: Goto? What no one understands about implementing goto is how complicated it is to implement in an interpreter. Maybe if someone would demonstrate how easy it is to implement; then they could post the code and that could be discussed on EUforum. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20804 Date: 2008 May 12 14:16 From: Jeremy Cowgar <jeremy at co?gar.?om> Subject: Re: Goto? Bernie Ryan wrote: > What no one understands about implementing goto is how > complicated it is to implement in an interpreter. > Maybe if someone would demonstrate how easy it is to implement; > then they could post the code and that could be discussed on EUforum. The front end code is pretty easy actually, at first glance. Now, what may be difficult is what I mentioned in the post in regards to the for loop. Jumping out of a for loop is going to leave things pretty dirty, but I am certain that can be solved with a bit of thought. But, I do not wish to spend any time developing code that will be rejected, so I think the discussion must come first. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20805 Date: 2008 May 12 14:18 From: c.k.lester <euphoric at ckles?er.?om> Subject: Re: Goto? Jeremy Cowgar wrote: > > I have mixed emotions about it. Goto in some situations can be a very valuable > construct but it can also be a construct that novice programmers can really > get in trouble with causing hours of unnecessary debugging. I've never encountered a case where a goto is the best solution. Never. One thing I want to avoid on any interpreter upgrade is bloating the interpreter and/or slowing it down. If goto is going to be considered, I'm sure there are more popular options to be considered first. -= B E G I N =- X-EUFORUM: 20806 Date: 2008 May 12 14:26 From: Kat <KAT12 at coosahs??et> Subject: Re: New keyword added: continue Jeremy Cowgar wrote: > > Kat wrote: > > > > Why? > > Here's how you use one keyword instead of six: > > > > <eucode> > > > > --repeat until > > :repeat > > x -= 1 > > if x > 12 then goto repeat end if > > > > > > -- case > > atom fred, a, d > > fred = 45 > > a = 1 > > d = 44 > > > > goto x > > puts(1,x&" is not covered") goto caseend > > :1 puts(1,"it's 1!") goto caseend > > :34 puts(1,"wow, 34!") > > :"Sam" puts(1,"you got Sam!" goto caseend > > :a+d puts(1,"Yep, fred is 45!") goto caseend > > :caseend > > > > -- continue, retry, restart, and next > > :restart > > for loop = 1 to 12 do > > :retry > > -- code > > if test = failed then goto retry end if > > if thistest = failed then goto restart end if > > if bored = true then goto next end if > > if done then goto demoend end if > > -- code > > :next > > end for > > :demoend > > > > </eucode> > > The above code is not entirely correct or as simple as it seems. Let's start > with the case statement. I think a case statement would a much better choice. > Why? What if you want two case statements, either nested or in the same function > in different sections that answer both to the integer 1 ? > > <eucode> > goto x > :1 puts "One!\n" > :2 puts "Two!\n" > :caseend > > goto y > :1 puts "One!\n" -- invalid already used > :2 puts "Two!\n" -- invalid already used > :caseend -- invalid already used > </eucode> I wasn't arguing against the case, i have been in favor of case before, and would use it if it existed. I mentioned that in #Euphoria even. Before i left the channel. If you do make a case for case in Eu, please look at how nicely Matt did the case/goto targets in OOEU. I suspect even those could be made more versatile. > The for loop with next, retry, exit, restart, etc... First to program might > be a bit of a chore because on the keywords "end for" the stack is cleaned up, > temp variables cleared, etc... A direct goto out of the for loop w/o hitting > an end for would leave the internals dirty. It should be able to detect that > it went out of the loop and then clean up, but it's not as easy as pushing adding > a label and going to a label in the backend as you would think. Depends on how it's done. In some languages, the loop is nearly a second program, and leaving it's code space clears everything that's not in the proc/funct it's nested in. Such "nearly a 2nd program" also justified nesting functions and procedures inside other functions of procedures, making the internal proc/func local to the proc/func it was nested in. I don't know how Eu does it. > #2 with the for loop, it suffers the same fate as the case statement. Sure, > on the first for loop you can use :retry, :end, :next, :restart, but then on > subsequent for loops in the same context (in top level or inside a function), > you would have to get creative in your naming... :end2, :next2, :restart2, etc... > Then have 1 for loop that is nested in another, and then later in the function > you add a new for loop. Then, as time goes on, you add a for loop at the beginning > of the function. Now, your first for loop is named :end3, :restart3, and your > second is just :end, :restart, etc... and an inner is :restart3, etc... It begins > to get pretty confusing. OMGess, do you really program like that? > So, while I personally think a goto statement is a good thing, I do not think > it is a replacement for exit, continue and a case statement. I nominate it again for exit, continue, restart, next, retry (not the error handling retry), or any other keyword where the purpose is to get around intervening code. In your example of nested loops, i have no clue where an exit would goto, and in most cases i bet it would not goto where i wanted. There's been numerous posts showing an exit not traveling far enough, leading to more flag tests to see if it's necessary to exit some more. One goto would have been enough, and quite clear, mentioning a descriptive target at both ends of the jump, and easy to find with text search in an editor. While i am at this example of nested loops, that's about the only reason i use goto, the others being to simulate case i don't have, hop some debug code, or get right to the end of a procedure (tis easy to exit a function, you can return from anywhere inside it)(altho i have often put cleanup code at the bottoms of proc/func and goto that code before leaving). Case is a clear goto, but without a scope limit at the bottom (</case> ?), your objection to using goto for case is almost correct. I think Matt considered a goto switch that prohibited reverse :target lookups, which would have partly solved your case objection. In any case, i believe it looked for the next :target down the code that was in scope, and on not finding one, then looked down from the beginning of the scope. I can still see gotchas, and am not against case to solve those. Kat -= B E G I N =- X-EUFORUM: 20807 Date: 2008 May 12 14:37 From: Daryl Border <Darylb5 at ao?.c?m> Subject: Re: Debug Block? Jeremy Cowgar wrote: > > I was looking through the feature requests on the SF.net page trying to clean > things up. A lot of old suggestions exist, some of which were already implemented, > so I closed them. Anyway, I ran across a feature request by CK Lester and figured > I would bring his suggestion to the forum for discussion so we can either implement > (do not think it would be hard) or clear the suggestion. No reason to have it > sit there in limbo for no reason. Keep in mind, I am just brining this to peoples > attention. It's not my idea, although, I think it's a good one. > > <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=1771686&group_id=182827&atid=902785">http://sourceforge.net/tracker/index.php?func=detail&aid=1771686&group_id=182827&atid=902785</a> > > He is basically suggesting the ability to remove debug code in the final copies > of your Euphoria source. His suggestion is instead of: > > <eucode> > --- code > if DEBUG then > printf(1, "Loop var is %d\n", {loopVar}) > end if > --- code > </eucode> > > which would be included in your final code, therefore causing extra processing > for no reason (has to check DEBUG condition). His idea is that a debug statement > be added: > > <eucode> > with debug > > --- code > . printf(1, "Loop var is %d\n", {loopVar}) > --- code > </eucode> > > His suggestion was any line starting with a . would be debug code. Thus, when > with debug or without debug is in the source code, the lines starting with . > would not even be emitted to the final versions of your Euphoria programmer, > thus, debug code would cause no slow down in your final version of your app. > > I also thought possibly instead of . you could: > > <eucode> > with debug > > debug > printf(1, "Loop var is %d\n", {loopVar}) > -- more debug code > end debug > </eucode> > > Over all I do not see any bad side effects, only benefits, but wanted to get > your input. I do think a more defined block, such as debug ... end debug would > make the source code a bit cleaner and more easily understood, but everyone > can go read CK's feature request on the SF URL listed above. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I would like to point out that this is actually a specialized form of conditional compilation. A general conditional compilation system would provide this behavior and a lot more. -= B E G I N =- X-EUFORUM: 20808 Date: 2008 May 12 14:37 From: Kat <KAT12 at ?oo?ahs.net> Subject: Re: Goto? Bernie Ryan wrote: > > > What no one understands about implementing goto is how > > complicated it is to implement in an interpreter. > > Maybe if someone would demonstrate how easy it is to implement; > > then they could post the code and that could be discussed on EUforum. See the 1200 words on it is done, with options and etc: http://ooeu.sourceforge.net/docs/USING_GOTO.htm Kat -= B E G I N =- X-EUFORUM: 20809 Date: 2008 May 12 14:40 From: Derek Parnell <ddparnell at ?igpond.co?> Subject: Re: Goto? Jeremy Cowgar wrote: > > the subject of Goto I vote to have it. I will never use it. I will not use Euphoria programs that use it. I will not try to maintain Euphoria code that uses it. GOTO in Euphoria would serve two purposes ... (A) If the only way to get the extra microseconds of performance from your critical section of code is to use it, then it is justified. However, this assumes you have actually exhusted all other methods first. Even then, if you are actually trying for speed, code in assembler. (B) To demonstrate that GOTO is the wrong tool in nearly every case. However having said all that, if someone wants to use it in the privacy of their own code and its not hurting anyone else, they should be free to do so. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20810 Date: 2008 May 12 14:40 From: Jeremy Cowgar <jeremy at ?owgar.c?m> Subject: Re: New keyword added: continue Kat wrote: > > Depends on how it's done. In some languages, the loop is nearly a second program, > and leaving it's code space clears everything that's not in the proc/funct it's > nested in. Such "nearly a 2nd program" also justified nesting functions and > procedures inside other functions of procedures, making the internal proc/func > local to the proc/func it was nested in. I don't know how Eu does it. Yes, that's how it would be done, but in your example, there were things like endcase, endfor, etc... those are outside the loop. > > #2 with the for loop, it suffers the same fate as the case statement. Sure, > > on the first for loop you can use :retry, :end, :next, :restart, but then on > > subsequent for loops in the same context (in top level or inside a function), > > you would have to get creative in your naming... :end2, :next2, :restart2, etc... > > Then have 1 for loop that is nested in another, and then later in the function > > you add a new for loop. Then, as time goes on, you add a for loop at the beginning > > of the function. Now, your first for loop is named :end3, :restart3, and your > > second is just :end, :restart, etc... and an inner is :restart3, etc... It begins > > to get pretty confusing. > > OMGess, do you really program like that? > Do I have nested loops? I sure do. Do I sometimes go back and add a new loop to a function? I sure do. That's all the above was showing, but using your example of goto. Because it is such a mess, I was using it as a case against using a goto as you described. > > So, while I personally think a goto statement is a good thing, I do not think > > it is a replacement for exit, continue and a case statement. > > I nominate it again for exit, continue, restart, next, retry (not the error > handling retry), or any other keyword where the purpose is to get around intervening > code. In your example of nested loops, i have no clue where an exit would goto, > and in most cases i bet it would not goto where i wanted. There's been numerous > posts showing an exit not traveling far enough, leading to more flag tests to > see if it's necessary to exit some more. One goto would have been enough, and > quite clear, mentioning a descriptive target at both ends of the jump, and easy > to find with text search in an editor. An exit and continue could be modified pretty easy to do something like this: <eucode> for a = 1 to 5 do for b = 1 to 5 do for c = 1 to 5 do exit 2 -- exit 2 loops end for -- never reached puts(1, "Hello!\n") end for printf(1, "%d,", {a}) end for </eucode> Output of above is 1,2,3,4,5. The same could be done for continue. Before enabling goto to exit a loop, I would nominate the above construct. If a parameter was not given to exit or continue, it would simply exit 1 loop as normal. However, can we please move goto discussions to the new Goto? thread? Thanks. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20811 Date: 2008 May 12 14:42 From: Jeremy Cowgar <jeremy at cow?ar?com> Subject: Re: Debug Block? Daryl Border wrote: > > I would like to point out that this is actually a specialized form of conditional > compilation. > A general conditional compilation system would provide this behavior and a lot > more. Can you give an example of what you are speaking of? Are you talking in regards to a C like preprocessor? #ifdef DEBUG puts(1, "Hello World\n") #endif #ifdef WINDOWS puts(1, "Windows\n") #endif ? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20812 Date: 2008 May 12 14:46 From: Matt Lewis <matthewwalkerlewis at g?ail?com> Subject: Re: Debug Block? Derek Parnell wrote: > > Also, some way of turning it off/on from the command line instead of having > to edit source code, should be considered. > > e.g. > exu myapp.e --eu:debug=on Euphoria 4.0 will introduce command line switches that are supplied before the program. There are currently only 2, which affect the directories used as include directories, so your example would maybe look like: $ exu --debug=on myapp.e Matt -= B E G I N =- X-EUFORUM: 20813 Date: 2008 May 12 14:52 From: Bernie Ryan <xotron at bluef??g.com> Subject: Re: Goto? Kat wrote: > > Bernie Ryan wrote: > > > > > > What no one understands about implementing goto is how > > > > complicated it is to implement in an interpreter. > > > > Maybe if someone would demonstrate how easy it is to implement; > > > > then they could post the code and that could be discussed on EUforum. > > See the 1200 words on it is done, with options and etc: > > <a href="http://ooeu.sourceforge.net/docs/USING_GOTO.htm">http://ooeu.sourceforge.net/docs/USING_GOTO.htm</a> > Kat: If OOEU works then why aren't you using it for all your coding instead of keep asking for it ? Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20814 Date: 2008 May 12 14:52 From: Matt Lewis <matthewwalkerlewis at gma?l.co?> Subject: Re: Goto? Bernie Ryan wrote: > > What no one understands about implementing goto is how > complicated it is to implement in an interpreter. > Maybe if someone would demonstrate how easy it is to implement; > then they could post the code and that could be discussed on EUforum. Already done. All of it. We already have goto. It's called exit. Seriously, look at what it does. A simple, static goto is trivial. Making it dynamic is slightly more difficult, but not impossible. I even made it work with dynamic labels! (Which I think was a bridge too far.) Look at the code for yourself: http://ooeu.sourceforge.net/svn.htm Matt -= B E G I N =- X-EUFORUM: 20815 Date: 2008 May 12 14:53 From: Matt Lewis <matthewwalkerlewis at g??il.com> Subject: Re: Goto? Jeremy Cowgar wrote: > > Bernie Ryan wrote: > > What no one understands about implementing goto is how > > complicated it is to implement in an interpreter. > > Maybe if someone would demonstrate how easy it is to implement; > > then they could post the code and that could be discussed on EUforum. > > The front end code is pretty easy actually, at first glance. Now, what may be > difficult is what I mentioned in the post in regards to the for loop. Jumping > out of a for loop is going to leave things pretty dirty, but I am certain that > can be solved with a bit of thought. But, I do not wish to spend any time developing > code that will be rejected, so I think the discussion must come first. What's dirty about it? It's no different than exit. Jumping *into* a for loop is bad juju. Matt -= B E G I N =- X-EUFORUM: 20816 Date: 2008 May 12 14:57 From: Jason Gade <jaygade at ??hoo.com> Subject: Re: Goto? Bernie Ryan wrote: > If OOEU works then why aren't you using it for all your coding instead > of keep asking for it ? > > Bernie > > My files in archive: > WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API > > Can be downloaded here: > <a href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a> I think that OOEU has a lot of features that it would be nice to fold back into the "official" version of Euphoria. And it's at least worthwhile to discuss them. Even the dreaded "goto". And OO. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20817 Date: 2008 May 12 15:03 From: Kat <KAT12 at ?oosahs.ne?> Subject: Re: Goto? Jeremy Cowgar wrote: <snip=huge> > An exit and continue could be modified pretty easy to do something like this: > > <eucode> > for a = 1 to 5 do > for b = 1 to 5 do > for c = 1 to 5 do > exit 2 -- exit 2 loops > end for > -- never reached > puts(1, "Hello!\n") > end for > > printf(1, "%d,", {a}) > end for > </eucode> > > Output of above is 1,2,3,4,5. The same could be done for continue. Before enabling > goto to exit a loop, I would nominate the above construct. If a parameter was > not given to exit or continue, it would simply exit 1 loop as normal. Sure, but then like you said you'd do, you'd add another layer of loop, and then look up all the exits and change them, whereas the goto :target would not need changing. Besides, could you do all the variations on :target that Matt did? Then why not just do "goto" and not limit all that work to just "exit"? Like Daryl said about debug blocks and conditional compilation (and i agree - with CK that we need them, and with Daryl too), exit is a specialised goto, let's have a general goto. Kat -= B E G I N =- X-EUFORUM: 20818 Date: 2008 May 12 15:07 From: Jeremy Cowgar <jeremy at c?wga?.com> Subject: Re: Goto? Matt Lewis wrote: > > What's dirty about it? It's no different than exit. Jumping *into* a > for loop is bad juju. > How does the loop status get updated? in_loop or loop_stack, etc... ? When jumping out of a loop via a goto, will it not leave those variables untouched, thus, the stack could build and build and build? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20819 Date: 2008 May 12 15:09 From: Jeremy Cowgar <jeremy at cow??r.com> Subject: Re: Goto? Kat wrote: > > > Like Daryl said about debug blocks and conditional compilation (and i agree > - with CK that we need them, and with Daryl too), exit is a specialised goto, > let's have a general goto. > That's what this discussion is about :-) Just your previous was why have 6 keywords when it could be done with 1, goto... in which I described why that was not feasible. But let's keep this to a discussion about the general goto. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20820 Date: 2008 May 12 15:18 From: Jason Gade <jaygade at ya?oo?com> Subject: sanity.ex Is sanity.ex going to be replaced with unit tests, or are the unit tests solely for the standard library? I'm trying (slowly) to get back to helping out around here instead of just making inane comments, but the last time I messed with the code in the svn repository sanity.ex wasn't working due to changes in get.e I believe. Is sanity.ex working now with either 3.1.1 or with 4.0? -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20821 Date: 2008 May 12 15:25 From: Kat <KAT12 at ?oosah?.net> Subject: Re: Goto? Bernie Ryan wrote: > > Kat wrote: > > > > Bernie Ryan wrote: > > > > > > > > > What no one understands about implementing goto is how > > > > > > complicated it is to implement in an interpreter. > > > > > > Maybe if someone would demonstrate how easy it is to implement; > > > > > > then they could post the code and that could be discussed on EUforum. > > > > See the 1200 words on it is done, with options and etc: > > > > <a href="http://ooeu.sourceforge.net/docs/USING_GOTO.htm">http://ooeu.sourceforge.net/docs/USING_GOTO.htm</a> > > > > Kat: > > If OOEU works then why aren't you using it for all your coding instead > > of keep asking for it ? It has a couple,, umm,, issues that i can't get around. The readme still makes me drool and keep trying tho. There's a *lot* more in OOEU that is appealing besides goto. Just the fact that Matt could do all that is in OOEU, when RobC couldn't/wouldn't in the last 10 years speaks volumes. I know Matt would be doing even more if he wasn't already so busy. I'd help if not for real life, and essentially being told in #Euphoria that i shouldn't. Kat -= B E G I N =- X-EUFORUM: 20822 Date: 2008 May 12 15:26 From: Jeremy Cowgar <jeremy at ?owgar?com> Subject: Re: sanity.ex Jason Gade wrote: > Is sanity.ex going to be replaced with unit tests, or are the unit tests solely > for the standard library? sanity.ex is still valid, however, I think unit tests are easier to maintain and use. I have not converted anything from sanity.ex to unit tests. Unit tests does currently test some internal functions. Eventually, I think sanity.ex should not exist but there are too many checks in it right now to remove it. So, did that answer the question? :-D > I'm trying (slowly) to get back to helping out around here instead of just making > inane comments, but the last time I messed with the code in the svn repository > sanity.ex wasn't working due to changes in get.e I believe. > > Is sanity.ex working now with either 3.1.1 or with 4.0? > This is *great* news! Thanks! I actually just ran sanity.ex and had to make one simple change to it (include math.e). It tells me 100% passed. So, until sanity.ex is merged into unit testing, it wouldn't be a bad idea to run both before committing. Migrating sanity.ex to unit tests should be a goal before 4.0 release. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20823 Date: 2008 May 12 15:36 From: Kat <KAT12 at ?oos?hs.net> Subject: Re: Goto? Matt Lewis wrote: > > Bernie Ryan wrote: > > > > What no one understands about implementing goto is how > > complicated it is to implement in an interpreter. > > Maybe if someone would demonstrate how easy it is to implement; > > then they could post the code and that could be discussed on EUforum. > > Already done. All of it. > > We already have goto. It's called exit. Seriously, look at what it does. > A simple, static goto is trivial. Making it dynamic is slightly more > difficult, but not impossible. I even made it work with dynamic labels! > (Which I think was a bridge too far.) It's a wonderful option, and i hope that now you wrote it, you don't remove it. There's a line between wonderful options that few people would use, and those bridges that go too far. I see no pain in keeping it. Kat -= B E G I N =- X-EUFORUM: 20824 Date: 2008 May 12 15:54 From: Jeremy Cowgar <jeremy at cowgar.co?> Subject: Re: Goto? Kat wrote: > > Matt Lewis wrote: > > > > We already have goto. It's called exit. Seriously, look at what it does. > > A simple, static goto is trivial. Making it dynamic is slightly more > > difficult, but not impossible. I even made it work with dynamic labels! > > (Which I think was a bridge too far.) > > It's a wonderful option, and i hope that now you wrote it, you don't remove > it. There's a line between wonderful options that few people would use, and > those bridges that go too far. I see no pain in keeping it. > I think he's talking about in OOeu. I do not see any code in EU that supports Goto. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20825 Date: 2008 May 12 15:58 From: Kat <KAT12 at c?osahs.?et> Subject: Re: Goto? Jeremy Cowgar wrote: > > Kat wrote: > > > > Matt Lewis wrote: > > > > > > We already have goto. It's called exit. Seriously, look at what it does. > > > A simple, static goto is trivial. Making it dynamic is slightly more > > > difficult, but not impossible. I even made it work with dynamic labels! > > > (Which I think was a bridge too far.) > > > > It's a wonderful option, and i hope that now you wrote it, you don't remove > > it. There's a line between wonderful options that few people would use, and > > those bridges that go too far. I see no pain in keeping it. > > > > I think he's talking about in OOeu. I do not see any code in EU that supports > Goto. Yes,,, and? Kat -= B E G I N =- X-EUFORUM: 20826 Date: 2008 May 12 16:17 From: Daryl Border <Darylb5 at aol.?om> Subject: Re: Debug Block? Jeremy Cowgar wrote: > > Daryl Border wrote: > > > > I would like to point out that this is actually a specialized form of conditional > > compilation. > > A general conditional compilation system would provide this behavior and a lot > > more. > > Can you give an example of what you are speaking of? Are you talking in regards > to a C like preprocessor? > > #ifdef DEBUG > puts(1, "Hello World\n") > #endif > #ifdef WINDOWS > puts(1, "Windows\n") > #endif > > ? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> You've got it. The with debug clause is a compiler directive telling the parser to treat any line starting with . as a comment. The #ifdef WINDOWS clause does the same thing to lines up to the #endif, if WINDOWS is not defined. -= B E G I N =- X-EUFORUM: 20827 Date: 2008 May 12 16:49 From: Matt Lewis <matthewwalkerlewis at g?ail.com> Subject: Re: Goto? Jeremy Cowgar wrote: > > Matt Lewis wrote: > > > > What's dirty about it? It's no different than exit. Jumping *into* a > > for loop is bad juju. > > > > How does the loop status get updated? in_loop or loop_stack, etc... ? When jumping > out of a loop via a goto, will it not leave those variables untouched, thus, > the stack could build and build and build? Execution doesn't really care about that stuff. That's all front-end stuff. Again, take a look at what exit actually does. It's just a goto, with the target implicitly defined as just outside the current loop. Matt -= B E G I N =- X-EUFORUM: 20828 Date: 2008 May 12 16:53 From: Matt Lewis <matthewwalkerlewis at ?mail.com> Subject: Re: Goto? Kat wrote: > > Matt Lewis wrote: > > > > We already have goto. It's called exit. Seriously, look at what it does. > > A simple, static goto is trivial. Making it dynamic is slightly more > > difficult, but not impossible. I even made it work with dynamic labels! > > (Which I think was a bridge too far.) > > It's a wonderful option, and i hope that now you wrote it, you don't remove > it. There's a line between wonderful options that few people would use, and > those bridges that go too far. I see no pain in keeping it. Well, I'm not going to remove it from OOEU, but I'd be interested to hear about how you use it. Specifically, the ability to define your labels as variables, and how the interpreter will assess what the variable is at the time of the goto. It just seems like a nightmare to have the value of the labels changing. Matt -= B E G I N =- X-EUFORUM: 20829 Date: 2008 May 12 17:01 From: Jeremy Cowgar <jeremy at c?w?ar.com> Subject: Re: Goto? Matt Lewis wrote: > > Jeremy Cowgar wrote: > > > > Matt Lewis wrote: > > > > > > What's dirty about it? It's no different than exit. Jumping *into* a > > > for loop is bad juju. > > > > > > > How does the loop status get updated? in_loop or loop_stack, etc... ? When jumping > > out of a loop via a goto, will it not leave those variables untouched, thus, > > the stack could build and build and build? > > Execution doesn't really care about that stuff. That's all front-end stuff. > Again, take a look at what exit actually does. It's just a goto, with the > target implicitly defined as just outside the current loop. > Hm, but couldn't it invite bugs in the compiler? For instance, look at compile.e around line 146. It checks the length of the loop_stack and makes a decision based on it. Line 3792 dereferences variables (which I assume opens it up for either freeing or re-use of that memory) in the end loop. Now, I do see on line 3873 where return will deref any open loop vars but that will not handle top-level stuff. Just trying to learn the code. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20830 Date: 2008 May 12 17:10 From: Mike777 <anon4321 at gmail??om> Subject: Re: Goto? Jeremy Cowgar wrote: > > Kat wrote: > > > > Matt Lewis wrote: > > > > > > We already have goto. It's called exit. Seriously, look at what it does. > > > A simple, static goto is trivial. Making it dynamic is slightly more > > > difficult, but not impossible. I even made it work with dynamic labels! > > > (Which I think was a bridge too far.) > > > > It's a wonderful option, and i hope that now you wrote it, you don't remove > > it. There's a line between wonderful options that few people would use, and > > those bridges that go too far. I see no pain in keeping it. > > > > I think he's talking about in OOeu. I do not see any code in EU that supports > Goto. Not only is he talking about OOeu, he is specifically speaking about the ability to have the labels be defined dynamically. I agree with Kat that it is a neat option. But I don't think she was imploring him to maintain GOTO itself. She was talking about dynamic labels. Mike -= B E G I N =- X-EUFORUM: 20831 Date: 2008 May 12 18:26 From: Mike777 <anon4321 at g?ail?com> Subject: Re: Previous control CChris wrote: > > Mike777 wrote: > > > > I suppose the edit boxes and combo boxes don't really have a Click event, so > > I'm supposed to use a different event for w32HGetHandler. > > > > Any guidance would be appreciated. > > > > Thanks > > > > Mike > > Why not simply add an w32HGotFocus event handler to all the controls you are > interested in? > The common handler would save in a variable you define the id of the control > for which it is called (or stack them if you need more), and then you retrieve > them. > Doesn't work? Almost. w32HGotFocus doesn't fire when the mouse is clicked into a combobox. I tried w32HEvent, but then just passing the mouse over the control activates the event procedure, undoing what I've done by clicking in the cbo. It works for Text Boxes, Radio Buttons and Check Boxes. Is there a substitute for w32HGotFocus that works on combo boxes? [Yes, I've looked but I haven't found one, yet.] Mike -= B E G I N =- X-EUFORUM: 20832 Date: 2008 May 12 19:54 From: Asa <electro.legacy at gmail?c?m> Subject: abs() , rnd() func or integer cast? Hi everyone, maybe I just missed it, but i can't find a lib function or builtin to isolate the integer part of a number. I need to just take the integer part of a division result, but amazingly I can't find any way of doing this in Euphoria. I searched the docs for either a integer divide such as DIV in pascal, or a lib function strip the decimal part off a number so I can use it as an indice in a sequence! -= B E G I N =- X-EUFORUM: 20833 Date: 2008 May 12 20:01 From: Bernie Ryan <xotron at blue?rog.co?> Subject: Re: abs() , rnd() func or integer cast? Asa wrote: > > > Hi everyone, maybe I just missed it, but i can't find a lib function > or builtin to isolate the integer part of a number. I need to just take > the integer part of a division result, but amazingly I can't find any way > of doing this in Euphoria. I searched the docs for either a integer divide > such as DIV in pascal, or a lib function strip the decimal part off a number > so I can use it as an indice in a sequence! Look up ' floor ' Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20834 Date: 2008 May 12 20:21 From: Asa <electro.legacy at gmai?.c?m> Subject: Re: abs() , rnd() func or integer cast? Thanks for the quick reply! I guess the name thew me off. :) -= B E G I N =- X-EUFORUM: 20835 Date: 2008 May 12 20:47 From: Jeremy Cowgar <jeremy at ?owgar.c?m> Subject: Conditional Compiling I think what Daryl said was very valid. I came up with: <eucode> with define=debug ifdef debug puts(1, "Debug code\n") end ifdef ifdef hello puts(1, "Hello!\n") end ifdef -- Hello World puts(1, "Hello, World!\n") </eucode> The above outputs: Debug code Hello, World! The inners of ifdef hello ... end ifdef are just passed by, not injected into Euphoria at all. I am not totally happy with the use of with or with ifdef. Something just looks "funny" about the whole thing. I talked with Kat on IRC and we came up with a few alternatives about the with thing, but still not sure... <eucode> -- Current with define=debug with define=hello -- both debug and hello are defined -- Slightly better English reading but may cause problems with other -- with keywords: with debug=defined with hello=defined -- A list of words, but this would make it harder to add/remove items? with defined=debug,hello </eucode> You can also (when it's all done) do: exu/exwc -Ddebug myprog.e exu/exwc -Ddebug -Dhello myprog.e Any thoughts? I'm excited about the potential, but not too happy with the syntax yet. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20836 Date: 2008 May 12 22:52 From: CChris <christian.cuvier at agri?ulture.gouv.?r> Subject: Re: New keyword added: continue Kat wrote: > > > Why? > Here's how you use one keyword instead of six: > > <eucode> > > --repeat until > :repeat > x -= 1 > if x > 12 then goto repeat end if > > > -- case > atom fred, a, d > fred = 45 > a = 1 > d = 44 > > goto x > puts(1,x&" is not covered") goto caseend > :1 puts(1,"it's 1!") goto caseend > :34 puts(1,"wow, 34!") > :"Sam" puts(1,"you got Sam!" goto caseend > :a+d puts(1,"Yep, fred is 45!") goto caseend > :caseend > > -- continue, retry, restart, and next > :restart > for loop = 1 to 12 do > :retry > -- code > if test = failed then goto retry end if > if thistest = failed then goto restart end if > if bored = true then goto next end if > if done then goto demoend end if > -- code > :next > end for > :demoend > > </eucode> > > You know exactly where each "goto" lands, each :target can be in your own native > language, and OOEU prooves it can be done. It's ONE word. It's so SIMPLE. > > Kat You know where each goto lands, granted. But you don't know where you land from, as any label can be targeted from scarrered places. And that's why soem people are downright against it, and why I don't like using it. I had found out this: when you start writing code, and it is naive an simple, then goto are as easy to read as anything, and perhaps easier. Then, the code becomes more complex because there's a handful of special cases, and you now have to guarantee that it hardly matters, when you reach a label, what was the program state just before. It simply doesn't work. You can always set up flags, but then tell me that you never make mistakes updating them... I tried to implement goto in Æ. It works. But I added a twist: all goto statements must have a label, and there is another builtin, come_from(), which retrieves the last goto label you jumped from. Otherwise, I'd say: goto is nice, it's one keyword instead of 6, is not hard to type, but it makes maintaining code so much trickier. Pascal compilers didn't recognise goto, unless a specific option was turned on. Perhaps that would be the way to go: if you want goto, have it, but know that you are doing things the hard way. I still think some equivalent of come_from() is necessary to make goto usable in the Euphoria framework - you know, that world where raw pointers are considered unsafe -. CChris -= B E G I N =- X-EUFORUM: 20837 Date: 2008 May 12 22:57 From: Jeremy Cowgar <jeremy at co?gar.?om> Subject: Re: New keyword added: continue CChris wrote: > > Pascal compilers didn't recognise goto, unless a specific option was turned > on. Perhaps that would be the way to go: if you want goto, have it, but know > that you are doing things the hard way. I still think some equivalent of come_from() > is necessary to make goto usable in the Euphoria framework - you know, that > world where raw pointers are considered unsafe -. > I do not think this is a viable option as it would introduce code incompatabilities. Say, John likes goto's and writes a library but Joe does not like goto's. He downloads John's library and cannot use it because he will not enable gotos. Then, John will start declaring "goto must be enabled", etc... I think that one Euphoria programmer should be able to run another Euphoria application in the same version w/o incompatibilities. Along the lines of one of the requirements for the standard library... no external dependencies. This is so if Jane writes a program, she knows it will run on Jim's install of Euphoria. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20838 Date: 2008 May 12 23:03 From: CChris <christian.cuvier at agriculture.go??.fr> Subject: Re: Goto? c.k.lester wrote: > > Jeremy Cowgar wrote: > > > > I have mixed emotions about it. Goto in some situations can be a very valuable > > construct but it can also be a construct that novice programmers can really > > get in trouble with causing hours of unnecessary debugging. > > I've never encountered a case where a goto is the best solution. Never. > > One thing I want to avoid on any interpreter upgrade is bloating the > interpreter and/or slowing it down. If goto is going to be considered, I'm > sure there are more popular options to be considered first. There is one frequent case where goto could be tempting: exiting nested loops or if blocks. It would be very useful, and not very difficult, to implement an "exit n" or "exit <loop_label" or exif for if blocks. This would be a valuable addition, without any new keyword. Of course (as for goto targets), the values must be constants. Otherwise, it becomes very difficult, as Bernie pointed out. CChris -= B E G I N =- X-EUFORUM: 20839 Date: 2008 May 12 23:09 From: Jeremy Cowgar <jeremy at cowg?r.c?m> Subject: Goto Examples? In order to decide if goto should be added, maybe I should have asked a different question. Does anyone have examples of where goto is better than existing syntax? Maybe we should look at how goto will "simplify" our programming life? So, if you have an example that will *simply* life, except for keywords that we have (exit, continue) and for case statements (I think case will become part of 4.0), please post them here. They can be fictious examples that you would want to do in real life, or examples in other languages that you wrote or have seen, etc... Just examples of how goto is good. I think we all know how goto is bad, no need to post those examples here, please. Thanks! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20840 Date: 2008 May 12 23:22 From: Kat <KAT12 at ?oosah?.net> Subject: Re: Goto Examples? Jeremy Cowgar wrote: > > In order to decide if goto should be added, maybe I should have asked a different > question. Does anyone have examples of where goto is better than existing syntax? > Maybe we should look at how goto will "simplify" our programming life? > > So, if you have an example that will *simply* life, except for keywords that > we have (exit, continue) and for case statements (I think case will become part > of 4.0), please post them here. They can be fictious examples that you would > want to do in real life, or examples in other languages that you wrote or have > seen, etc... Just examples of how goto is good. I think we all know how goto > is bad, no need to post those examples here, please. Well, that lets out all my examples. Kat -= B E G I N =- X-EUFORUM: 20841 Date: 2008 May 12 23:26 From: Kat <KAT12 at coo??hs.net> Subject: Re: Goto? CChris wrote: > > c.k.lester wrote: > > > > Jeremy Cowgar wrote: > > > > > > I have mixed emotions about it. Goto in some situations can be a very valuable > > > construct but it can also be a construct that novice programmers can really > > > get in trouble with causing hours of unnecessary debugging. > > > > I've never encountered a case where a goto is the best solution. Never. > > > > One thing I want to avoid on any interpreter upgrade is bloating the > > interpreter and/or slowing it down. If goto is going to be considered, I'm > > sure there are more popular options to be considered first. > > There is one frequent case where goto could be tempting: exiting nested loops > or if blocks. > > It would be very useful, and not very difficult, to implement an "exit n" or > "exit <loop_label" or exif for if blocks. This would be a valuable addition, > without any new keyword. In developing a syntactic parser, i discovered exponential explosions in possibilities, and 90% of them could be eliminated early in the reparse. Having a goto more than doubled parse speed and eliminated if-then flag tests all over the place. Had i been forced to use exit(n), i'd have needed to keep an eye on all exits every time i added or removed code during development. Kat -= B E G I N =- X-EUFORUM: 20842 Date: 2008 May 12 23:27 From: Kat <KAT12 at coosahs.n?t> Subject: Re: New keyword added: continue Jeremy Cowgar wrote: > > CChris wrote: > > > > Pascal compilers didn't recognise goto, unless a specific option was turned > > on. Perhaps that would be the way to go: if you want goto, have it, but know > > that you are doing things the hard way. I still think some equivalent of come_from() > > is necessary to make goto usable in the Euphoria framework - you know, that > > world where raw pointers are considered unsafe -. > > > > I do not think this is a viable option as it would introduce code incompatabilities. > Say, John likes goto's and writes a library but Joe does not like goto's. He > downloads John's library and cannot use it because he will not enable gotos. > Then, John will start declaring "goto must be enabled", etc... I think that > one Euphoria programmer should be able to run another Euphoria application in > the same version w/o incompatibilities. > > Along the lines of one of the requirements for the standard library... no external > dependencies. This is so if Jane writes a program, she knows it will run on > Jim's install of Euphoria. Ok, don't turn off goto, and then Jane's code can run on Jim's computer. Kat -= B E G I N =- X-EUFORUM: 20843 Date: 2008 May 12 23:30 From: CChris <christian.cuvier at agricultur?.gouv.?r> Subject: Re: Previous control Mike777 wrote: > > CChris wrote: > > > > Mike777 wrote: > > > > > > I suppose the edit boxes and combo boxes don't really have a Click event, so > > > I'm supposed to use a different event for w32HGetHandler. > > > > > > Any guidance would be appreciated. > > > > > > Thanks > > > > > > Mike > > > > Why not simply add an w32HGotFocus event handler to all the controls you are > > interested in? > > The common handler would save in a variable you define the id of the control > > for which it is called (or stack them if you need more), and then you retrieve > > them. > > Doesn't work? > > Almost. w32HGotFocus doesn't fire when the mouse is clicked into a combobox. > I tried w32HEvent, but then just passing the mouse over the control activates > the event procedure, undoing what I've done by clicking in the cbo. > > It works for Text Boxes, Radio Buttons and Check Boxes. > > Is there a substitute for w32HGotFocus that works on combo boxes? [Yes, I've > looked but I haven't found one, yet.] > > Mike I didn't have time to check (busy documenting sets.e and adding more tests, and I certainly type 10x slower than Jeremy). I don't see why combo boxes wouldn't fire w32HGotFocus. If I can confirm this I'll fix it, Bill forbid. CChris -= B E G I N =- X-EUFORUM: 20844 Date: 2008 May 12 23:32 From: CChris <christian.cuvier at agricult??e.gouv.fr> Subject: Re: abs() , rnd() func or integer cast? Asa wrote: > > > Hi everyone, maybe I just missed it, but i can't find a lib function > or builtin to isolate the integer part of a number. I need to just take > the integer part of a division result, but amazingly I can't find any way > of doing this in Euphoria. I searched the docs for either a integer divide > such as DIV in pascal, or a lib function strip the decimal part off a number > so I can use it as an indice in a sequence! 1/ Check the manual for floor(), you'll be delighted. 2/ Sequence indexes are rounded down to integers if non integer atoms, so you don't even need to call floor() in this case, the interpreter does it for you. CChris -= B E G I N =- X-EUFORUM: 20845 Date: 2008 May 12 23:43 From: CChris <christian.cuvier at agricultu?e?gouv.fr> Subject: Re: Goto? Kat wrote: > > CChris wrote: > > > > c.k.lester wrote: > > > > > > Jeremy Cowgar wrote: > > > > > > > > I have mixed emotions about it. Goto in some situations can be a very valuable > > > > construct but it can also be a construct that novice programmers can really > > > > get in trouble with causing hours of unnecessary debugging. > > > > > > I've never encountered a case where a goto is the best solution. Never. > > > > > > One thing I want to avoid on any interpreter upgrade is bloating the > > > interpreter and/or slowing it down. If goto is going to be considered, I'm > > > sure there are more popular options to be considered first. > > > > There is one frequent case where goto could be tempting: exiting nested loops > > or if blocks. > > > > It would be very useful, and not very difficult, to implement an "exit n" or > > "exit <loop_label" or exif for if blocks. This would be a valuable addition, > > without any new keyword. > > In developing a syntactic parser, i discovered exponential explosions in possibilities, > and 90% of them could be eliminated early in the reparse. Having a goto more > than doubled parse speed and eliminated if-then flag tests all over the place. > Had i been forced to use exit(n), i'd have needed to keep an eye on all exits > every time i added or removed code during development. > > Kat Which is why <eucode> label "my_loop" for i=1 to n do while 1 do while f(x)=3 do ---.... if done() then exit "my_loop" end if end end end </eucode> is better than "exit 3", even though the latter is probably useful - but harder to maintain as you pointed out. CChris -= B E G I N =- X-EUFORUM: 20846 Date: 2008 May 12 23:43 From: Kat <KAT12 at co??ahs.net> Subject: Re: Goto? I should probably stop posting in regards to goto. I have been in favor of and used goto, since the ZX80 days, nearly 30 years ago. I used machine code jmps in various forms before that. I shall continue to use goto when it's available and the best choice for the task. Kat -= B E G I N =- X-EUFORUM: 20847 Date: 2008 May 13 0:01 From: Jeremy Cowgar <jeremy at cowg?r?com> Subject: Labeled Loops? CChris wrote: > > <eucode> > label "my_loop" > for i=1 to n do > while 1 do > while f(x)=3 do > ---.... > if done() then > exit "my_loop" > end if > end end end > </eucode> > Hm... what about: <eucode> for a = 1 to 10 label "top" do for b = 1 to 10 label "mid" do while 1 do if b = 3 then exit "top" end if if a = 2 then continue "mid" end if end while end for end for </eucode> A terrible loop example, but the ability to label loops. The addition of this labeling and exit/continue to those labels is cake. This is just me thinking aloud again once seeing Chris's example code. I kind of really like this idea. What about you? label is obviously optional, just as "by" is on a for loop. The implementation of such would allow you to reuse labels in non related loops and again, would cause no slow down what-so-ever if used or not used. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20848 Date: 2008 May 13 0:17 From: c.k.lester <euphoric at ?kl?ster.com> Subject: Re: Labeled Loops? Jeremy Cowgar wrote: > > for a = 1 to 10 label "top" do > for b = 1 to 10 label "mid" do > while 1 do > if b = 3 then exit "top" end if > if a = 2 then continue "mid" end if > end while > end for > end for or maybe: for a = 1 to 10 do for b = 1 to 10 do while 1 do if b = 3 then exit a end if if a = 2 then continue b end if end while end for end for -= B E G I N =- X-EUFORUM: 20849 Date: 2008 May 13 0:18 From: Matt Lewis <matthewwalkerlewis at gma?l.c?m> Subject: Re: Goto? Jeremy Cowgar wrote: > > Matt Lewis wrote: > > > > Execution doesn't really care about that stuff. That's all front-end stuff. > > Again, take a look at what exit actually does. It's just a goto, with the > > target implicitly defined as just outside the current loop. > > > > Hm, but couldn't it invite bugs in the compiler? For instance, look at compile.e > around line 146. It checks the length of the loop_stack and makes a decision > based on it. Line 3792 dereferences variables (which I assume opens it up for > either freeing or re-use of that memory) in the end loop. Now, I do see on line > 3873 where return will deref any open loop vars but that will not handle top-level > stuff. > > Just trying to learn the code. Not sure if this would be a problem or not. I haven't gotten into the translator as much as the interpreter. But in general, goto worked in the translator for me. That part you pointed to looks like something Rob put in there to decide when to break up files to keep certain compilers from choking. I don't think it has an effect on the code otherwise. I think it would only affect top level code with gotos. An easy solution is to disallow them at the top level. Matt -= B E G I N =- X-EUFORUM: 20850 Date: 2008 May 13 0:19 From: Mike777 <anon4321 at gma?l.co?> Subject: Re: Previous control CChris wrote: > > Mike777 wrote: > > > > CChris wrote: > > > > > > Mike777 wrote: > > > > > > > > I suppose the edit boxes and combo boxes don't really have a Click event, so > > > > I'm supposed to use a different event for w32HGetHandler. > > > > > > > > Any guidance would be appreciated. > > > > > > > > Thanks > > > > > > > > Mike > > > > > > Why not simply add an w32HGotFocus event handler to all the controls you are > > > interested in? > > > The common handler would save in a variable you define the id of the control > > > for which it is called (or stack them if you need more), and then you retrieve > > > them. > > > Doesn't work? > > > > Almost. w32HGotFocus doesn't fire when the mouse is clicked into a combobox. > > I tried w32HEvent, but then just passing the mouse over the control activates > > the event procedure, undoing what I've done by clicking in the cbo. > > > > It works for Text Boxes, Radio Buttons and Check Boxes. > > > > Is there a substitute for w32HGotFocus that works on combo boxes? [Yes, I've > > looked but I haven't found one, yet.] > > > > Mike > > I didn't have time to check (busy documenting sets.e and adding more tests, > and I certainly type 10x slower than Jeremy). I don't see why combo boxes wouldn't > fire w32HGotFocus. If I can confirm this I'll fix it, Bill forbid. I think it has something to do with the fact that the combo box is really two controls tied up together. In any event, my travels lead me to the following: 1) The GotFocus() event fires if the combo box is entered via a tab (either a regular tab or a shift tab) 2) The GotFocus() event does not fire if the mouse is used to select the combo box 3) I haven't tested whether a SetFocus command has the effect of firing the GotFocus event (not that I would be using this, anyway). My application requires that the comboboxes be empty at the moment. I'm wondering if that makes a difference. That is, I could load an item into each combobox and that would enable the dropdown event to fire. I don't think it can right how, because there aren't any items. But this is just a bad workaround anyway, so I'll use this only as a backup plan at the moment. Mike -= B E G I N =- X-EUFORUM: 20851 Date: 2008 May 13 0:20 From: Matt Lewis <matthewwalkerlewis at ?m?il.com> Subject: Re: Goto? CChris wrote: > > There is one frequent case where goto could be tempting: exiting nested loops > or if blocks. > > It would be very useful, and not very difficult, to implement an "exit n" or > "exit <loop_label" or exif for if blocks. This would be a valuable addition, > without any new keyword. Should definitely be a label. Using a number for the levels is too fragile. Matt -= B E G I N =- X-EUFORUM: 20852 Date: 2008 May 13 0:23 From: Matt Lewis <matthewwalkerlewis at gm?il.c?m> Subject: Re: Labeled Loops? c.k.lester wrote: > > or maybe: > > for a = 1 to 10 do > for b = 1 to 10 do > while 1 do > if b = 3 then exit a end if > if a = 2 then continue b end if > end while > end for > end for Ok, genius, how do you label a while loop? :P Matt -= B E G I N =- X-EUFORUM: 20853 Date: 2008 May 13 0:26 From: c.k.lester <euphoric at cklester.?o?> Subject: Re: Labeled Loops? Matt Lewis wrote: > c.k.lester wrote: > > or maybe: > > for a = 1 to 10 do > > for b = 1 to 10 do > > while 1 do > > if b = 3 then exit a end if > > if a = 2 then continue b end if > > end while > > end for > > end for > > Ok, genius, how do you label a while loop? :P while 1 label "matt_is_a_poopie_head" do ... exit "matt_is_a_poopie_head" end while Of course, an undefined exit takes you out of the latest loop. while 1 do exit end while or something like this: while 1 do "getrdone" while 1 do "inner_while" if y then exit "getrdone" else exit "getrdone" end if end while but I still say for loops need no label. :) -= B E G I N =- X-EUFORUM: 20854 Date: 2008 May 13 0:53 From: Jeremy Cowgar <jeremy at co?ga?.com> Subject: Re: Labeled Loops? Matt Lewis wrote: > > c.k.lester wrote: > > > > or maybe: > > > > for a = 1 to 10 do > > for b = 1 to 10 do > > while 1 do > > if b = 3 then exit a end if > > if a = 2 then continue b end if > > end while > > end for > > end for > > Ok, genius, how do you label a while loop? :P > Same way. Cake! I already have the code in my head floating around. I didn't add one just to show you didn't have to. <eucode> while TRUE label "top" do for a = 1 to 10 label "mid" do for b = 1 to 10 label "bottom" do exit "top" end for end for end while </eucode> If this is worth while, I'll code it up tonight (possibly). I am having too much fun with conditional compiling. Wait for my next post. I think everyone will be excited about the possibility. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20855 Date: 2008 May 13 0:55 From: Jeremy Cowgar <jeremy at cow??r.com> Subject: Re: Labeled Loops? Jeremy Cowgar wrote: > > > > > Ok, genius, how do you label a while loop? :P > > > > Same way. Cake! I already have the code in my head floating around. I didn't > add one just to show you didn't have to. > > <eucode> > while TRUE label "top" do > for a = 1 to 10 label "mid" do > for b = 1 to 10 label "bottom" do > exit "top" > end for > end for > end while > </eucode> > > If this is worth while, I'll code it up tonight (possibly). I am having too > much fun with conditional compiling. Wait for my next post. I think everyone > will be excited about the possibility. > Opps! It wasn't until I read CK's response that I realized it was directed to him and it was his code! So much for reading :-/ Sorry CK! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20856 Date: 2008 May 13 0:56 From: Jeremy Cowgar <jeremy at cowgar.?o?> Subject: Re: Labeled Loops? c.k.lester wrote: > > while 1 do "getrdone" > while 1 do "inner_while" > if y then > exit "getrdone" > else > exit "getrdone" > end if > end while > > but I still say for loops need no label. :) I think for consistency, for and while loops should be labeled the same. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20857 Date: 2008 May 13 1:15 From: Jason Gade <jaygade at ya?o?.com> Subject: Re: Goto? Heh, don't forget that some of us anti-gotos started about thirty years ago as well. (Almost). -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20858 Date: 2008 May 13 1:16 From: jacques deschênes <desja at globetr?tter.n?t> Subject: Re: Debug Block? I agree with Daryl border, I have always missed a precompiler in euphoria. Daryl Border wrote: > > Jeremy Cowgar wrote: > > > > Daryl Border wrote: > > > > > > I would like to point out that this is actually a specialized form of conditional > > > compilation. > > > A general conditional compilation system would provide this behavior and a lot > > > more. > > > > Can you give an example of what you are speaking of? Are you talking in regards > > to a C like preprocessor? > > > > #ifdef DEBUG > > puts(1, "Hello World\n") > > #endif > > #ifdef WINDOWS > > puts(1, "Windows\n") > > #endif > > > > ? > > > > -- > > Jeremy Cowgar > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > You've got it. The with debug clause is a compiler directive telling the parser > to treat any line starting with . as a comment. The #ifdef WINDOWS clause does > the same thing to lines up to the #endif, if WINDOWS is not defined. -= B E G I N =- X-EUFORUM: 20859 Date: 2008 May 13 1:18 From: Jason Gade <jaygade at yaho??com> Subject: Re: Labeled Loops? Matt Lewis wrote: > > c.k.lester wrote: > > > > or maybe: > > > > for a = 1 to 10 do > > for b = 1 to 10 do > > while 1 do > > if b = 3 then exit a end if > > if a = 2 then continue b end if > > end while > > end for > > end for > > Ok, genius, how do you label a while loop? :P > > Matt Yeah, using the loop var as the exit or continue target for a "for" statement makes sense to me. But as you and Jeremy pointed out, it /wouldn't/ make sense in the context of "while" loops. Hmm. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20860 Date: 2008 May 13 1:19 From: Matt Lewis <matthewwalkerlewis at gmail?c?m> Subject: Re: Labeled Loops? Jeremy Cowgar wrote: > > c.k.lester wrote: > > > > while 1 do "getrdone" > > while 1 do "inner_while" > > if y then > > exit "getrdone" > > else > > exit "getrdone" > > end if > > end while > > > > but I still say for loops need no label. :) > > I think for consistency, for and while loops should be labeled the same. I agree that they should be treated the same. I just like giving CK a hard time. Matt "poopie head" Lewis -= B E G I N =- X-EUFORUM: 20861 Date: 2008 May 13 1:30 From: jacques deschênes <desja at glo?e?rotter.net> Subject: suggestion I suggest that we the trace the line for the next version. If we always add new features, we'll never see the end of it. here how I see it. 1) before any work on a new version: discuss improvements 2) agree on which ones will be included in next version. 3) trace the line. 4) start working on next version 5) queue any further suggestions for after next version. 6) release next version 7) goto to step 1 Jacques Deschênes -= B E G I N =- X-EUFORUM: 20862 Date: 2008 May 13 1:33 From: D. Newhall <derek_newhall at yah?o?com> Subject: Long time no post... Hello all. Anyone remember me? I don't think I've posted on here in over a year or so. Today I found some reference to Euphoria online and my reaction was "Oh my God! I remember that..." It's odd, really. Euphoria was the only language I programed in for something like two full years. It was my programming life, I wrote every program in Euphoria, except when I tried to write a Euphoria interpreter in OpenPascal over a summer. I used it at my job for all my scripting tasks and even got my supervisor to sign off on letting me use it for a client or two. I was even writing a book on Euphoria programming (maybe I'll finish it someday, although it's probably obsolete already). Eventually, as college neared its end I started trying to find a job and such. I was starting work in a start-up doing Common Lisp work in Mac OS X (hence some of my last posts here consisted of me favorably comparing Euphoria to Lisp and complaining that Euphoria still wasn't available for Mac). The start-up fell through but Mac OS X and Common Lisp were too good to ever give up. Since then I've done no work in Euphoria and all my programming in Common Lisp (except for work, which was in Matlab and Java). Due to this change me checking EUforum made less and less sense until I just stopped doing it. Anyways, while I am mostly just poking my head in and saying "Hi" I also do have some questions: 1) How has the language changed? The last time I used Euphoria was right before the switch to it being open source (I think my last post was me saying I was going to work on porting Euphoria to Mac OS X). So, what has changed since 2.5? 3) Are there any new "killer apps" in Euphoria? 3) How is everyone? Good? I briefly saw that a goto thread got started again. I guess I didn't miss much... :-) - Derek -= B E G I N =- X-EUFORUM: 20863 Date: 2008 May 13 1:34 From: Jeremy Cowgar <jeremy at cowg?r.com> Subject: No more platform(), conditional includes, conditional functions, conditional compilation, all done! Wow, I am pumped... Look at this code: <eucode> with define=debug atom lib ifdef debug then include safe.e else include machine.e end ifdef ifdef LINUX then lib = open_dll("hello.so") global function say_hello() puts(1, "Hello from Linux!\n") end function elsifdef WIN32 then lib = open_dll("hello.dll") global function say_hello() puts(1, "Hello from Windows!\n") end function elsifdef DOS32 then lib = -1 global function say_hello() puts(1, "Hello from DOS!\n") end function end ifdef say_hello() </eucode> This all works and this works at the parsing level. What this means is: <eucode> for i = 1 to length(lines) do ifdef debug then printf(1, "Line: %s\n", {lines[i]}) end ifdef -- real code end for </eucode> During the parse, the ifdef is translated at parse/compile time. Not runtime. This means that the decision "ifdef debug" is made once, not every iteration of the loop. Therefore, if debug is defined, then this is *exactly* what the code looks like to the runtime or in the C code translated: <eucode> for i = 1 to length(lines) do printf(1, "Line: %s\n", {lines[i]}) -- real code end for </eucode> Notice, no decision logic! If debug is not defined, then in both the interpreter and C code translated, you only see: <eucode> for i = 1 to length(lines) do -- real code end for </eucode> This is exciting! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20864 Date: 2008 May 13 1:38 From: Jason Gade <jaygade at y??oo.com> Subject: Re: suggestion jacques deschênes wrote: > > > I suggest that we the trace the line for the next version. If we always add > new features, we'll never see the end of it. > > here how I see it. > > 1) before any work on a new version: discuss improvements > 2) agree on which ones will be included in next version. > 3) trace the line. > 4) start working on next version > 5) queue any further suggestions for after next version. > 6) release next version > 7) goto to step 1 > > Jacques Deschênes No goto! :-) But yeah, we do seem to be experiencing some feature creep and keep moving the actual target. I thought that 4.0 would include the new standard library and the namespace improvement. The other stuff is pie-in-the-sky future stuff, right? I think. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20865 Date: 2008 May 13 1:43 From: Jeremy Cowgar <jeremy at cowga?.?om> Subject: Re: suggestion jacques deschênes wrote: > > I suggest that we the trace the line for the next version. If we always add > new features, we'll never see the end of it. > > here how I see it. > > 1) before any work on a new version: discuss improvements > 2) agree on which ones will be included in next version. > 3) trace the line. > 4) start working on next version > 5) queue any further suggestions for after next version. > 6) release next version > 7) goto to step 1 > It's always good to have a plan yes. I created a roadmap on the wiki a while ago: http://euwiki.ayo.biz/Roadmap however, I have been stalling for some decisions to be made. In stalling, I started a doc overhaul which CK Lester is working on (and could use some help). During this time, I have spent time in the interpreter and translator code learning it. In learning, I found a few things I could do. I closed some bugs, saw some old feature requests out there, so I began posting here for discussion as to see which features should be implemented or not. The big thing to me that needs done is more improvements of the namespace. That's of the utmost priority but we are not totally sure what to do there yet to solve some name conflicts. That's another thing that put me in a holding pattern. SF.net has a feature request list: http://sourceforge.net/tracker/?group_id=182827&atid=902785 The wiki also has a feature request list (some of which I've implemented): http://euwiki.ayo.biz/Category:Requested_functionalities I think we should focus on things that will possibly break code as 4.0 does have a few of those in it. If we are going to break code, I think we should have one release that breaks code, not one release that breaks a little code (4.0), then have 4.1 break a little more, 4.2 break a little more, etc... (well, actually, I think within major versions, code should not be broken). Breaking code should not be a repetitive thing. Your right. A list needs to be created. Now, how to go about creating this list? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20866 Date: 2008 May 13 1:44 From: Jason Gade <jaygade at yaho?.com> Subject: Re: Long time no post... Hi, Derek! Has it been a year already? > 3) How is everyone? Good? I briefly saw that a goto thread got started again. I guess I didn't miss much... :-) Heh, that about sums it up. But we haven't had a good goto argument in quite awhile! Jeremy Cowgar has proposed a standard library project and is actually making progress on it for future release. Otherwise up to this point the language is still pretty much the same. How goes Common Lisp? I never quite grokked Lisp or its variants, although I'm slowly starting to learn some of its features that have made their way into other languages. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20867 Date: 2008 May 13 1:45 From: jacques deschênes <desja at glo?etr?tter.net> Subject: Re: No more platform(), conditional includes, conditional functions, conditiona well this as exciting as C preprocessor directive and it is what I always wanted for euphoria. I strongly vote for it. Include it in version 4.0 and trace the line (see my prevous post.) regards, Jacques Deschênes Jeremy Cowgar wrote: > > Wow, I am pumped... Look at this code: > > <eucode> > with define=debug > atom lib > > ifdef debug then > include safe.e > else > include machine.e > end ifdef > > > ifdef LINUX then > > lib = open_dll("hello.so") > global function say_hello() > puts(1, "Hello from Linux!\n") > end function > > elsifdef WIN32 then > > lib = open_dll("hello.dll") > global function say_hello() > puts(1, "Hello from Windows!\n") > end function > > elsifdef DOS32 then > > lib = -1 > global function say_hello() > puts(1, "Hello from DOS!\n") > end function > > end ifdef > > say_hello() > </eucode> > > This all works and this works at the parsing level. What this means is: > > <eucode> > for i = 1 to length(lines) do > ifdef debug then > printf(1, "Line: %s\n", {lines[i]}) > end ifdef > > -- real code > end for > </eucode> > > During the parse, the ifdef is translated at parse/compile time. Not runtime. > This means that the decision "ifdef debug" is made once, not every iteration > of the loop. Therefore, if debug is defined, then this is *exactly* what the > code looks like to the runtime or in the C code translated: > > <eucode> > for i = 1 to length(lines) do > printf(1, "Line: %s\n", {lines[i]}) > -- real code > end for > </eucode> > > Notice, no decision logic! If debug is not defined, then in both the interpreter > and C code translated, you only see: > > <eucode> > for i = 1 to length(lines) do > -- real code > end for > </eucode> > > This is exciting! > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> -= B E G I N =- X-EUFORUM: 20868 Date: 2008 May 13 1:50 From: Jeremy Cowgar <jeremy at cowgar?co?> Subject: Re: Long time no post... D. Newhall wrote: > Welcome back! > 1) How has the language changed? The last time I used Euphoria was right before > the switch to it being open source (I think my last post was me saying I was > going to work on porting Euphoria to Mac OS X). So, what has changed since 2.5? A Mac OS X port has been done, but it is not in current SVN trunk. It would be fantastic to have you on board and tidy the port up to work with SVN trunk. In fact, it may just work. http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=OSX Release notes for the current SVN trunk are available at: http://jeremy.cowgar.com/euphoria/relnotes.htm There are a few really killer features that have been added in the last few days. The release notes have not been regenerated because currently the doc structure is changing, so not everything is converted to the new format. I think they are: continue, conditional includes and conditional compiling. Sets have also been added. An expansion of available functions has been underway as well, over 100 functions have been added to Euphoria. > 3) Are there any new "killer apps" in Euphoria? Hm. BBCMF is one that comes to mind by CK Lester. Others will have ideas there too. > 3) How is everyone? Good? I briefly saw that a goto thread got started again. I guess I didn't miss much... :-) I'm doing good, but then again, you probably do not know me as I was not active on the forums a year ago. Well, I popped in once in a while. I'm a long time Euphoria user, just not long time forum user. Pleased to meet you! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20869 Date: 2008 May 13 1:57 From: jacques deschênes <desja at gl?betrotter.?et> Subject: Re: suggestion Jeremy Cowgar wrote: > > jacques deschênes wrote: > > > > I suggest that we the trace the line for the next version. If we always add > > new features, we'll never see the end of it. > > > > here how I see it. > > > > 1) before any work on a new version: discuss improvements > > 2) agree on which ones will be included in next version. > > 3) trace the line. > > 4) start working on next version > > 5) queue any further suggestions for after next version. > > 6) release next version > > 7) goto to step 1 > > > > It's always good to have a plan yes. I created a roadmap on the wiki a while ago: <a href="http://euwiki.ayo.biz/Roadmap">http://euwiki.ayo.biz/Roadmap</a> > however, I have been stalling for some decisions to be made. > > In stalling, I started a doc overhaul which CK Lester is working on (and could > use some help). During this time, I have spent time in the interpreter and translator > code learning it. In learning, I found a few things I could do. I closed some > bugs, saw some old feature requests out there, so I began posting here for discussion > as to see which features should be implemented or not. > > The big thing to me that needs done is more improvements of the namespace. That's > of the utmost priority but we are not totally sure what to do there yet to solve > some name conflicts. That's another thing that put me in a holding pattern. > > SF.net has a feature request list: <a href="http://sourceforge.net/tracker/?group_id=182827&atid=902785">http://sourceforge.net/tracker/?group_id=182827&atid=902785</a> > > The wiki also has a feature request list (some of which I've implemented): > <a href="http://euwiki.ayo.biz/Category:Requested_functionalities">http://euwiki.ayo.biz/Category:Requested_functionalities</a> > > I think we should focus on things that will possibly break code as 4.0 does > have a few of those in it. If we are going to break code, I think we should > have one release that breaks code, not one release that breaks a little code > (4.0), then have 4.1 break a little more, 4.2 break a little more, etc... (well, > actually, I think within major versions, code should not be broken). Breaking > code should not be a repetitive thing. > > Your right. A list needs to be created. > > Now, how to go about creating this list? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> the line for me as for version 4.0 should be: 1) fix bugs 2) standard libraries (no addition from now) 3) namespace resolution (Mat seem to have an acceptable solution to it, freeze it there, if we wait for a perfect solution,we'll never see the end). that's it, that's all for preprocessor athougth I've been waiting for it for a long time it should be queued. Jacques Deschênes -= B E G I N =- X-EUFORUM: 20870 Date: 2008 May 13 2:00 From: Fernando Bauer <fmbauer at hotmail.c?m> Subject: Re: Goto Examples? Jeremy Cowgar wrote: > > In order to decide if goto should be added, maybe I should have asked a different > question. Does anyone have examples of where goto is better than existing syntax? > Maybe we should look at how goto will "simplify" our programming life? > > So, if you have an example that will *simply* life, except for keywords that > we have (exit, continue) and for case statements (I think case will become part > of 4.0), please post them here. They can be fictious examples that you would > want to do in real life, or examples in other languages that you wrote or have > seen, etc... Just examples of how goto is good. I think we all know how goto > is bad, no need to post those examples here, please. > > Thanks! > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> IMHO, in some cases (possibly not very common), the use of 'goto' is better than 'exit', 'continue', .... Maybe it's the best solution. I'm thinking about navigation by keys, typically in console mode, when you have, for example, a list of parameters to be adjusted. Without 'goto', a solution is to nest each parameter input in a while loop. Even using 'continue' the code is not very elegant: Example: ... while 1 do -- Show A key = get_key() if (key = BACK) then exit end if ... while 1 do -- Show B key = get_key() if (key = BACK) then exit end if ... while 1 do -- Show C key = get_key() if (key = BACK) then exit end if ... end while if (key = BACK) then continue end if end while if (key = BACK) then continue end if end while if (key = BACK) then continue end if return This solution with 'goto' is cleaner and more simple: ... ENTRY_A: -- Show A key = get_key() if (key = BACK) then return if ... ENTRY_B: -- Show B key = get_key() if (key = BACK) then goto ENTRY_A end if ... ENTRY_C: -- Show C key = get_key() if (key = BACK) then goto ENTRY_B end if ... This is just an example of an elegant use of 'goto' typically used in microcontroller firmwares. - Fernando -= B E G I N =- X-EUFORUM: 20871 Date: 2008 May 13 2:01 From: c.k.lester <euphoric at cklester??om> Subject: Re: Labeled Loops? Jeremy Cowgar wrote: > > c.k.lester wrote: > > > > while 1 do "getrdone" > > while 1 do "inner_while" > > if y then > > exit "getrdone" > > else > > exit "getrdone" > > end if > > end while > > > > but I still say for loops need no label. :) > > I think for consistency, for and while loops should be labeled the same. They're not consistent now... so what do you mean? -= B E G I N =- X-EUFORUM: 20872 Date: 2008 May 13 2:02 From: Derek Parnell <ddparnell at bigpo?d.?om> Subject: Re: No more platform(), conditional includes, conditional functions, conditiona Jeremy Cowgar wrote: > This is exciting! About bloody time ;-) This is a long wished for facility. Nowif it can be combined with command-line switch invocation ... hmmmm... [[ file: test.ex ]] ifdef debug include safe.e else include machine.e end ifdef [[command line ]] ex --define=debug test.ex -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20873 Date: 2008 May 13 2:03 From: Jeremy Cowgar <jeremy at co?ga?.com> Subject: Re: suggestion jacques deschênes wrote: > > the line for me as for version 4.0 should be: > > 1) fix bugs > 2) standard libraries (no addition from now) > 3) namespace resolution (Mat seem to have an acceptable solution to it, freeze > it there, if we wait for a perfect solution,we'll never see the end). > > that's it, that's all > > for preprocessor athougth I've been waiting for it for a long time it should > be queued. Hm, pre-processor is done. It contains features that people have been wanting for a long time. Also, continue is done and is part of 4.0. I think also that a case statement should be added. 4.0 is a major release and I think it should contain not tiny improvements, but something that warrants a major release. So far, I think we are on a good track. The labeled loops I think also should go into 4.0. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20874 Date: 2008 May 13 2:06 From: Jeremy Cowgar <jeremy at ??wgar.com> Subject: Re: Labeled Loops? c.k.lester wrote: > > > I think for consistency, for and while loops should be labeled the same. > > They're not consistent now... so what do you mean? The means of labeling and addressing them: <eucode> while 1 label "top" do for a = 1 to 10 label "mid" do end for end while </eucode> I do not think you should refer to the for loop as "a", I think when you want a label, you give it one for consistencies sake. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20875 Date: 2008 May 13 2:07 From: Jeremy Cowgar <jeremy at c?w?ar.com> Subject: Re: No more platform(), conditional includes, conditional functions, condit Derek Parnell wrote: > > Jeremy Cowgar wrote: > > > This is exciting! > > About bloody time ;-) This is a long wished for facility. Nowif it can be combined > with command-line switch invocation ... hmmmm... > > [[ file: test.ex ]] > ifdef debug > include safe.e > else > include machine.e > end ifdef > > [[command line ]] > > ex --define=debug test.ex > Yes, it can: ex -Ddebug -Djohndoe -Dsimple test.ex -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20876 Date: 2008 May 13 2:10 From: c.k.lester <euphoric at ?klester?com> Subject: Re: Labeled Loops? Jeremy Cowgar wrote: > c.k.lester wrote: > > > I think for consistency, for and while loops should be labeled the same. > > They're not consistent now... so what do you mean? > The means of labeling and addressing them: > while 1 label "top" do > for a = 1 to 10 label "mid" do > end for > end while > > I do not think you should refer to the for loop as "a", I think when you want > a label, you give it one for consistencies sake. Can't it be simpler? while 1 do "top" for a = 1 to 10 do "mid" end for end while or, if you absolutely need a "label" statement while 1 do ~top for a = 1 to 10 do ~mid end for end while -= B E G I N =- X-EUFORUM: 20877 Date: 2008 May 13 2:15 From: Derek Parnell <ddparnell at bigpo?d.com> Subject: Re: Goto Examples? Fernando Bauer wrote: I'm not 100% sure I understood the flow, but here is my goto-less attempt. ... label AA while 1 do -- Show A key = get_key() if (key = BACK) then exit AA end if ... label BB while 1 do -- Show B key = get_key() if (key = BACK) then next AA end if ... label CC while 1 do -- Show C key = get_key() if (key = BACK) then next BB end if ... end while end while end while return > This solution with 'goto' is cleaner and more simple: I think your 'goto' version has a few 'while loops' omitted, no? -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20878 Date: 2008 May 13 2:15 From: Jeremy Cowgar <jeremy at cow?ar.com> Subject: Re: No more platform(), conditional includes, conditional functions, condit Jeremy Cowgar wrote: > > > > > ex --define=debug test.ex > > > > Yes, it can: > > ex -Ddebug -Djohndoe -Dsimple test.ex > More over, I want to stress that this is *not* a pre-processor. A pre-processor will load the source file, scan from top to bottom looking for pre-processor keywords. The pre-processor would then alter the code as necessary and the pass it on to the parser. That is not what ifdef does. Ifdef is a compile time execution keyword. It does not inject any of it's own code into the IL or C translated output. It does not inject any of the "FALSE" defines into IL or C code. What this means is that the ifdef keyword causes no speed change in Euphoria like a pre-processor would. If you use it, you will get a performance hit equivalent to executing 1 if statement 1 time (well, per condition you have of course). And again, that happens at parse time, not every iteration, because it's never injected into IL or C. That is important to note. It's not a pre-processor. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20879 Date: 2008 May 13 2:15 From: Jason Gade <jaygade at ya?oo.com> Subject: Re: Labeled Loops? Jeremy Cowgar wrote: > > c.k.lester wrote: > > > > > I think for consistency, for and while loops should be labeled the same. > > > > They're not consistent now... so what do you mean? > > The means of labeling and addressing them: > > <eucode> > while 1 label "top" do > for a = 1 to 10 label "mid" do > end for > end while > </eucode> > > I do not think you should refer to the for loop as "a", I think when you want > a label, you give it one for consistencies sake. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Just to be clear, for labeled loops, I would hope that the programmer would choose a better variable name than "a". -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20880 Date: 2008 May 13 2:18 From: Derek Parnell <ddparnell at bigpond.??m> Subject: Re: Goto Examples? Jeremy Cowgar wrote: >Does anyone have examples of where goto is better than existing syntax? I direct your attention to this 1974 paper by Donald Knuth. http://pplab.snu.ac.kr/courses/adv_pl05/papers/p261-knuth.pdf -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell > end for > end while > > or, if you absolutely need a "label" statement > > while 1 do ~top > for a = 1 to 10 do ~mid > end for > end while I think for as much as it will be used and for clarity and parsing reasons, label "abc" would be best, but others may disagree. It especially will not work after the do. It would be hard to detect if it's the first execution token of the block or a label. Also, I do not think the label would need to be quoted, it would just be label top. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20881 Date: 2008 May 13 2:18 From: Jeremy Cowgar <jeremy at cowga?.co?> Subject: Re: Labeled Loops? c.k.lester wrote: > > > while 1 label "top" do > > for a = 1 to 10 label "mid" do > > end for > > end while > > > > I do not think you should refer to the for loop as "a", I think when you want > > a label, you give it one for consistencies sake. > > Can't it be simpler? > > while 1 do "top" > for a = 1 to 10 do "mid" > end for > end while > > or, if you absolutely need a "label" statement > > while 1 do ~top > for a = 1 to 10 do ~mid > end for > end while I think for as much as it will be used and for clarity and parsing reasons, label "abc" would be best, but others may disagree. It especially will not work after the do. It would be hard to detect if it's the first execution token of the block or a label. Also, I do not think the label would need to be quoted, it would just be label top. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20882 Date: 2008 May 13 2:19 From: Mike777 <anon4321 at gmail.c?m> Subject: Re: Previous control Mike777 wrote: > > CChris wrote: > > > > Mike777 wrote: > > > > > > CChris wrote: > > > > > > > > Mike777 wrote: > > > > > > > > > > I suppose the edit boxes and combo boxes don't really have a Click event, > so</font></i> > > > > > I'm supposed to use a different event for w32HGetHandler. > > > > > > > > > > Any guidance would be appreciated. > > > > > > > > > > Thanks > > > > > > > > > > Mike > > > > > > > > Why not simply add an w32HGotFocus event handler to all the controls you are > > > > interested in? > > > > The common handler would save in a variable you define the id of the control > > > > for which it is called (or stack them if you need more), and then you retrieve > > > > them. > > > > Doesn't work? > > > > > > Almost. w32HGotFocus doesn't fire when the mouse is clicked into a combobox. > > > I tried w32HEvent, but then just passing the mouse over the control activates > > > the event procedure, undoing what I've done by clicking in the cbo. > > > > > > It works for Text Boxes, Radio Buttons and Check Boxes. > > > > > > Is there a substitute for w32HGotFocus that works on combo boxes? [Yes, I've > > > looked but I haven't found one, yet.] > > > > > > Mike > > > > I didn't have time to check (busy documenting sets.e and adding more tests, > > and I certainly type 10x slower than Jeremy). I don't see why combo boxes wouldn't > > fire w32HGotFocus. If I can confirm this I'll fix it, Bill forbid. I have a workaround. For those controls that have a GotFocus event, as per your suggestion. For those that don't, params[1]=273 seems to execute only once when the control is selected with the mouse, so I added the w32HEvent but filtered on params[1]=273. Seems to work for now. I attempted to find someplace which would identify the parameter codes (and the other parameters, for that matter) to no avail. So, for now, it was trial and error (thank you pretty_print) and search for a code that occurs exactly once each time a control is selected. Not at all elegant, but functional. Mike -= B E G I N =- X-EUFORUM: 20883 Date: 2008 May 13 2:22 From: Jeremy Cowgar <jeremy at ?owg?r.com> Subject: Re: Labeled Loops? Jason Gade wrote: > > Just to be clear, for labeled loops, I would hope that the programmer would > choose a better variable name than "a". > Depends on how complex the loop is for me. If it's only a few lines, I'll commonly use a,b,c or i,j,k for loop variables. <eucode> for a in 1 to length(lines) do line = lines[a] puts(output, trim(" \t\r\n", line) & "\n") end for </eucode> You'll find code like that in my production apps. Now, am I going to do a lot of processing on it? Is the loop many lines long? Sure, a more appropriate name will be given, but in the above example? nah, a is just fine for me. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20884 Date: 2008 May 13 2:27 From: Jason Gade <jaygade at ya?oo.c?m> Subject: Re: Labeled Loops? I'm not sure I'm following here. But say it's implemented so the syntax is: <eucode> while 1 do label top for i = 1 to 10 do label mid ? i end for end while </eucode> Where top and mid have a scope similar to "for" variables -- that is, to the end of their respective "end" statements and couldn't be used otherwise as variables. But they wouldn't be objects or anything. Hmm. Maybe that's a reason to make them string or sequence constants instead? Still kinda confused. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20885 Date: 2008 May 13 2:29 From: Jason Gade <jaygade at yah??.com> Subject: Re: Labeled Loops? Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > Just to be clear, for labeled loops, I would hope that the programmer would > > choose a better variable name than "a". > > > > Depends on how complex the loop is for me. If it's only a few lines, I'll commonly > use a,b,c or i,j,k for loop variables. > > <eucode> > for a in 1 to length(lines) do > line = lines[a] > puts(output, trim(" \t\r\n", line) & "\n") > end for > </eucode> > > You'll find code like that in my production apps. Now, am I going to do a lot > of processing on it? Is the loop many lines long? Sure, a more appropriate name > will be given, but in the above example? nah, a is just fine for me. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Well, yeah, I do loops like that too for simple loops. But for something where you are going to have some kind of complicated exit/continue semantics seems like a not simple loop. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20886 Date: 2008 May 13 2:33 From: Jeremy Cowgar <jeremy at cow?a?.com> Subject: Re: Labeled Loops? Jason Gade wrote: > > I'm not sure I'm following here. > > But say it's implemented so the syntax is: > <eucode> > while 1 do label top > for i = 1 to 10 do label mid > ? i > end for > end while > </eucode> > It would be slightly different <eucode> while 1 label top do for i = 1 to 10 label mid do ? i end for end while </eucode> > Where top and mid have a scope similar to "for" variables -- that is, to the > end of their respective "end" statements and couldn't be used otherwise as variables. > But they wouldn't be objects or anything. Hmm. > > Maybe that's a reason to make them string or sequence constants instead? > > Still kinda confused. > Internally a for loop and while loop have a stack where a reference to the loop variable is stored (for loop), the position in IL where the loop starts and ends. A label would simply be added to that stack item associated with the loop. Thus, the label could be considered an internal loop identifier. It has to be neither a sequence or integer. It simply has to exist, if you give the loop a "label" keyword. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20887 Date: 2008 May 13 2:34 From: Jeremy Cowgar <jeremy at co?ga?.com> Subject: Re: Labeled Loops? Jason Gade wrote: > > Well, yeah, I do loops like that too for simple loops. But for something where > you are going to have some kind of complicated exit/continue semantics seems > like a not simple loop. It was merely an example :-/ -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20888 Date: 2008 May 13 2:47 From: "Euler German" <eulerg at gmail.com> Subject: Re: Labeled Loops? > On 12 May 2008 at 17:01, Jeremy Cowgar wrote (maybe snipped): > Hm... what about: > > <eucode> > for a = 1 to 10 label "top" do > for b = 1 to 10 label "mid" do > while 1 do > if b = 3 then exit "top" end if > if a = 2 then continue "mid" end if > end while > end for > end for > </eucode> > I agree if all we need is "breaking" loop laces. But if I need to go to "Far Far Away" then probably we'd need "goto". The problem I see is that in an Euphorian way, labels should (must?) be declared prior to use, just like variables, so this would be a problem in most cases. Though I never need it before (since those times of BASIC and COBOL), there are times I need to re-think a large part of the code so I don't get stuck on lace-structured code. Goto and gosub would get me out of the trouble in a snap, but my code would look (and would be) so ugly and (probably) so difficult to maintain that I can't see the real benefit of it. But this is just me. ;) And Jeremy, just trying to understand the concept of "exit" and "continue" on the example above: continue "mid" exits the while loop and goes to next iteration of "mid" for...end for loop. OTOH, exit "top" exits the whole thing and code will continue execution after "top" for...end for loop, if any. Did I get it right? Sorry, but I'm getting these nouveaut=E9s quite slowly. :) Best, Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 20889 Date: 2008 May 13 3:01 From: Jeremy Cowgar <jeremy at cow?ar.co?> Subject: Re: Labeled Loops? Euler German wrote: > > > On 12 May 2008 at 17:01, Jeremy Cowgar wrote (maybe snipped): > > > Hm... what about: > > > > <eucode> > > for a = 1 to 10 label "top" do > > for b = 1 to 10 label "mid" do > > while 1 do > > if b = 3 then exit "top" end if > > if a = 2 then continue "mid" end if > > end while > > end for > > end for > > </eucode> > > > > I agree if all we need is "breaking" loop laces. But if I need to go > to "Far Far Away" then probably we'd need "goto". The problem I see > is that in an Euphorian way, labels should (must?) be declared prior > to use, just like variables, so this would be a problem in most > cases. No, labels would neither be declared nor usable in anything but a exit or continue. i.e. <eucode> while 1 label hello do ? hello end while </eucode> You will get a compile error of an unknown variable hello. Their use in continue and exit will be special uses and will search the loop stack for the corresponding loop label, not a variable stack or anything. > > And Jeremy, just trying to understand the concept of "exit" and > "continue" on the example above: continue "mid" exits the while loop > and goes to next iteration of "mid" for...end for loop. OTOH, exit > "top" exits the whole thing and code will continue execution after > "top" for...end for loop, if any. Did I get it right? Sorry, but I'm > getting these nouveaut=E9s quite slowly. :) > In the above example... exit "top" exits to the loop with the label "top". continue "mid" continues with next iteration of the loop labeled "mid". We would probably need a special label such as "all" or something that would exit all loops. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20890 Date: 2008 May 13 3:04 From: Jeremy Cowgar <jeremy at c?wga?.com> Subject: Re: Long time no post... Oh, Eu 4.0 also has built in regular expressions now also. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20891 Date: 2008 May 13 5:21 From: Jeremy Cowgar <jeremy at cowgar.??m> Subject: New keywords: ifdef, elsifdef, end ifdef Ok, in SVN revision 452, there are 2 new keywords. ifdef and elsifdef. The ifdef is combined with an existing keyword, end, to make a complete set of conditional compilation keywords. A quick rundown: 1. Setting defines can be done in 2 ways: 1a..... with define=debug ....... this can be given multiple times to define more than one item 1b..... exu/ecu, ex/exw/exwc/ecw -D debug ....... -D parameter can be given multiple times to define more than one item 2. Clearing defines can be done with without: 1a..... without define=debug ....... this turns off the debug define. 3. Predefined "defines" 2a..... Current operating system (WIN32, DOS32, LINUX, FREEBSD) 2b..... Current Euphoria version (EU400) 4. ifdef/elsifdef/end ifdef work on static defines. You cannot execute dynamic code in your ifdef/elseifdef. A few examples: <eucode> ifdef debug then puts(1, "DEBUG\n") end ifdef </eucode> exwc myprog.e --- no output exwc -D debug myprog.e ---- "DEBUG" <eucode> with define=debug ifdef debug then puts(1, "DEBUG\n") end ifdef </eucode> exwc myprog.e --- "DEBUG" Conditional includes <eucode> ifdef debug then include safe.e else include machine.e end ifdef </eucode> platform() replacement <eucode> sequence name ifdef WIN32 then name = "Windows" global procedure say_hello() puts(1, "Hello from Windows!\n") end procedure elsifdef LINUX then name = "Linux" global procedure say_hello() puts(1, "Hello from Linux!\n") end procedure elsifdef DOS32 then name = "DOS" global procedure say_hello() puts(1, "Hello from DOS!\n") end procedure end ifdef say_hello() puts(1, "You are on " & name & "\n") </eucode> with/without <eucode> with define=debug if debug then puts(1, "Hello Debug\n") end ifdef without define=debug if debug then puts(1, "Serious error, you should not be here!\n") end ifdef </eucode> Things you *cannot* do: <eucode> sequence name name = prompt_string("Enter style:") ifdef name = "SIMPLE" then end ifdef ifdef myfunc() then end ifdef ifdef age = 32 then end ifdef </eucode> All three of the above are dynamic. i.e. it depends on code to be executing, thus those are decisions that can take place only in the interpreter, not at parse time. If you need the above, then you use the normal if/elsif/else/end if statements. This is in SVN right now for anyone who wishes to test it, play with it. There is a unit test added for it: tests/t_condcmp.e ... 672 tests now and counting! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20892 Date: 2008 May 13 5:47 From: Jeremy Cowgar <jeremy at c?w?ar.com> Subject: Re: New keywords: ifdef, elsifdef, end ifdef I wanted to follow up after reading my own post :-) First, the else keyword also works inside of an ifdef, elsifdef, else, end ifdef structure. Second, this is not just a nice addition to use, it will speed your code up in any case where it is useful. How does it do it? Take this for example: <eucode> for i = 1 to 10000 do if debug = 1 then printf(1, "Loop iteration %i\n", {i}) end if --- code end for </eucode> Each iteration, the interpreter must check to see if debug is equal to 1. Now, look at this example: <eucode> for i = 1 to 10000 do ifdef debug then printf(1, "Loop iteration %i\n", {i}) end ifdef --- code end for </eucode> The interpreter *never* checks if debug is on or off. How does it do it? During the parsing of your source code, the ifdef keyword is found and instead of "emitting" the code to the interpreter (IL code), the parser looks in a sequence of defines to see if the define you requested exists. If so, then it ignores itself (i.e. the ifdef debug then) and allows the parser to continue to "emit" the code in it's own block to the interpreter (IL code). If it is not defined, then the parser skips all code, not emiting IL code for the entire contained block. Thus, the interpreter never even knows the code exists. So, in the above example, if debug is not defined, then the interpreter thinks the application looks like: <eucode> for i = 1 to 10000 do --- code end for </eucode> If debug is defined, then the interpreter thinks the application looks like: <eucode> for i = 1 to 10000 do printf(1, "Loop iteration %i\n", {i}) --- code end for </eucode> Again, I want to stress for those who did not read a few previous posts under a different subject. This is *not* a pre-processor. A pre-process will slow things down. This does not. A pre-processor will scan the source contents before the parser ever get's it and filter out any unwanted code. Once the pre-processor is done, it then sends it's processed code to the parser for the real scanning. The new ifdef construct happens during the normal parse. It's use will only speed things up, not slow them down. If you do not use the ifdef keyword then it will have zero effect on your code. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20893 Date: 2008 May 13 5:57 From: Dan Moyer <danielmoyer at pro??gy.net> Subject: [Win21Lib] is list open? Is there a test that would tell if a listbox is open (ie, displaying items)? I'll set flags if necessary, but it would be easier to just test it. Dan Moyer -= B E G I N =- X-EUFORUM: 20894 Date: 2008 May 13 7:09 From: Dan Moyer <danielmoyer at prodigy.?e?> Subject: Re: [Win21Lib] is list open? (duh, [Win32Lib] !) Whoops, of course I meant Win32Lib, fingers just went too far. Dan -= B E G I N =- X-EUFORUM: 20895 Date: 2008 May 13 8:48 From: CChris <christian.cuvier at agricultu?e.g?uv.fr> Subject: Re: Labeled Loops? Jeremy Cowgar wrote: > > CChris wrote: > > > > <eucode> > > label "my_loop" > > for i=1 to n do > > while 1 do > > while f(x)=3 do > > ---.... > > if done() then > > exit "my_loop" > > end if > > end end end > > </eucode> > > > > Hm... what about: > > <eucode> > for a = 1 to 10 label "top" do > for b = 1 to 10 label "mid" do > while 1 do > if b = 3 then exit "top" end if > if a = 2 then continue "mid" end if > end while > end for > end for > </eucode> > > A terrible loop example, but the ability to label loops. The addition of this > labeling and exit/continue to those labels is cake. > > This is just me thinking aloud again once seeing Chris's example code. I kind > of really like this idea. What about you? label is obviously optional, just > as "by" is on a for loop. The implementation of such would allow you to reuse > labels in non related loops and again, would cause no slow down what-so-ever > if used or not used. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Actually that's how "label" is used in Æ with no gotoes... CChris -= B E G I N =- X-EUFORUM: 20896 Date: 2008 May 13 9:01 From: CChris <christian.cuvier at a?r?culture.gouv.fr> Subject: Re: No more platform(), conditional includes, conditional functions, conditiona Jeremy Cowgar wrote: > > Wow, I am pumped... Look at this code: > > <eucode> > with define=debug > atom lib > > ifdef debug then > include safe.e > else > include machine.e > end ifdef > > > ifdef LINUX then > > lib = open_dll("hello.so") > global function say_hello() > puts(1, "Hello from Linux!\n") > end function > > elsifdef WIN32 then > > lib = open_dll("hello.dll") > global function say_hello() > puts(1, "Hello from Windows!\n") > end function > > elsifdef DOS32 then > > lib = -1 > global function say_hello() > puts(1, "Hello from DOS!\n") > end function > > end ifdef > > say_hello() > </eucode> > > This all works and this works at the parsing level. What this means is: > > <eucode> > for i = 1 to length(lines) do > ifdef debug then > printf(1, "Line: %s\n", {lines[i]}) > end ifdef > > -- real code > end for > </eucode> > > During the parse, the ifdef is translated at parse/compile time. Not runtime. > This means that the decision "ifdef debug" is made once, not every iteration > of the loop. Therefore, if debug is defined, then this is *exactly* what the > code looks like to the runtime or in the C code translated: > > <eucode> > for i = 1 to length(lines) do > printf(1, "Line: %s\n", {lines[i]}) > -- real code > end for > </eucode> > > Notice, no decision logic! If debug is not defined, then in both the interpreter > and C code translated, you only see: > > <eucode> > for i = 1 to length(lines) do > -- real code > end for > </eucode> > > This is exciting! > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> At last! This will change the way we code. Good job! CChris -= B E G I N =- X-EUFORUM: 20897 Date: 2008 May 13 9:20 From: CChris <christian.cuvier at agricultur?.?ouv.fr> Subject: Re: No more platform(), conditional includes, conditional functions, condit Jeremy Cowgar wrote: > > Jeremy Cowgar wrote: > > > > > > > > ex --define=debug test.ex > > > > > > > Yes, it can: > > > > ex -Ddebug -Djohndoe -Dsimple test.ex > > > > More over, I want to stress that this is *not* a pre-processor. A pre-processor > will load the source file, scan from top to bottom looking for pre-processor > keywords. The pre-processor would then alter the code as necessary and the pass > it on to the parser. > > That is not what ifdef does. Ifdef is a compile time execution keyword. It does > not inject any of it's own code into the IL or C translated output. It does > not inject any of the "FALSE" defines into IL or C code. > > What this means is that the ifdef keyword causes no speed change in Euphoria > like a pre-processor would. If you use it, you will get a performance hit equivalent > to executing 1 if statement 1 time (well, per condition you have of course). > And again, that happens at parse time, not every iteration, because it's never > injected into IL or C. That is important to note. It's not a pre-processor. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I think ifdef would be even more useful with a couple predefined variables. One I'm thinking about is "version": <eucode> ifdef version-3.1.1 then x=find_from(0,s,5) else x=find(0,s[5..$]) if x>0 then x+=(5-1) end if end if </eucode> Of course, this particular code won't work because 3.1.1 doesn't recognise ifdef, but you get the idea.... CChris -= B E G I N =- X-EUFORUM: 20898 Date: 2008 May 13 9:34 From: CChris <christian.cuvier at ?gricul?ure.gouv.fr> Subject: Re: Previous control Mike777 wrote: > > Mike777 wrote: > > > > CChris wrote: > > > > > > Mike777 wrote: > > > > > > > > CChris wrote: > > > > > > > > > > Mike777 wrote: > > > > > > > > > > > > I suppose the edit boxes and combo boxes don't really have a Click event, > > so</font></i> > > > > > > I'm supposed to use a different event for w32HGetHandler. > > > > > > > > > > > > Any guidance would be appreciated. > > > > > > > > > > > > Thanks > > > > > > > > > > > > Mike > > > > > > > > > > Why not simply add an w32HGotFocus event handler to all the controls you > are</font></i> > > > > > interested in? > > > > > The common handler would save in a variable you define the id of the control > > > > > for which it is called (or stack them if you need more), and then you retrieve > > > > > them. > > > > > Doesn't work? > > > > > > > > Almost. w32HGotFocus doesn't fire when the mouse is clicked into a combobox. > > > > I tried w32HEvent, but then just passing the mouse over the control activates > > > > the event procedure, undoing what I've done by clicking in the cbo. > > > > > > > > It works for Text Boxes, Radio Buttons and Check Boxes. > > > > > > > > Is there a substitute for w32HGotFocus that works on combo boxes? [Yes, I've > > > > looked but I haven't found one, yet.] > > > > > > > > Mike > > > > > > I didn't have time to check (busy documenting sets.e and adding more tests, > > > and I certainly type 10x slower than Jeremy). I don't see why combo boxes wouldn't > > > fire w32HGotFocus. If I can confirm this I'll fix it, Bill forbid. > > I have a workaround. For those controls that have a GotFocus event, as per > your suggestion. For those that don't, params[1]=273 seems to execute only > once when the control is selected with the mouse, so I added the w32HEvent but > filtered on params[1]=273. > > Seems to work for now. > > I attempted to find someplace which would identify the parameter codes (and > the other parameters, for that matter) to no avail. So, for now, it was trial > and error (thank you pretty_print) and search for a code that occurs exactly > once each time a control is selected. > > Not at all elegant, but functional. > > Mike The list is called winuser.h, and it is fairly easy to get. There are holes in that list, and I found other references that were filling some of the holes. I'm not sure, however, whether these messages are very helpful: * some come from older versions of Windows (typically WM_TESTING or WM_COMPACTING) * some are probably specific to Wine, Windows CE or such variants * and for some I don't have a clue (like WM_SIZEWAIT). This one is not bad: http://wiki.winprog.org/wiki/Windows_messages but it has holes too. Some other pages do fill these gaps, but then not the others. There is no such list on MSDN - shame on them! CChris -= B E G I N =- X-EUFORUM: 20899 Date: 2008 May 13 10:32 From: CChris <christian.cuvier at ag?iculture.gouv?fr> Subject: Re: Previous control Mike777 wrote: > > Mike777 wrote: > > > > CChris wrote: > > > > > > Mike777 wrote: > > > > > > > > CChris wrote: > > > > > > > > > > Mike777 wrote: > > > > > > > > > > > > I suppose the edit boxes and combo boxes don't really have a Click event, > > so</font></i> > > > > > > I'm supposed to use a different event for w32HGetHandler. > > > > > > > > > > > > Any guidance would be appreciated. > > > > > > > > > > > > Thanks > > > > > > > > > > > > Mike > > > > > > > > > > Why not simply add an w32HGotFocus event handler to all the controls you > are</font></i> > > > > > interested in? > > > > > The common handler would save in a variable you define the id of the control > > > > > for which it is called (or stack them if you need more), and then you retrieve > > > > > them. > > > > > Doesn't work? > > > > > > > > Almost. w32HGotFocus doesn't fire when the mouse is clicked into a combobox. > > > > I tried w32HEvent, but then just passing the mouse over the control activates > > > > the event procedure, undoing what I've done by clicking in the cbo. > > > > > > > > It works for Text Boxes, Radio Buttons and Check Boxes. > > > > > > > > Is there a substitute for w32HGotFocus that works on combo boxes? [Yes, I've > > > > looked but I haven't found one, yet.] > > > > > > > > Mike > > > > > > I didn't have time to check (busy documenting sets.e and adding more tests, > > > and I certainly type 10x slower than Jeremy). I don't see why combo boxes wouldn't > > > fire w32HGotFocus. If I can confirm this I'll fix it, Bill forbid. > > I have a workaround. For those controls that have a GotFocus event, as per > your suggestion. For those that don't, params[1]=273 seems to execute only > once when the control is selected with the mouse, so I added the w32HEvent but > filtered on params[1]=273. > > Seems to work for now. > > I attempted to find someplace which would identify the parameter codes (and > the other parameters, for that matter) to no avail. So, for now, it was trial > and error (thank you pretty_print) and search for a code that occurs exactly > once each time a control is selected. > > Not at all elegant, but functional. > > Mike In its unfathomable wisdom, Windows does not send WM_SETFOCUS to a combo box when clicked. That's why w32HGotFocus doesn't fire. It is not related to the combo being empty. What you get is an old style notification message (CBN_SETFOCUS) through WM_COMMAND (the ubiquitous 273). I'll add code to fire w32HGotFocus on this notification tonight. Not difficult, but not a one liner either, I need to add a test to wmCommand() for that. CChris PS: Judith, I didn't forget about ColoredButtons! but I wanted to get the tax forms done, and am busy documenting and unit-testing sets.e for inclusion in the new standard lib. Will look into it ASAP. Derek: if you need more time, could you email me, so that I post a later date for releasing 70.4a? -= B E G I N =- X-EUFORUM: 20900 Date: 2008 May 13 10:43 From: Matt Lewis <matthewwalkerlewis at gma?l.?om> Subject: Re: New keywords: ifdef, elsifdef, end ifdef Jeremy Cowgar wrote: > > platform() replacement This being the Internet and all, I'm going to pick on your arbitrary example for the sake of argumentativeness: <eucode> sequence name ifdef WIN32 then name = "Windows" elsifdef LINUX then name = "Linux" elsifdef DOS32 then name = "DOS" end ifdef global procedure say_hello() printf(1, "Hello from %s\n", {name}) end procedure say_hello() puts(1, "You are on " & name & "\n") </eucode> Seriously, though. This is good stuff. Matt -= B E G I N =- X-EUFORUM: 20901 Date: 2008 May 13 10:53 From: CChris <christian.cuvier at agricu?tu?e.gouv.fr> Subject: Re: [Win21Lib] is list open? (duh, [Win32Lib] !) Dan Moyer wrote: > > > Whoops, of course I meant Win32Lib, fingers just went too far. > > Dan Not directly, but... <eucode> integer list_dropped list_dropped=0 procedure monitor_list_state(integer id,integer event,sequence s) if event=w32HDropDown then list_dropped=1 else list_dropped=0 end if end procdeure setHandler(the_list_id,{w32HDropDown,w32HCloseUp},routine_id("monitor_list_state")) </eucode> To all users: is an isDropped(id) routine useful? It would apply to menus,lists, combos and ComboBoxEx. Returns 1 if id is showing items, else 0. CChris CChris -= B E G I N =- X-EUFORUM: 20902 Date: 2008 May 13 10:58 From: Pete Stoner <stoner.pete at gmail?co?> Subject: Re: [Win21Lib] is list open? (duh, [Win32Lib] !) CChris wrote: > > To all users: is an isDropped(id) routine useful? It would apply to menus,lists, > combos and ComboBoxEx. Returns 1 if id is showing items, else 0. > > CChris It certainly would, I've needed that in the past.. PeteS -= B E G I N =- X-EUFORUM: 20903 Date: 2008 May 13 11:15 From: CChris <christian.cuvier at ag?icult?re.gouv.fr> Subject: Re: [Win21Lib] is list open? (duh, [Win32Lib] !) Pete Stoner wrote: > > CChris wrote: > > > > To all users: is an isDropped(id) routine useful? It would apply to menus,lists, > > combos and ComboBoxEx. Returns 1 if id is showing items, else 0. > > > > CChris > > It certainly would, I've needed that in the past.. > > PeteS Ok, will add. The menu part is done already so as to determine whether a menu is visible, which is important for setPointer() to know so as to skip invisible things. For other controls, I'll use the trick I just posted in response to Dan, implementing it in a protected handler at the bottom of the chain. Unless I find another way (didn't check for children of the control, for instance). CChris -= B E G I N =- X-EUFORUM: 20904 Date: 2008 May 13 11:51 From: Jeremy Cowgar <jeremy at cowgar.c??> Subject: Re: New keywords: ifdef, elsifdef, end ifdef Matt Lewis wrote: > > This being the Internet and all, I'm going to pick on your arbitrary > example for the sake of argumentativeness: > I wanted to merely show you could make different functions under an ifdef statement, that's all. My examples aren't always proper coding, such as the loop var names being a, b, c :-) -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20905 Date: 2008 May 13 11:59 From: Jeremy Cowgar <jeremy at ?o?gar.com> Subject: Re: No more platform(), conditional includes, conditional functions, condit CChris wrote: > > I think ifdef would be even more useful with a couple predefined variables. > One I'm thinking about is "version": > <eucode> > ifdef version-3.1.1 then > x=find_from(0,s,5) > else > x=find(0,s[5..$]) > if x>0 then x+=(5-1) end if > end if > </eucode> Yes, I included predefined version for here on out. Predefined "defines" I made all upper case and 1 word. So, the version number is EU400. But I am open to suggestions on version number schemes. The above, version-3.1.1 would cause parsing problems in my code, i.e. version - 3.1.1 var version, minus an invalid number (3.1.1). I was thinking VERSION_400 might be a bit clearer than what I initially choose, EU400. Anyway, EU400, EU401, EU402, EU500, etc... You can then do things like this as a library writer: <eucode> ifdef EU400 then -- 4.0 does not have the new 5.0 function "insanely_fast_sort", so -- mimic it with a slower sort global function insanely_fast_sort(sequence items) return sort(items) end global function end ifdef </eucode> Now, a future plan should be simple comparisons and logical operators, but it's not there yet <eucode> ifdef VERSION > 400 then -- code end ifdef ifdef LINUX or FREEBSD then -- code end ifdef </eucode> The above will come, but maybe not with 4.0. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20906 Date: 2008 May 13 12:07 From: marky1124 <mark_young at hotmai??com> Subject: Re: New keyword added: continue My vote is for continue, not that it matters hugely. My reasons are that of the 10 languages listed about 9 of them use continue and I think consistency is important. Especially given the earlier argument that next in VBA means "end for" and hence leans towards more confusion. I speak as a developer who currently is primarily using Euphoria and perl, and perl was the only one of the 10 that uses next. However there are so many significant syntax differences between perl and Euphoria that consistency of the use of next pales in comparison. Perl requires a semi-colon at the end of every line. Perl uses braces for code blocks. etc. Anyway - hoorah for this new addition to Euphoria, whatever it ends up being called. Thank you. Cheers, Mark -= B E G I N =- X-EUFORUM: 20907 Date: 2008 May 13 12:45 From: Michael J. Sabal <m_sabal at yahoo.c?m> Subject: Benchmarks Just to allay the fears that all these enhancements are going to kill the speed with which Euphoria programs run, would it be possible to publish some benchmarks comparing version 2.5, 3.1, and 4.0? -= B E G I N =- X-EUFORUM: 20908 Date: 2008 May 13 13:00 From: Jeremy Cowgar <jeremy at c?wgar.c?m> Subject: Re: Benchmarks Michael J. Sabal wrote: > > Just to allay the fears that all these enhancements are going to kill the > speed with which Euphoria programs run, would it be possible to publish some > benchmarks comparing version 2.5, 3.1, and 4.0? Michael, Would you be willing to create some valuable benchmarks (which is not an easy thing to do) ? As far as new enhancements slowing things down, when you start to use them, you will only see speed increases :-) It's not a miracle, you can look at the methods in parser.e and compiler.e.... However, some benchmarks would be nice, but I do not think for the fact of the recent new enhancements. I also think, as anyone who has done benchmarking would agree, that benchmarking is highly subjective and difficult to come up with some that are useful. That being said, I think for exposure, Euphoria should become part of The Computer Language Shootout (http://shootout.alioth.debian.org/). Jason Glade created some/all (?) of those benchmarks in the archive. Search for benchmark. Would you be willing to make sure they still all run and run them in different versions of Euphoria and post the results? Now, those benchmarks will not show any speed improvements as I am sure none of them are doing any conditional compiling that we would normally do in our applications/libraries. So, we would probably need some benchmarks on top of those. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20909 Date: 2008 May 13 13:20 From: CChris <christian.cuvier at agriculture.go?v.fr> Subject: Re: can_add() and linear() CChris wrote: > > I'd suggest two additions to sequence.e, which I hope will appear pretty natural: > > <eucode> > global function can_add(object a,object b) > -- Determines whether a+b would crash the interpreter. > -- Returns 1 if addition possible, else 0. > if atom(a) or atom(b) then > return 1 > end if > if length(a)!=length(b) then > return 0 > end if > for i=1 to length(a) do > if not can_add(a[i],b[i]) then > return 0 > end if > end for > return 1 > end function > > global funtion linear(object start,object increment,integer count) > -- Returns 0 on failure, or a sequence of count objects. > -- The first one is start, and the whole sequence is a linear progrssion using increment. > sequence result > > if count<0 or not can_add(start,increment) then > return 0 > end if > result=repeat(start,count) > for i=2 to count do > start+=increment > result[i]=start > end for > return result > end function > </eucode> > > The latter might go to math.e just as well, but for its dependency on can_add(). > > CChris More suggestions: global function project(sequence vectors,sequence coords) -- currently in sets.e -- vectors is a rectangular matrix -- coords is a list of coordinate lists -- returns a sequence the length of vectors. Each element is a sequence, -- the length of coords, of sequences. Each inner sequence is made of the -- coordinates of the vector for the given coord list. sequence result,current_vector,coord_set,result_item,projection integer current_index result=vectors for i=1 to length(vectors) do result_item=coords current_vector=vectors[i] for j=1 to length(coords) do coord_set=coords[j] projection=coord_set for k=1 to length(coords_set) do current_index=coords[k] if current_index<1 or current_index>length(current_vector) then crash("Invalid coordinate %d in set %d for vector #%d",{coords[k],j,i}) end if projection[k]=current_vector[current_index] end for result_item[j]=projection end for result[i]=result_item end for return result end function </eucode> fetch() and store() are useful too - they deal with variable length indexing of sequences. The implementation is close to J. Babor's: <eucode> global function fetch(sequence s,sequence indexes) for i=1 to length(indexes)-1 do s=s[indexes[i]] end for return s[indexes[$]] end function function store-(sequence s,sequence indexes,integer index,object x) integer n n=indexes[index] if index=length(indexes) then s[n]=x else s[n]=store_(s[n],indexes,index+1,x) end if return s end function global function store(sequence s,sequence indexes,object x) return store_(s,indexes,1,x) end function </eucode> For the sake of simplicity, I didn't consider using slices. A complete version is to be found in http://oedoc.free.fr/Fichiers/ESL/seqops.zip, which agrees with the OpenEu extended index specification. CChris -= B E G I N =- X-EUFORUM: 20910 Date: 2008 May 13 13:28 From: Les Rogers <selgor1 at verizonma?l.com> Subject: Re: BEZIER CURVES Hi, Thanks to all who answered !! I obviously was very vague. My System is :- SIV - System Information Viewer V3.29 LES::Les Windows XP Professional (Single User) V5.01 Build 2600 Service Pack 2 SiS-741 LES::Les English (0x0C09) Australia (61) Workgroup WORKGROUP up: 00 00:23:54 2008-05-13 22:50:52 [BIOS 6.00 PG] Powered by Mains Resource Usage 43% Current MB (KB) Maximum MB (KB) Free MB (KB) [528] System Physical Memory 450 (460,464) 1,024 (1,048,576) 189 (193,832) System Paging File 350 (357,592) 2,464 (2,523,232) 2,114 (2,165,640) System File Cache 484 (496,564) 485 (496,652) 0 (88) Sensor ITE/SiS IT8712F/950 MB 60.0°C (56-61) I/O +2.90 PSU +5.19 +7.66 -2.99 -3.07 Fans 3,515 0 0 Sempron 3000+ (Thorton) Family 6 (7) Model 10 (0A) Stepping 0 (0) PAS 16GB 2.00GHz Processor [A2] Socket A L1 Code Cache 2-way 64-byte 64KB Core 1.58 volts 166MHz System Bus (FSB) x12.0 Mask 1.0.11 L1 Data Cache 2-way 64-byte 64KB 2.00GHz Level 2 Cache Technology 0.13µm L2 Unified Cache 16-way 64-byte 512KB Fan 3,515 RPM AuthenticAMD [ MMX+ 3D!+ SSE ] AMD Sempron(tm) 3000+ [ Cache Latency ] and this program (my re-hash of "polygon" in demo Euphoria) is what I would like the curve to do -- BkCl3Bst.ex Polygons 2 -- ----------------------------- include graphics.e include select.e include machine.e include mouse.e use_vesa(1) if graphics_mode(18) then end if constant X = 1, Y = 2 sequence config integer nlines, npoints, spacing, solid,klr,kol,kolr procedure stall() for i = 1 to 2750000 do end for end procedure procedure colour() klr=rand(14) kol=rand(14) kolr=rand(14) if klr=kol or klr=kolr then colour() elsif kol=kolr or kol=klr then colour() elsif kolr=klr or kolr=kol then colour() end if bk_color(kolr) end procedure colour() procedure dun() if get_key() = 27 then abort(0) end if mouse_pointer(0) mouse_events(2) if sequence(get_mouse()) then abort(1) end if end procedure procedure poly_pattern() sequence points,pts,deltas,dels,history,his config = video_config() pts=rand(repeat(config[VC_XPIXELS..VC_YPIXELS],npoints))+2 points = rand(repeat(config[VC_XPIXELS..VC_YPIXELS], npoints))+2 deltas = rand(repeat({2*spacing-1, 2*spacing-1}, npoints)) - spacing dels=rand(repeat({2*spacing-1,2*spacing-1},npoints))-spacing history = {} his={} dun() clear_screen() while get_key() != 27 do if length(history) >= nlines then polygon(0, solid, history[1]) history = history[2..nlines] end if dun() if length(his) >= nlines then polygon(0,solid,his[1]) his=his[2..nlines] end if polygon(klr,solid,pts) polygon(kol, solid, points) dun() history = append(history, points) his=append(his,pts) points += deltas pts+=dels dun() for j = 1 to npoints do if points[j][X] <= 0 or points[j][X] >= config[VC_XPIXELS] then deltas[j][X] = -deltas[j][X] end if if points[j][Y] <= 0 or points[j][Y] >= config[VC_YPIXELS] then deltas[j][Y] = -deltas[j][Y] end if end for for j = 1 to npoints do if pts[j][X] <= 0 or pts[j][X] >= config[VC_XPIXELS] then dels[j][X] = -dels[j][X] end if if pts[j][Y] <= 0 or pts[j][Y] >= config[VC_YPIXELS] then dels[j][Y] = -dels[j][Y] end if dun() end for if rand(101) = 1 then colour() end if -- was 201 dun() stall() end while end procedure while get_key() != 27 do nlines = 6 npoints = 4 spacing = 15 solid=0 dun() poly_pattern() end while and this program is one I wrote. Turns at certain points to form Kaleidoscope effect !! include graphics.e include machine.e include mouse.e use_vesa(1) if graphics_mode(18) then end if atom a,b,c,d, a1,b1,c1,d1, a2,b2,c2,d2, a3,b3,c3,d3, x,y,x1,y1, xx,yy,xx1,yy1, xxx,yyy,xxx1,yyy1, xxxx,yyyy,xxxx1,yyyy1, lt,tp,rt,bt, lt1,tp1,rt1,bt1, lt2,tp2,rt2,bt2, lt3,tp3,rt3,bt3, kount,kcol,endit kount=0 kcol=1 endit=0 lt=0 tp=0 bt=240 rt=315 lt1=315 tp1=0 bt1=240 rt1=630 lt2=0 tp2=240 bt2=480 rt2=315 lt3=315 tp3=240 bt3=480 rt3=630 x=235 x1=205 y=200 y1=140 xx=392 xx1=422 yy=200 yy1=140 xxx=235 xxx1=205 yyy=280 yyy1=340 xxxx=392 xxxx1=422 yyyy=280 yyyy1=340 a=1 b=2 c=2 d=1 a1=a b1=b c1=c d1=d a2=a b2=b c2=c d2=d a3=a b3=b c3=c d3=d procedure dun() mouse_pointer(0) mouse_events(2) if sequence(get_mouse()) then abort(1) end if end procedure procedure kullar() if kcol>=16 then kcol = rand(15) end if if kcol= GRAY then kcol=YELLOW end if if kount=50 then kcol=rand(16) end if if kount=60 then kcol+=1 kount=0 end if end procedure procedure val() x-=a y-=b x1-=c y1-=d xx+=a1 yy-=b1 xx1+=c1 yy1-=d1 xxx-=a2 yyy+=b2 xxx1-=c2 yyy1+=d2 xxxx+=a3 yyyy+=b3 xxxx1+=c3 yyyy1+=d3 end procedure procedure xyopp() if x<lt or x>rt then a=-a end if if y<tp or y>bt then b=-b end if if x1<lt or x1>rt then c=-c end if if y1<tp or y1>bt then d=-d end if end procedure procedure xyopp2() if xx<lt1 or xx>rt1 then a1=-a1 end if if yy<tp1 or yy>bt1 then b1=-b1 end if if xx1<lt1 or xx1>rt1 then c1=-c1 end if if yy1<tp1 or yy1>bt1 then d1=-d1 end if end procedure procedure xyopp3() if xxx<lt2 or xxx>rt2 then a2=-a2 end if if yyy<tp2 or yyy>bt2 then b2=-b2 end if if xxx1<lt2 or xxx1>rt2 then c2=-c2 end if if yyy1<tp2 or yyy1>bt2 then d2=-d2 end if end procedure procedure xyopp4() if xxxx<lt3 or xxxx>rt3 then a3=-a3 end if if yyyy<tp3 or yyyy>bt3 then b3=-b3 end if if xxxx1<lt3 or xxxx1>rt3 then c3=-c3 end if if yyyy1<tp3 or yyyy1>bt3 then d3=-d3 end if end procedure procedure stl() for i=1 to 1500000 do end for end procedure procedure draw_it() for i= 1 to 500 do kount+=1 kullar() draw_line(kcol,{{x+a,y+b},{x1+c,y1+d}}) draw_line(kcol,{{(xxx+a2),(yyy+b2)},{(xxx1+c2),(yyy1+d2)}}) draw_line(kcol,{{xx+a1,yy+b1},{xx1+c1,yy1+d1}}) draw_line(kcol,{{xxxx+a3,yyyy+b3},{xxxx1+c3,yyyy1+d3}}) if get_key()=27 then abort(0) end if if get_key()=27 then abort(0) end if dun() stl() val() xyopp() xyopp2() xyopp3() xyopp4() end for clear_screen() end procedure while endit != 15 do draw_it() endit+=1 end while -- if system_exec("ex \\euphoria\\uze\\a.ex",0) then end if ­1.0 and this is a bezier curve program include graphics.e include machine.e include mouse.e -- include truecolr.e use_vesa(1) if graphics_mode(18) then end if atom b1,b2,b3,b4 ,x1,x2,x3,x4,y1,y2,y3,y4 x1=50 x2=150 x3=200 x4=250 y1=400 y2=50 y3=300 y4=350 procedure stall() for time_lag = 1 to 2500000 do end for end procedure procedure dun() if get_key()=27 then abort(0) end if mouse_pointer(0) mouse_events(2) if sequence(get_mouse()) then abort(1) end if if get_key()=27 then abort(0) end if end procedure procedure draw_it() for u = .01 to 1.52 by .001 do ---- was 0 to 1 by .01 if get_key()=27 then abort(0) end if dun() pixel(rand(5),{u*u*u*(x4+3*(x2-x3)-x1)+3*u*u*(x1-2*x2+x3)+3*u*(x2-x1)+x1, u*u*u*(y4+3*(y2-y3)-y1)+3*u*u*(y1-2*y2+y3)+3*u*(y2-y1)+y1}) dun() stall() if get_key() = 27 then abort(0) end if end for end procedure while get_key() != 27 do dun() draw_it() end while and this is a program with many beziers . Bezier Curves is a Windows XP Screen Saver Program. I am trying to write "it" in the Euphoria language !! include graphics.e include machine.e include mouse.e --include truecolr.e use_vesa(1) if graphics_mode(18) then end if atom x1,x2,x3,x4,y1,y2,y3,y4 x1=50 x2=20 x3=150 x4=400 y1=100 y2=200 y3=400 y4=300 procedure stall() for time_lag = 1 to 225000000 do end for end procedure procedure dun() if get_key()=27 then abort(1) end if mouse_pointer(0) mouse_events(2) if sequence(get_mouse()) then abort(1) end if if get_key()=27 then abort(1) end if end procedure procedure draw_it() for t = 0 to 1.0952 by .0001 do dun() if get_key() = 27 then abort(1) end if pixel(rand(15),{((1-t)*(1-t)*(1-t)*x1+.123*(1-t)*(1-t)*t*x2+3*(1-t)*t*t*x3+t*t*t*x4), (1-t)*(1-t)*(1-t)*y1+3*(1-t)*(1-t)*t*y2+.53*(1-t)*t*t*y3+t*t*t*y4}) dun() if get_key() = 27 then abort(1) end if end for stall() x1=rand(600) x2=rand(600) x3=rand(600) x4=rand(600) y1=rand(500) y2=rand(500) y3=rand(500) y4=rand(500) end procedure while get_key() != 27 do if get_key() = 27 then abort(1) end if draw_it() end while Any help ? I just would like to have a turning point when the curve reaches a top bottom ?? Hope the above proves I am not mucking around !! Les.R. -= B E G I N =- X-EUFORUM: 20911 Date: 2008 May 13 13:32 From: Fernando Bauer <fmbauer at ho?mail.co?> Subject: Re: Goto Examples? Derek Parnell wrote: > > Fernando Bauer wrote: > I'm not 100% sure I understood the flow, but here is my goto-less attempt. > > ... > label AA > while 1 do > -- Show A > key = get_key() > if (key = BACK) then exit AA end if > ... > label BB > while 1 do > -- Show B > key = get_key() > if (key = BACK) then next AA end if > ... > label CC > while 1 do > -- Show C > key = get_key() > if (key = BACK) then next BB end if > ... > end while > end while > end while > return Ok, thanks! It's better than my original version. When I wrote it I was only considering the use of statements without labels (Eu3.2). However, the nested while loops structure remains and IMHO it's not as elegant and simple as the 'goto' solution. > > > This solution with 'goto' is cleaner and more simple: > > I think your 'goto' version has a few 'while loops' omitted, no? No. Could you clarify your point? I've been using that kind of structure in several projects for many years. > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell Regards, Fernando P.S.: I'm not proposing the implementation of goto, I was just replying to a question from Jeremy. -= B E G I N =- X-EUFORUM: 20912 Date: 2008 May 13 13:33 From: Jason Gade <jaygade at ?ahoo.co?> Subject: Re: New keywords: ifdef, elsifdef, end ifdef Jeremy Cowgar wrote: > > Matt Lewis wrote: > > > > This being the Internet and all, I'm going to pick on your arbitrary > > example for the sake of argumentativeness: > > > > I wanted to merely show you could make different functions under an ifdef statement, that's all. My > examples aren't always proper coding, such as the loop var names being a, b, c :-) > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Heh, I was just picking on your choice of examples, using meaningful names as labels vice single letter loop variables, thereby making the label examples look a lot better. :-) -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20913 Date: 2008 May 13 13:40 From: Shawn Pringle <shawn.pringle at gmai??com> Subject: Re: Goto? a read opinion Jeremy, Please look at the wiki article http://en.wikipedia.org/goto and click on the links to Edsger Dijkstra's article, and Donald Knuth's article. To read what the arguments of the experts. To find examples of goto you can look at basic programs. There is lots of basic source around and they use goto. I downloaded one that gives us the sunrise times. It used goto four times. Each time, it would be easy to replace with if/then/end-if blocks if you wanted to translate to EUPHORIA 3.1. With goto you can jump out of a nested for/if/for/if <eucode> for i = 1 to length(s) do if sequence(s[i]) then for j = 1 to length(s[i]) do if sequence(s[i]) then goto foo end if end for end if end for foo: puts(1,"hello\n") </eucode> Just because I can come up with code that could use goto, doesn't mean real code designed with a purpose will need goto. Let's read these two opposing articles to get an informed opinion. Shawn Pringle -= B E G I N =- X-EUFORUM: 20914 Date: 2008 May 13 13:54 From: Jason Gade <jaygade at ya??o.com> Subject: Re: Benchmarks Yeah, you should use the ones that have been created so far: http://www.rapideuphoria.com/shootout.zip I kinda lost interest in continuing to develop it when they didn't want to include Euphoria in the "official" shootout. But there are some pretty good tests in there. Not all of them written by me. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20915 Date: 2008 May 13 14:01 From: Jeremy Cowgar <jeremy at cow??r.com> Subject: Re: Goto? a read opinion Shawn Pringle wrote: > > Please look at the wiki article http://en.wikipedia.org/goto > and click on the links to Edsger Dijkstra's article, and > Donald Knuth's article. To read what the arguments of the > experts. I have not read either of those. I am aware of several problems with goto and I am not advocating or against it. The articles you are referencing I think are a bit invalid as one was created in 1968 and was taking a stance against languages that only had a goto statements for any real branching/looping. The wikipedia article states: "The GOTO statement has been the target of much continued criticism and debate, with the primary negative claim being that use of GOTO results in unreadable and generally unmaintainable "spaghetti code". As structured programming became more popular in the 1960s and 1970s, many computer scientists came to the conclusion that programs should always use so-called 'structured' flow-control commands such as loops and if-then-else statements in place of GOTO. Even today some programming style coding standards forbid the use of GOTO statements using similar rationales. In defense of GOTO statements, others have noted that the restrained use of GOTO does not necessarily lead to poor quality code, and also argue that there are some tasks that cannot be straightforwardly accomplished in many programming languages without the use of one or more GOTO statements, such as implementing finite state machines, breaking out of nested loops and exception handling." I just wanted the community to talk about it. I'll read them, but adding goto or not adding goto is not my decision. I merely brought it up in light of a few conversions we have had in the past and we are currently talking about possible improvements. > Just because I can come up with code that could use goto, > doesn't mean real code designed with a purpose will need > goto. Let's read these two opposing articles to get an > informed opinion. > I think my original question was "Does anyone have examples of where goto is better than existing syntax?" So, I was wanting the goto crowd to come up with examples that goto would be better than anything we have, thus, justify goto. If no one could come up with an example of why goto is better than anything we have, then why create it? That was my thought. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20916 Date: 2008 May 13 14:04 From: Jeremy Cowgar <jeremy at ?owgar.co?> Subject: Re: Benchmarks Jason Gade wrote: > > I kinda lost interest in continuing to develop it when they didn't want to include > Euphoria in the "official" shootout. But there are some pretty good tests in > there. > Jason, why did they not want to include it? In TIOBE index we are currently #47 in popularity and there are languages below that existing in the official shootout. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20917 Date: 2008 May 13 14:06 From: Jason Gade <jaygade at ??hoo.com> Subject: Re: Benchmarks Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > I kinda lost interest in continuing to develop it when they didn't want to include > > Euphoria in the "official" shootout. But there are some pretty good tests in > > there. > > > > Jason, why did they not want to include it? In TIOBE index we are currently > #47 in popularity and there are languages below that existing in the official > shootout. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Maybe because I didn't sell it enough... I'd have to fish out the old emails again. The guy did email me back several months later and say that he was impressed with the amount of tests that had been coded, and that they had some newer tests, but he still wasn't interested in including Euphoria in the list. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20918 Date: 2008 May 13 14:10 From: Jeremy Cowgar <jeremy at c?wgar.co?> Subject: Re: Benchmarks Jason Gade wrote: > > Maybe because I didn't sell it enough... I'd have to fish out the old emails > again. > > The guy did email me back several months later and say that he was impressed > with the amount of tests that had been coded, and that they had some newer tests, > but he still wasn't interested in including Euphoria in the list. > I think we should probably wait for Eu 4.0 to be released, (2nd generation of open source Euphoria), update the tests, add new ones that are not implemented and try again. We have to be able to interest him in it. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20919 Date: 2008 May 13 14:11 From: c.k.lester <euphoric at ckles??r.com> Subject: Re: Benchmarks Jason Gade wrote: > > The guy did email me back several months later and say that he was impressed > with the amount of tests that had been coded, and that they had some newer tests, > but he still wasn't interested in including Euphoria in the list. So it was just some arbitrary decision by one guy? He wouldn't have to do any work to include it, either, except maybe a link or two. Wow. What an *censored*. -= B E G I N =- X-EUFORUM: 20920 Date: 2008 May 13 14:18 From: Dan Moyer <danielmoyer at prodigy?n?t> Subject: Re: [Win21Lib] is list open? (duh, [Win32Lib] !) CChris wrote: > > Dan Moyer wrote: > > > > > > Whoops, of course I meant Win32Lib, fingers just went too far. > > > > Dan > > Not directly, but... > <eucode> > integer list_dropped list_dropped=0 > procedure monitor_list_state(integer id,integer event,sequence s) > if event=w32HDropDown then > list_dropped=1 > else > list_dropped=0 > end if > end procdeure > setHandler(the_list_id,{w32HDropDown,w32HCloseUp},routine_id("monitor_list_state")) > </eucode> > > To all users: is an isDropped(id) routine useful? It would apply to menus,lists, > combos and ComboBoxEx. Returns 1 if id is showing items, else 0. > > CChris > CChris CChris, Looks good! Thanks! Dan -= B E G I N =- X-EUFORUM: 20921 Date: 2008 May 13 14:21 From: Jason Gade <jaygade at ya?oo.?om> Subject: Re: Benchmarks c.k.lester wrote: > > Jason Gade wrote: > > > > The guy did email me back several months later and say that he was impressed > > with the amount of tests that had been coded, and that they had some newer tests, > > but he still wasn't interested in including Euphoria in the list. > > So it was just some arbitrary decision by one guy? He wouldn't have to do > any work to include it, either, except maybe a link or two. > > Wow. What an *censored*. I wouldn't say that, and I'm not sure if it was just one guy. I think there are other people involved in the project. And I understand that they can't include every niche language. Having Euphoria easily installed on Linux will probably help a bit too. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20922 Date: 2008 May 13 14:57 From: Jerry Story <story.jerry at gma??.com> Subject: Re: No more platform(), conditional includes, conditional functions, conditiona How would you get the slash right without platform()? <eucode> if platform() = LINUX then SLASH = "/" else SLASH = "\\" end if </eucode> -= B E G I N =- X-EUFORUM: 20923 Date: 2008 May 13 15:01 From: Dan Moyer <danielmoyer at ?rodigy.?et> Subject: Re: [Win21Lib] is list open? (duh, [Win32Lib] !) Dan Moyer wrote: > > CChris wrote: > > > > Dan Moyer wrote: > > > > > > > > > Whoops, of course I meant Win32Lib, fingers just went too far. > > > > > > Dan > > > > Not directly, but... > > <eucode> > > integer list_dropped list_dropped=0 > > procedure monitor_list_state(integer id,integer event,sequence s) > > if event=w32HDropDown then > > list_dropped=1 > > else > > list_dropped=0 > > end if > > end procdeure > > setHandler(the_list_id,{w32HDropDown,w32HCloseUp},routine_id("monitor_list_state")) > > </eucode> > > > > To all users: is an isDropped(id) routine useful? It would apply to menus,lists, > > combos and ComboBoxEx. Returns 1 if id is showing items, else 0. > > > > CChris > > CChris > > > CChris, > > Looks good! Thanks! > > Dan CChris, I tried your routine, but it won't fire at all on open/close a list. I'm using Eu2.5 and Win32Lib .60-6; maybe I have to have it look at any list event & test inside for w32HDropDown,w32HCloseUp? Maybe they're not in .60-6? Dan -= B E G I N =- X-EUFORUM: 20924 Date: 2008 May 13 15:02 From: Jeremy Cowgar <jeremy at c??gar.com> Subject: Re: No more platform(), conditional includes, conditional functions, condit Jerry Story wrote: > > How would you get the slash right without platform()? > > <eucode> > if platform() = LINUX then > SLASH = "/" > else > SLASH = "\\" > end if > </eucode> Well, two ways... 1, include file.e which defines PATHSEP and also NL depending on platform or 2. almost exactly how you did it, but a new way w/much speed improvements: <eucode> sequence SLASH ifdef LINUX then SLASH = "/" else SLASH = "\\" end ifdef </eucode> This platform check takes place at parse/compile time not during runtime. The difference is described in detail in: http://www.openeuphoria.org/EUforum/m20892.html -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20925 Date: 2008 May 13 15:07 From: Jeremy Cowgar <jeremy at c?w?ar.com> Subject: Re: No more platform(), conditional includes, conditional functions, condit Oh.... and I did not remove platform(). It still stands and probably always well for backward compatability, but the new ifdef platform checks are much better. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20926 Date: 2008 May 13 15:15 From: "Euler German" <eulerg at gmail.com> Subject: Re: Labeled Loops? > On 12 May 2008 at 20:01, Jeremy Cowgar wrote (maybe snipped): > Euler German wrote: > > > > > On 12 May 2008 at 17:01, Jeremy Cowgar wrote (maybe snipped): > > > > > Hm... what about: > > > > > > <eucode> > > > for a = 1 to 10 label "top" do > > > for b = 1 to 10 label "mid" do > > > while 1 do > > > if b = 3 then exit "top" end if > > > if a = 2 then continue "mid" end if > > > end while > > > end for > > > end for > > > </eucode> > > > > > > > I agree if all we need is "breaking" loop laces. But if I need to go > > to "Far Far Away" then probably we'd need "goto". The problem I see > > is that in an Euphorian way, labels should (must?) be declared prior > > to use, just like variables, so this would be a problem in most > > cases. > > No, labels would neither be declared nor usable in anything but a exit > or continue. i.e. > > > <eucode> > while 1 label hello do > ? hello > end while > </eucode> > > You will get a compile error of an unknown variable hello. Their use > in continue and exit will be special uses and will search the loop > stack for the corresponding loop label, not a variable stack or > anything. > Hmmm, I got that. What I was saying "labels" would be part of while and for laces *only*, that is, there'll be no outsiders that could be used, say, for a "goto". Let me go a little further and play the Devil's lawyer. <eucode> while 1 label hello do ... if FALSE exit hello end if ... end while while 1 label hi do ... if FALSE exit hello end if -- note "hello" in place of "hi" ... end while </eucode> I would expect an error as "hello" isn't part of the second loop stack, right? Maybe I'm exaggerating but that is why I don't like labels. They can be easily misplaced. If escape conditions are to be constrained to loops I see very little benefit of using it. > > > > And Jeremy, just trying to understand the concept of "exit" and > > "continue" on the example above: continue "mid" exits the while loop > > and goes to next iteration of "mid" for...end for loop. OTOH, exit > > "top" exits the whole thing and code will continue execution after > > "top" for...end for loop, if any. Did I get it right? Sorry, but I'm > > getting these nouveaut=E9s quite slowly. :) > > > > In the above example... exit "top" exits to the loop with the label > "top". continue "mid" continues with next iteration of the loop > labeled "mid". > Do you mean it'll restart "top" loop from 1? I'm a bit confused. I understand "continue" very clearly. It means (to me) "forget this one, but continue trying with next". But what I get from "exit" is just "left this and go ahead". > We would probably need a special label such as "all" or something that > would exit all loops. > I don't know, really. You guys are light-years ahead of me. But it looks more as shortcuts to gain nanoseconds or ways to get into a hole an emerge in a parallel dimension. Please, don't take this as criticism. I want to contribute with my lack of knowledge so Euphoria still be attractive to newcomers. Best, Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 20927 Date: 2008 May 13 15:19 From: Bernie Ryan <xotron at b?u?frog.com> Subject: Re: No more platform(), conditional includes, conditional functions, condit Jeremy Cowgar wrote: > > Oh.... and I did not remove platform(). It still stands and probably always > well for backward compatability, but the new ifdef platform checks are much > better. Jeremy: Who is making all these decisions about what is included in the interpreter and not in the interpreter ?? I thought you were working on standard libraries. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20928 Date: 2008 May 13 15:28 From: Jeremy Cowgar <jeremy at cowga??com> Subject: Re: No more platform(), conditional includes, conditional functions, condit Bernie Ryan wrote: > > Jeremy: > > Who is making all these decisions about what is included in the > interpreter and not in the interpreter ?? > I thought you were working on standard libraries. > It was discussed here on the forum with great delight. Is there a problem you see with it? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20929 Date: 2008 May 13 15:34 From: Jeremy Cowgar <jeremy at ?owg?r.com> Subject: Re: Labeled Loops? No, labels in this sense would not be used anywhere else, only in loop bodies. There are many situations where it would be helpful to break cleanly out of nested loops. The other method is to setup conditions in the parent loops to watch for a var change in a child loop. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20930 Date: 2008 May 13 15:34 From: Jeremy Cowgar <jeremy at c?wgar?com> Subject: Re: No more platform(), conditional includes, conditional functions, condit Jeremy Cowgar wrote: > > Bernie Ryan wrote: > > > > Jeremy: > > > > Who is making all these decisions about what is included in the > > interpreter and not in the interpreter ?? > > I thought you were working on standard libraries. > > > > It was discussed here on the forum with great delight. Is there a problem you > see with it? Bernie, It has also been a long standing request on SF page and in the archives many people have made pre-processors. The desire is great and the benefit irrefutable. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20931 Date: 2008 May 13 15:58 From: Mike777 <anon4321 at g??il.com> Subject: Re: [Win21Lib] is list open? (duh, [Win32Lib] !) CChris wrote: > > To all users: is an isDropped(id) routine useful? It would apply to menus,lists, > combos and ComboBoxEx. Returns 1 if id is showing items, else 0. Yes. Mike -= B E G I N =- X-EUFORUM: 20932 Date: 2008 May 13 15:59 From: Bernie Ryan <xotron at b?uef?og.com> Subject: Re: No more platform(), conditional includes, conditional functions, condit > > It has also been a long standing request on SF page and in the archives many > people have made pre-processors. The desire is great and the benefit irrefutable. > > -- Jeremy: You used the word ' I ' implying that you were making the decisions. about keeping or not keeping platform() The if/ifdef/then requires that a user needs to inform the program what operating system the code is using by command line or typing a a constant at the top of the program. Platform() is automatic and requires no interaction by the user. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20933 Date: 2008 May 13 16:10 From: Jeremy Cowgar <jeremy at c?wga?.com> Subject: Re: No more platform(), conditional includes, conditional functions, condit Bernie Ryan wrote: > > Jeremy: > You used the word ' I ' implying that you were making the decisions. > about keeping or not keeping platform() > Because I wrote the code, I addressed it as I did not remove platform(). Not that I ever would. I wrote the subject title that was misleading "No more platform()" so I said I did not remove platform(). > The if/ifdef/then requires that a user needs to inform the program > what operating system the code is using by command line or typing a > a constant at the top of the program. > Platform() is automatic and requires no interaction by the user. Now, did you actually read any of the examples or how to use the new ifdef that I spent time in writing? I specifically stated that there are defines that the system defines *itself*. Those are what version of euphoria your code is being written on and what platform you are running on. Please go back and read this post: http://www.openeuphoria.org/EUforum/m20891.html Pay specific attention to the examples, and also the overview which states clearly: 3. Predefined "defines" 2a..... Current operating system (WIN32, DOS32, LINUX, FREEBSD) 2b..... Current Euphoria version (EU400) -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20934 Date: 2008 May 13 16:45 From: Dan Moyer <danielmoyer at ?rodigy?net> Subject: [Win32Lib] monitor_list_state procedure not fire? CChris wrote: > > Dan Moyer wrote: > > > > > > Whoops, of course I meant Win32Lib, fingers just went too far. > > > > Dan > > Not directly, but... > > integer list_dropped list_dropped=0 > procedure monitor_list_state(integer id,integer event,sequence s) > if event=w32HDropDown then > list_dropped=1 > else > list_dropped=0 > end if > end procdeure > setHandler(the_list_id,{w32HDropDown,w32HCloseUp},routine_id("monitor_list_state")) > > > To all users: is an isDropped(id) routine useful? It would apply to menus,lists, > combos and ComboBoxEx. Returns 1 if id is showing items, else 0. > > CChris > CChris CChris, I tried your routine, but it won't fire at all for me on open/close a list. I'm using Eu2.5 and Win32Lib .60-6; maybe I have to have it look at any list event & test inside for w32HDropDown,w32HCloseUp? Maybe they're not in .60-6? Dan -= B E G I N =- X-EUFORUM: 20935 Date: 2008 May 13 17:04 From: CChris <christian.cuvier at ?griculture.gouv.f?> Subject: Re: [Win32Lib] monitor_list_state procedure not fire? Dan Moyer wrote: > > CChris wrote: > > > > Dan Moyer wrote: > > > > > > > > > Whoops, of course I meant Win32Lib, fingers just went too far. > > > > > > Dan > > > > Not directly, but... > > > > integer list_dropped list_dropped=0 > > procedure monitor_list_state(integer id,integer event,sequence s) > > if event=w32HDropDown then > > list_dropped=1 > > else > > list_dropped=0 > > end if > > end procdeure > > setHandler(the_list_id,{w32HDropDown,w32HCloseUp},routine_id("monitor_list_state")) > > > > > > To all users: is an isDropped(id) routine useful? It would apply to menus,lists, > > combos and ComboBoxEx. Returns 1 if id is showing items, else 0. > > > > CChris > > CChris > > CChris, > > I tried your routine, but it won't fire at all for me on open/close a list. > > I'm using Eu2.5 and Win32Lib .60-6; maybe I have to have it look at > any list event & test inside for w32HDropDown,w32HCloseUp? Maybe they're > not in .60-6? > > Dan Hmph. Works for ComboBox[Ex], but not for dropdown lists. I'll check what I can do about it. CChis -= B E G I N =- X-EUFORUM: 20936 Date: 2008 May 13 17:15 From: Dan Moyer <danielmoyer at p?odigy.n?t> Subject: Re: [Win32Lib] monitor_list_state procedure not fire? CChris wrote: > > Dan Moyer wrote: > > > > CChris wrote: > > > > > > Dan Moyer wrote: > > > > > > > > > > > > Whoops, of course I meant Win32Lib, fingers just went too far. > > > > > > > > Dan > > > > > > Not directly, but... > > > > > > integer list_dropped list_dropped=0 > > > procedure monitor_list_state(integer id,integer event,sequence s) > > > if event=w32HDropDown then > > > list_dropped=1 > > > else > > > list_dropped=0 > > > end if > > > end procdeure > > > setHandler(the_list_id,{w32HDropDown,w32HCloseUp},routine_id("monitor_list_state")) > > > > > > > > > To all users: is an isDropped(id) routine useful? It would apply to menus,lists, > > > combos and ComboBoxEx. Returns 1 if id is showing items, else 0. > > > > > > CChris > > > CChris > > > > CChris, > > > > I tried your routine, but it won't fire at all for me on open/close a list. > > > > I'm using Eu2.5 and Win32Lib .60-6; maybe I have to have it look at > > any list event & test inside for w32HDropDown,w32HCloseUp? Maybe they're > > not in .60-6? > > > > Dan > > Hmph. Works for ComboBox[Ex], but not for dropdown lists. I'll check what I > can do about it. > > CChis <grin> thanks! :) Dan -= B E G I N =- X-EUFORUM: 20937 Date: 2008 May 13 17:31 From: Kat <KAT12 at ?oosahs.net> Subject: machine exception in file.e The program ran for 3 days, then crashed with the ex.err on http://pastebin.ca/1017034 Platform is winxp-sp2. I opened a dox box on that dir,and did a listing > dir.txt, which is 3,634,889 bytes long, my average filename len seems to be 44 chars. Dir size is 254,305,792 bytes, 43,989 files, 0 folders. The last filenames written look fine, i can open the dir in Textpad, get a listing, and open the files. So what happened? Kat -= B E G I N =- X-EUFORUM: 20938 Date: 2008 May 13 18:41 From: Jason Gade <jaygade at ?ahoo.com> Subject: Re: machine exception in file.e Kat wrote: > > > The program ran for 3 days, then crashed with the ex.err on > > <a href="http://pastebin.ca/1017034">http://pastebin.ca/1017034</a> > > Platform is winxp-sp2. I opened a dox box on that dir,and did a listing > > dir.txt, which is 3,634,889 bytes long, my average filename len seems to be > 44 chars. Dir size is 254,305,792 bytes, 43,989 files, 0 folders. The last filenames > written look fine, i can open the dir in Textpad, get a listing, and open the > files. > > So what happened? > > Kat Hmm. No one else has answered and I'm not sure how much I can help with the problem without understanding the nature of the machine exception better -- whether it was an access violation or what. My only guess is the interpreter is somehow running out of memory or swap or something, or somehow the interpreter got hold of a bad address and either tried to access it or free it. Which version of Euphoria are you using? Which interpreter are you running -- ex.exe, exw.exe, or exwc.exe? -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20939 Date: 2008 May 13 18:45 From: Kat <KAT12 at coo?a?s.net> Subject: Re: machine exception in file.e Jason Gade wrote: > > Kat wrote: > > > > > > The program ran for 3 days, then crashed with the ex.err on > > > > <a href="http://pastebin.ca/1017034">http://pastebin.ca/1017034</a> > > > > Platform is winxp-sp2. I opened a dox box on that dir,and did a listing > > > dir.txt, which is 3,634,889 bytes long, my average filename len seems to be > > 44 chars. Dir size is 254,305,792 bytes, 43,989 files, 0 folders. The last filenames > > written look fine, i can open the dir in Textpad, get a listing, and open the > > files. > > > > So what happened? > > > > Kat > > Hmm. No one else has answered and I'm not sure how much I can help with the > problem without understanding the nature of the machine exception better -- > whether it was an access violation or what. > > My only guess is the interpreter is somehow running out of memory or swap or > something, or somehow the interpreter got hold of a bad address and either tried > to access it or free it. > > Which version of Euphoria are you using? Which interpreter are you running -- > ex.exe, exw.exe, or exwc.exe? exw.exe v3.1 Kat -= B E G I N =- X-EUFORUM: 20940 Date: 2008 May 13 18:48 From: Jason Gade <jaygade at yah??.com> Subject: Re: machine exception in file.e Did you get a pop-up window from Windows saying that an error has occurred and that exw.exe would be closed and then it gives you a (hex-value) stack trace? Or did you just get an ex.err file? -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20941 Date: 2008 May 13 18:58 From: Jason Gade <jaygade at y?hoo.c?m> Subject: Re: machine exception in file.e Originally I thought it had to do with allocating space for name or for the return value of machine_func(), but maybe something within machine_func(M_DIR) itself? I don't have the source code handy right now. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20942 Date: 2008 May 13 19:05 From: Bernie Ryan <xotron at bluefro?.?om> Subject: Re: machine exception in file.e Kat wrote: > > > The program ran for 3 days, then crashed with the ex.err on > > <a href="http://pastebin.ca/1017034">http://pastebin.ca/1017034</a> > > Platform is winxp-sp2. I opened a dox box on that dir,and did a listing > > dir.txt, which is 3,634,889 bytes long, my average filename len seems to be > 44 chars. Dir size is 254,305,792 bytes, 43,989 files, 0 folders. The last filenames > written look fine, i can open the dir in Textpad, get a listing, and open the > files. > > So what happened? > Kat: Are you running FAT32 or NTFS ?? Remember FAT32 has max size limits and you may have exceeded the limit and not realize that your hidden SWAP file has to be taken into consideration. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 20943 Date: 2008 May 13 20:41 From: CChris <christian.cuvier at a?riculture.?ouv.fr> Subject: Re: [Win32Lib] monitor_list_state procedure not fire? Dan Moyer wrote: > > CChris wrote: > > > > Dan Moyer wrote: > > > > > > CChris wrote: > > > > > > > > Dan Moyer wrote: > > > > > > > > > > > > > > > Whoops, of course I meant Win32Lib, fingers just went too far. > > > > > > > > > > Dan > > > > > > > > Not directly, but... > > > > > > > > integer list_dropped list_dropped=0 > > > > procedure monitor_list_state(integer id,integer event,sequence s) > > > > if event=w32HDropDown then > > > > list_dropped=1 > > > > else > > > > list_dropped=0 > > > > end if > > > > end procdeure > > > > setHandler(the_list_id,{w32HDropDown,w32HCloseUp},routine_id("monitor_list_state")) > > > > > > > > > > > > To all users: is an isDropped(id) routine useful? It would apply to menus,lists, > > > > combos and ComboBoxEx. Returns 1 if id is showing items, else 0. > > > > > > > > CChris > > > > CChris > > > > > > CChris, > > > > > > I tried your routine, but it won't fire at all for me on open/close a list. > > > > > > I'm using Eu2.5 and Win32Lib .60-6; maybe I have to have it look at > > > any list event & test inside for w32HDropDown,w32HCloseUp? Maybe they're > > > not in .60-6? > > > > > > Dan > > > > Hmph. Works for ComboBox[Ex], but not for dropdown lists. I'll check what I > > can do about it. > > > > CChis > > > <grin> thanks! :) > > Dan The events fire correctly now. I'll code isDropped() after dinner I think, it will work now. CChris -= B E G I N =- X-EUFORUM: 20944 Date: 2008 May 13 21:17 From: D. Newhall <derek_newhall at yaho?.?om> Subject: Re: New keywords: ifdef, elsifdef, end ifdef Jeremy Cowgar wrote: > > Ok, in SVN revision 452, there are 2 new keywords. ifdef and elsifdef. The ifdef > is combined with an existing keyword, end, to make a complete set of conditional > compilation keywords. > > A quick rundown: > > 1. Setting defines can be done in 2 ways: > 1a..... with define=debug > ....... this can be given multiple times to define more than one item > 1b..... exu/ecu, ex/exw/exwc/ecw -D debug > ....... -D parameter can be given multiple times to define more than one item > > 2. Clearing defines can be done with without: > 1a..... without define=debug > ....... this turns off the debug define. > > 3. Predefined "defines" > 2a..... Current operating system (WIN32, DOS32, LINUX, FREEBSD) > 2b..... Current Euphoria version (EU400) > > 4. ifdef/elsifdef/end ifdef work on static defines. You cannot execute dynamic > code in your ifdef/elseifdef. > (snip examples) > > All three of the above are dynamic. i.e. it depends on code to be executing, > thus those are decisions that can take place only in the interpreter, not at > parse time. If you need the above, then you use the normal if/elsif/else/end > if statements. > > This is in SVN right now for anyone who wishes to test it, play with it. There > is a unit test added for it: tests/t_condcmp.e ... 672 tests now and counting! > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Now, granted I've just dropped in after not even looking at Euphoria for a year or so, but the above looks really ugly to me. To me, it looks like some bastardized version of C macros. I considered Euphoria to be one of cleanest "scripting languages" around. Granted, it has its occasional rough edges which you quickly got used to (remember when '$' first appeared?) but overall the design of the language and the library is really, really clean. The 'ifdef' and 'elsifdef' statements seem much less clean than the rest of the language. Also, what about such constructs like a 'ifnotdef' or an 'elsedef'? These would also be needed as well and they are even uglier. This is just me, however, and there are worse designs than what's been proposed. Moreover, what I would want in a language is probably not what you would want in one. I think compile-time coding is a terribly important thing (it is actually one of the things that might make me come back to Euphoria) but I would want just that, compile-time coding, not just simple conditional including. (Odd Lisp-influenced tangent follows) In case you don't see what I mean I'll give you an example. (The syntax used was the one from a preprocessor I wrote for my own use a while ago. It just called the Euphoria interpreter after parsing. Everything after a '#' is done at compile time. I'm not saying this syntax is better necessarily (although, I do partially prefer it), I'm just illustrating what would I think would be the "right thing" to do in this case.) This code (which is based on code I actually used in a project) opens a file and puts all the variable/value pairs from each line inside the code itself. <eucode> -- Program code #sequence filenm, line, var_val #integer fn #filenm = "consts.conf" #fn = open(filenm, "r") #line = gets(fn) #while sequence(line) do # var_val = split(line, '\t') -- This "puts the statement in the code" -- (it just puts a string into a buffer) # statement("sequence " & var_val[1]) # statement(var_val[1] & " = " & var_val[2]) # end while -- Program code </eucode> This code was used to allow a user to embed constants and variables in the program so they could use them later on in the code because later on there was some code that allowed the user to specify any include files they wrote to etend the program. I use the Common Lisp equivalent of these constructs every time I code. An alternative syntax could be to stick the compile-time code into a block of some sort, such as: -- Assuming we defined the above code in a procedure... compile_time -- This could instead be 'macro' or anything really read_consts() end compile_time There is of course the argument that supporting this would make the interpreter more complex and perhaps slower is a very valid argument that needs to be considered. There is not, I feel, an argument that such constructs would not be used. It obviously would be used for everything 'ifdef' is intended for plus it could be used for more advanced stuff which some people need (I wrote a preprocessor program so I could this type of programming). Heck, you might even get some Lispers migrate to Euphoria. I don't expect this to ever be supported, I'm just illustrating what I think the "ideal" thing to support would be. Regardless, I still feel that the 'ifdef'and 'elseifdef' constructs need to be revised for the sake of the language's clarity. I still have a deep (if not currently utilized) love for the language and recommend Euphoria to beginning programmers so I'd hate to have something which seems so counter-intuitive to the language's goals included in it. - Derek -= B E G I N =- X-EUFORUM: 20945 Date: 2008 May 13 21:31 From: CChris <christian.cuvier at agriculture.go??.fr> Subject: config.wat in SVN revision 454 Where is it? I replaced it with configure.bat in makefile.wat, but that didn't work well - some warning about unrecognised tokens or unexpected = signs. ifdef is recognised, so I asume exw[c].exe was properly built. test at t_file.e:11 crashes, because the length of an atom is undefined. CChris -= B E G I N =- X-EUFORUM: 20946 Date: 2008 May 13 21:33 From: Kat <KAT12 at coosa?s.ne?> Subject: Re: machine exception in file.e Jason Gade wrote: > > Did you get a pop-up window from Windows saying that an error has occurred and > that exw.exe would be closed and then it gives you a (hex-value) stack trace? > > Or did you just get an ex.err file? L:\wikipedia\euphoria\file.e:100 in function dir() A machine-level exception occurred during execution of this statement ... called from L:\wikipedia\euphoria\splitwiki2.ex:21 in procedure create_direc tory() ... called from L:\wikipedia\euphoria\splitwiki2.ex:161 in procedure split() ... called from L:\wikipedia\euphoria\splitwiki2.ex:218 --> See ex.err Press Enter... -= B E G I N =- X-EUFORUM: 20947 Date: 2008 May 13 21:58 From: Jason Gade <jaygade at ?a?oo.com> Subject: Re: machine exception in file.e Heh. Sorry, I meant other than that... Like this: http://members.aol.com/shobansen3/illegal_operation.gif (That's the quickest one I could find -- I think the XP one is a little different). -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20948 Date: 2008 May 13 22:15 From: Kat <KAT12 at coo?ahs.net> Subject: Re: machine exception in file.e Jason Gade wrote: > > Heh. Sorry, I meant other than that... > > Like this: > <a href="http://members.aol.com/shobansen3/illegal_operation.gif">http://members.aol.com/shobansen3/illegal_operation.gif</a> No, i was putsing to a dos box, so that's where the error msg went, like i copy/pasted in last post. Kat -= B E G I N =- X-EUFORUM: 20949 Date: 2008 May 13 22:54 From: Mike777 <anon4321 at gmail.c??> Subject: Re: New keywords: ifdef, elsifdef, end ifdef D. Newhall wrote: > > Jeremy Cowgar wrote: > > > > Ok, in SVN revision 452, there are 2 new keywords. ifdef and elsifdef. The ifdef > > is combined with an existing keyword, end, to make a complete set of conditional > > compilation keywords. > > > > A quick rundown: > > > > 1. Setting defines can be done in 2 ways: > > 1a..... with define=debug > > ....... this can be given multiple times to define more than one item > > 1b..... exu/ecu, ex/exw/exwc/ecw -D debug > > ....... -D parameter can be given multiple times to define more than one item > > > > 2. Clearing defines can be done with without: > > 1a..... without define=debug > > ....... this turns off the debug define. > > > > 3. Predefined "defines" > > 2a..... Current operating system (WIN32, DOS32, LINUX, FREEBSD) > > 2b..... Current Euphoria version (EU400) > > > > 4. ifdef/elsifdef/end ifdef work on static defines. You cannot execute dynamic > > code in your ifdef/elseifdef. > > > (snip examples) > > > > All three of the above are dynamic. i.e. it depends on code to be executing, > > thus those are decisions that can take place only in the interpreter, not at > > parse time. If you need the above, then you use the normal if/elsif/else/end > > if statements. > > > > This is in SVN right now for anyone who wishes to test it, play with it. There > > is a unit test added for it: tests/t_condcmp.e ... 672 tests now and counting! > > > > -- > > Jeremy Cowgar > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > Now, granted I've just dropped in after not even looking at Euphoria for a year > or so, but the above looks really ugly to me. To me, it looks like some bastardized > version of C macros. > > I considered Euphoria to be one of cleanest "scripting languages" around. Granted, > it has its occasional rough edges which you quickly got used to (remember when > '$' first appeared?) but overall the design of the language and the library > is really, really clean. The 'ifdef' and 'elsifdef' statements seem much less > clean than the rest of the language. Also, what about such constructs like a > 'ifnotdef' or an 'elsedef'? These would also be needed as well and they are > even uglier. > > This is just me, however, and there are worse designs than what's been proposed. > Moreover, what I would want in a language is probably not what you would want > in one. I think compile-time coding is a terribly important thing (it is actually > one of the things that might make me come back to Euphoria) but I would want > just that, compile-time coding, not just simple conditional including. > > > (Odd Lisp-influenced tangent follows) > > In case you don't see what I mean I'll give you an example. (The syntax used > was the one from a preprocessor I wrote for my own use a while ago. It just > called the Euphoria interpreter after parsing. Everything after a '#' is done > at compile time. I'm not saying this syntax is better necessarily (although, > I do partially prefer it), I'm just illustrating what would I think would be > the "right thing" to do in this case.) This code (which is based on code I actually > used in a project) opens a file and puts all the variable/value pairs from each > line inside the code itself. > > <eucode> > -- Program code > #sequence filenm, line, var_val > #integer fn > #filenm = "consts.conf" > #fn = open(filenm, "r") > #line = gets(fn) > #while sequence(line) do > # var_val = split(line, '\t') > -- This "puts the statement in the code" > -- (it just puts a string into a buffer) > # statement("sequence " & var_val[1]) > # statement(var_val[1] & " = " & var_val[2]) > # end while > -- Program code > </eucode> > > This code was used to allow a user to embed constants and variables in the program > so they could use them later on in the code because later on there was some > code that allowed the user to specify any include files they wrote to etend > the program. I use the Common Lisp equivalent of these constructs every time > I code. > > An alternative syntax could be to stick the compile-time code into a block of > some sort, such as: > > -- Assuming we defined the above code in a procedure... > compile_time -- This could instead be 'macro' or anything really > read_consts() > end compile_time > > There is of course the argument that supporting this would make the interpreter > more complex and perhaps slower is a very valid argument that needs to be considered. > There is not, I feel, an argument that such constructs would not be used. It > obviously would be used for everything 'ifdef' is intended for plus it could > be used for more advanced stuff which some people need (I wrote a preprocessor > program so I could this type of programming). Heck, you might even get some > Lispers migrate to Euphoria. > > > I don't expect this to ever be supported, I'm just illustrating what I think > the "ideal" thing to support would be. Regardless, I still feel that the 'ifdef'and > 'elseifdef' constructs need to be revised for the sake of the language's clarity. > I still have a deep (if not currently utilized) love for the language and recommend > Euphoria to beginning programmers so I'd hate to have something which seems > so counter-intuitive to the language's goals included in it. Derek, Unless I am not understanding, your construct seems to miss the entire point of the exercise. In the version proposed by Jeremy, you end up modifying the code which is sent to the compiler. If the code isn't there, it doesn't run. If it doesn't run, it doesn't slow down the execution. Further, it provides for various levels of conditional compiles effortlessly. For example, someone might have a Trial version and a regular version of their program. With Jeremy's construct, the Trial version is compiled without the regular version's code (in places where the code is different, of course), thereby absolutely ensuring that no reverse engineering of any sort can discover things intended to be undiscovered by the programmer. With your construct, all you have done is allowed the program to run its various tests with the knowledge the they will succeed or fail based on reference to an outside configuration file. But the tests themselves must interrogate the resulting variables in order to decide what to do. I admit that it has been over 30 years since I dabbled in LISP (and the current incarnation probably has little resemblance to what I struggled with at university), but I think you are looking at this a bit differently than the way it is intended to be viewed. Mike -= B E G I N =- X-EUFORUM: 20950 Date: 2008 May 13 23:54 From: Jeremy Cowgar <jeremy at cow?ar.c?m> Subject: Re: New keywords: ifdef, elsifdef, end ifdef D. Newhall wrote: > > Now, granted I've just dropped in after not even looking at Euphoria for a year > or so, but the above looks really ugly to me. To me, it looks like some bastardized > version of C macros. Yes, but I'm not sure I see that as a problem? > I considered Euphoria to be one of cleanest "scripting languages" around. Granted, > it has its occasional rough edges which you quickly got used to (remember when > '$' first appeared?) but overall the design of the language and the library > is really, really clean. The 'ifdef' and 'elsifdef' statements seem much less > clean than the rest of the language. Also, what about such constructs like a > 'ifnotdef' or an 'elsedef'? These would also be needed as well and they are > even uglier. Hm, what's wrong with <eucode> ifdef !debug then -- code end ifdef </eucode> Oh, also there is the else statement that works as every Euphoria programmer already knows (because the whole ifdef is modeled after if statements afterall): <eucode> ifdef debug then puts(1, "Debug version\n") else puts(1, "Release version\n") end ifdef </eucode> No need for a elseifdef. We would want to introduce less keywords to make it easier for the programmer and faster in the parsing. > This is just me, however, and there are worse designs than what's been proposed. > Moreover, what I would want in a language is probably not what you would want > in one. I think compile-time coding is a terribly important thing (it is actually > one of the things that might make me come back to Euphoria) but I would want > just that, compile-time coding, not just simple conditional including. What has been provided with the ifdef/elsifdef *is* conditional compilation. It really has nothing to do with conditional including. Conditional includes is just a side effect that was planned to occur with the design. > (Odd Lisp-influenced tangent follows) > > In case you don't see what I mean I'll give you an example. (The syntax used > was the one from a preprocessor I wrote for my own use a while ago. It just > called the Euphoria interpreter after parsing. Everything after a '#' is done > at compile time. I'm not saying this syntax is better necessarily (although, > I do partially prefer it), I'm just illustrating what would I think would be > the "right thing" to do in this case.) This code (which is based on code I actually > used in a project) opens a file and puts all the variable/value pairs from each > line inside the code itself. Hm. If it is not better necessarily, can you please give me an example of what is better so I may be able to change ifdef/elsifdef to be better as well? > <eucode> > -- Program code > #sequence filenm, line, var_val > #integer fn > #filenm = "consts.conf" > #fn = open(filenm, "r") > #line = gets(fn) > #while sequence(line) do > # var_val = split(line, '\t') > -- This "puts the statement in the code" > -- (it just puts a string into a buffer) > # statement("sequence " & var_val[1]) > # statement(var_val[1] & " = " & var_val[2]) > # end while > -- Program code > </eucode> > > This code was used to allow a user to embed constants and variables in the program > so they could use them later on in the code because later on there was some > code that allowed the user to specify any include files they wrote to etend > the program. I use the Common Lisp equivalent of these constructs every time > I code. I am sorry, but I do not follow the syntax or what the above example is doing. Can you give me an example of what the input is and then what the output is? i.e. what is sent to the pre-processor then what is passed on to the interpreter/translator? > An alternative syntax could be to stick the compile-time code into a block of > some sort, such as: > > -- Assuming we defined the above code in a procedure... > compile_time -- This could instead be 'macro' or anything really > read_consts() > end compile_time Yes, in the ifdef/elsifdef scheme, there is no execution involved of any code, however, I treat that as a feature which keeps Euphoria simple, also keeps it lightning fast. > There is of course the argument that supporting this would make the interpreter > more complex and perhaps slower is a very valid argument that needs to be considered. I wouldn't worry about the complexity too much, as long as it is maintainable code, but the performance is certainly a major concern. One of the things that makes Euphoria so attractive to many is it is just about the fastest scripting language out there and on top of that, it compiles to a real binary! How cool! Now, when you introduce a pre-processor into the stage, that's when things can begin to slow down. As with C, it's not a big deal because the pre-processor takes place only during the compilation. Then when the user uses the application, it's compiled. It really does not matter how much the C pre-processor slows the compilation down because for the most part, you do not care how long it takes C to compile (within reason, i.e. I know applications that take 6-8 hours to compile, introducing even a slight delay in the compiler at those times, makes a huge difference, but most of us (myself included) never have to deal with such a huge app). When it comes to Euphoria the use of the pre-processor has a huge impact. Each time the user runs the script, it is effected. If you have a large Euphoria application the delay of execution would be very noticeable. The pre-processor has to load all the code, scan it for it's own tokens, do string replacements (in your case execute some code as well to come up with results), then reconstruct the source and presumably write back to disk a new processed application in which the Euphoria interpreter is then called on. Now where it gets worse is that the pre-processor has to run on everyones code all the time. It has no idea if the user used any preprocessor tokens that it should process until it looks. The argument could be made that the user could pass a command line parameter, such as -pp, but then you have the whole compatibility of libraries the user may depend on. Does it need the pre-processor? Thus, it is always a performance hit. The ifdef/elsifdef keywords scheme has no such problem. It is only invoked when the normal parser comes across an ifdef statement. The parser then does 1 if statment check internally to determine if the nested block should be emitted to IL (or C) or not. All conditions are short circuited. So, if the first condition in a multiple condition ifdef/elsifdef statement is true, then the code is emited as normal, w/no injection of speed processing what-so-ever. It simply returns control to the parser and it continues it's parsing as normal. This is the same way any statement works in Euphoria. Now, where the real speed increase comes in is when a statement is false. When a statement is false, then the ifdef/elsifdef command eats all tokens until it finds the next condition to check. If that condition is false as well (or if it found a true condition already), then ifdef/elsifdef contiunes to eat tokens until it finally finds an end ifdef. This "eating" takes place as ultra-speed. > There is not, I feel, an argument that such constructs would not be used. It > obviously would be used for everything 'ifdef' is intended for plus it could > be used for more advanced stuff which some people need (I wrote a preprocessor > program so I could this type of programming). Heck, you might even get some > Lispers migrate to Euphoria. > > > I don't expect this to ever be supported, I'm just illustrating what I think > the "ideal" thing to support would be. Regardless, I still feel that the 'ifdef'and > 'elseifdef' constructs need to be revised for the sake of the language's clarity. Can you please give a bit clearer of an example or explain better what the above example does? > I still have a deep (if not currently utilized) love for the language and recommend > Euphoria to beginning programmers so I'd hate to have something which seems > so counter-intuitive to the language's goals included in it. > What do you think is counter-intuitive and how is ifdef/elsifdef against the language goals? I am not arguing, I am trying to learn. Now about being able to introduce conditional compile time constants, ifdef/elsifdef can do that fine. It can also introduce compile time variables. It cannot dynamically execute code and insert the result of that said code during parsing time (if that's what your above example did, I'm still a bit unclear about it). <eucode> sequence version ifdef shareware_edition then constant SHAREWARE = 1 version = "1.0 Shareware" else constant SHAREWARE = 0 version = "1.0 Registered" end ifdef </eucode> Now, the above code is not a good example of how to protect your application, I'm just using it as an example. Now, you can certainly change how a variable is initialized dynamically once the code begins to execute: <eucode> sequence version ifdef shareware_edition then version = shareware_version() else version = registered_version() end ifdef </eucode> Thank you for your input, I am looking forward to more about how to make things better yet. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20951 Date: 2008 May 14 0:24 From: Kat <KAT12 at coosahs.?e?> Subject: request for 4.0 Is it possible to add a keyword or three to augment the filesystem commands we already have? For instance, seek() accepts only maxint, which means i can seek only 1/4 the way into the file i have here. And from what i understand, passing a bigger value to seek() won't work. So how about seek_more() or seek_skip() or seek_large() to call code in the OS to manage the numbers over maxint, so Eu doesn't see them and roll them into floating points? That way, to seek 6 gigabytes into a file, i can seek(4000000000) and then seek_large(2000000000). Kat -= B E G I N =- X-EUFORUM: 20952 Date: 2008 May 14 0:31 From: Jeremy Cowgar <jeremy at c?wga?.com> Subject: Re: config.wat in SVN revision 454 I think config.wat needs to be: PWD=FULL PATH TO 4.0 sources DIRECTORY and if you are building with Euphoria 3.x (i.e. no 4.0 installed yet), then you need to add: EU3=1 So, an example may be: EU3=1 PWD=C:\eu40\source Matt may be able to provide more information. configure.bat should have created this for you, however, we did discover that Win98 doesn't have some of the commands used in configure.bat, so, it's still a bit unstable still. Sorry about that. There have been a few tweaks to the build system the past few days trying to make it build easily for everyone. Matt has a few ideas that will make it very easy to build Eu 4.0 even w/o an existing Euphoria install. However, it is not yet in SVN. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20953 Date: 2008 May 14 1:01 From: Jason Gade <jaygade at yahoo??om> Subject: Re: request for 4.0 Kat wrote: > > > Is it possible to add a keyword or three to augment the filesystem commands > we already have? For instance, seek() accepts only maxint, which means i can > seek only 1/4 the way into the file i have here. And from what i understand, > passing a bigger value to seek() won't work. So how about seek_more() or seek_skip() > or seek_large() to call code in the OS to manage the numbers over maxint, so > Eu doesn't see them and roll them into floating points? That way, to seek 6 > gigabytes into a file, i can seek(4000000000) and then seek_large(2000000000). > > Kat This seems to be more a limitation of the underlying C library than of Euphoria itself. (I browsed the source to make sure.) Euphoria should be able to seek into a file up to four gigabytes. We'd probably have to look into more platform-specific methods of seeking into a file to expand seek's parameters past 32 bits. Wow, Kat. You really know how to push the limits, eh? :-) -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20954 Date: 2008 May 14 1:58 From: Jeremy Cowgar <jeremy at co?gar?com> Subject: Exiting multiple loop constructs We've talked about labeled loops and a bit about existing loop constructs, exiting loops, etc... but I do not think we came to any conclusive decision. Here is a summary of different methods of exiting multiple loops: <eucode> integer in_top in_top = 1 while in_top do for i = 1 to 10 do if i = 3 then in_top = 0 exit end if end for end while </eucode> This will work fine unless you have processing *under* the nested loop, then you must provide an extra condition check (which is in a loop and is executed each iteration): <eucode> integer in_top in_top = 1 while in_top do for i = 1 to 10 do if i = 3 then in_top = 0 exit end if end for if in_top = 0 then exit end if -- do more processing here end while </eucode> NOTE: The above two methods compound in complexity with each nested loop you add. However, in real life, I'm not sure if I have ever programmed a loop that is 3 deep. This method uses optional numeric methods to exit and continue keywords: <eucode> while 1 do for i = 1 to 10 do if i = 3 then exit 2 -- end if end for end while </eucode> Notice "exit 2". That means exit 2 loops. The final method is labeled loops, in which I will make a slightly more advanced example. <eucode> while 1 label top do for i = 1 to 10 label mid do for j = 1 to 10 label bottom do -- exit current loop "to" the top loop if j = 2 then exit top end if -- exit all loops (in this function) if j = 5 then exit all end if end for end for end while </eucode> So. Is one clearer than another? I do not know. Should any syntax change to support exiting multiple loops? I am not sure, the benefit is you can remove multiple checks making code easier to write and better performing. So, what do you think? Are there other ways that I missed? What should be done? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20955 Date: 2008 May 14 2:15 From: Kat <KAT12 at coo?ahs.?et> Subject: Re: Exiting multiple loop constructs Jeremy Cowgar wrote: > > We've talked about labeled loops and a bit about existing loop constructs, exiting > loops, etc... but I do not think we came to any conclusive decision. Here is > a summary of different methods of exiting multiple loops: > > <eucode> > integer in_top > in_top = 1 > > while in_top do > for i = 1 to 10 do > if i = 3 then > in_top = 0 > exit > end if > end for > end while > </eucode> > > This will work fine unless you have processing *under* the nested loop, then > you must provide an extra condition check (which is in a loop and is executed > each iteration): > > <eucode> > integer in_top > in_top = 1 > > while in_top do > for i = 1 to 10 do > if i = 3 then > in_top = 0 > exit > end if > end for > if in_top = 0 then > exit > end if > -- do more processing here > end while > </eucode> > > NOTE: The above two methods compound in complexity with each nested loop you > add. However, in real life, I'm not sure if I have ever programmed a loop that > is 3 deep. > > This method uses optional numeric methods to exit and continue keywords: > > <eucode> > while 1 do > for i = 1 to 10 do > if i = 3 then exit 2 -- end if > end for > end while > </eucode> > > Notice "exit 2". That means exit 2 loops. > > The final method is labeled loops, in which I will make a slightly more advanced > example. > > <eucode> > while 1 label top do > for i = 1 to 10 label mid do > for j = 1 to 10 label bottom do > -- exit current loop "to" the top loop > if j = 2 then exit top end if > > -- exit all loops (in this function) > if j = 5 then exit all end if > end for > end for > end while > </eucode> > > > So. Is one clearer than another? I do not know. Should any syntax change to > support exiting multiple loops? I am not sure, the benefit is you can remove > multiple checks making code easier to write and better performing. > > So, what do you think? Are there other ways that I missed? What should be done? I prefer : <eucode> while 1 do -- label top for i = 1 to 10 do -- label mid for j = 1 to 10 do -- label bottom -- exit current loop "to" the top loop if j = 2 then exit top end if -- exit all loops (in this function) if j = 5 then exit all end if end for end for end while </eucode> or <eucode> while 1 do for i = 1 to 10 do for j = 1 to 10 do -- exit current loop "to" the top loop if j = 2 then goto whereiwanto end if -- exit all loops (in this function) if j = 5 then goto whereiwantonow end if end for end for end while </eucode> Kat -= B E G I N =- X-EUFORUM: 20956 Date: 2008 May 14 2:19 From: Jason Gade <jaygade at yahoo??om> Subject: Re: Exiting multiple loop constructs My only real concern is the placement of the "label" statement. Not sure where it should go to be most clear. I don't like the "all" option, you should know the label of the highest level you are exiting. No need for a predefined label, IMO. I'm not sure what kinds of stack cleanup/unwinding would need to be done in order to prevent memory/resource leaks and/or fill up the interpreter's stack with data from exited loops. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20957 Date: 2008 May 14 2:22 From: c.k.lester <euphoric at ckles?er.co?> Subject: Re: Exiting multiple loop constructs Jeremy Cowgar wrote: > > This method uses optional numeric methods to exit and continue keywords: Bad because of code maintenance/updating. > The final method is labeled loops, in which I will make a slightly more advanced > example. If loops are going to be exited from, labels should do the trick. From what I've seen, it's likely that inner loops won't be labeled. People always seem to want to exit out of loops that are further away. -= B E G I N =- X-EUFORUM: 20958 Date: 2008 May 14 2:44 From: Derek Parnell <ddparnell at bi??ond.com> Subject: Re: Exiting multiple loop constructs I reject the 'numbered' loop approach due to the added work it requires during maintenance. > The final method is labeled loops, in which I will make a slightly more advanced > example. > > <eucode> > while 1 label top do > for i = 1 to 10 label mid do > for j = 1 to 10 label bottom do > -- exit current loop "to" the top loop > if j = 2 then exit top end if > > -- exit all loops (in this function) > if j = 5 then exit all end if > end for > end for > end while > </eucode> You seem to be saying that 'exit' means 'exit TO' rather than the existing meaning of 'exit FROM'. To me, the label identifies a loop and the 'exit <name>' construct means 'stop executing code in the loop called <name> and commence at the next statement after the loop's "end" statement' and it should not mean 'proceed immediately to the start of the loop called <name> and increment the counter'. That is the meaning of the 'next' keyword. In short ... ... 'exit' should mean EXIT FROM the (named) loop. ... 'next' should mean begin the NEXT iteration of the (named) loop. ... 'retry' should mean RETRY the same iteration of the (named) loop. So I would rewrite your eaxmple as ... <eucode> while 1 label top do for i = 1 to 10 label mid do for j = 1 to 10 label bottom do -- stop processing current loop and go to the top loop if j = 2 then next top end if -- exit current loop and go to end of mid loop if j = 4 then exit mid end if -- exit all loops (in this function) if j = 5 then exit all end if end for end for end while </eucode> > Should any syntax change to support exiting multiple loops? Huh? Do you mean exiting from deeply nested loops or are you referring to something else. In any case the 'exit all' phrase is a bit redundant because, as per your example, one could code 'exit top' and the topmost loop is labelled. I'm thinking that the 'label' syntax is just too easy to overlook as it makes the code seem cluttered. Maybe using some punctuation might help make it stand out? <eucode> while 1 :top: do for i = 1 to 10 :mid: do for j = 1 to 10 :bottom: do </eucode> <eucode> while 1 @top do for i = 1 to 10 @mid do for j = 1 to 10 @bottom do </eucode> I do think that the label needs to be to the left of the 'do' but maybe it can actually be to the left of the loop statement. <eucode> @top while 1 do @mid for i = 1 to 10 do @bottom for j = 1 to 10 do </eucode> because then it could be made to standout even more by placing it on its own line ... <eucode> @top while 1 do @mid for i = 1 to 10 do @bottom for j = 1 to 10 do </eucode> -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20959 Date: 2008 May 14 2:51 From: "Euler German" <eulerg at gmail.com> Subject: Re: Exiting multiple loop constructs > On 13 May 2008 at 18:58, Jeremy Cowgar wrote (maybe snipped): > We've talked about labeled loops and a bit about existing loop > constructs, exiting loops, etc... but I do not think we came to any > conclusive decision. Here is a summary of different methods of exiting > multiple loops: > > <eucode> > integer in_top > in_top = 1 > > while in_top do > for i = 1 to 10 do > if i = 3 then > in_top = 0 > exit > end if > end for > end while > </eucode> > > This will work fine unless you have processing *under* the nested > loop, then you must provide an extra condition check (which is in a > loop and is executed each iteration): > > <eucode> > integer in_top > in_top = 1 > > while in_top do > for i = 1 to 10 do > if i = 3 then > in_top = 0 > exit > end if > end for > if in_top = 0 then > exit > end if > -- do more processing here > end while > </eucode> > > NOTE: The above two methods compound in complexity with each nested > loop you add. However, in real life, I'm not sure if I have ever > programmed a loop that is 3 deep. > > This method uses optional numeric methods to exit and continue > keywords: > > <eucode> > while 1 do > for i = 1 to 10 do > if i = 3 then exit 2 -- end if > end for > end while > </eucode> > > Notice "exit 2". That means exit 2 loops. > > The final method is labeled loops, in which I will make a slightly > more advanced example. > > <eucode> > while 1 label top do > for i = 1 to 10 label mid do > for j = 1 to 10 label bottom do > -- exit current loop "to" the top loop > if j = 2 then exit top end if > > -- exit all loops (in this function) > if j = 5 then exit all end if > end for > end for > end while > </eucode> > > > So. Is one clearer than another? I do not know. Should any syntax > change to support exiting multiple loops? I am not sure, the benefit > is you can remove multiple checks making code easier to write and > better performing. > > So, what do you think? Are there other ways that I missed? What should > be done? > Jeremy, the last method is obviously the best as it provides additional flow control. Alas, I still in doubt about "exit" keyword behavior. I'm sorry to insist, but maybe I should exemplify. <eucode> while 1 label top do +-> ... | for i = 1 to 10 label mid do | for j = 1 to 10 label bottom do | -- exit current loop "to" the top loop | if j = 2 then +------------<- exit top elseif j = 7 then +------------<- continue top | end if | | -- exit all loops (in this function) | if j = 5 then exit all end if ->+ | end for | | end for | +-> ... | end while | ... <---------------------------------------+ </eucode> Did I get it right or should I go after an ice-cream cone to stick it in the head? :P Best, Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 20960 Date: 2008 May 14 3:01 From: Derek Parnell <ddparnell at ?ig?ond.com> Subject: Re: Exiting multiple loop constructs Euler German wrote: > Alas, I still in doubt about "exit" keyword > behavior. I'm sorry to insist, but maybe I should exemplify. I see how it should behave as very different from the diagram the Euler drew. I see it as ... <eucode> while 1 label top do +-> ... | for i = 1 to 10 label mid do | for j = 1 to 10 label bottom do | if j = 2 then | exit top -----------------------+ | elseif j = 7 then | +------------<- continue top | end if | | if j = 5 then exit all end if ->+ | end for | | end for | | end while | | ... <---------------------------------------+ | ... <-----------------------------------------+ </eucode> -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20961 Date: 2008 May 14 3:05 From: Jason Gade <jaygade at yah?o.com> Subject: Re: Exiting multiple loop constructs Gah, I missed that. I agree, Derek, that it should be exit from, not exit to. Derek Parnell wrote: > I'm thinking that the 'label' syntax is just too easy to overlook as it makes > the code seem cluttered. Maybe using some punctuation might help make it stand > out? > > <eucode> > while 1 :top: do > for i = 1 to 10 :mid: do > for j = 1 to 10 :bottom: do > </eucode> > > <eucode> > while 1 @top do > for i = 1 to 10 @mid do > for j = 1 to 10 @bottom do > </eucode> > > I do think that the label needs to be to the left of the 'do' but maybe it can > actually be to the left of the loop statement. > <eucode> > @top while 1 do > @mid for i = 1 to 10 do > @bottom for j = 1 to 10 do > </eucode> > > because then it could be made to standout even more by placing it on its own > line ... > > <eucode> > @top > while 1 do > @mid > for i = 1 to 10 do > @bottom > for j = 1 to 10 do > </eucode> > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell I agree that maybe the label should be before the loop, but I really don't like the punctuation in place of a keyword. I find the word label far easier to read than a decorating symbol, too many of which end up looking like line noise. Maybe crib from other languages again? <eucode> label outer: while count < last_item do label inner: -- can also appear on its own line for i = 1 to length(stuff) do if stuff[i] = BADVALUE then exit outer -- leaves both loops elsif stuff[i] > LIMIT then continue inner -- goes to next iteration else mung(stuff[i]) end if end for end while </eucode> Nah, that might not work because it might not be linked to the end <loop> statement. What about "dolabel"? <eucode> while count < last_item dolabel outer for i = 1 to length(stuff) dolabel inner if stuff[i] = BADVALUE then exit outer -- leaves both loops elsif stuff[i] > LIMIT then continue inner -- goes to next iteration else mung(stuff[i]) end if end for end while </eucode> Just brainstorming. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20962 Date: 2008 May 14 3:15 From: Jeremy Cowgar <jeremy at co?ga?.com> Subject: Re: Exiting multiple loop constructs Derek Parnell wrote: > > I reject the 'numbered' loop approach due to the added work it requires during > maintenance. I agree. Just including them all :-) > In short ... > ... 'exit' should mean EXIT FROM the (named) loop. > > ... 'next' should mean begin the NEXT iteration of the (named) loop. > > ... 'retry' should mean RETRY the same iteration of the (named) loop. > Yes, that makes better sense (although I am still in favor of continue instead of next, but that's another discussion that has not yet finished :-)). > > > Should any syntax change to support exiting multiple loops? > > Huh? Do you mean ... <snip> I mean, do we need to make this change or is the current multiple check/condition that exists in Euphoria right now OK for loops. > > I'm thinking that the 'label' syntax is just too easy to overlook as it makes > the code seem cluttered. Maybe using some punctuation might help make it stand > out? The label keyword I think, unless Rob or Matt has a better idea, pretty important because it fits the idea of how the parser works. For instance, I can say in the parsing code: <eucode> tok = next_token() if tok[T_ID] = LABEL then loop_label = StringToken() else putback(tok) end if </eucode> I am not sure how an unidentified label would fit into the parsing scheme. The thing is for certain that we want *optional* labels. I could easily parse: <eucode> while 1 :top: do --- or --- while 1 @top do --- or any other thing --- </eucode> if a label was required, but we absolutely do not want to require a label. Now bear in mind, that when you load the source in your editor (if it does syntax highlighting) that it the keyword label will highlight just as an optional "by" keyword highlights in a for loop: <eucode> for i = 1 to 10 by 2 do </eucode> If your editor is nice enough, it may even be able to make the word after the label bright flashing red, green and blue colors for you :-) > <eucode> > @top while 1 do > @mid for i = 1 to 10 do > @bottom for j = 1 to 10 do > </eucode> Syntax parsing would have to change to make this work, I do not think that's somewhere I want to venture due to understanding of the parser still. If something like that is the final decision, then Matt or Rob will have to step in. However, I must say, that I personally think it's very distracting. The key to those lines is not what the label is, it is the fact they are a while, for and for loop. But with the @top, @mid, @bottom, the "while", "for" and "for" are then lost. I think the labels are secondary to the function that's being performed. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20963 Date: 2008 May 14 3:15 From: Jeremy Cowgar <jeremy at cowg?r.co?> Subject: Re: Exiting multiple loop constructs Derek Parnell wrote: > > I see how it should behave as very different from the diagram the Euler drew. > I see it as ... > > <eucode> > while 1 label top do > +-> ... > | for i = 1 to 10 label mid do > | for j = 1 to 10 label bottom do > | if j = 2 then > | exit top -----------------------+ > | elseif j = 7 then | > +------------<- continue top | > end if | > | > if j = 5 then exit all end if ->+ | > end for | | > end for | | > end while | | > ... <---------------------------------------+ | > ... <-----------------------------------------+ > </eucode> > I like this. And also, to this effect, there would not need to be a predefined label "all" as previously stated in one of the messages. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20964 Date: 2008 May 14 3:18 From: Jeremy Cowgar <jeremy at c??gar.com> Subject: Re: Exiting multiple loop constructs Jason Gade wrote: > > I agree that maybe the label should be before the loop, but I really don't like > the punctuation in place of a keyword. I find the word label far easier to read > than a decorating symbol, too many of which end up looking like line noise. > > Maybe crib from other languages again? > > <eucode> > label outer: while count < last_item do > label inner: -- can also appear on its own line > for i = 1 to length(stuff) do > if stuff[i] = BADVALUE then exit outer -- leaves both loops > elsif stuff[i] > LIMIT then continue inner -- goes to next iteration > else mung(stuff[i]) > end if > end for > end while > </eucode> > Here again, I think this takes away from the purpose and makes code *very* hard to read and understand. label is an optional parameter for a while/for keyword. The while and for keywords are the important part of the line. The label is 100% secondary. Also, the above syntax and one proposed by Derek would make you think you could: <eucode> @again if 1 = 20 then </eucode> Which you cannot. <eucode> for a = 1 to length(lines) by 2 label top do end for </eucode> is clear, understandable, readable and not confusing the matter that the for loop is labeled TOP. Now, if you want to make it stand out, use syntax highlighting or make it all caps? <eucode> for a = 1 to length(lines) by 2 label TOP do end for </eucode> -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20965 Date: 2008 May 14 3:22 From: Jason Gade <jaygade at ya?oo.com> Subject: Re: Exiting multiple loop constructs Well, I said "maybe" and came up with a different solution later on in the same post. I had rejected this solution because it doesn't link the label as tightly to the loop as does having the label after the loop statement. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20966 Date: 2008 May 14 3:24 From: Jason Gade <jaygade at ?a?oo.com> Subject: Re: Exiting multiple loop constructs Jason Gade wrote: > > Well, I said "maybe" and came up with a different solution later on in the same > post. > > I had rejected this solution because it doesn't link the label as tightly to > the loop as does having the label after the loop statement. > > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. Er, I meant my own example that you quoted. Not your example. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20967 Date: 2008 May 14 3:25 From: Matt Lewis <matthewwalkerlewis at gma??.com> Subject: Re: Benchmarks c.k.lester wrote: > > Wow. What an *censored*. I think you mean, "Wow. What a *censored*." I swear, you kids and your awful Internet grammar. Matt -= B E G I N =- X-EUFORUM: 20968 Date: 2008 May 14 3:27 From: Jeremy Cowgar <jeremy at cowgar.c??> Subject: Re: Exiting multiple loop constructs Jason Gade wrote: > > Well, I said "maybe" and came up with a different solution later on in the same > post. > > I had rejected this solution because it doesn't link the label as tightly to > the loop as does having the label after the loop statement. > Opps. I misunderstood. I understand what you meant now. Sorry. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20969 Date: 2008 May 14 3:27 From: Matt Lewis <matthewwalkerlewis at gma??.com> Subject: Re: No more platform(), conditional includes, conditional functions, condit Jeremy Cowgar wrote: > > This platform check takes place at parse/compile time not during runtime. The > difference is described in detail in: The only downside to this is for shrouded code. Originally, the platform call was optimized at compile time. But it was changed so that shrouded code could be more cross platform. I guess this puts us back to single platform shrouded code. But I'm not sure that many people shroud anything anymore. I can't recall the last time I did that. I either bind or translate. Matt -= B E G I N =- X-EUFORUM: 20970 Date: 2008 May 14 3:29 From: Matt Lewis <matthewwalkerlewis at gm?il.?om> Subject: Re: No more platform(), conditional includes, conditional functions, condit Bernie Ryan wrote: > > Jeremy: > > Who is making all these decisions about what is included in the > interpreter and not in the interpreter ?? > I thought you were working on standard libraries. Bernie: We all are. He's just got more time to do so right now. I thought you weren't contributing anything constructive to the conversation. Oh, yeah. You aren't. Matt -= B E G I N =- X-EUFORUM: 20971 Date: 2008 May 14 3:36 From: Matt Lewis <matthewwalkerlewis at g?a?l.com> Subject: Re: config.wat in SVN revision 454 Jeremy Cowgar wrote: > > I think config.wat needs to be: > > PWD=FULL PATH TO 4.0 sources DIRECTORY > > and if you are building with Euphoria 3.x (i.e. no 4.0 installed yet), then > you need to add: > > EU3=1 > > So, an example may be: > > EU3=1 > PWD=C:\eu40\source Yes. The proper way to do this, assuming that you're working with a checked out trunk: > configure.bat --with-eu3 > Matt may be able to provide more information. configure.bat should have created > this for you, however, we did discover that Win98 doesn't have some of the commands > used in configure.bat, so, it's still a bit unstable still. Sorry about that. > There have been a few tweaks to the build system the past few days trying to > make it build easily for everyone. > > Matt has a few ideas that will make it very easy to build Eu 4.0 even w/o an > existing Euphoria install. However, it is not yet in SVN. It's committed now. The target is "source". This was already done when I was building deb packages, so I could build a proper source tarball. Matt -= B E G I N =- X-EUFORUM: 20972 Date: 2008 May 14 3:43 From: Matt Lewis <matthewwalkerlewis at gmai?.co?> Subject: Re: machine exception in file.e Kat wrote: > > > The program ran for 3 days, then crashed with the ex.err on > > <a href="http://pastebin.ca/1017034">http://pastebin.ca/1017034</a> > > Platform is winxp-sp2. I opened a dox box on that dir,and did a listing > > dir.txt, which is 3,634,889 bytes long, my average filename len seems to be > 44 chars. Dir size is 254,305,792 bytes, 43,989 files, 0 folders. The last filenames > written look fine, i can open the dir in Textpad, get a listing, and open the > files. > > So what happened? Memory going bad? Power supply? I'd suspect hardware... Matt -= B E G I N =- X-EUFORUM: 20973 Date: 2008 May 14 3:52 From: Derek Parnell <ddparnell at bi?pond.com> Subject: Re: Exiting multiple loop constructs Jeremy Cowgar wrote: > The label keyword I think, unless Rob or Matt has a better idea, > pretty important because it fits the idea of how the parser works. Ok, I see what you mean, namely that the concept of a 'label' is that it is an optional component of the 'loop' statement, and not a statement in its own right. Fair enough, I'll stay within that boundary (for now). Do the parsing rules mean that this below would be valid ... <eucode> while 1 label :top: do </eucode> In other words, the symbol used to name a label can contain any character except whitespace and cannot start with either a digit or '#' or '--'. So it would be okay (if not a bit over-the-top) to have ... <eucode> while true label &&MAIN-PROCESSING-BLOCK: do . . . end while </eucode> -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20974 Date: 2008 May 14 3:59 From: Jeremy Cowgar <jeremy at c?wgar.?om> Subject: Re: Exiting multiple loop constructs Derek Parnell wrote: > > > Ok, I see what you mean, namely that the concept of a 'label' is that it is > an optional component of the 'loop' statement, and not a statement in its own > right. Fair enough, I'll stay within that boundary (for now). > > > Do the parsing rules mean that this below would be valid ... > <eucode> > while 1 label :top: do > </eucode> I tried, that works fine. > In other words, the symbol used to name a label can contain any character except > whitespace and cannot start with either a digit or '#' or '--'. So it would > be okay (if not a bit over-the-top) to have ... > > <eucode> > while true > label &&MAIN-PROCESSING-BLOCK: > do > . . . > end while > </eucode> I tried that too. It works also. Also: <eucode> while 1 label 25 do . . . end while </eucode> Works too, although, please do not use it :-D... The key is it must not contain a space. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20975 Date: 2008 May 14 4:05 From: Kat <KAT12 at coosahs.?e?> Subject: Re: Exiting multiple loop constructs Jeremy Cowgar wrote: > > Derek Parnell wrote: > > > > > > Ok, I see what you mean, namely that the concept of a 'label' is that it is > > an optional component of the 'loop' statement, and not a statement in its own > > right. Fair enough, I'll stay within that boundary (for now). > > > > > > Do the parsing rules mean that this below would be valid ... > > <eucode> > > while 1 label :top: do > > </eucode> > > I tried, that works fine. > > > In other words, the symbol used to name a label can contain any character except > > whitespace and cannot start with either a digit or '#' or '--'. So it would > > be okay (if not a bit over-the-top) to have ... > > > > <eucode> > > while true > > label &&MAIN-PROCESSING-BLOCK: > > do > > . . . > > end while > > </eucode> > > I tried that too. It works also. > > Also: > > <eucode> > while 1 > label 25 > do > . . . > end while > </eucode> > > Works too, although, please do not use it :-D... The key is it must not contain > a space. Kool, we have targets of various forms! Now, onto the keyword for a target: goto! Kat -= B E G I N =- X-EUFORUM: 20976 Date: 2008 May 14 4:10 From: Jason Gade <jaygade at yah?o.c?m> Subject: Re: Exiting multiple loop constructs Kat wrote: > > Kool, we have targets of various forms! Now, onto the keyword for a target: > goto! > > Kat A rose, by any other name... :-) -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 20977 Date: 2008 May 14 4:28 From: Kat <KAT12 at co?s?hs.net> Subject: Re: machine exception in file.e Matt Lewis wrote: > > Kat wrote: > > > > > > The program ran for 3 days, then crashed with the ex.err on > > > > <a href="http://pastebin.ca/1017034">http://pastebin.ca/1017034</a> > > > > Platform is winxp-sp2. I opened a dox box on that dir,and did a listing > > > dir.txt, which is 3,634,889 bytes long, my average filename len seems to be > > 44 chars. Dir size is 254,305,792 bytes, 43,989 files, 0 folders. The last filenames > > written look fine, i can open the dir in Textpad, get a listing, and open the > > files. > > > > So what happened? > > Memory going bad? Power supply? I'd suspect hardware... About what? Oh.... I don't know. I added a trace: <eucode> junk = dir(directory) if atom(junk) then trace(1) </eucode> so i could see when it happens, but it's all been legit so far. It was gigabytes way into the 15gig file, and since Winxp and *nixes have a 48bit series of extensions to the file operations Eu uses, praps the blockbuster v4.0 could offer these as fall thrus if the new conditional code detects the OS has them? http://msdn.microsoft.com/en-us/library/aa365542(VS.85).aspx http://msdn.microsoft.com/en-us/library/aa364937(VS.85).aspx http://msdn.microsoft.com/en-us/library/aa365748(VS.85).aspx etc. Kat -= B E G I N =- X-EUFORUM: 20978 Date: 2008 May 14 4:32 From: yuku <yuku at ikite?.c?m> Subject: Re: New keywords: ifdef, elsifdef, end ifdef Jeremy Cowgar wrote: > <eucode> > ifdef debug then > puts(1, "Debug version\n") > else > puts(1, "Release version\n") > end ifdef > </eucode> > > No need for a elseifdef. We would want to introduce less keywords to make it > easier for the programmer and faster in the parsing. Congratulations on implementing this feature! This is a feature that I wished very much. However, I don't really like the syntax. Especially the elsifdef, it looks like a cramped abbreviation. Other suggestions that came in mind: 1. Use another keyword after "if" like "defined" <eucode> if defined LINUX then -- linux code elsif defined WIN32 then -- win32 code else -- whatever end if </eucode> Adv: only 1 new keyword instead of 2. Less abbreviation. Dis: harder to implement (?) 2. Use static if (idea from D) <eucode> static if VERSION > 400 then puts(1, "you are in the future!") elsif VERSION < 400 then puts(1, "Please upgrade") else puts(1, "hohoho"); end if </eucode> Adv: One keyword instead of 2. Only need to write "static" once instead of 2 times "defined" like above. Can use >, <, = instead of just boolean testing. Dis: same as above 3. Use $ for "preprocessor" variables (variables that are defined during compilation), no need to use new keywords. <eucode> if $VERSION > 400 then puts(1, "you are in the future!") elsif $DOS32 then puts(1, "good old-timer") else puts(1, "hohoho"); end if </eucode> Adv: The $ sign makes it stands out from normal if-statement. $ sign is already used so no new keyword or symbol introduced. Can use >, <, = instead of just boolean testing. Dis: none? ____ Personally I prefer the 3rd point above. How do you think? -= B E G I N =- X-EUFORUM: 20979 Date: 2008 May 14 5:17 From: Alan F <acf.projects at g?ail?com> Subject: Re: No more platform(), conditional includes, conditional functions, condit Jerry Story wrote: > > How would you get the slash right without platform()? > > <eucode> > if platform() = LINUX then > SLASH = "/" > else > SLASH = "\\" > end if > </eucode> From what I understand, it would work like those examples above. DOS, WINDOWS, or LINUX is defined automatically depending on the operating system, so you could then do: ifdef LINUX then SLASH = '/' else SLASH = '\\' end ifdef -= B E G I N =- X-EUFORUM: 20980 Date: 2008 May 14 5:20 From: Alan F <acf.projects at gm??l.com> Subject: Re: No more platform(), conditional includes, conditional functions, condit Whoops, somehow the topic name got truncated after Jerry's post, and so the thread search didn't show the rest of the discussion. So my previous post and this one are redundant. :-) -= B E G I N =- X-EUFORUM: 20981 Date: 2008 May 14 5:56 From: Mike777 <anon4321 at gm?il.c?m> Subject: Re: No more platform(), conditional includes, conditional functions, condit Matt Lewis wrote: > > Jeremy Cowgar wrote: > > > > This platform check takes place at parse/compile time not during runtime. The > > difference is described in detail in: > > The only downside to this is for shrouded code. Originally, the platform > call was optimized at compile time. But it was changed so that shrouded code > could be more cross platform. I guess this puts us back to single platform > shrouded code. > > But I'm not sure that many people shroud anything anymore. I can't recall > the last time I did that. I either bind or translate. I'm not sure what I do. By that I mean that I use Judith's IDE and frequently just "run" rather than bind. Mike -= B E G I N =- X-EUFORUM: 20982 Date: 2008 May 14 8:05 From: CChris <christian.cuvier at agriculture.go?v?fr> Subject: Re: Exiting multiple loop constructs Jeremy Cowgar wrote: > > We've talked about labeled loops and a bit about existing loop constructs, exiting > loops, etc... but I do not think we came to any conclusive decision. Here is > a summary of different methods of exiting multiple loops: > > <eucode> > integer in_top > in_top = 1 > > while in_top do > for i = 1 to 10 do > if i = 3 then > in_top = 0 > exit > end if > end for > end while > </eucode> > > This will work fine unless you have processing *under* the nested loop, then > you must provide an extra condition check (which is in a loop and is executed > each iteration): > > <eucode> > integer in_top > in_top = 1 > > while in_top do > for i = 1 to 10 do > if i = 3 then > in_top = 0 > exit > end if > end for > if in_top = 0 then > exit > end if > -- do more processing here > end while > </eucode> > > NOTE: The above two methods compound in complexity with each nested loop you > add. However, in real life, I'm not sure if I have ever programmed a loop that > is 3 deep. > > This method uses optional numeric methods to exit and continue keywords: > > <eucode> > while 1 do > for i = 1 to 10 do > if i = 3 then exit 2 -- end if > end for > end while > </eucode> > > Notice "exit 2". That means exit 2 loops. > > The final method is labeled loops, in which I will make a slightly more advanced > example. > > <eucode> > while 1 label top do > for i = 1 to 10 label mid do > for j = 1 to 10 label bottom do > -- exit current loop "to" the top loop > if j = 2 then exit top end if > > -- exit all loops (in this function) > if j = 5 then exit all end if > end for > end for > end while > </eucode> > > > So. Is one clearer than another? I do not know. Should any syntax change to > support exiting multiple loops? I am not sure, the benefit is you can remove > multiple checks making code easier to write and better performing. > > So, what do you think? Are there other ways that I missed? What should be done? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> There is another way: <eucode> procedure nested_loops(sequence args) for i=1 to 27 do while f(x)=3 do .... if exit_em_all() then return end if end end.... end end procedure -- ... some code nested_loops(args) </eucode> and after all, nesd_loops() may be a function as well. While this works well at top leel, it is less obvious in a routine, beause nested_loops() may access the privates of the calling routines. If, like Æ or Pascal, Euphoria had nested routines, it would work fine. And the chagnges are not that difficult really. The method you quote first is what e are doing now. Error prone, invites a goto statement to make the code more maintainable. Method #2 is good in small programs, the code is the cleaest, but maintaining is tricky because ading/removing a loop level will cause to examine all exit/continue statements. Method #3 is more heavyhanded, but after all, not all loops are affected, and maintaining is the easiest. Methood #4 has been available, but does not always work, or becomes as error prone as #1 when privates have to be passed and updated. My suggestion would be to add method #3, possibly adding #2. For #2, things can be made less fragile by being able to use non positive optional arguments - exit 0 would exit all loops, exit -1 all but the topmost, etc. Like when using $ for sequences. Alternatively, if we had nested routines, we'd solve a few more problems and could always use method #4. Perhaps the best. CChris -= B E G I N =- X-EUFORUM: 20983 Date: 2008 May 14 8:11 From: CChris <christian.cuvier at agri?ulture.?ouv.fr> Subject: Re: Exiting multiple loop constructs Jason Gade wrote: > > My only real concern is the placement of the "label" statement. Not sure where > it should go to be most clear. > > I don't like the "all" option, you should know the label of the highest level > you are exiting. No need for a predefined label, IMO. > > I'm not sure what kinds of stack cleanup/unwinding would need to be done in > order to prevent memory/resource leaks and/or fill up the interpreter's stack > with data from exited loops. > > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. None. The parser doesn't exit your loops, ig plows sequentially through them. There is a stack of requested exits, and, at each end for/end while, they are examined, and thoe who are ripe get backpatched appropriately. The stack grows when an exit statement is met, and shrinks when all end exit requests are marked as processed. At least that's how I implemented it. So, there is a stack,, but it dosn't grow larger than the deepest loop nesting level in program. Stack overflow is very unlikely. CChris -= B E G I N =- X-EUFORUM: 20984 Date: 2008 May 14 8:27 From: Jeremy Cowgar <jeremy at ?owgar.co?> Subject: Re: New keywords: ifdef, elsifdef, end ifdef yuku wrote: > > However, I don't really like the syntax. > Especially the elsifdef, it looks like a cramped abbreviation. > I was not too happy. I think my first post about the feature was asking for suggestions. It's functional and I think it can grow on you, but at first sight, ifdef, elsifdef is, eh? > Other suggestions that came in mind: > > 1. Use another keyword after "if" like "defined" > > <eucode> > if defined LINUX then > -- linux code > elsif defined WIN32 then > -- win32 code > else > -- whatever > end if > </eucode> > > Adv: only 1 new keyword instead of 2. Less abbreviation. > Dis: harder to implement (?) > It's not only harder to implement but it would slow *all* programs down. The reason for this is each and every *if* statement that the parser would come across would have to be checked for an optional "defined" keyword. IMHO, this shoots down the above syntax. > 2. Use static if (idea from D) > > <eucode> > static if VERSION > 400 then > puts(1, "you are in the future!") > elsif VERSION < 400 then > puts(1, "Please upgrade") > else > puts(1, "hohoho"); > end if > </eucode> > > Adv: One keyword instead of 2. Only need to write "static" once instead of 2 times > "defined" like above. Can use >, <, = instead of just boolean testing. > Dis: same as above > This has potential. The static keyword would be the keyword and send the parser into a new Static_statement() function that would then begin looking for the if, elsif, end if statements. This would cause zero slow down in existing applications and in applications that utilize it, it would only cause speed increases. However, I dis-like using the word static as static usually means something totally different. For instance: <eucode> function next() static integer id if !defined(id) then id = 0 end if id += 1 return id end function </eucode> There are other uses for the static keyword as well. Perhaps a different "trigger" word could be found? This is a good idea, static is just not the best choice, I do not think. > 3. Use $ for "preprocessor" variables (variables that are defined during compilation), > no need to use new keywords. > > <eucode> > if $VERSION > 400 then > puts(1, "you are in the future!") > elsif $DOS32 then > puts(1, "good old-timer") > else > puts(1, "hohoho"); > end if > </eucode> > > Adv: The $ sign makes it stands out from normal if-statement. $ sign is already > used so no new keyword or symbol introduced. Can use >, <, = instead of just > boolean testing. > Dis: none? > Has the same problem as the first option. I think your second idea is the best one but with a different trigger word. One thing that may be confusing about that, and possibly a reason not to use a trigger word would be people would think you could then do: <eucode> compile-time procedure init() -- compute big long value that has all sorts of -- nested loops, complex decisions, random number -- generation and takes 10 minutes to come up with -- the final answer. answer = result_of_everything_above end procedure </eucode> and by the nature of "compile-time" keyword, that sounds perfectly legit but not currently (or ever that I can see in my finite mind) possible. So, we should carefully consider the use of a trigger word. It makes the if statement look better, but provides other real benefit and could cause confusion. Sure, people could read the manual, but how often do they and should they have to? I know for the most part I can look at a few examples of code in a new language and begin programming in that language. Sure, there are minor nuances that must be learned by reading document references, but is this one of those things or no? I like the looks of it quite a bit better, but ... Thoughts? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20985 Date: 2008 May 14 8:44 From: Derek Parnell <ddparnell at b?gpond.c?m> Subject: Re: New keywords: ifdef, elsifdef, end ifdef Jeremy Cowgar wrote: > yuku wrote: > > 2. Use static if (idea from D) > > > > <eucode> > > static if VERSION > 400 then > > puts(1, "you are in the future!") > > elsif VERSION < 400 then > > puts(1, "Please upgrade") > > else > > puts(1, "hohoho"); > > end if > > </eucode> > > > > Adv: One keyword instead of 2. Only need to write "static" once instead of 2 times > > "defined" like above. Can use >, <, = instead of just boolean testing. > > Dis: same as above I love the D language but this use of 'static' is one of the most blatant warts in its syntax. There seems to be an absolute terror by the D developers to use new keywords so they use existing ones in new and confusing ways. I have no problem with the proposed keyword 'ifdef' to signal the start of parser-time condition testing. The 'else' and 'elsif' keywords can be comfortably reused in this context as they semantically mean the same whether processed at parser-time or at execute-time, the only difference is *when* it gets processed. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20986 Date: 2008 May 14 8:49 From: Jeremy Cowgar <jeremy at cow?ar?com> Subject: Re: No more platform(), conditional includes, conditional functions, condit Matt Lewis wrote: > > The only downside to this is for shrouded code. Originally, the platform > call was optimized at compile time. But it was changed so that shrouded code > could be more cross platform. I guess this puts us back to single platform > shrouded code. > > But I'm not sure that many people shroud anything anymore. I can't recall > the last time I did that. I either bind or translate. > We should make a decision here because I think I can make it work in either. Here's what I would do... if not shrouded, do exactly as it does now. However, if shrouded, all defines would turn into a constant and when a ifdef/elsifdef was encountered, a if/elsif would be emitted. So, in shrouded code you gain no benefit, but your code still works. But, I am with you Matt. Is there any reason to shroud? I do not think it's worth the extra code. In fact, I wonder if shrouding should be done away with? At first I was thinking, maybe John Doe would like to create ultra-cool library ABC and sell it to Euphoria programmers, but if someone really wanted to do that !?!? then wouldn't they be better off translating their library into a Euphoria dll file? And if not, what do other languages do that do not provide shrouding? Me, personally? I wouldn't worry about shrouding, but others may see value in it still. I'll start a new thread, Do you shroud? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20987 Date: 2008 May 14 8:51 From: Jeremy Cowgar <jeremy at co?gar.?om> Subject: Do you shroud? Now that Euphoria is open source and the C translator works so well and is free, do you shroud? If so, why would you shroud vs translate? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20988 Date: 2008 May 14 8:55 From: Jeremy Cowgar <jeremy at cowg??.com> Subject: Re: New keywords: ifdef, elsifdef, end ifdef Derek Parnell wrote: > > I have no problem with the proposed keyword 'ifdef' to signal the start of parser-time > condition testing. The 'else' and 'elsif' keywords can be comfortably reused > in this context as they semantically mean the same whether processed at parser-time > or at execute-time, the only difference is *when* it gets processed. > I was thinking of doing that but I did not want to cause confusion. i.e. if ... then ... elsif ... else ... end if vs. ifdef ... then ... elsifdef ... end ifdef I like elsif better and it would reduce one keyword count, but I'm not sure about it's clarity? Also, it would then blend in better with other standard if/elsif/end if statements? Thinking aloud seeking input. Now that the functionality exists, it's easy to change its syntax. This is what Open Source software is about, isn't this great? Ideas implemented, improved and furthered. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20989 Date: 2008 May 14 9:48 From: CChris <christian.cuvier at agricult?re?gouv.fr> Subject: Re: No more platform(), conditional includes, conditional functions, condit > > Me, personally? I wouldn't worry about shrouding, but others may see value in > it still. I'll start a new thread, Do you shroud? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> No. I had stated my views around 2004 when the first version of Visual Euphoria was released as closed source. I think shrouding is against the freedom to learn from others and adapt things from others. This becomes all the more true as Eu is open source now, which it wasn't at the time. Now wait. shroud() just outputs the IL now, and having IL files has its obvious benefits. So... 18 months ago, I'd have said: do away with shrouding. Now I'd say: shrouding is useful for special applications or advanced debugging, so keep it, but call it "bytecoding", for instance. What could be done with with benefits is the old crypted format where keywords where replaced with characters in the 128-255 range. Stopping support for it would allow identifiers to benefit from the full UTF-8 range, while Unicode is not supported. Rob said he was considering the move (url may wrap) http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=4&fromYear=C&toMonth=5&toYear=C&postedBy=Robert+Craig&keywords=crypted , perhaps you can make it. Or me when I have time. CChris -= B E G I N =- X-EUFORUM: 20990 Date: 2008 May 14 9:57 From: CChris <christian.cuvier at agricul?ure.gouv.f?> Subject: Re: New keywords: ifdef, elsifdef, end ifdef Jeremy Cowgar wrote: > > Derek Parnell wrote: > > > > I have no problem with the proposed keyword 'ifdef' to signal the start of parser-time > > condition testing. The 'else' and 'elsif' keywords can be comfortably reused > > in this context as they semantically mean the same whether processed at parser-time > > or at execute-time, the only difference is *when* it gets processed. > > > > I was thinking of doing that but I did not want to cause confusion. i.e. if > ... then ... elsif ... else ... end if vs. ifdef ... then ... elsifdef ... > end ifdef > > I like elsif better and it would reduce one keyword count, but I'm not sure > about it's clarity? Also, it would then blend in better with other standard > if/elsif/end if statements? Thinking aloud seeking input. > > Now that the functionality exists, it's easy to change its syntax. This is what > Open Source software is about, isn't this great? Ideas implemented, improved > and furthered. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Blending in better is a mixed blessing, because what elsif or else means is to be checked at the master if statement level. For very short code, it hardly matters, but it doesn't hlelp clarity. I think I like ifdef better, even if elsifdef looks awkward. After all, it will be the les used keyword in the group, so it may not matter much. Perhaps to such an extent that we will hardly need it, so that we'd write <eucode> ifdef WINDOWS then ... elsedef ifdef DOS then -- else -- LINUX then -- end ifdef end ifdef </eucode> if we don't want elsifdef. CChris CChris -= B E G I N =- X-EUFORUM: 20991 Date: 2008 May 14 10:07 From: Derek Parnell <ddparnell at bigpond.?o?> Subject: Re: Do you shroud? Jeremy Cowgar wrote: > do you shroud? No. I never have and have never needed to. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 20992 Date: 2008 May 14 12:31 From: c.k.lester <euphoric at ck?est?r.com> Subject: Re: Do you shroud? Jeremy Cowgar wrote: > do you shroud? Only when I'm out in public. Actually, I've never shrouded my code but if I ever came up with a brilliant library whose functionality nobody could duplicate, I would shroud it and sell it and make billions. All my code is generally available as open source under a BSD license. I don't make a living selling code, but others might. :/ -= B E G I N =- X-EUFORUM: 20993 Date: 2008 May 14 12:41 From: Michael J. Sabal <m_sabal at yaho?.co?> Subject: Re: No more platform(), conditional includes, conditional functions, condit Matt Lewis wrote: > > Jeremy Cowgar wrote: > > > > This platform check takes place at parse/compile time not during runtime. The > > difference is described in detail in: > > The only downside to this is for shrouded code. Originally, the platform > call was optimized at compile time. But it was changed so that shrouded code > could be more cross platform. I guess this puts us back to single platform > shrouded code. > > But I'm not sure that many people shroud anything anymore. I can't recall > the last time I did that. I either bind or translate. > > Matt I was going to say that with platform(), I could bind once and run anywhere; but then I woke up from my fantasy. Every bind is platform-specific anyway because of the interpreter backend it joins with. So, I can't really think of any examples where platform() would work but ifdef wouldn't. And I thought that the original use of shroud ended at version 2.5. The current incarnation of "shroud" is little more than precompiled bytecode similar to a Java .class file or a .NET executable. I can't say that I've ever used it, but I could see where it could be useful in some customized applications. -= B E G I N =- X-EUFORUM: 20994 Date: 2008 May 14 14:38 From: Jeremy Cowgar <jeremy at c?wgar?com> Subject: wmake -f makefile.wat source Matt Lewis wrote: > > It's committed now. The target is "source". This was already done when I > was building deb packages, so I could build a proper source tarball. > What is this suppose to do? I'm trying to help iamscared on IRC build on Windows 98. I was thinking this would build from pre-translated sources so that Euphoria did not have to be installed in order to compile it? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20995 Date: 2008 May 14 15:19 From: yuku <yuku at i?it?k.com> Subject: Optional "then" and "do" I made changes to the parser.e so that the keyword "then" and "do" is optional (if the coder wants that it is still accepted). Reasons: - Less typing - Prevent mistakes of writing if <expr> do and for <expr> then which I did a lot of times (Kat too) If no real objection is made, I will commit it. -= B E G I N =- X-EUFORUM: 20996 Date: 2008 May 14 15:39 From: Marco Achury <achury at cantv.??t> Subject: Re: Optional "then" and "do" I have not problem with type as ed.exe complete the expression. I like the change, specially in for, this way looks a lot like the BASIC FOR. The only bad thing is the error message will be less clear for newbies, the parser must to difference if the error is at the boolean condition or in the first statement after it. +-+-+-+-+-+-+-+ Marco A. Achury Caracas, Venezuela -= B E G I N =- X-EUFORUM: 20997 Date: 2008 May 14 15:52 From: CChris <christian.cuvier at agriculture.??uv.fr> Subject: Re: Benchmarks Jason Gade wrote: > > Jeremy Cowgar wrote: > > > > Jason Gade wrote: > > > > > > I kinda lost interest in continuing to develop it when they didn't want to include > > > Euphoria in the "official" shootout. But there are some pretty good tests in > > > there. > > > > > > > Jason, why did they not want to include it? In TIOBE index we are currently > > #47 in popularity and there are languages below that existing in the official > > shootout. > > > > -- > > Jeremy Cowgar > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > Maybe because I didn't sell it enough... I'd have to fish out the old emails > again. > > The guy did email me back several months later and say that he was impressed > with the amount of tests that had been coded, and that they had some newer tests, > but he still wasn't interested in including Euphoria in the list. > > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. Jason and Jeremy, I found this in the forum archive: <quote> Date: 2007 Jan 8 18:40 From: Jason Gade <jaygade at yahoo.com> Subject: Re: Computer Language Shootout c.k.lester wrote: > > Which web site hosts this shootout? I've found several, but none have Euphoria > included in the results. I haven't actually submitted it yet, just to the Euphoria archive. Shootout page: http://shootout.alioth.debian.org/ I need to find out if someone will make a Debian package or Gentoo ebuild for Euphori a 3.0. It's a requirement of the contest that the language be open-source and have a Debian package or Gentoo ebuild. Or be able to build from source in the standard manner. Alexander Torreson made a Debian package for 2.5 but that version of Euphoria is not open-source. -- "Any programming problem can be solved by adding a level of indirection." --anonymous "Any performance problem can be solved by removing a level of indirection." --M. Haertel "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. </quote> Things have moved on in the meantime, so trying again may not hurt. CChris -= B E G I N =- X-EUFORUM: 20998 Date: 2008 May 14 16:01 From: Jeremy Cowgar <jeremy at cow??r.com> Subject: Re: Benchmarks CChris wrote: > > I need to find out if someone will make a Debian package or Gentoo ebuild for > Euphori > a 3.0. It's a requirement of the contest that the language be open-source and > have a > Debian package or Gentoo ebuild. Or be able to build from source in the standard manner. > I've built a few GenToo ebuilds, submitted and have been accepted into the main GenToo dist. I am not a GenToo developer, so we would need to find a developer to submit, but it didn't seem that hard last time I did it. We would need to include the translated sources in a Unix source download. Then it could be built on gentoo w/no previous Eu installed. However, I think this should wait until 4.0 is released. If someone wants to work on benchmarks, however, then they would be ready. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 20999 Date: 2008 May 14 16:29 From: Mike777 <anon4321 at g?ail.?om> Subject: Re: Optional "then" and "do" yuku wrote: > > I made changes to the parser.e so that the keyword "then" and "do" > is optional (if the coder wants that it is still accepted). > > Reasons: > > - Less typing > > - Prevent mistakes of writing if <expr> do and for <expr> then > which I did a lot of times (Kat too) > > If no real objection is made, I will commit it. I have no real objection and mild support. It would certainly save me from an error message or two in the future. And I'm not concerned about losing the help that the error checking provides. Mike -= B E G I N =- X-EUFORUM: 21000 Date: 2008 May 14 16:33 From: Jason Gade <jaygade at yah?o?com> Subject: Re: Optional "then" and "do" yuku wrote: > > I made changes to the parser.e so that the keyword "then" and "do" > is optional (if the coder wants that it is still accepted). > > Reasons: > > - Less typing > > - Prevent mistakes of writing if <expr> do and for <expr> then > which I did a lot of times (Kat too) > > If no real objection is made, I will commit it. Can you give some examples of code doing this? I mean, how optional is it? I'm mainly wondering whether the parser relies on the keyword "then" or "do" being between <expr> and <statement>. I don't know enough about the internals to say. I've never really had a problem with "then" or "do" (except occasionally forgetting "do") but I also don't have a problem with removing them if there is no major effect. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21001 Date: 2008 May 14 16:35 From: Jason Gade <jaygade at ?ahoo?com> Subject: Re: Benchmarks One piece of advice that I was given by Isaac Gouy (of the shootout) was to download their test framework from CVS and run the benchmarks and publish the numbers myself. I never got to that point. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21002 Date: 2008 May 14 16:53 From: Larry Miller <larrymiller at ?as?tel.net> Subject: Re: Optional "then" and "do" yuku wrote: > > I made changes to the parser.e so that the keyword "then" and "do" > is optional (if the coder wants that it is still accepted). > > Reasons: > > - Less typing > > - Prevent mistakes of writing if <expr> do and for <expr> then > which I did a lot of times (Kat too) > > If no real objection is made, I will commit it. If I remember correctly Rob Craig had mentioned this some time ago. I wasn't able to find the reference. I think the parser needs these words to avoid ambiguity in some cases. I think this needs to be further investigated before making any changes. Larry Miller -= B E G I N =- X-EUFORUM: 21003 Date: 2008 May 14 16:58 From: yuku <yuku at i?itek.?om> Subject: Re: Optional "then" and "do" Jason Gade wrote: > Can you give some examples of code doing this? I mean, how optional is it? Every then and do become optional. It doesn't matter where it is placed. > I'm mainly wondering whether the parser relies on the keyword "then" or "do" being > between <expr> and <statement>. I don't know enough about the internals > to say. I looked at the internals, and the parser only *asserts* that there are THENs and DOs on the correct places. The THENs and DOs does not help the parser at all. There is no ambiguity generated too. > I've never really had a problem with "then" or "do" (except occasionally forgetting > "do") but I also don't have a problem with removing them if there is no major > effect. Oh yes, I forgot to mention that. Besides being mixed up between THEN and DO, occassionally I forgot to write that. What a. -= B E G I N =- X-EUFORUM: 21004 Date: 2008 May 14 18:30 From: "Euler German" <eulerg at gmail.com> Subject: Re: Benchmarks > On 13 May 2008 at 7:21, Jason Gade wrote (maybe snipped): > c.k.lester wrote: > > > > Jason Gade wrote: > > > > > > The guy did email me back several months later and say that he was > > > impressed with the amount of tests that had been coded, and that > > > they had some newer tests, but he still wasn't interested in > > > including Euphoria in the list. > > > > So it was just some arbitrary decision by one guy? He wouldn't have > > to do any work to include it, either, except maybe a link or two. > > > > Wow. What an *censored*. > > I wouldn't say that, and I'm not sure if it was just one guy. I think > there are other people involved in the project. And I understand that > they can't include every niche language. > > Having Euphoria easily installed on Linux will probably help a bit > too. > I never understood why Rob didn't submit Euphoria to http://dada.perl.it/shootout/ (the Win32 port of Doug Bagley shootout). He mentions it at bench.doc but I wonder why no other code but sieve.ex was created and submitted. Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 21005 Date: 2008 May 14 19:03 From: Kat <KAT12 at co??ahs.net> Subject: Re: Optional "then" and "do" Larry Miller wrote: > > yuku wrote: > > > > I made changes to the parser.e so that the keyword "then" and "do" > > is optional (if the coder wants that it is still accepted). > > > > Reasons: > > > > - Less typing > > > > - Prevent mistakes of writing if <expr> do and for <expr> then > > which I did a lot of times (Kat too) Confirmed, especially when changing code from one loop form to another to get program flow to use exit correctly. I often wonder why "then" and "do" aren't the same word. It's like,, ok, make two loop constructs to not use "goto", and then complicate them some by making them extra different from each other too! > > If no real objection is made, I will commit it. > > If I remember correctly Rob Craig had mentioned this some time ago. I wasn't > able to find the reference. I think the parser needs these words to avoid ambiguity > in some cases. I think this needs to be further investigated before making any > changes. Iirc, RobC said it more easily narrows down where the error is. Which i can maybe see in a one-pass interpreter or compiler. Not that this is advocating a *one* pass interpreter or compiler for Euphoria. Or that it's necessarily true. And i have said that a language can be a *lot* smarter with a clever interpreter riding over the code, even if a little slower on the olde 386DX40 or 586-133 or .... nope, i then jumped to ghz Pentium-class boxes. Kat -= B E G I N =- X-EUFORUM: 21006 Date: 2008 May 14 19:20 From: MBianchi <mebian at tiscal??et.it> Subject: Re: Benchmarks I'd like very much to see Eu listed in the shootout, too. For what concerns .deb distros, you could also prepare an .rpm release, and pass it with alien to have both kind of installations (recorded by the Debian packages database as "installed from alien"), but what about a good .configure/make/make install chain ? That should allow people not willing to interfere with system wide installation packages to choose a local install in $/home/xxx with ease. Cheers. MBianchi Two cents, as always. -= B E G I N =- X-EUFORUM: 21007 Date: 2008 May 14 19:32 From: Salix <salix at free?a?l.hu> Subject: Re: Optional "then" and "do" yuku wrote: > > I made changes to the parser.e so that the keyword "then" and "do" > is optional (if the coder wants that it is still accepted). > Reasons: > - Less typing > - Prevent mistakes of writing if <expr> do and for <expr> then > which I did a lot of times (Kat too) > If no real objection is made, I will commit it. I am against the optional "then" and "do". I understand if in this example it is too hard to type "then". <eucode> if apple=1 and bananas=3 then peach=7 end if </eucode> But if I tend to forget "and". The result now is <eucode> if apple=1 bananas=3 then peach=7 end if </eucode> that gives an error message. With optional "then" it would be <eucode> if apple=1 bananas=3 peach=7 end if </eucode> that is much harder to track down. Let's not skip "do" and "then". Regards, Salix -= B E G I N =- X-EUFORUM: 21008 Date: 2008 May 14 19:37 From: Rob H. <robert.hrosc at gmail?com> Subject: C.K.Lester - Can I have your EU books? I'm sorry for posting a message like this at the EU forum. This message is for C.K. Lester... I'm trying to get some tutorials that you've written but your site doesn't have them any longer. They are: Jubilation Guiphoria Can you send those to me somehow along with any other tutorials that you've written?? I'd really appreciate it if you can!! Thank you. Rob H. -= B E G I N =- X-EUFORUM: 21009 Date: 2008 May 14 19:44 From: c.k.lester <euphoric at ckles??r.com> Subject: Re: C.K.Lester - Can I have your EU books? Rob H. wrote: > > I'm trying to get some tutorials that you've written but your site doesn't have > them any longer. > > They are: > Jubilation > Guiphoria Jubilation: http://www.usingeuphoria.com/books/jubilation/ GUIphoria: http://www.usingeuphoria.com/books/guiphoria/ Sorry 'bout that. When I switched domains, some links got broked. Most should be fixed now. :) -= B E G I N =- X-EUFORUM: 21010 Date: 2008 May 14 19:53 From: MBianchi <mebian at tiscalinet.??> Subject: emacs, anyone? Does it exist an Eu-mode for emacsen, to have font-lock aka syntax highlighting for Euphoria and perhaps some menu added as an aid to developers (a la Quack for Scheme, for instance)? I searched the net but found nothing .... TIA. Cheers. MBianchi -= B E G I N =- X-EUFORUM: 21011 Date: 2008 May 14 21:33 From: Jeremy Cowgar <jeremy at co?gar?com> Subject: IRC link test post A bot in IRC now watches the RSS feed provided here on EUforum and let's those know on IRC when new posts have been made. iamscared on IRC wrote the interface into his bot, eubotmar2 (which is written in Euphoria). So, this is a test post to ensure it's working. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21012 Date: 2008 May 14 21:35 From: Jeremy Cowgar <jeremy at co?gar.c?m> Subject: Re: IRC link test post Jeremy Cowgar wrote: > > A bot in IRC now watches the RSS feed provided here on EUforum and let's those > know on IRC when new posts have been made. > > iamscared on IRC wrote the interface into his bot, eubotmar2 (which is written > in Euphoria). So, this is a test post to ensure it's working. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> It worked... Here's what we got in irc.freenode.net #euphoria ====================== <eubotmar2> + | Jeremy Cowgar : IRC link test post : http://www.OpenEuphoria.org/EUforum/m21011.html : Wed, 14 May 2008 21:33:00 GMT : ====================== -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21013 Date: 2008 May 14 22:32 From: Rob H. <robert.hrosc at gmai?.c?m> Subject: Re: C.K.Lester - Can I have your EU books? Thank you. I did find Jubilation and the GUI building tutorial after I posted... However, what about PartII of the GUI tutorial? Can you post a link to that one? Thanks a lot. -= B E G I N =- X-EUFORUM: 21014 Date: 2008 May 14 22:45 From: Fernando Bauer <fmbauer at hotma?l?com> Subject: Re: Optional "then" and "do" Kat wrote: > > Larry Miller wrote: > > > > yuku wrote: > > > > > > I made changes to the parser.e so that the keyword "then" and "do" > > > is optional (if the coder wants that it is still accepted). > > > > > > Reasons: > > > > > > - Less typing > > > > > > - Prevent mistakes of writing if <expr> do and for <expr> then > > > which I did a lot of times (Kat too) > > Confirmed, especially when changing code from one loop form to another to get > program flow to use exit correctly. I often wonder why "then" and "do" aren't > the same word. Me too. I think both 'do' and 'then' exist to mark the beginning of a executable block of code. So, if they are synonyms, one of them is superfluous and could be eliminated (in my opinion 'then'). A similar case occurs with '..' (slice operator) and 'to' (historical note: ZX81 BASIC uses 'TO' for 'FOR' statements and also for slices). Both have the meaning of a range. In this case I would keep with '..'. Then, we could write something like this: for i = 1..10 do if i=3 do exit end if end for [snipped] Just some provocative thoughts! :-) - Fernando -= B E G I N =- X-EUFORUM: 21015 Date: 2008 May 14 22:49 From: c.k.lester <euphoric at ckle?ter?com> Subject: Re: C.K.Lester - Can I have your EU books? Rob H. wrote: > > However, what about PartII of the GUI tutorial? Can you post a link to that > one? That one's really not much done... but it's started and available here: http://www.usingeuphoria.com/books/eugui/ -= B E G I N =- X-EUFORUM: 21016 Date: 2008 May 14 23:07 From: Jason Gade <jaygade at yahoo??om> Subject: Re: Optional "then" and "do" Fernando Bauer wrote: > > Kat wrote: > > > > Larry Miller wrote: > > > > > > yuku wrote: > > > > > > > > I made changes to the parser.e so that the keyword "then" and "do" > > > > is optional (if the coder wants that it is still accepted). > > > > > > > > Reasons: > > > > > > > > - Less typing > > > > > > > > - Prevent mistakes of writing if <expr> do and for <expr> then > > > > which I did a lot of times (Kat too) > > > > Confirmed, especially when changing code from one loop form to another to get > > program flow to use exit correctly. I often wonder why "then" and "do" aren't > > the same word. > > Me too. I think both 'do' and 'then' exist to mark the beginning of a executable > block of code. So, if they are synonyms, one of them is superfluous and could > be eliminated (in my opinion 'then'). > > A similar case occurs with '..' (slice operator) and 'to' (historical note: > ZX81 BASIC uses 'TO' for 'FOR' statements and also for slices). Both have the > meaning of a range. In this case I would keep with '..'. > Then, we could write something like this: > > for i = 1..10 do > if i=3 do exit end if > end for > > [snipped] > > Just some provocative thoughts! :-) > > - Fernando Okay, now to that I have to say "yuk!" I mean, we may as well write for(i = 0; i < 10; i++) { /* do something */ } Which certainly has its own elegance, but it isn't Euphoria. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21017 Date: 2008 May 14 23:11 From: Jason Gade <jaygade at yaho?.?om> Subject: Re: Optional "then" and "do" Oh, and to me, do and then really aren't synonyms so much. It's the way you say things in English. Well, "then" is anyway. if i=3 do exit end if is very ugly to me too. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21018 Date: 2008 May 14 23:15 From: Jeremy Cowgar <jeremy at cowg?r.c?m> Subject: Re: Optional "then" and "do" Jason Gade wrote: > > Oh, and to me, do and then really aren't synonyms so much. It's the way you > say things in English. > > Well, "then" is anyway. > > if i=3 do exit end if > > is very ugly to me too. > I agree. do and then may be a place holder, but read very different, thus make code cleaner and easier to read, which is very important. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21019 Date: 2008 May 14 23:37 From: Jeremy Cowgar <jeremy at ?o?gar.com> Subject: Enum? I do this all the time and I know others do because I see in it code everywhere. Here are some examples, some of which you will recognize: <eucode> constant FILE_NO = 1, -- file number LINE_NO = 2, -- local line number FILE_PTR = 3, -- open file number FILE_START_SYM = 4, -- symbol before start of file OP_WARNING = 5, -- save/restore with/without options OP_TRACE = 6, OP_TYPE_CHECK = 7, OP_PROFILE_TIME = 8, OP_PROFILE_STATEMENT = 9, OP_DEFINES = 10 -- ifdef defines global constant GET_SUCCESS = 0, GET_EOF = -1, GET_FAIL = 1, GET_NOTHING = -2 global constant D_NAME = 1, D_ATTRIBUTES = 2, D_SIZE = 3, D_YEAR = 4, D_MONTH = 5, D_DAY = 6, D_HOUR = 7, D_MINUTE = 8, D_SECOND = 9 </eucode> Etc... This is fine, but what if you want to add a new element and not at the end? I am sure we've all done it. Well, I borrowed a good thing from other languages called an enum (enumeration)... I've done the code already but have not committed. What do you think? <eucode> global enum D_NAME, D_ATTRIBUTES, D_SIZE, ... global enum PERSON_NAME, PERSON_AGE=5, PERSON_DOB, PERSON_EMAIL printf(1, "name=%d, attributes=%d, size=%d\n", { D_NAME, D_ATTRIBUTES, D_SIZE}) printf(1, "person_name=%d, age=%d, dob=%d, email=%d\n", { PERSON_NAME, PERSON_AGE, PERSON_DOB, PERSON_EMAIL}) -- name=1, attributes=2, size=3 -- person_name=1, age=5, dob=6, email=7 </eucode> An enum is not a new type, it emits a constant. They can be local or global. I think it has a lot of benefit but wanted to get community input. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21020 Date: 2008 May 14 23:37 From: Fernando Bauer <fmbauer at hot??il.com> Subject: Re: Optional "then" and "do" Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > Oh, and to me, do and then really aren't synonyms so much. It's the way you > > say things in English. > > > > Well, "then" is anyway. > > > > if i=3 do exit end if > > > > is very ugly to me too. > > > > I agree. do and then may be a place holder, but read very different, thus make > code cleaner and easier to read, .. for English speakers, > which is very important. > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> -= B E G I N =- X-EUFORUM: 21021 Date: 2008 May 15 0:11 From: Alan F <acf.projects at gmail?co?> Subject: Re: Enum? Jeremy Cowgar wrote: > Etc... This is fine, but what if you want to add a new element and not at the > end? I am sure we've all done it. Well, I borrowed a good thing from other languages > called an enum (enumeration)... I've done the code already but have not committed. > What do you think? > > <eucode> > global enum D_NAME, D_ATTRIBUTES, D_SIZE, ... > global enum PERSON_NAME, PERSON_AGE=5, PERSON_DOB, PERSON_EMAIL > > printf(1, "name=%d, attributes=%d, size=%d\n", { > D_NAME, D_ATTRIBUTES, D_SIZE}) > printf(1, "person_name=%d, age=%d, dob=%d, email=%d\n", { > PERSON_NAME, PERSON_AGE, PERSON_DOB, PERSON_EMAIL}) > > -- name=1, attributes=2, size=3 > -- person_name=1, age=5, dob=6, email=7 > </eucode> > > An enum is not a new type, it emits a constant. They can be local or global. > I think it has a lot of benefit but wanted to get community input. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I think this is a very good idea. This seems like a relatively safe change to make, as it only affects the front-end. With something like this in the language, I think we could stop worrying about how/whether to implement structures, as this pretty much takes care of that. -= B E G I N =- X-EUFORUM: 21022 Date: 2008 May 15 0:15 From: Alex Caracatsanis <sunpsych at ?cabl?.com.au> Subject: switch/case construct for Eu? Would people find a "case" or "switch" construct useful to have in Eu? It's not that I would know how to do this myself, but since we're talking about all sorts of changes to Eu I thought this would be a good time to add this question to the agenda. Alex Caracatsanis -= B E G I N =- X-EUFORUM: 21023 Date: 2008 May 15 0:22 From: c.k.lester <euphoric at ?kleste?.com> Subject: Re: Enum? Jeremy Cowgar wrote: > > An enum is not a new type, it emits a constant. They can be local or global. > I think it has a lot of benefit but wanted to get community input. I've always wanted this kind of functionality, but got by without it. It would be interesting to see how much code this would replace in the archive. -= B E G I N =- X-EUFORUM: 21024 Date: 2008 May 15 0:40 From: Fernando Bauer <fmbauer at hotma?l.c?m> Subject: Re: Optional "then" and "do" Jason Gade wrote: > > Fernando Bauer wrote: > > > > Kat wrote: > > > > > > Larry Miller wrote: > > > > > > > > yuku wrote: > > > > > > > > > > I made changes to the parser.e so that the keyword "then" and "do" > > > > > is optional (if the coder wants that it is still accepted). > > > > > > > > > > Reasons: > > > > > > > > > > - Less typing > > > > > > > > > > - Prevent mistakes of writing if <expr> do and for <expr> then > > > > > which I did a lot of times (Kat too) > > > > > > Confirmed, especially when changing code from one loop form to another to get > > > program flow to use exit correctly. I often wonder why "then" and "do" aren't > > > the same word. > > > > Me too. I think both 'do' and 'then' exist to mark the beginning of a executable > > block of code. So, if they are synonyms, one of them is superfluous and could > > be eliminated (in my opinion 'then'). > > > > A similar case occurs with '..' (slice operator) and 'to' (historical note: > > ZX81 BASIC uses 'TO' for 'FOR' statements and also for slices). Both have the > > meaning of a range. In this case I would keep with '..'. > > Then, we could write something like this: > > > > for i = 1..10 do > > if i=3 do exit end if > > end for > > > > [snipped] > > > > Just some provocative thoughts! :-) > > > > - Fernando > > Okay, now to that I have to say "yuk!" > > I mean, we may as well write > for(i = 0; i < 10; i++) { > /* do something */ > } > > Which certainly has its own elegance, but it isn't Euphoria. Agreed. But I'm sure that any Euphoria programmer would understand my example. The difference is minimal, just other characters (already used) for the same token and the advantage is: less keywords to know and to parse. You could call it a Euphoria dialect. All things change and evolve, even if we don't want. A computer language should also obey this natural principle. One form to evolve is creating mutations, which in this case is a dialect. Some modifications in Eu 4.0 are more profound than these ones. Finally, your example uses a different syntax and semantics, and not every Euphoria programmer would understand it, so IMHO it's not a Euphoria dialect. Anyway, thanks for your reply! - Fernando > > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. -= B E G I N =- X-EUFORUM: 21025 Date: 2008 May 15 0:51 From: Kat <KAT12 at coo?a?s.net> Subject: Re: Enum? Alan F wrote: > > Jeremy Cowgar wrote: > > Etc... This is fine, but what if you want to add a new element and not at the > > end? I am sure we've all done it. Well, I borrowed a good thing from other languages > > called an enum (enumeration)... I've done the code already but have not committed. > > What do you think? > > > > <eucode> > > global enum D_NAME, D_ATTRIBUTES, D_SIZE, ... > > global enum PERSON_NAME, PERSON_AGE=5, PERSON_DOB, PERSON_EMAIL > > > > printf(1, "name=%d, attributes=%d, size=%d\n", { > > D_NAME, D_ATTRIBUTES, D_SIZE}) > > printf(1, "person_name=%d, age=%d, dob=%d, email=%d\n", { > > PERSON_NAME, PERSON_AGE, PERSON_DOB, PERSON_EMAIL}) > > > > -- name=1, attributes=2, size=3 > > -- person_name=1, age=5, dob=6, email=7 > > </eucode> > > > > An enum is not a new type, it emits a constant. They can be local or global. > > I think it has a lot of benefit but wanted to get community input. > > > > -- > > Jeremy Cowgar > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > I think this is a very good idea. This seems like a relatively safe change to > make, as it only affects the front-end. With something like this in the language, > I think we could stop worrying about how/whether to implement structures, as > this > pretty much takes care of that. Static structures, yeas. Still, go for it, Jeremy! Kat -= B E G I N =- X-EUFORUM: 21026 Date: 2008 May 15 1:09 From: irv mullins <irvm at el?ijay.?om> Subject: Re: Enum? Kat wrote: > > Alan F wrote: > > > > Jeremy Cowgar wrote: > > > Etc... This is fine, but what if you want to add a new element and not at the > > > end? I am sure we've all done it. Well, I borrowed a good thing from other languages > > > called an enum (enumeration)... I've done the code already but have not committed. > > > What do you think? > > > > > > <eucode> > > > global enum D_NAME, D_ATTRIBUTES, D_SIZE, ... > > > global enum PERSON_NAME, PERSON_AGE=5, PERSON_DOB, PERSON_EMAIL > > > > > > printf(1, "name=%d, attributes=%d, size=%d\n", { > > > D_NAME, D_ATTRIBUTES, D_SIZE}) > > > printf(1, "person_name=%d, age=%d, dob=%d, email=%d\n", { > > > PERSON_NAME, PERSON_AGE, PERSON_DOB, PERSON_EMAIL}) > > > > > > -- name=1, attributes=2, size=3 > > > -- person_name=1, age=5, dob=6, email=7 > > > </eucode> > > > > > > An enum is not a new type, it emits a constant. They can be local or global. > > > I think it has a lot of benefit but wanted to get community input. > > > > > > -- > > > Jeremy Cowgar > > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > > > I think this is a very good idea. This seems like a relatively safe change to > > make, as it only affects the front-end. With something like this in the language, > > I think we could stop worrying about how/whether to implement structures, as > > this > > pretty much takes care of that. > > Static structures, yeas. Still, go for it, Jeremy! > > Kat It would have saved me - no exaggeration - several day's work. Please add enums. -= B E G I N =- X-EUFORUM: 21027 Date: 2008 May 15 1:11 From: Derek Parnell <ddparnell at ?igpond?com> Subject: Re: Optional "then" and "do" Fernando Bauer wrote: > I think both 'do' and 'then' exist to mark the beginning of a executable > block of code. So, if they are synonyms, one of them is superfluous > and could be eliminated (in my opinion 'then'). I was thinking along the same lines. 'do' and 'then' both serve identical semantic purpose : A delimiter between the end of an expression and the beginning of the next statement. Technically they could be used interchangably without upsetting the parser. for i = 1 to 10 then ... end for if i = 1 do ... end if But, for (English-speaking) coders reading the text, 'then' after an 'if' reads better than 'do'. And 'then' following a loop keyword just reads weirdly. So I think we should keep their usage as is and also not make them optional. > A similar case occurs with '..' (slice operator) and 'to' (historical note: > ZX81 BASIC uses 'TO' for 'FOR' statements and also for slices). Both have the > meaning of a range. In this case I would keep with '..'. > Then, we could write something like this: > > for i = 1..10 do > if i=3 do exit end if > end for I think a range operator would make a useful addition to the language, but not yet. We need to think this one through a lot more to see how generic and 'Euphoric' we can make it. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21028 Date: 2008 May 15 1:31 From: Derek Parnell <ddparnell at ?igpond.com> Subject: Re: Enum? Jeremy Cowgar wrote: > > I do this all the time and I know others do because I see in it code everywhere. > Here are some examples, some of which you will recognize: Yes, I do this OFTEN! However, I use a execute-time mechanism to make it less error prone ... <eucode> include series.e constant sFILE = next-number(0), FILE_NO = next-number(sFILE), LINE_NO = next-number(sFILE), FILE_PTR = next-number(sFILE), FILE_START_SYM = next-number(sFILE), OP_WARNING = next-number(sFILE), OP_TRACE = next-number(sFILE), OP_TYPE_CHECK = next-number(sFILE), OP_PROFILE_TIME = next-number(sFILE), OP_PROFILE_STATEMENT = next-number(sFILE), OP_DEFINES = next-number(sFILE), maxFILE = current-number(sFILE) </eucode> > What do you think? This idea would be a good addition to the language. It is good because it happens at parser-time and not execute-time like my solution does. Just an an idle thought, it is sometimes useful to know the first and last values (the range) of an enumeration. Can you think of a syntax that would give us this? Maybe something like this, borrowing from RegEx syntax ... <eucode> enum FILE_NO, LINE_NO, FILE_PTR, FILE_START_SYM, OP_WARNING, OP_TRACE, OP_TYPE_CHECK, OP_PROFILE_TIME, OP_PROFILE_STATEMENT, OP_DEFINES, minFILE=^, -- first enumeration value maxFILE=$ -- last enumeration value </eucode> -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21029 Date: 2008 May 15 1:45 From: Derek Parnell <ddparnell at ?igpond?com> Subject: Re: switch/case construct for Eu? Alex Caracatsanis wrote: > > Would people find a "case" or "switch" construct useful to have in Eu? It's > not that I would know how to do this myself, but since we're talking about > all sorts of changes to Eu I thought this would be a good time to add this > question to the agenda. Yes, and apart from the syntax of such a construct, the contentious issues revolve around ... (a) Do we allow drop though by default? (b) Do we allow expression lists? (c) Do we allow non-equality expressions? (d) Do we force a 'default' case? <eucode> test someVar -- (1) when 1 do ... end when -- (2) when 2, 3, 5, 8 do ... end when -- (3) when > 10 do ... end when -- (4) when otherwise do ... end when -- (5) end test -- (6) </eucode> Line #1: Must this be a variable or can we also use any expression? Line #2: After doing the statements, does flow drop though to the next 'when' or go to the 'end test'? In which case, we need an 'exit' to leave the construct. Line #3: Can I use a list of expressions? Line #4: Can I give a non-equality test? Line #5: Must I have a default case? I'm not wedded to the example syntax above, I'm just using it to show the issues that need to be resolved first. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21030 Date: 2008 May 15 1:45 From: Shawn Pringle <shawn.pringle at ?mail.?om> Subject: Re: No more platform(), conditional includes, conditional functions, condit Everything you are talking about here can be done in the existing syntax of Euphoria. Its a matter of syntax whether you define or not define something; or if you define it to be one value or another. You just need two builtins: version_string(), and version_atom(). You can guess what they could do and why all of this ifdef stuff is surpufluous. Shawn Pringle Jeremy Cowgar wrote: > > CChris wrote: > > > > I think ifdef would be even more useful with a couple predefined variables. > > One I'm thinking about is "version": > > <eucode> > > ifdef version-3.1.1 then > > x=find_from(0,s,5) > > else > > x=find(0,s[5..$]) > > if x>0 then x+=(5-1) end if > > end if > > </eucode> > > Yes, I included predefined version for here on out. Predefined "defines" I made > all upper case and 1 word. So, the version number is EU400. But I am open to > suggestions on version number schemes. The above, version-3.1.1 would cause > parsing problems in my code, i.e. version - 3.1.1 var version, minus an > invalid number (3.1.1). > > I was thinking VERSION_400 might be a bit clearer than what I initially choose, > EU400. Anyway, EU400, EU401, EU402, EU500, etc... You can then do things like > this as a library writer: > > <eucode> > ifdef EU400 then > -- 4.0 does not have the new 5.0 function "insanely_fast_sort", so > -- mimic it with a slower sort > global function insanely_fast_sort(sequence items) > return sort(items) > end global function > end ifdef > </eucode> > > Now, a future plan should be simple comparisons and logical operators, but it's > not there yet > > <eucode> > ifdef VERSION > 400 then > -- code > end ifdef > > ifdef LINUX or FREEBSD then > -- code > end ifdef > </eucode> > > The above will come, but maybe not with 4.0. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> -= B E G I N =- X-EUFORUM: 21031 Date: 2008 May 15 1:46 From: Jason Gade <jaygade at yah?o.?om> Subject: Re: Enum? Jeremy Cowgar wrote: > > I do this all the time and I know others do because I see in it code everywhere. > Here are some examples, some of which you will recognize: > > <eucode> > constant FILE_NO = 1, -- file number > LINE_NO = 2, -- local line number > FILE_PTR = 3, -- open file number > FILE_START_SYM = 4, -- symbol before start of file > OP_WARNING = 5, -- save/restore with/without options > OP_TRACE = 6, > OP_TYPE_CHECK = 7, > OP_PROFILE_TIME = 8, > OP_PROFILE_STATEMENT = 9, > OP_DEFINES = 10 -- ifdef defines > > global constant GET_SUCCESS = 0, > GET_EOF = -1, > GET_FAIL = 1, > GET_NOTHING = -2 > > global constant > D_NAME = 1, > D_ATTRIBUTES = 2, > D_SIZE = 3, > D_YEAR = 4, > D_MONTH = 5, > D_DAY = 6, > D_HOUR = 7, > D_MINUTE = 8, > D_SECOND = 9 > </eucode> > > Etc... This is fine, but what if you want to add a new element and not at the > end? I am sure we've all done it. Well, I borrowed a good thing from other languages > called an enum (enumeration)... I've done the code already but have not committed. > What do you think? > > <eucode> > global enum D_NAME, D_ATTRIBUTES, D_SIZE, ... > global enum PERSON_NAME, PERSON_AGE=5, PERSON_DOB, PERSON_EMAIL > > printf(1, "name=%d, attributes=%d, size=%d\n", { > D_NAME, D_ATTRIBUTES, D_SIZE}) > printf(1, "person_name=%d, age=%d, dob=%d, email=%d\n", { > PERSON_NAME, PERSON_AGE, PERSON_DOB, PERSON_EMAIL}) > > -- name=1, attributes=2, size=3 > -- person_name=1, age=5, dob=6, email=7 > </eucode> > > An enum is not a new type, it emits a constant. They can be local or global. > I think it has a lot of benefit but wanted to get community input. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Yes, I think with the ubiquity of sequences and how they are used to simulate structures sometimes, enumerated constants would be a welcome addition. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21032 Date: 2008 May 15 1:46 From: Jason Gade <jaygade at yaho?.?om> Subject: Re: Optional "then" and "do" Well, I guess you could write a programming language in a language other than English if you wanted. :-) -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21033 Date: 2008 May 15 1:50 From: Jason Gade <jaygade at yahoo??om> Subject: Re: Optional "then" and "do" Fernando Bauer wrote: > > Jason Gade wrote: > > > > I mean, we may as well write > > for(i = 0; i < 10; i++) { > > /* do something */ > > } > > > > Which certainly has its own elegance, but it isn't Euphoria. > > Agreed. But I'm sure that any Euphoria programmer would understand my example. > The difference is minimal, just other characters (already used) for the same > token and the advantage is: less keywords to know and to parse. You could call > it a Euphoria dialect. All things change and evolve, even if we don't want. > A computer language should also obey this natural principle. One form to evolve > is creating mutations, which in this case is a dialect. Some modifications in > Eu 4.0 are more profound than these ones. > Finally, your example uses a different syntax and semantics, and not every Euphoria > programmer would understand it, so IMHO it's not a Euphoria dialect. > > Anyway, thanks for your reply! > - Fernando Well, I can understand a lot of things, but some of these examples are jarring. One of the things that I like about Euphoria is that it accomplishes the relatively difficult goal of reading very similarly to natural English without being overly wordy. I think that it strikes a happy medium. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21034 Date: 2008 May 15 1:57 From: Jeremy Cowgar <jeremy at cow?ar.co?> Subject: Re: No more platform(), conditional includes, conditional functions, condit Shawn Pringle wrote: > > Everything you are talking about here can be done in the existing syntax > of Euphoria. > > Its a matter of syntax whether you define or not define something; or if you > define it to be one value or another. You just need two builtins: > version_string(), and version_atom(). You can guess what they could do and > why all of this ifdef stuff is surpufluous. > Shawn, do you understand what ifdef/elsifdef stuff does? What you describe is *far* from what ifdef/elsifdef is capable of. ifdef/elsifdef is all compile time decisions. i.e. no runtime performance hits. Code that is not matched does not even get emitted as IL or as C translator code. Please read: http://www.openeuphoria.org/EUforum/m20863.html -- and -- http://www.openeuphoria.org/EUforum/m20891.html After reading that, let me know if you think the ifdef stuff is superfluous. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21035 Date: 2008 May 15 1:59 From: Derek Parnell <ddparnell at bi?pond.co?> Subject: Re: No more platform(), conditional includes, conditional functions, condit Shawn Pringle wrote: Hi Shawn, > Everything you are talking about here can be done in the existing syntax > of Euphoria. Thanks for this idea. However, it appears that current Euphoria can't actually do some of the things that 'ifdef' would bring to the language. The reason is one of timing. When Euphoria runs a program it does two things: (1) Converts your source code to IL (intermediate language). This is the front-end at work. (2) Executes the generated IL code. This is the back-end at work. To use the current Euphoria, the tests for version, debug, whatever... all happen during the back-end phase, everytime it needs to make a decision about which section of code to run. The proposal is to move a lot of this to the front-end. The effect will be to have it decide once only and to decrease the size of the IL generated. This is because it looks at the 'ifdef' during converting the text and if it needs to convert the next section of code it does otherwise it just skips over it. The result is that the runtime phase never needs to make the decision again, it just runs the required code. > Its a matter of syntax whether you define or not define something; or if you > define it to be one value or another. You just need two builtins: > version_string(), and version_atom(). You can guess what they could do and > why all of this ifdef stuff is surpufluous. In one way it is superfluous, but the value of it is that it can make programs run faster. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21036 Date: 2008 May 15 2:08 From: Alan F <acf.projects at ?ma?l.com> Subject: Re: Enum? Derek Parnell wrote: > > Just an an idle thought, it is sometimes useful to know the first and last values > (the range) of an enumeration. Can you think of a syntax that would give us > this? Maybe something like this, borrowing from RegEx syntax ... > > <eucode> > enum > FILE_NO, > LINE_NO, > FILE_PTR, > FILE_START_SYM, > OP_WARNING, > OP_TRACE, > OP_TYPE_CHECK, > OP_PROFILE_TIME, > OP_PROFILE_STATEMENT, > OP_DEFINES, > minFILE=^, -- first enumeration value > maxFILE=$ -- last enumeration value > </eucode> > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell From what I understand, the first entry in any 'enum' statement is always set to 1. However, the 'last enumeration value' option would be useful (for example, to define a sequence of that length for holding a structure), but I wasn't and still am not sure what would be good syntax for this. I'm not so sure about the $ syntax proposed. -= B E G I N =- X-EUFORUM: 21037 Date: 2008 May 15 2:10 From: yuku <yuku at ?k?tek.com> Subject: Re: Optional "then" and "do" Salix wrote: > But if I tend to forget "and". The result now is > > <eucode> > if apple=1 bananas=3 then peach=7 end if > </eucode> > > With optional "then" it would be > > <eucode> > if apple=1 bananas=3 peach=7 end if > </eucode> > > that is much harder to track down. You can always write the "then" if you want. Especially in such one-line if. Reason of making it optional is that it reduces the mental load of remembering the correct delimiter for every if, for and while statement. -= B E G I N =- X-EUFORUM: 21038 Date: 2008 May 15 2:24 From: Jeremy Cowgar <jeremy at c?wgar?com> Subject: Re: Enum? > From what I understand, the first entry in any 'enum' statement is always > set to 1. However, the 'last enumeration value' option would be useful > (for example, to define a sequence of that length for holding a structure), > but I wasn't and still am not sure what would be good syntax for this. I'm not > so sure about the $ syntax proposed. Actually, you can set it to anything you want. It defaults to 1 if nothing is given... <eucode> enum NAME=20,AGE,DOB -- 20,21,22 enum ENGINE,WHEELS,MUFFLER -- 1,2,3 enum A=-3,B,C,D,E,F -- -3, -2, -1, 0, 1, 2 enum A,B,C,D=10,E,F -- 1,2,3,10,11,12 </eucode> -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21039 Date: 2008 May 15 2:26 From: Derek Parnell <ddparnell at ?igpond.co?> Subject: Re: Enum? Alan F wrote: > From what I understand, the first entry in any 'enum' statement is always > set to 1. Actually it turns out that this is not always the case. Consider ... enum FAILURE = -1, OKAY enum WM_USER = #0400, WM_NOTIFY, WM_DROPDOWN In these cases, the first item is not 1. There is also the case where a coder does this ... enum OPTA = 2, OPTB = 9, OPTC = 0, OPTD = 7 Here the 'first' one is 2, the 'minimum' one is 0, then 'number of values' is 4, the 'last' one is 7 and the 'maximum' one is 9. All these properties (okay maybe not first and last) are useful to know. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21040 Date: 2008 May 15 4:15 From: Shawn Pringle <shawn.pringle at gmail.?o?> Subject: Re: New keywords: ifdef, elsifdef, end ifdef Jeremy Cowgar wrote: > I like elsif better and it would reduce one keyword count, but I'm not sure > about it's clarity? Also, it would then blend in better with other standard > if/elsif/end if statements? Thinking aloud seeking input. That sounds like optimization: Consider, in binding an executable that has the condition involving platform() comparing to a constant. For the interpreter this is an expression that could change from execution to execution, but for the program that makes the binary it will be a constant in the target executable. So, it can optimize out the stuff that is for Windows if you are binding for a Linux program. EUPHORIA expressions involving no functions always give you the same value if they contain only constants. That can be the criteria for whether the binder should evaluate the expression itself and optimize accordingly. Shawn Pringle -= B E G I N =- X-EUFORUM: 21041 Date: 2008 May 15 4:23 From: Jason Gade <jaygade at y?hoo.?om> Subject: Re: New keywords: ifdef, elsifdef, end ifdef Shawn Pringle wrote: > > Jeremy Cowgar wrote: > > > I like elsif better and it would reduce one keyword count, but I'm not sure > > about it's clarity? Also, it would then blend in better with other standard > > if/elsif/end if statements? Thinking aloud seeking input. > > That sounds like optimization: > > > Consider, in binding an executable that has the condition involving platform() > comparing to a constant. For the interpreter this is an expression that could > > change from execution to execution, but for the program that makes the binary > it will be a constant in the target executable. So, it can optimize out the > stuff that is for Windows if you are binding for a Linux program. > > EUPHORIA expressions involving no functions always give you the same value if > they contain only constants. That can be the criteria for whether the binder > should evaluate the expression itself and optimize accordingly. > > Shawn Pringle For most uses of ifdef and its ilk, the performance difference will be so small as to be completely unnoticeable. I mean, you're not going to usually do an ifdef around a critical loop. Well, you might... The main thing I see is that conditional interpretation can help version-proof the language among other things. If I am thinking correctly, anything that doesn't pass an ifdef test is considered a comment by the interpreter and is discarded. A small feature, but seemingly useful. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21042 Date: 2008 May 15 4:29 From: Jeremy Cowgar <jeremy at ?o?gar.com> Subject: Re: New keywords: ifdef, elsifdef, end ifdef Shawn Pringle wrote: > > That sounds like optimization: > It's much more than that. It's the ability for conditional includes. It's the ability to remove code from bound or executable code you may not want in there (such as shareware/full), It gives you the function of even being able to maintain backwards compatability! Say for instance 4.1 comes out and 4.1 defines a new function called fast_find or who knows what. You can now: <eucode> ifdef EU400 then global function fast_find(...) end function end ifdef </eucode> All sorts of other things. Imagine this: <eucode> while 1 do if debug = 1 then puts(1, "Reading xyz...\n") end if -- code end while </eucode> Well, before you ship your app, you should remove all your if debug = 1 statements. Now look at: <eucode> while 1 do ifdef debug then puts(1, "Reading xyz...\n") end ifdef -- code end while </eucode> Now, run your app: exwc -D debug myapp.ex or translate: ecu myapp.ex That loop may run 100,000 times in your application. Hm, in fact, I have that in a web app that is small time and it takes about 8 million hits a month now to the dynamic side of the app. Granted, that's not big, but, it's not a for 1 = 1 to 10 loop either. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21043 Date: 2008 May 15 4:49 From: Shawn Pringle <shawn.pringle at gmai?.?om> Subject: Re: Enum? A better enum for EUPHORIA Instead of enum as it is from C. We can vastly improve on enum. Consider labeling a group of constants in an enum statement enum memory_protection MEM_WRITEREAD = #40, MEM_READ = #80, ... puts(1, memory_protection.to_string( #40 )) -- displays "MEM_WRITEREAD" enum bitfield linux_memory_protection PROT_NONE = 0, PROT_READ = 1, PROT_WRITE = 2, PROT_EXEC = 4 puts( 1, linux_memory_protection.to_string( 3 ) ) -- displays "or_bits( PROT_READ, PROT_WRITE )" -= B E G I N =- X-EUFORUM: 21044 Date: 2008 May 15 4:53 From: Jeremy Cowgar <jeremy at cowg?r.com> Subject: Re: Enum? A better enum for EUPHORIA Shawn Pringle wrote: > > Instead of enum as it is from C. We can vastly improve on > enum. Consider labeling a group of constants in an enum statement > > enum memory_protection MEM_WRITEREAD = #40, MEM_READ = #80, ... > > > puts(1, memory_protection.to_string( #40 )) -- displays "MEM_WRITEREAD" > > > enum bitfield linux_memory_protection PROT_NONE = 0, > PROT_READ = 1, > PROT_WRITE = 2, PROT_EXEC = 4 > > puts( 1, linux_memory_protection.to_string( 3 ) ) -- displays "or_bits( PROT_READ, > PROT_WRITE )" Do you want var names stored in translated and IL code? How would that be helpful? Also, it seems that the enum would create a namespace that would then have to be tracked, parsed and looked up? I'm a bit confused at what this accomplishes, can you expand a bit. I am all for better things. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21045 Date: 2008 May 15 4:58 From: Shawn Pringle <shawn.pringle at gm?il.co?> Subject: Re: New keywords: ifdef, elsifdef, end ifdef Jeremy Cowgar wrote: > > Shawn Pringle wrote: > > > > That sounds like optimization: > > > > It's much more than that. It's the ability for conditional includes. It's the > ability to remove code from bound or executable code you may not want in there > (such as shareware/full), It gives you the function of even being able to maintain > backwards compatability! Say for instance 4.1 comes out and 4.1 defines a new > function called fast_find or who knows what. You can now: > > <eucode> > ifdef EU400 then > global function fast_find(...) > end function > end ifdef > </eucode> > That would have been useful when win32lib.ew put a string type in their library. What I meant by my previous post was you could blend the if and ifdef by having the truth value evaluated when you the program gets bound. Then you don't need ifdef. You could have a version() builtin to get a version number -= B E G I N =- X-EUFORUM: 21046 Date: 2008 May 15 5:02 From: Shawn Pringle <shawn.pringle at ??ail.com> Subject: Re: Enum? A better enum for EUPHORIA Jeremy Cowgar wrote: > > Shawn Pringle wrote: > > > > Instead of enum as it is from C. We can vastly improve on > > enum. Consider labeling a group of constants in an enum statement > > > > enum memory_protection MEM_WRITEREAD = #40, MEM_READ = #80, ... > > > > > > puts(1, memory_protection.to_string( #40 )) -- displays "MEM_WRITEREAD" > > > > > > enum bitfield linux_memory_protection PROT_NONE = 0, > > PROT_READ = 1, > > PROT_WRITE = 2, PROT_EXEC = 4 > > > > puts( 1, linux_memory_protection.to_string( 3 ) ) -- displays "or_bits( PROT_READ, > > PROT_WRITE )" > > Do you want var names stored in translated and IL code? How would that be helpful? > Also, it seems that the enum would create a namespace that would then have to > be tracked, parsed and looked up? I'm a bit confused at what this accomplishes, > can you expand a bit. I am all for better things. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> This would help a lot in debugging or when there is an error condition, I will print out an error but I am not likely to write out the strings for all of say the Windows error constants. This construct would save the programmer the trouble though. Shawn Pringle -= B E G I N =- X-EUFORUM: 21047 Date: 2008 May 15 5:06 From: Jeremy Cowgar <jeremy at co?gar?com> Subject: Re: New keywords: ifdef, elsifdef, end ifdef Shawn Pringle wrote: > > That would have been useful when win32lib.ew put a string type in their library. > > What I meant by my previous post was you could blend the if and ifdef by > having the truth value evaluated when you the program gets bound. Then you > don't need ifdef. You could have a version() builtin to get a version number I think we are running into a limitation of what can be done, feasibly. I see your point, however, I think it's nearly impossible w/out some huge rewrites. Currently nothing can be executed until the whole app is translated into IL code. So, functions that return values or dynamic if statements are currently out of the question for the potential of omitting code. A new keyword was needed that would do very limited decision making based on values that are known at parse time, hence the defined words that are handled at parse time via command line and using the with keyword (which is a parse time keyword as well). -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21048 Date: 2008 May 15 5:06 From: Kat <KAT12 at ??osahs.net> Subject: Re: New keywords: ifdef, elsifdef, end ifdef Shawn Pringle wrote: <snip> > That would have been useful when win32lib.ew put a string type in their library. Wait,, there's a string type in win32lib?? Kat -= B E G I N =- X-EUFORUM: 21049 Date: 2008 May 15 5:17 From: Jason Gade <jaygade at ya?oo.?om> Subject: Re: request for 4.0 Kat wrote: > > > Is it possible to add a keyword or three to augment the filesystem commands > we already have? For instance, seek() accepts only maxint, which means i can > seek only 1/4 the way into the file i have here. And from what i understand, > passing a bigger value to seek() won't work. So how about seek_more() or seek_skip() > or seek_large() to call code in the OS to manage the numbers over maxint, so > Eu doesn't see them and roll them into floating points? That way, to seek 6 > gigabytes into a file, i can seek(4000000000) and then seek_large(2000000000). > > Kat This may be doable, I need to look into it some more... No promises though. You know how I am with projects and procrastination. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21050 Date: 2008 May 15 5:38 From: Mike777 <anon4321 at gmail??om> Subject: Re: New keywords: ifdef, elsifdef, end ifdef Kat wrote: > > Shawn Pringle wrote: > > <snip> > > > That would have been useful when win32lib.ew put a string type in their library. > > Wait,, there's a string type in win32lib?? type w32string Implements an ASCII string. Mike -= B E G I N =- X-EUFORUM: 21051 Date: 2008 May 15 6:09 From: Salix <salix at fr??mail.hu> Subject: Re: Optional "then" and "do" yuku wrote: > > You can always write the "then" if you want. > Especially in such one-line if. > > Reason of making it optional is that it reduces the mental load of > remembering the correct delimiter for every if, for and while statement. It does increase the mental load. You can not competely rely on the interpreter that it will catch the "skipping error" in my example. To handle your problem you should rather consider changing your code editor with predefined code patterns. E.g. you just type <eucode> for -- press Ctrl-J in Context </eucode> ... and you can get <eucode> for i=1 to | by 1 do -- doit() end for </eucode> I'd be really sad if a feature that I keep very useful would be killed from Euphoria because of the mental problems mentioned by you. :-) Anyway this is the way I see it... There are others (inc. you) who code 100x more in Euphoria than I do. Cheers, Salix -= B E G I N =- X-EUFORUM: 21052 Date: 2008 May 15 7:26 From: CChris <christian.cuvier at agriculture?gou?.fr> Subject: Re: Optional "then" and "do" Jason Gade wrote: > > Fernando Bauer wrote: > > > > Jason Gade wrote: > > > > > > I mean, we may as well write > > > for(i = 0; i < 10; i++) { > > > /* do something */ > > > } > > > > > > Which certainly has its own elegance, but it isn't Euphoria. > > > > Agreed. But I'm sure that any Euphoria programmer would understand my example. > > The difference is minimal, just other characters (already used) for the same > > token and the advantage is: less keywords to know and to parse. You could call > > it a Euphoria dialect. All things change and evolve, even if we don't want. > > A computer language should also obey this natural principle. One form to evolve > > is creating mutations, which in this case is a dialect. Some modifications in > > Eu 4.0 are more profound than these ones. > > Finally, your example uses a different syntax and semantics, and not every Euphoria > > programmer would understand it, so IMHO it's not a Euphoria dialect. > > > > Anyway, thanks for your reply! > > - Fernando > > Well, I can understand a lot of things, but some of these examples are jarring. > > One of the things that I like about Euphoria is that it accomplishes the relatively > difficult goal of reading very similarly to natural English without being overly > wordy. I think that it strikes a happy medium. > I certainly wouldn't agree with the latter. See how much you have to write to share a state (as a sequence - no pointers) between two functions. You can pass {x1,x2,x3}, fine.. But when the sequence state is returned, you have to code x1=state[1] x2=sate[2] etc while {x1,x2,x3}=state is clear enough. Just one example out of many. CChris > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. -= B E G I N =- X-EUFORUM: 21053 Date: 2008 May 15 7:31 From: CChris <christian.cuvier at agr?culture.g?uv.fr> Subject: Re: No more platform(), conditional includes, conditional functions, condit Derek Parnell wrote: > > Shawn Pringle wrote: > > Hi Shawn, > > > Everything you are talking about here can be done in the existing syntax > > of Euphoria. > > Thanks for this idea. > > However, it appears that current Euphoria can't actually do some of the things > that 'ifdef' would bring to the language. The reason is one of timing. > > When Euphoria runs a program it does two things: > (1) Converts your source code to IL (intermediate language). This is the front-end > at work. > (2) Executes the generated IL code. This is the back-end at work. > > To use the current Euphoria, the tests for version, debug, whatever... all happen > during the back-end phase, everytime it needs to make a decision about which > section of code to run. The proposal is to move a lot of this to the front-end. > The effect will be to have it decide once only and to decrease the size of the > IL generated. This is because it looks at the 'ifdef' during converting the > text and if it needs to convert the next section of code it does otherwise it > just skips over it. The result is that the runtime phase never needs to make > the decision again, it just runs the required code. > > > Its a matter of syntax whether you define or not define something; or if you > > define it to be one value or another. You just need two builtins: > > version_string(), and version_atom(). You can guess what they could do and > > why all of this ifdef stuff is surpufluous. > > In one way it is superfluous, but the value of it is that it can make programs > run faster. > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell Let me add a short example. Following a suggestion, I added task_yield() to the main event loop in win32lib. task_yield() is not defined in 2.5 official. How to prevent a crash? "Simple", using Shawn's idea: <eucode> if version_atom >= 3.0 or equal(version_string,"2.5r3") then task_yield() end if </eucode> But that won't prevent the parser *seeing* task_yield() and complaining because it is not defined. ifdef does that, preventing the parser from seeing something. CChris -= B E G I N =- X-EUFORUM: 21054 Date: 2008 May 15 8:19 From: CChris <christian.cuvier at agriculture.?ou?.fr> Subject: Re: New keywords: ifdef, elsifdef, end ifdef Mike777 wrote: > > Kat wrote: > > > > Shawn Pringle wrote: > > > > <snip> > > > > > That would have been useful when win32lib.ew put a string type in their library. > > > > Wait,, there's a string type in win32lib?? > > type w32string Implements an ASCII string. > > Mike Sorry to nitpick, but... I'll change this doc entry anyway. User defined types in Eu hardly implement stuff, they just recognise it. A w32string is a plain sequence the contents of which are printable or control single byte chars. It doesn't implement char[] or TCHAR[] as such. btw I may consider tagging some user ctypes as printable, so as to allow DBCS chars in w32strings. Will be in 70.4a if it's delayed enough :-) CChris -= B E G I N =- X-EUFORUM: 21055 Date: 2008 May 15 8:58 From: Matt Lewis <matthewwalkerlewis at ?mail.?om> Subject: Re: wmake -f makefile.wat source Jeremy Cowgar wrote: > > Matt Lewis wrote: > > > > It's committed now. The target is "source". This was already done when I > > was building deb packages, so I could build a proper source tarball. > > > > What is this suppose to do? I'm trying to help iamscared on IRC build on Windows > 98. I was thinking this would build from pre-translated sources so that Euphoria > did not have to be installed in order to compile it? It's designed to allow a developer to translate the front end, but not compile. Then we can distribute a source tree that doesn't rely on the person doing the build having a working interpreter. Matt -= B E G I N =- X-EUFORUM: 21056 Date: 2008 May 15 9:01 From: Matt Lewis <matthewwalkerlewis at g?ail.?om> Subject: Re: Benchmarks CChris wrote: > > I need to find out if someone will make a Debian package or Gentoo ebuild for > Euphori a 3.0. It's a requirement of the contest that the language be > open-source and have a Debian package or Gentoo ebuild. Or be able to > build from source in the standard manner. Yes, I've already made a debian package (for 3.2, when it was called that). There's support for it in the source tree for both building a deb package, and for making a standard source tarball. Matt -= B E G I N =- X-EUFORUM: 21057 Date: 2008 May 15 9:15 From: Matt Lewis <matthewwalkerlewis at gma?l.?om> Subject: Re: Optional "then" and "do" yuku wrote: > > I made changes to the parser.e so that the keyword "then" and "do" > is optional (if the coder wants that it is still accepted). > > Reasons: > > - Less typing > > - Prevent mistakes of writing if <expr> do and for <expr> then > which I did a lot of times (Kat too) > > If no real objection is made, I will commit it. Though it has already been committed as I write this, I object. The then and do keywords serve a purpose. Consider the following error (warning C code ahead): while(1); { // do stuff goto foo; } foo: // do stuff Note that the semi-colon after the while statement ends the loop. So you get an infinite loop. This can be difficult to detect because you are drawn to the brackets, and can miss the fact that the semi-colon makes an empty statement become the body of the loop. This is similar to the point Salix made. While objections about having to use shifts to get to certain symbols make some sense to me (I guess emacs users don't mind this sort of thing) I think if you are really complaining about having to type 2 or 4 normal characters, you should go code in APL or something. I don't think we should combine then and do, although that's a less bad idea than making them optional. The if-then ties are pretty strong, IMHO. I think before we start making syntax optional, we should consider carefully where that leads. This is one reason why perl can be so difficult to read: There Is More Than One Way To Do It. Matt -= B E G I N =- X-EUFORUM: 21058 Date: 2008 May 15 9:19 From: Matt Lewis <matthewwalkerlewis at ?mail.?om> Subject: Re: Optional "then" and "do" yuku wrote: > > Salix wrote: > > But if I tend to forget "and". The result now is > > > > <eucode> > > if apple=1 bananas=3 then peach=7 end if > > </eucode> > > > > With optional "then" it would be > > > > <eucode> > > if apple=1 bananas=3 peach=7 end if > > </eucode> > > > > that is much harder to track down. > > You can always write the "then" if you want. > Especially in such one-line if. > > Reason of making it optional is that it reduces the mental load of > remembering the correct delimiter for every if, for and while statement. I argue that this mental load is dwarfed by the mental load required for maintenance. Matt -= B E G I N =- X-EUFORUM: 21059 Date: 2008 May 15 10:01 From: gshingles <gshingles at ?mail.c?m> Subject: Re: Enum? Derek Parnell wrote: > <eucode> > enum > FILE_NO, > LINE_NO, > FILE_PTR, > FILE_START_SYM, > OP_WARNING, > OP_TRACE, > OP_TYPE_CHECK, > OP_PROFILE_TIME, > OP_PROFILE_STATEMENT, > OP_DEFINES, > minFILE=^, -- first enumeration value > maxFILE=$ -- last enumeration value > </eucode> At first I didn't understand it, but after reading other proposals, I like this idea the best. I was wondering how you would determine the range of an enum from one of its members but if I understand what you are proposing, the ^ and $ symbols are valid from the start to the end of the enum statement. This seems the simplest for a compile-time feature, however does the entry 'minFILE' count against the value of maxFILE? :) ie from your example above: intent: minFILE = 1, maxFILE = 10 actual: minFILE = 1, maxFILE = 11 (because of minFILE) Maybe you could just store these in constants with ^ and $ available until the next enum keyword is encountered? They would have to be better named though because of $ being used for slices. eg enum_start, enum_end, enum_count ? But for the sake of not having to change 50 lines of code to insert a 'record' in a sequence I'm all for this change regardless. Gary -= B E G I N =- X-EUFORUM: 21060 Date: 2008 May 15 10:03 From: gshingles <gshingles at ?mail.?om> Subject: Re: Optional "then" and "do" Matt Lewis wrote: > I don't think we should combine then and do, although that's a less bad > idea than making them optional. The if-then ties are pretty strong, IMHO. > I think before we start making syntax optional, we should consider carefully > where that leads. This is one reason why perl can be so difficult to > read: There Is More Than One Way To Do It. I personally don't read Perl. I just write it once and it does what I want. ;-) Gary -= B E G I N =- X-EUFORUM: 21061 Date: 2008 May 15 10:21 From: CChris <christian.cuvier at agricultur?.gouv.?r> Subject: Re: Optional "then" and "do" Matt Lewis wrote: > > yuku wrote: > > > > Salix wrote: > > > But if I tend to forget "and". The result now is > > > > > > <eucode> > > > if apple=1 bananas=3 then peach=7 end if > > > </eucode> > > > > > > With optional "then" it would be > > > > > > <eucode> > > > if apple=1 bananas=3 peach=7 end if > > > </eucode> > > > > > > that is much harder to track down. > > > > You can always write the "then" if you want. > > Especially in such one-line if. > > > > Reason of making it optional is that it reduces the mental load of > > remembering the correct delimiter for every if, for and while statement. > > I argue that this mental load is dwarfed by the mental load required for > maintenance. > > Matt If using proper indentation to start and end code blocks, you'd get clearer code with less typing: <eucode> if something() do_stuff() while true poll_channel() -- end of all three blocks </eucode> Do away with end, do and then in one sweep. Make code structure visually clear, making maintainance easier. How clear is a sequence of interspersed "end if", "end for" and "end while"? All editors I know, except Notepad, have a detab command. The only drawback of the above is the stronger need to use it when pasting code from other files. CChris CChris -= B E G I N =- X-EUFORUM: 21062 Date: 2008 May 15 10:22 From: CChris <christian.cuvier at ?gr?culture.gouv.fr> Subject: Re: Enum? gshingles wrote: > > Derek Parnell wrote: > > <eucode> > > enum > > FILE_NO, > > LINE_NO, > > FILE_PTR, > > FILE_START_SYM, > > OP_WARNING, > > OP_TRACE, > > OP_TYPE_CHECK, > > OP_PROFILE_TIME, > > OP_PROFILE_STATEMENT, > > OP_DEFINES, > > minFILE=^, -- first enumeration value > > maxFILE=$ -- last enumeration value > > </eucode> > > At first I didn't understand it, but after reading other proposals, I like this > idea the best. > > I was wondering how you would determine the range of an enum from one of its > members > but if I understand what you are proposing, the ^ and $ symbols are valid from > the > start to the end of the enum statement. > > This seems the simplest for a compile-time feature, however > does the entry 'minFILE' count against the value of maxFILE? :) > > ie from your example above: > intent: minFILE = 1, maxFILE = 10 > actual: minFILE = 1, maxFILE = 11 (because of minFILE) > > Maybe you could just store these in constants with ^ and $ available > until the next enum keyword is encountered? They would have to be better > named though because of $ being used for slices. eg enum_start, enum_end, > enum_count ? > > But for the sake of not having to change 50 lines of code to insert a 'record' > in a sequence I'm all for this change regardless. > > Gary Me too. CChris -= B E G I N =- X-EUFORUM: 21063 Date: 2008 May 15 11:32 From: Matt Lewis <matthewwalkerlewis at gmai?.co?> Subject: Re: Optional "then" and "do" CChris wrote: > > If using proper indentation to start and end code blocks, you'd get clearer > code with less typing: > <eucode> > if something() > do_stuff() > while true > poll_channel() > -- end of all three blocks > </eucode> > > Do away with end, do and then in one sweep. Python called. Apparently, you answered. :P > Make code structure visually clear, making maintainance easier. How clear is > a sequence of interspersed "end if", "end for" and "end while"? I agree that consistent indentation is good coding style. I do it myself. But I really don't see the benefit here. I think it's a good thing to have clear definitions for blocks of code. The thens and dos and ends of euphoria are an expanded version of the curly brackets that many languages use. The more I think about this, the more strongly I feel that we shouldn't weaken the block definition, which removing a keyword (even optionally) does. Matt -= B E G I N =- X-EUFORUM: 21064 Date: 2008 May 15 11:49 From: ChrisBurch3 <crylex at gm?il.co?> Subject: Re: Optional "then" and "do" Hi Rarely chipping in into the (too?) rapidly evolving euphoria language. De blocking blocks of code with optional then then-do-ends will make for ugly, hard to maintain code, I for one vote strongly against this. As annoying as it is to keep on having to add do s and thens at run time, it makes the code much easier to read, and maintain later on. This commit should be de-commited asap. Chris -= B E G I N =- X-EUFORUM: 21065 Date: 2008 May 15 11:50 From: Derek Parnell <ddparnell at bigpond??om> Subject: Re: Optional "then" and "do" CChris wrote: > Do away with end, do and then in one sweep. ROFLMAO -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21066 Date: 2008 May 15 11:55 From: Derek Parnell <ddparnell at b?gpond.?om> Subject: Re: Optional "then" and "do" Matt Lewis wrote: > > yuku wrote: > > If no real objection is made, I will commit it. > > Though it has already been committed as I write this, I object. What!? Yuku, I think you were way too quick to commit this. Please, in future, discuss and get agreement/commitment BEFORE you commit stuff, especially things that are debatable. I STRONGLY OPPOSE THIS CHANGE. Making these delimiters optional will cause coding and maintenance errors. And the benefit ??? ... I just can see why this is a 'good thing'. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21067 Date: 2008 May 15 12:02 From: ChrisBurch3 <crylex at ?ma?l.com> Subject: Feature creep Hi There are so many changes going on at once, without solid feature testing (no disrespect Jeremy, but unit tests will only give you back what you want, and not always how they would react in real life (for this read all over the place coders like me)) Assume I am Mr Bog Standard Joe Coder. I don't care about all the internal shenannigans, I just want a robust, fast reasonably feature rich language, that could evolve at a reasonable pace, without breaking vast tracts of previous code and be well supported by all the authors. Where's the release for general programmers? Mr Coder wants a precompiled binary to run on Windows and Linux to just get going and testing (before you say there you go, you do it, that would just create so many problems for other poeple that its really not worth it). Mr Coder doesn't necessarily want to compile the language to get it to work, on either platform. Also Mr Coder wants to be able to test the new Eu, without de installing or breaking a previous setup until he gets confidence in the new install. The feature list for eu 4 has crept from the standard libs (great work), all the way to enums and (horror) optional then do s. Shouldn't the evolution be defined first, that evolution achieved, then released as a release. The way things are going, the language will have morphed into C, D or Q before Mr Coder gets to do anything useful. Also, there's a lot of voting going on in the list - why not just use one of the free poll sites to ask a question and see what the majority want, or, once there is a stable release, then add new features, and see if poeple wish to retain it? Yet another argument for forums, as opposed to the list (though the threads go a little way to help - will be really useful once organised by date of the last post). Most forums have an inbuilt poll. So, Jeremy, since you are without doubt at the helm of Euphoria 4.0 now, I charge you to fix the feature list, achieve the list, and release for beta and stability testing. Chris -= B E G I N =- X-EUFORUM: 21068 Date: 2008 May 15 12:10 From: Derek Parnell <ddparnell at ??gpond.com> Subject: Re: Enum? gshingles wrote: > I was wondering how you would determine the range of an > enum from one of its members but if I understand what > you are proposing, the ^ and $ symbols are valid from > the start to the end of the enum statement. I was just 'shooting from the hip'. It was not a thought out proposal or syntax. > does the entry 'minFILE' count against the value of maxFILE? :) But now I've got a bit of time I'll flesh it out a bit more... There are three properies of an enumeration that can be useful to know: (1) The number of elements in the enumeration. (2) The value of the lowest item. (3) The value of the highest item. All of these are known to the parser. I propose that in addition to setting values in an enumeration, that three special tokens can be used that denote these three properities on an enumeration. The tokens I propose are these below ... (but please feel free to come up with better ones) (1) enum:length (2) enum:min (3) enum:max When used in an enumeration declaration, they do not themselves become values in the enumeration. Example: <eucode> enum FILE_NO, LINE_NO, FILE_PTR, FILE_START_SYM, OP_WARNING=-1, OP_TRACE=-2, OP_TYPE_CHECK=0, OP_PROFILE_TIME=18, OP_PROFILE_STATEMENT=3, OP_DEFINES=9, minFILE=enum:min, -- lowest enumeration value maxFILE=enum:max, -- highest enumeration value lenFILE=enum:length -- count of items in THIS enumeration </eucode> This is equivalent to ... <eucode> constant FILE_NO = 1, LINE_NO = 2, FILE_PTR = 3, FILE_START_SYM = 4, OP_WARNING = -1, OP_TRACE = -2, OP_TYPE_CHECK = 0, OP_PROFILE_TIME = 18, OP_PROFILE_STATEMENT = 3, -- note duplicates are okay OP_DEFINES = 9, minFILE = -2, -- lowest enumeration value maxFILE = 18, -- highest enumeration value lenFILE = 10 -- count of items in THIS enumeration </eucode> If used, the special enumeration values MUST be the last ones in the declaration and each one can be used any number of times (0 or more) before the end of the enumeration. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21069 Date: 2008 May 15 12:32 From: Matt Lewis <matthewwalkerlewis at gm?il?com> Subject: Re: Feature creep ChrisBurch3 wrote: > > Hi > > There are so many changes going on at once, without solid feature > testing (no disrespect Jeremy, but unit tests will only give you back what > you want, and not always how they would react in real life (for this read > all over the place coders like me)) > > Assume I am Mr Bog Standard Joe Coder. I don't care about all the internal > shenannigans, I just want a robust, fast reasonably feature rich language, > that could evolve at a reasonable pace, without breaking vast tracts of previous > code and be well supported by all the authors. Yes, I agree with this. > Where's the release for general programmers? Mr Coder wants a precompiled > binary to run on Windows and Linux to just get going and testing This will happen. It's not hard to do. Just takes a bit of time (and figuring out when a good time would be). Most of the work to this point has been in the libraries and modifying the build process to accommodate the new library structure. > Also Mr Coder wants to be able to test the new Eu, without de installing or > breaking a previous setup until he gets confidence in the new install. One of the benefits of less reliance on EUDIR and EUINC (in fact, you can do completely without them!) is that this sort of testing will be easier to do. > The feature list for eu 4 has crept from the standard libs (great work), > all the way to enums and (horror) optional then do s. Yeah, I think Aku jumped the gun a bit on this one. It's a significant change, and wasn't around on the forum for even a day before it was committed. > So, Jeremy, since you are without doubt at the helm of Euphoria 4.0 now, > I charge you to fix the feature list, achieve the list, and release for > beta and stability testing. Yeah, he's definitely got the stick, though only because he seems to have the most time and energy right now. I think we may be nearing time to formalize some project governance, though I'm not sure what that should look like. One thing I've thought about is having each developer work in his own branch, and then have some mechanism for what to put back into the trunk. It would allow individuals to experiment, but would provide a bit of a buffer to allow others to examine and comment before putting it into the trunk. Certainly open to others' thoughts and suggestions. Matt -= B E G I N =- X-EUFORUM: 21070 Date: 2008 May 15 12:47 From: Derek Parnell <ddparnell at b?gpond.co?> Subject: Re: Feature creep ChrisBurch3 wrote: > > Hi > > There are so many changes going on at once, without solid feature > testing (no disrespect Jeremy, but unit tests will only give you back what > you want, and not always how they would react in real life (for this read > all over the place coders like me)) I'm also worried about this. I'm a strong believer in unittests, but they can only go so far. A well thought out plan and test suite for each facility in Eu needs to be developed and maintained. It should be good enough to be the standard that a compliant Euphoria system should be able to pass. > So, Jeremy, since you are without doubt at the helm of Euphoria 4.0 > now, I charge you to fix the feature list, achieve the list, and > release for beta and stability testing. By the time Eu4 hits the streets, it should have gone through enough testing that the only things that go wrong will be truly exceptional ones. The vast majority of Euphoria code (once any broken syntax is repaired) should execute without any surprises. But that goes without saying, of course. However, making sure that this actually happens will not be easy. I will require a strong project manager, thorough planning, lots of consulation, and lots of highly motivated people doing the testing and reviewing. I'm sure we need a lot of alpha testing, at least one round of beta testing but probably two, then a stage of having it available to cutting-edge dare-devil coders before making it readily available to the masses. The first thing to do, is decide who is going to be its lead person. I think Jeremy is doing a good job and if he has time and energy, and wants to do it, I vote for him. The scope of the Eu4 changes need to be documented and very very soon we must stop adding to it. Once closed, only changes that are absolutely and immediately important, and agreed upon, can be added/changed/deleted. Someone needs to take charge of the test plan, including the master test suite development. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21071 Date: 2008 May 15 12:47 From: irv mullins <irvm at ellijay?com> Subject: Re: Feature creep Looks like Euphoria development has gone from "glacially slow" to "avalanche". Rob was terribly reluctant to make changes, even when they were totally justified. Now, we're changing stuff just because we can, without regard to whether the changes are needed or will actually work. Still, none of the fundamental limitations that make Euphoria awkward to use have been addressed. I won't bother to enumerate them, they've been cussed and discussed thoroughly. Read the archives. -= B E G I N =- X-EUFORUM: 21072 Date: 2008 May 15 13:24 From: Jason Gade <jaygade at yah?o.c?m> Subject: Re: Optional "then" and "do" CChris wrote: > > Jason Gade wrote: > > > > Fernando Bauer wrote: > > > > > > Jason Gade wrote: > > > > > > > > I mean, we may as well write > > > > for(i = 0; i < 10; i++) { > > > > /* do something */ > > > > } > > > > > > > > Which certainly has its own elegance, but it isn't Euphoria. > > > > > > Agreed. But I'm sure that any Euphoria programmer would understand my example. > > > The difference is minimal, just other characters (already used) for the same > > > token and the advantage is: less keywords to know and to parse. You could call > > > it a Euphoria dialect. All things change and evolve, even if we don't want. > > > A computer language should also obey this natural principle. One form to evolve > > > is creating mutations, which in this case is a dialect. Some modifications in > > > Eu 4.0 are more profound than these ones. > > > Finally, your example uses a different syntax and semantics, and not every Euphoria > > > programmer would understand it, so IMHO it's not a Euphoria dialect. > > > > > > Anyway, thanks for your reply! > > > - Fernando > > > > Well, I can understand a lot of things, but some of these examples are jarring. > > > > One of the things that I like about Euphoria is that it accomplishes the relatively > > difficult goal of reading very similarly to natural English without being overly > > wordy. I think that it strikes a happy medium. > > > > I certainly wouldn't agree with the latter. > > See how much you have to write to share a state (as a sequence - no pointers) > between two functions. You can pass {x1,x2,x3}, fine.. But when the sequence > state is returned, you have to code > x1=state[1] > x2=sate[2] > etc > > while {x1,x2,x3}=state is clear enough. > > Just one example out of many. > > CChris > > > -- > > A complex system that works is invariably found to have evolved from a simple > > system that works. > > --John Gall's 15th law of Systemantics. > > > > "Premature optimization is the root of all evil in programming." > > --C.A.R. Hoare > > > > j. I guess that we have to keep on disagreeing then. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21073 Date: 2008 May 15 13:27 From: Jason Gade <jaygade at ya?oo.c?m> Subject: Re: Optional "then" and "do" CChris wrote: > > Matt Lewis wrote: > > > > yuku wrote: > > > > > > Salix wrote: > > > > But if I tend to forget "and". The result now is > > > > > > > > <eucode> > > > > if apple=1 bananas=3 then peach=7 end if > > > > </eucode> > > > > > > > > With optional "then" it would be > > > > > > > > <eucode> > > > > if apple=1 bananas=3 peach=7 end if > > > > </eucode> > > > > > > > > that is much harder to track down. > > > > > > You can always write the "then" if you want. > > > Especially in such one-line if. > > > > > > Reason of making it optional is that it reduces the mental load of > > > remembering the correct delimiter for every if, for and while statement. > > > > I argue that this mental load is dwarfed by the mental load required for > > maintenance. > > > > Matt > > If using proper indentation to start and end code blocks, you'd get clearer > code with less typing: > <eucode> > if something() > do_stuff() > while true > poll_channel() > -- end of all three blocks > </eucode> > > Do away with end, do and then in one sweep. > Make code structure visually clear, making maintainance easier. How clear is > a sequence of interspersed "end if", "end for" and "end while"? > > All editors I know, except Notepad, have a detab command. The only drawback > of the above is the stronger need to use it when pasting code from other files. > > CChris > CChris There's already a language that does this, it's called Python. Mandatory indentation? No thanks. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21074 Date: 2008 May 15 13:28 From: Jason Gade <jaygade at y?ho?.com> Subject: Re: Optional "then" and "do" Matt Lewis wrote: > > CChris wrote: > > > > If using proper indentation to start and end code blocks, you'd get clearer > > code with less typing: > > <eucode> > > if something() > > do_stuff() > > while true > > poll_channel() > > -- end of all three blocks > > </eucode> > > > > Do away with end, do and then in one sweep. > > Python called. Apparently, you answered. :P > > > Make code structure visually clear, making maintainance easier. How clear is > > a sequence of interspersed "end if", "end for" and "end while"? > > I agree that consistent indentation is good coding style. I do it myself. > But I really don't see the benefit here. I think it's a good thing to have > clear definitions for blocks of code. The thens and dos and ends of euphoria > are an expanded version of the curly brackets that many languages use. > > The more I think about this, the more strongly I feel that we shouldn't > weaken the block definition, which removing a keyword (even optionally) does. > > Matt Agreed. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21075 Date: 2008 May 15 13:38 From: Shawn Pringle <shawn.pringle at gmai?.co?> Subject: Re: No more platform(), conditional includes, conditional functions, condit CChris wrote: > Let me add a short example. > > Following a suggestion, I added task_yield() to the main event loop in win32lib. > task_yield() is not defined in 2.5 official. How to prevent a crash? > > "Simple", using Shawn's idea: > <eucode> > if version_atom >= 3.0 or equal(version_string,"2.5r3") then > task_yield() > end if > </eucode> > The idea was 'functions' like platform(): version_atom(), version_string(). No, an example like this would end in a crash with any version except our hypothetical 4.0 or greater. So, there is no point in checking for any version before 4.0. Secondly, in my hypothetical 4.0, the parser would try to evaluate the if expressions as if they were ifdef. Some things can be evaluated before the program gets made into an executable. Consider what is constant when a program is bound: global constants, platform(), these butilin version constants, any expression using these only constants is also a constant. If the boolean expression is 'constant' then the parser evaluates it if not it gets translated into IL code. This puts makes it a whole lot simplier for the user. And yes, it makes it more complicated for you guys who want to implement this stuff but this is starting to look more and more like C here. Can't we do better? Shawn Pringle -= B E G I N =- X-EUFORUM: 21076 Date: 2008 May 15 13:39 From: Larry Miller <larrymiller at saskt?l?net> Subject: Re: Optional "then" and "do" yuku wrote: > > I made changes to the parser.e so that the keyword "then" and "do" > is optional (if the coder wants that it is still accepted). > > Reasons: > > - Less typing > > - Prevent mistakes of writing if <expr> do and for <expr> then > which I did a lot of times (Kat too) > > If no real objection is made, I will commit it. I know the changes have already been made at this time but I must still object. It is not too late to change this. Yes, removing the necessity of typing "do" and "then" may speed initial coding, at least for some. But not for me, and I suspect many others as well. I will continue to add them, even for a quick and dirty test. As any experienced programmer would agree, the real cost in writing software is not the initial coding. It is in debugging and maintenance. I believe that "do" and "then" make it easier to read code, particularly when it is complex and written by others. Rob Craig had a reason for adding "do" and "then". If they are not needed by the interpreter they must have been for the benefit of the programmer. After reading many of his posts about the design of Euphoria I have come to the conclusion that everything was well thought out, nothing was done on a whim. And I think few would disagree, most of these decisions were correct. We might disagree about the details but that will always be inevitable in this world. Larry Miller -= B E G I N =- X-EUFORUM: 21077 Date: 2008 May 15 13:54 From: yuku <yuku at ?kitek.?om> Subject: Re: Feature creep Matt Lewis wrote: > > The feature list for eu 4 has crept from the standard libs (great work), > > all the way to enums and (horror) optional then do s. > > Yeah, I think Aku jumped the gun a bit on this one. It's a significant > change, and wasn't around on the forum for even a day before it was > committed. I saw so many committed changes before they were agreed on the forum. Examples include the continue, enum and ifdef keyword. So I just followed the pattern. -= B E G I N =- X-EUFORUM: 21078 Date: 2008 May 15 13:59 From: yuku <yuku at ikitek?c?m> Subject: Real Discussion Forum (was: Feature creep) ChrisBurch3 wrote: > Also, there's a lot of voting going on in the list - why not just use > one of the free poll sites to ask a question and see what the majority > want, or, once there is a stable release, then add new features, and see > if poeple wish to retain it? > > Yet another argument for forums, as opposed to the list (though the threads > go a little way to help - will be really useful once organised by date of the > last post). Most forums have an inbuilt poll. I can provide such a forum - one of the reason if the donation of Derek Parnell that keeps my hosting going - but I don't think anyone will really use it unless this mailing list is deprecated. My guess above is based on several attempts to create a Euphoria forum that never had succeeded. Shall we move from this unthreaded list to a full-featured forum? -= B E G I N =- X-EUFORUM: 21079 Date: 2008 May 15 14:06 From: Jeremy Cowgar <jeremy at c?wgar.c?m> Subject: Re: Feature creep ChrisBurch3 wrote: > > Hi > > There are so many changes going on at once, without solid feature > testing (no disrespect Jeremy, but unit tests will only give you back what > you want, and not always how they would react in real life (for this read > all over the place coders like me)) > > Assume I am Mr Bog Standard Joe Coder. I don't care about all the internal > shenannigans, I just want a robust, fast reasonably feature rich language, > that could evolve at a reasonable pace, without breaking vast tracts of previous > code and be well supported by all the authors. > > Where's the release for general programmers? Mr Coder wants a precompiled > binary to run on Windows and Linux to just get going and testing (before you > > say there you go, you do it, that would just create so many problems for other > poeple that its really not worth it). Mr Coder doesn't necessarily want to > compile the language to get it to work, on either platform. Also Mr Coder > wants to be able to test the new Eu, without de installing or breaking a previous > setup until he gets confidence in the new install. I am not following what you are speaking of above. Eu4 will be available for download just as any others once it hits alpha and on. It will run side by side against any other Eu install (as I do now). > > The feature list for eu 4 has crept from the standard libs (great work), all > > the way to enums and (horror) optional then do s. > > Shouldn't the evolution be defined first, that evolution achieved, then > released as a release. The way things are going, the language will have > morphed into C, D or Q before Mr Coder gets to do anything useful. > A while ago, I called for a roadmap, created a roadmap wiki page and asked people to please help define where 4.0 is going. No one responded, no one made any suggestion what-so-ever. There were a few comments on on the roadmap page about "I like that" but nothing more. When I first started developing on Eu, I asked, "Where's the plan? Where's the roadmap?" The answer was, we just work and it get's released when it get's released. I said, Hm? Really? back then. > Also, there's a lot of voting going on in the list - why not just use > one of the free poll sites to ask a question and see what the majority > want, or, once there is a stable release, then add new features, and see > if poeple wish to retain it? I thought of this, but whenever I have directed people *outside* of EUforum, the response was nil. > Yet another argument for forums, as opposed to the list (though the threads > go a little way to help - will be really useful once organised by date of the > last post). Most forums have an inbuilt poll. > > So, Jeremy, since you are without doubt at the helm of Euphoria 4.0 now, I charge > you to fix the feature list, achieve the list, and release for beta and > stability testing. > This is a step I feared greatly to take. Not because of responsibility, not because of authority, but I am the new kid on the developer block. Who am I to jump in like a mighty giant and start telling developers who have been working on improving Euphoria for a few years now, this is what is going to happen and this is how it is going to happen. I'm the boss, your the slave. But it needs some type of direction. Now, let me explain myself a bit on the new features... Right now further standard library development is in a holding pattern due to conflicts amongst the developers on how to resolve some namespace issues. We were wanting to create a few options and present it to the list but we feel as though we do not understand each others side well enough yet for even us to understand what the options are. This is an ongoing discussion that seems to have slowed. During this time, I have no ability to even execute on a decision that we make in namespaces because I have a limited knowledge of the translator and IL code. So, I began looking at code, started looking at proposals and feature requests. With my minimal knowledge of the backend, I then decided what would be easiest to implement and begin to give me experience in the backend. The request on SF.net and EuWiki for continue was the answer. While in a holding pattern, I took the time to learn. I studied, tried, failed. Studied more, tried and failed again. I then studied again and again and again, and came up with a working solution. It however, was not optimal, so I scratched that and studied some more. Finally, I understood what was going on and how to implement continue. I did so then I asked the forum about it. I did this in the reverse order I normally work for one reason... I didn't know if I could do it. I did not want to pose a feature to the forum and have them accept it with great favor and then say, um, sorry guys, I can't do it. So, in my learning, I learned how other things worked. I then looked for more feature requests. Two of them that have been requested and implemented many times in the archive w/pre-processors or other means, were a debug block and conditional includes. I sat down and thought, what would be the best way to do this? I then thought let's learn from others. I looked at some pre-processors. I looked at other languages pre-processors I then started thinking of the best way to make that work in Euphoria. I did not want a pre-processor, as that would cause code slowdown in an interpreted language. That is not what we want. I am not using Euphoria because it's slow :-) So, I came up with the idea for the ifdef with some help of those here on the forum. I implemented it and then posted here about my results. This time I talked about it before implementing because I was pretty sure I could do it. Once implemented, I posted here. It met with great favor. There was talk about possible different keywords, but keyword changing is easy, the functionality was the hard part, so I committed. We can change syntax, we are not at an alpha level. So, I then went for one more, because I was still not at the point of being able to help any with namespaces. Looking again at Euphoria code and asking what could be done here to make Euphoria easier yet to use w/o causing performance degration or added complexity? Maybe even what could make it perform better. The enum idea came to my head. All the while, we are still in a holding pattern getting no closer to 4.0 due to namespace issues. I often would change the structure while refactoring my code and have to go back and add new items, change a bunch of numbers, etc... So, I worked on enum, again to ensure I could do it. I then posted to the list and again, it was met with great favor. Now, we are here today. I felt good about making such changes, because, after all, we are making a major version jump. A version jump to 4.0. This is the time to take care of *very long* standing requests that are beneficial. There are many requests I skiped on by because of one reason or another (mass changes, no apparent benefit, highly controversial, etc...). I asked questions about some features in SF area. I closed some features that have already been implemented, etc... So, that's my story and that's how we are where we are today. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21080 Date: 2008 May 15 14:07 From: Larry Miller <larrymiller at ?asktel.?et> Subject: Re: Feature creep As much as I welcome the new additions to Euphoria, I think the time is fast approaching when we must call a halt to new features (for the current release). In the past I was concerned that Euphoria might never progress. Now we are in danger of the opposite. We must consider whether some of the changes are really beneficial (optional "do" and "then"). New features must be thoroughly tested and fixed. Some of the releases since Euphoria gone open source have been lacking here. Larry Miller -= B E G I N =- X-EUFORUM: 21081 Date: 2008 May 15 14:08 From: Salix <salix at freema?l?hu> Subject: Re: IRC link test post May I request a change? Currently the message looks like this: + | Jason Gade : Re: Optional "then" and "do" : http://www.OpenEuphoria.org/EUforum/m21074.html : Thu, 15 May 2008 13:28:00 GMT : If a few messages arrive to the forum then the IRC mirror would look much better with this order: + | Thu, 15 May 2008 13:28:00 GMT : http://www.OpenEuphoria.org/EUforum/m21074.html : Jason Gade : Re: Optional "then" and "do" This way the first 80 characters would be the same width and size... Just a thought. Otherwise I like the bot a lot. Regards, Salix -= B E G I N =- X-EUFORUM: 21082 Date: 2008 May 15 14:09 From: Jeremy Cowgar <jeremy at cowg??.com> Subject: Re: No more platform(), conditional includes, conditional functions, condit Shawn Pringle wrote: > the user. And yes, it makes it more complicated for you guys who want to > implement this stuff but this is starting to look more and more like C here. > Can't we do better? It's not just harder, it's basically a complete rewrite of how Euphoria works and that's not going to happen anytime soon, if ever. It will also cause slowdown no matter how you develop it, because the interpreter would have to kick in many times during the normal parsing of a file. I do not see this happening anytime soon and I am certainly not the person to do it. If we want to wait for such a construct, then I suppose we will be waiting for a very long time, if ever. In the meantime, we can have ifdef if we want it. If not? That's why we use SVN. About 3 seconds and it would be reverted as if it never existed. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21083 Date: 2008 May 15 14:11 From: Jeremy Cowgar <jeremy at cowg?r.?om> Subject: Re: Feature creep yuku wrote: > > Matt Lewis wrote: > > > The feature list for eu 4 has crept from the standard libs (great work), > > > all the way to enums and (horror) optional then do s. > > > > Yeah, I think Aku jumped the gun a bit on this one. It's a significant > > change, and wasn't around on the forum for even a day before it was > > committed. > > I saw so many committed changes before they were agreed on the forum. > Examples include the continue, enum and ifdef keyword. > So I just followed the pattern. They were met with great favor, not with concerns, votes against, legitimate examples of confusion. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21084 Date: 2008 May 15 14:21 From: Jason Gade <jaygade at yah?o?com> Subject: Re: Feature creep I think you're doing a fine job, Jeremy. I didn't comment on the roadmap because it was good. Now, we've discussed other possibilities here. Not all of them need to be included in 4.0 instead of in the future, but I don't know if 4.0 ready for feature-freeze yet, either. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21085 Date: 2008 May 15 14:40 From: yuku <yuku at ??itek.com> Subject: Re: Optional "then" and "do" ChrisBurch3 wrote: > This commit should be de-commited asap. Done :) -= B E G I N =- X-EUFORUM: 21086 Date: 2008 May 15 15:33 From: c.k.lester <euphoric at ckl?ster.c?m> Subject: Re: Feature creep Jeremy Cowgar wrote: > > A while ago, I called for a roadmap, created a roadmap wiki page and asked people > to please help define where 4.0 is going. No one responded, no one made any > suggestion what-so-ever. There were a few comments on on the roadmap page about > "I like that" but nothing more. This is why I think public development of Euphoria is a joke. MOST of the people using Euphoria love it, and they don't care to get involved in its development because they trust those who are developing it, or they're too busy doing actual work with the current implementation of Euphoria. Therefore, I propose we form a Euphoria Developers Group. Anybody who is interested in developing Euphoria can join. This group will no doubt be small, and that will allow Euphoria to get on and remain on the cutting edge of giving end users what they want and need to get their programs created quickly. We will move development-related discussion from this EuForum to another forum elsewhere (SF.net, etc.). > This is a step I feared greatly to take. Not because of responsibility, not > because of authority, but I am the new kid on the developer block. Who am I > to jump in like a mighty giant and start telling developers who have been working > on improving Euphoria for a few years now, this is what is going to happen and > this is how it is going to happen. I'm the boss, your the slave. Because you (we) are the one[s] who is/are vocal and working. The squeaky wheel will get the grease. If you want to squeak, join the Euphoria Developers Group. If you trust the EDG, then you don't have to join. But if you are part of that group, you will be expected to at least give your input. You won't have to necessarily commit changes, etc. We have Jeremy and Matt for that. ;) So far with development of 4.0, the only thing I was cautious about was making 'then' and 'do' optional. I would always use those terms simply for maintenance purposes, so my only concern was what if I began using a library that did not use 'then' and 'do?' Could that lead to problems in my own code? So, somebody set up a Euphoria Developers forum and those who care about Euphoria development can join. -= B E G I N =- X-EUFORUM: 21087 Date: 2008 May 15 15:43 From: ChrisBurch2 <crylex at ?reeuk.?o.uk> Subject: Re: Optional "then" and "do" yuku wrote: > > ChrisBurch3 wrote: > > This commit should be de-commited asap. > > Done :) :-) -= B E G I N =- X-EUFORUM: 21088 Date: 2008 May 15 15:46 From: "Euler German" <eulerg at gmail.com> Subject: Re: Enum? > On 14 May 2008 at 19:08, Alan F wrote (maybe snipped): > From what I understand, the first entry in any 'enum' statement is > always > set to 1. However, the 'last enumeration value' option would be useful > (for example, to define a sequence of that length for holding a > structure), but I wasn't and still am not sure what would be good > syntax for this. I'm not so sure about the $ syntax proposed. > $ makes sense. It is "euphoric" alright (subscripts), but I'm not sure about the convenience of "^". Well, I could used to it some day, but can't get the point. Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 21089 Date: 2008 May 15 15:47 From: ChrisBurch2 <crylex at fr?e?k.co.uk> Subject: Re: Feature creep c.k.lester wrote: > > Jeremy Cowgar wrote: > > > > A while ago, I called for a roadmap, created a roadmap wiki page and asked people > > to please help define where 4.0 is going. No one responded, no one made any > > suggestion what-so-ever. There were a few comments on on the roadmap page about > > "I like that" but nothing more. > > This is why I think public development of Euphoria is a joke. MOST of the > people using Euphoria love it, and they don't care to get involved in its > development because they trust those who are developing it, or they're too > busy doing actual work with the current implementation of Euphoria. > > Therefore, I propose we form a Euphoria Developers Group. Anybody who is > interested in developing Euphoria can join. This group will no doubt be > small, and that will allow Euphoria to get on and remain on the cutting > edge of giving end users what they want and need to get their programs > created quickly. We will move development-related discussion from this > EuForum to another forum elsewhere (SF.net, etc.). > > > This is a step I feared greatly to take. Not because of responsibility, not > > because of authority, but I am the new kid on the developer block. Who am I > > to jump in like a mighty giant and start telling developers who have been working > > on improving Euphoria for a few years now, this is what is going to happen and > > this is how it is going to happen. I'm the boss, your the slave. > > Because you (we) are the one[s] who is/are vocal and working. > > The squeaky wheel will get the grease. If you want to squeak, join the > Euphoria Developers Group. If you trust the EDG, then you don't have to > join. > > But if you are part of that group, you will be expected to at least give your > input. You won't have to necessarily commit changes, etc. We have Jeremy > and Matt for that. ;) > > So far with development of 4.0, the only thing I was cautious about was > making 'then' and 'do' optional. I would always use those terms simply > for maintenance purposes, so my only concern was what if I began using > a library that did not use 'then' and 'do?' Could that lead to problems > in my own code? > > So, somebody set up a Euphoria Developers forum and those who care about > Euphoria development can join. Absolutey bang on the nail CK. A developers group should be split off. The reason I don't get involved in the WIKI roadmap is because I feel like you Jeremy, but you've got the ability / time / dedication whatever to get up there and do it. As I said before, I may not agree with everything that you do, but I support you 100% for getting on and doing it. Don't get disheartened - this is the biggest kick up the bum that Eu's had for a long time. Keep kicking. Chris -= B E G I N =- X-EUFORUM: 21090 Date: 2008 May 15 15:55 From: c.k.lester <euphoric at ck?ester.?om> Subject: Euphoria Developers Group Discussion ChrisBurch2 wrote: > c.k.lester wrote: > > So, somebody set up a Euphoria Developers forum and those who care about > > Euphoria development can join. > Absolutey bang on the nail CK. A developers group should be split off. I nominate http://www.assembla.com/ to host the developer's group. :) It is faster than SourceForge and free. I don't know if it's as feature-rich, but it looks like it has all we need. But you guys can look it up and compare. I am using Assembla for BBCMF development. -= B E G I N =- X-EUFORUM: 21091 Date: 2008 May 15 16:15 From: Derek Parnell <ddparnell at ?igpond.com> Subject: Re: Euphoria Developers Group Discussion c.k.lester wrote: > > > So, somebody set up a Euphoria Developers forum > I am using Assembla for BBCMF development. But the sourceforge site is already established and workable. What would be the incentive to move to yet another 'forum'. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21092 Date: 2008 May 15 16:47 From: Mike777 <anon4321 at g?ail.?om> Subject: Re: Euphoria Developers Group Discussion Derek Parnell wrote: > > c.k.lester wrote: > > > > > So, somebody set up a Euphoria Developers forum > > > I am using Assembla for BBCMF development. > > But the sourceforge site is already established and workable. What would be > the incentive to move to yet another 'forum'. "Use Assembla spaces for rapid software development, and agile team collaboration. Get free workspaces with unlimited team size and integrated tools like wiki, discussion, alerts, chat, ticketing, Trac, Git and Subversion." Mike -= B E G I N =- X-EUFORUM: 21093 Date: 2008 May 15 16:52 From: CChris <christian.cuvier at ?g?iculture.gouv.fr> Subject: Re: Feature creep c.k.lester wrote: > > Jeremy Cowgar wrote: > > > > A while ago, I called for a roadmap, created a roadmap wiki page and asked people > > to please help define where 4.0 is going. No one responded, no one made any > > suggestion what-so-ever. There were a few comments on on the roadmap page about > > "I like that" but nothing more. > > This is why I think public development of Euphoria is a joke. MOST of the > people using Euphoria love it, and they don't care to get involved in its > development because they trust those who are developing it, or they're too > busy doing actual work with the current implementation of Euphoria. > > Therefore, I propose we form a Euphoria Developers Group. Anybody who is > interested in developing Euphoria can join. There is such a group already, those who have ability to commit to the SVN repository because they asked for it and were let in. Perhaps should it include some people without an access, but at least this core exists already. > This group will no doubt be > small, and that will allow Euphoria to get on and remain on the cutting > edge of giving end users what they want and need to get their programs > created quickly. We will move development-related discussion from this > EuForum to another forum elsewhere (SF.net, etc.). > This has been highly controversial. Some "basic users" have already been complaining about "high brow" tech discussions here. Splitting he forum would indeed relieve them from such reading. However, it could foster a two tier model, producers on one side, consumers on another, with ability for anyone not to care about what the other group says. Either this would happen, and would be detrimental, or most everyone will continue reading and posting on both forums anyway. This is why I see an unified list as a lesser evil. > > This is a step I feared greatly to take. Not because of responsibility, not > > because of authority, but I am the new kid on the developer block. Who am I > > to jump in like a mighty giant and start telling developers who have been working > > on improving Euphoria for a few years now, this is what is going to happen and > > this is how it is going to happen. I'm the boss, your the slave. > > Because you (we) are the one[s] who is/are vocal and working. > > The squeaky wheel will get the grease. If you want to squeak, join the > Euphoria Developers Group. If you trust the EDG, then you don't have to > join. > > But if you are part of that group, you will be expected to at least give your > input. You won't have to necessarily commit changes, etc. We have Jeremy > and Matt for that. ;) > Consider time availability here. Like 2-3 years ago, I happened to be able to start working oin the interpreter and making a few changes I considered beneficial. I currently don't. Who know when I get another window of opportunity. I have been doing some stuff, true, mostly related to win32lib. I saw the iron curtain falling down around Euphoria, that's why I am still here, even though I was planning to just leave them alone as other languages allow me more comfortable development. And this is why I'm working on making my earlier sets.e part of the std lib. Reformatting takes time, but it's moving forward. I'll commit in a few days, this month anyway. So yes, input is to be expected from anyone in the EDG. And usually some output too. But I'd suggest considering some sort of long term average in order to assess whether someone contributes. > So far with development of 4.0, the only thing I was cautious about was > making 'then' and 'do' optional. I would always use those terms simply > for maintenance purposes, so my only concern was what if I began using > a library that did not use 'then' and 'do?' Could that lead to problems > in my own code? > Zero. The parser stops reading a logical expression as soon as it finds any token which would not make sense in a conditional expression at the point it is. It will keep doing that. Someone said it would weaken the block structure (how? "if" opens a block, not "then"), and at the same time rejected a nice way to make it even more visible in code - proper indentation is a good policy, but no one is compelled to comply. I must say that I don't quite understand the discrepancy. CChris > So, somebody set up a Euphoria Developers forum and those who care about > Euphoria development can join. -= B E G I N =- X-EUFORUM: 21094 Date: 2008 May 15 16:56 From: CChris <christian.cuvier at a?riculture.gouv.?r> Subject: Re: Enum? Euler German wrote: > > > On 14 May 2008 at 19:08, Alan F wrote (maybe snipped): > > > From what I understand, the first entry in any 'enum' statement is > > always > > set to 1. However, the 'last enumeration value' option would be useful > > (for example, to define a sequence of that length for holding a > > structure), but I wasn't and still am not sure what would be good > > syntax for this. I'm not so sure about the $ syntax proposed. > > > > $ makes sense. It is "euphoric" alright (subscripts), but I'm not > sure about the convenience of "^". Well, I could used to it some day, > but can't get the point. > > Euler > In any regular expression description I heard about, ^ stands for start of line and $ for end of line. Eu will have regular expressions, so these symbols make sense for first/last term of enum. They are not part of an anum. Of course, this_enum.start and this_enum.end are more explicit and clear. CChris > -- > _ > _| euler f german > _| sete lagoas, mg, brazil > _| efgerman{AT}gmail{DOT}com > > -= B E G I N =- X-EUFORUM: 21095 Date: 2008 May 15 17:04 From: Jeremy Cowgar <jeremy at co?g?r.com> Subject: Re: Euphoria Developers Group Discussion Derek Parnell wrote: > > c.k.lester wrote: > > > > > So, somebody set up a Euphoria Developers forum > > > I am using Assembla for BBCMF development. > > But the sourceforge site is already established and workable. What would be > the incentive to move to yet another 'forum'. > I would stick with what we have. However, I'm not sure the "EDG" is the answer either. We've always had one, sorta. A few of us developers have talked via email about such a thing and we agree that we do not want the Euphoria community to feel as though the "Elite" drive the direction and leave the Euphoria community in the dark. Sure, anyone can join the list, but do you want to filter through all the nitty gritty of development questions dealing with implementing things internally like what does Line 605 do of parser.e just to pick up on one idea of a new feature? And at that, one feature that is suggested and then subsequently put aside due to it being a bad idea or whatever? I suspect that many people would join in with the EDG and initially it would seem like a good idea, but eventually it will be one or two people max posting on the list/forum/whatever. And their questions will go like this: What do you think of feature ABC? Day 1, day 2, day 3... "Yeah, that's nice..." day 4, day 5, day 6. "Um, should I do it?", day 7, day 8, day 9, etc... I don't think that solves anything and from my experience in Open source development as well as closed source development it's not a matter of if this will happen, it's a matter of if it is 2, 3 or 6 weeks from now. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21096 Date: 2008 May 15 17:20 From: c.k.lester <euphoric at ck?ester.co?> Subject: Re: Euphoria Developers Group Discussion Derek Parnell wrote: > c.k.lester wrote: > > > > So, somebody set up a Euphoria Developers forum > > I am using Assembla for BBCMF development. > But the sourceforge site is already established and workable. "Established" is debatable, in that only a few people use it. I think we could afford to move now, if we wanted to. The incentive would be: better interface and faster server. HOWEVER, I'm not against using SourceForge; in my dreams, we're using something better, though. :) -= B E G I N =- X-EUFORUM: 21097 Date: 2008 May 15 17:27 From: c.k.lester <euphoric at ?k?ester.com> Subject: Re: Feature creep CChris wrote: > c.k.lester wrote: > > Therefore, I propose we form a Euphoria Developers Group. Anybody who is > > interested in developing Euphoria can join. > There is such a group already, those who have ability to commit to the SVN repository > because they asked for it and were let in. True, but we need to move development discussions to some other forum besides this one (EuForum). When I ask EuForum if they agree or disagree with some change to the interpreter, and I get 2-3 responses, I'm not so enthusiastic about querying the population anymore. They apparently 1. don't care about it, or 2. agree with it, or 3. don't disagree enough to speak up. > > This group will no doubt be > > small, and that will allow Euphoria to get on and remain on the cutting > > edge of giving end users what they want and need to get their programs > > created quickly. We will move development-related discussion from this > > EuForum to another forum elsewhere (SF.net, etc.). > > > > This has been highly controversial. No more controversial than when one person made all the decisions. :) > However, it could foster a two tier model, producers on one side, consumers > on another, with ability for anyone not to care about what the other group says. This is probably not true because all the producers will themselves be consumers! > Either this would happen, and would be detrimental, or most everyone will continue > reading and posting on both forums anyway. This is why I see an unified list > as a lesser evil. The population of developers is very tiny. I would say, at the most, there are maybe 5-10 active developers, and that's being optimistic. > So yes, input is to be expected from anyone in the EDG. And usually some output > too. But I'd suggest considering some sort of long term average in order to > assess whether someone contributes. Well, of course. -= B E G I N =- X-EUFORUM: 21098 Date: 2008 May 15 17:32 From: Mike777 <anon4321 at gmail.c?m> Subject: Re: Euphoria Developers Group Discussion Jeremy Cowgar wrote: > > Derek Parnell wrote: > > > > c.k.lester wrote: > > > > > > > So, somebody set up a Euphoria Developers forum > > > > > I am using Assembla for BBCMF development. > > > > But the sourceforge site is already established and workable. What would be > > the incentive to move to yet another 'forum'. > > > > I would stick with what we have. However, I'm not sure the "EDG" is the answer > either. We've always had one, sorta. A few of us developers have talked via > email about such a thing and we agree that we do not want the Euphoria community > to feel as though the "Elite" drive the direction and leave the Euphoria community > in the dark. > > Sure, anyone can join the list, but do you want to filter through all the nitty > gritty of development questions dealing with implementing things internally > like what does Line 605 do of parser.e just to pick up on one idea of a new > feature? And at that, one feature that is suggested and then subsequently put > aside due to it being a bad idea or whatever? > > I suspect that many people would join in with the EDG and initially it would > seem like a good idea, but eventually it will be one or two people max posting > on the list/forum/whatever. And their questions will go like this: > > What do you think of feature ABC? Day 1, day 2, day 3... "Yeah, that's nice..." > day 4, day 5, day 6. "Um, should I do it?", day 7, day 8, day 9, etc... > > I don't think that solves anything and from my experience in Open source development > as well as closed source development it's not a matter of if this will happen, > it's a matter of if it is 2, 3 or 6 weeks from now. You have hit upon the essential conundrum. If there is enough traffic which is development related to be distracting (and, in fact, offputting) to those who have no interest in such things, it is best to bifurcate. If, OTOH, combined traffic is light it is actually a positive (from the perspective of those just peeking their head in for a quick look see) to have all traffic on one list. It implies a certain robustness in the community. I can certainly tell you that one of my concerns about Euphoria when I first looked into it was whether the community offered support to newbies or whether it was hostile to them (as ANY developer's forum will appear, whether or not true). A relatively active forum (as this was at the time, although it pales in comparison to how active it has become) provided me with a glimpse of both and, obviously, satisfied my concerns. With that said, I am strongly in favor of bifurcation. Certainly the current level of wheat to chaff for a newbie is offputting. And you want your support forum to be as welcoming as possible if your goal is to invite Mr. Coder (which I consider myself to be, BTW). Keep in mind that any decision to bifurcate needn't be permanent. Heck, it doesn't even have to be consistent. Things can be discussed on the general forum until it makes sense to move things to a secondary avenue for detailed further discussion amongst the interested. I submit that the time to set up the secondary venue is right now, when developer traffic is high and is likely to continue that way for at least the next few weeks. Sort of a beta, if you will. If it won't fly now, it will never fly. Whether it keeps flying in the inevitable slow down to come is irrelevant to me. If it does, great. If it doesn't, that doesn't mean it won't necessarily revive itself when 5.0 is being actively considered. $0.02 Mike777 -= B E G I N =- X-EUFORUM: 21099 Date: 2008 May 15 17:34 From: c.k.lester <euphoric at c??ester.com> Subject: Re: Euphoria Developers Group Discussion Jeremy Cowgar wrote: > Derek Parnell wrote: > > c.k.lester wrote: > > > > > So, somebody set up a Euphoria Developers forum > > > I am using Assembla for BBCMF development. > > But the sourceforge site is already established and workable. What would be > > the incentive to move to yet another 'forum'. > I would stick with what we have. However, I'm not sure the "EDG" is the answer > either. We've always had one, sorta. A few of us developers have talked via > email about such a thing and we agree that we do not want the Euphoria community > to feel as though the "Elite" drive the direction and leave the Euphoria community > in the dark. I don't view it as the "Elite," but as those who have the time and inclination to make sure Euphoria is the best it can be. This idea of the Elite is silly. All Euphorians would have input, anyway. It's just that development discussion would primarily be by those who 1. have the skillset 2. have the motivation 3. have the desire > I suspect that many people would join in with the EDG... I doubt it. You get very little response here on EuForum when asking for ideas... maybe a core group of 5-10 people (out of how many Euphoria programmers?). > seem like a good idea, but eventually it will be one or two people max posting > on the list/forum/whatever. And their questions will go like this: > > What do you think of feature ABC? Day 1, day 2, day 3... "Yeah, that's nice..." > day 4, day 5, day 6. "Um, should I do it?", day 7, day 8, day 9, etc... Unlikely doomsday scenario. :) Current development with EuForum and IRC is rather rapid. I'm just tired of y'all trying to get the approval of people who don't really care anyway (by which I mean they don't care how good you make Euphoria, not about Euphoria itself). > I don't think that solves anything and from my experience in Open source development > as well as closed source development it's not a matter of if this will happen, > it's a matter of if it is 2, 3 or 6 weeks from now. A Euphoria Developers Group can be quick and agile, so that it's more often 2 weeks and not 6 weeks. -= B E G I N =- X-EUFORUM: 21100 Date: 2008 May 15 17:36 From: c.k.lester <euphoric at cklest?r.?om> Subject: Re: Euphoria Developers Group Discussion Mike777 wrote: > > > With that said, I am strongly in favor of bifurcation. Mike777 +1 -= B E G I N =- X-EUFORUM: 21101 Date: 2008 May 15 17:38 From: yuku <yuku at ikitek.?o?> Subject: Re: Euphoria Developers Group Discussion c.k.lester wrote: > > Mike777 wrote: > > > > > > With that said, I am strongly in favor of bifurcation. > > Mike777 +1 Mike777 += 1 Certainly new-users should not be overwhelmed by language developer issues. -= B E G I N =- X-EUFORUM: 21102 Date: 2008 May 15 17:43 From: c.k.lester <euphoric at ck?ester.com> Subject: Re: Euphoria Developers Group Discussion yuku wrote: > > Certainly new-users should not be overwhelmed by language developer issues. And I wonder what sort of impact and draw v4.0 will have, now with its new standard lib, Linux distributions, etc... Should we expect an influx of new users? Regardless, we need a separate developers forum. -= B E G I N =- X-EUFORUM: 21103 Date: 2008 May 15 17:45 From: Jason Gade <jaygade at yah?o?com> Subject: Re: Euphoria Developers Group Discussion Heh. I've read the whole thread but I'm just now responding. I like this list, really. It's a simple and straightforward interface. However. A forum is a good idea in order to keep the regular users and user/developers together in the same place but where each has their own subforum. One problem, though, is keeping the community all in one place. I think that is why previous attempts have failed. And I know that's why /I/ stay here instead of dealing with the wiki and other stuff. I've registered at the two forums set up for Euphoria, and even posted a couple of times. But right now I don't even remember the addresses, because all of the activity occurs right here. So that's my point -- it would be nice to keep the development stuff separated from the user/beginning user stuff, but it doesn't work if it's not still all in one place. IMO. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21104 Date: 2008 May 15 17:47 From: Matt Lewis <matthewwalkerlewis at ?mail.co?> Subject: Re: Feature creep CChris wrote: > > c.k.lester wrote: > > > So far with development of 4.0, the only thing I was cautious about was > > making 'then' and 'do' optional. I would always use those terms simply > > for maintenance purposes, so my only concern was what if I began using > > a library that did not use 'then' and 'do?' Could that lead to problems > > in my own code? > > Zero. The parser stops reading a logical expression as soon as it finds any > token which would not make sense in a conditional expression at the point it > is. It will keep doing that. You didn't answer his question. Of course the parser could be capable of doing that. But that's only one part of the equation. The programmer must also be considered. We've already had one person tell us about how this would absolutely cause him problems. > Someone said it would weaken the block structure (how? "if" opens a block, > not "then"), and at the same time rejected a nice way to make it even more > visible in code - proper indentation is a good policy, but no one is > compelled to comply. I must say that I don't quite understand the > discrepancy. Yes, I said it. We must have different definitions of block. I (nor did Jason) reject proper indentation. I guess we assumed (I certainly did) that since the topic was modifying the interpreter, so were you. Even so, it's not uncommon to write multi-line conditionals. I do sometimes miss putting an "and" or an "or" between lines (just like Salix's example). As to the block issue, consider the following: <eucode> -- Current syntax: if foo then puts(1,"foo") end if -- Optional then syntax: if foo puts(1,"foo") end if </eucode> In both cases, the block of code within the if statement is puts(1,"foo"). In the current example, the block is defined by "then" and "end if". In the optional example, the block is defined by the end of the logical expression ("foo") and "end if". In neither case would I consider "foo" to be part of the block. Nor does any other language I'm aware of. In fact, many require you to put the condition inside parenthesis, which euphoria does not. -= B E G I N =- X-EUFORUM: 21105 Date: 2008 May 15 18:05 From: Jeremy Cowgar <jeremy at ??wgar.com> Subject: Re: Euphoria Developers Group Discussion c.k.lester wrote: > > And I wonder what sort of impact and draw v4.0 will have, now with its new > standard lib, Linux distributions, etc... Should we expect an influx of new > users? > > Regardless, we need a separate developers forum. Ok, what will we discuss on this developer forum? So far what has been discussed on EUforum are new ideas. Should the developers on this forum just decide that enums are a good thing and develop it w/no input from the EU community? Or optional then/do's? On EUforum we have not went into source level details. There have been email conversations amongst developers w/source level details, we have not done any of that on the forum. I do not think that communication amongst developers is the problem with direction for Euphoria. Direction is what we are really talking about. Not communication amongst developers. A developers mailing list will solve the problem of someone occasionally hitting Reply instead of Reply-to-all. We need direction and better organization. Yes, that comes through communication, but it's only 1 part. Now, you did recommend an organization tool in the start, which is beneficial, if used, and it should be the focal point of this discussion. I think we are already on SF, we should use the tools given to us. SF is at times terribly slow, in fact, I hate using the wiki there, I literally wait all the time for the pages to come up and it's not me, it's SF. But, we can deal with that. Now, back to discussion. The discussion on the forum has been flying, but we are on the brink of a brand new release. The forum will always increase in activity during these times. We do not want a new user coming to see Euphoria and look at the user forum to find the last post was 3 days ago, or that there is 2 posts today, 3 posts yesterday, the prior day no posts, etc... -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21106 Date: 2008 May 15 18:05 From: "Euler German" <eulerg at gmail.com> Subject: Re: Enum? > On 15 May 2008 at 9:56, CChris wrote (maybe snipped): > In any regular expression description I heard about, ^ stands for > start of line and $ for end of line. Eu will have regular expressions, > so these symbols make sense for first/last term of enum. They are not > part of an anum. > > Of course, this_enum.start and this_enum.end are more explicit and > clear. > > CChris > Yeah, I know. Just avoiding a mix-up. Besides, Derek already changed his mind on syntax used. :) I like regexes very much and use them very often, so I got used to its terse, cryptic syntax, but could we leave this *only* for regex strings? ;) Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 21107 Date: 2008 May 15 18:06 From: "Euler German" <eulerg at gmail.com> Subject: Re: Real Discussion Forum (was: Feature creep) > On 15 May 2008 at 6:59, yuku wrote (maybe snipped): > ChrisBurch3 wrote: > > Also, there's a lot of voting going on in the list - why not just > > use one of the free poll sites to ask a question and see what the > > majority want, or, once there is a stable release, then add new > > features, and see if poeple wish to retain it? > > > > Yet another argument for forums, as opposed to the list (though the > > threads go a little way to help - will be really useful once > > organised by date of the last post). Most forums have an inbuilt > > poll. > > I can provide such a forum - one of the reason if the donation of > Derek Parnell that keeps my hosting going - but I don't think anyone > will really use it unless this mailing list is deprecated. > > My guess above is based on several attempts to create a Euphoria forum > that never had succeeded. > > Shall we move from this unthreaded list to a full-featured forum? > I don't like fora, but this is me. My (free) mail client put all messages from this list in a convenient threaded chronological form. More, it's spam free! I don't think we need more than this, and if we need to place votes, would it be too difficult to put this feature in the used Eu code? Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 21108 Date: 2008 May 15 18:18 From: c.k.lester <euphoric at cklester.co?> Subject: Re: Euphoria Developers Group Discussion Jeremy Cowgar wrote: > c.k.lester wrote: > > And I wonder what sort of impact and draw v4.0 will have, now with its new > > standard lib, Linux distributions, etc... Should we expect an influx of new > > users? > > Regardless, we need a separate developers forum. > > Ok, what will we discuss on this developer forum? Changes to the core, including standard libs. These are things that newbs aren't interested in and could be overwhelmed by. > So far what has been discussed > on EUforum are new ideas. Should the developers on this forum just decide that > enums are a good thing and develop it w/no input from the EU community? That's the funny thing... ONLY developers are getting involved anyway. How much input are you seeing here? I'm only seeing a few involved. On a whole, I think the community trusts those who are interested in developing Euphoria... or they're too busy coding. :) Changes to the interpreter do not require community input except when those changes will introduce breaks with old code or will in some way harm the current performance of Euphoria. Otherwise, it's just another feature they can decide to use or not use. What developers should do is discuss among themselves implementation details, then present a vote to the community... MAYBE. As above, most changes can be done without consulting the general population... and I don't think they'll care! It's just another feature they can decide to use or not use. > We do not want a new user coming to see Euphoria and look > at the user forum to find the last post was 3 days ago, or that there is 2 posts > today, 3 posts yesterday, the prior day no posts, etc... Why not? Stability and a smart userbase is a good thing. ;) -= B E G I N =- X-EUFORUM: 21109 Date: 2008 May 15 18:21 From: Jeremy Cowgar <jeremy at cow??r.com> Subject: Re: Euphoria Developers Group Discussion c.k.lester wrote: > > What developers should do is discuss among themselves implementation details, > then present a vote to the community... MAYBE. As above, most changes can > be done without consulting the general population... and I don't think they'll > care! It's just another feature they can decide to use or not use. Is this what users want? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21110 Date: 2008 May 15 18:41 From: Mike777 <anon4321 at ?mail.c?m> Subject: Re: Real Discussion Forum (was: Feature creep) Euler German wrote: > > > On 15 May 2008 at 6:59, yuku wrote (maybe snipped): > > > ChrisBurch3 wrote: > > > Also, there's a lot of voting going on in the list - why not just > > > use one of the free poll sites to ask a question and see what the > > > majority want, or, once there is a stable release, then add new > > > features, and see if poeple wish to retain it? > > > > > > Yet another argument for forums, as opposed to the list (though the > > > threads go a little way to help - will be really useful once > > > organised by date of the last post). Most forums have an inbuilt > > > poll. > > > > I can provide such a forum - one of the reason if the donation of > > Derek Parnell that keeps my hosting going - but I don't think anyone > > will really use it unless this mailing list is deprecated. > > > > My guess above is based on several attempts to create a Euphoria forum > > that never had succeeded. > > > > Shall we move from this unthreaded list to a full-featured forum? > > > > I don't like fora, but this is me. My (free) mail client put all > messages from this list in a convenient threaded chronological form. OK, I'll byte. How do you get the messages from the Forum to be sent to you via email? I actually thought that would be an advantage available from an alternate location that is NOT currently available. Mike -= B E G I N =- X-EUFORUM: 21111 Date: 2008 May 15 18:45 From: Jeremy Cowgar <jeremy at c?wg?r.com> Subject: EUforum in your Email client A lot of email clients today will support RSS feeds, such as Thunderbird. Simply add a new feed of: http://www.openeuphoria.org/EUforum/messages_full.xml And you will now have EUforum in your email :-) http://jeremy.cowgar.com/snap/1210877017858803992.png -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21112 Date: 2008 May 15 18:50 From: Mike777 <anon4321 at ??ail.com> Subject: Re: Euphoria Developers Group Discussion Jeremy Cowgar wrote: > > c.k.lester wrote: > > > > And I wonder what sort of impact and draw v4.0 will have, now with its new > > standard lib, Linux distributions, etc... Should we expect an influx of new > > users? > > > > Regardless, we need a separate developers forum. > > Ok, what will we discuss on this developer forum? So far what has been discussed > on EUforum are new ideas. Should the developers on this forum just decide that > enums are a good thing and develop it w/no input from the EU community? Or optional > then/do's? As primarily a user, I think the answers are basically: Whatever makes sense for developers to discuss amongst themselves. You have indicated below that there are some conversations which are held via email. In an open source world, that is quite an indictment. If the reason is that it seemed to be too detailed for discussion on the Forum you have made one of the strongest arguments to making a better venue available. Yes, enums should be in the hands of the developers until it is decided that it is a good idea and that it can be implemented. At that point, as with any implementation, some excited fool (probably me) will no doubt find him or herself letting the cat out of the bag on the Forum. That is a very good thing. At that point, the users can weigh in, as their input at that point is just what is needed. Optional then/do's wouldn't have seen the light of day on the Forum. Another good thing. > On EUforum we have not went into source level details. This is subjective. When I see multiple implementations of a construct in a single post, I see the same thing. Little arrow diagrams. MIGO. > There have been email > conversations amongst developers w/source level details, we have not done any > of that on the forum. See above. Egads. > Now, back to discussion. The discussion on the forum has been flying, but we > are on the brink of a brand new release. The forum will always increase in activity > during these times. We do not want a new user coming to see Euphoria and look > at the user forum to find the last post was 3 days ago, or that there is 2 posts > today, 3 posts yesterday, the prior day no posts, etc... If you can conjecture that the developer traffic will decline at some point in the future, I can conjecture that a new version with additional features will increase the language's reach and therefore increase the user forum traffic. I'd rather plan for future expansion and be disappointed than not do so and suffer the consequences of a damaged reputation brought about by being described as "unweildly". Mike -= B E G I N =- X-EUFORUM: 21113 Date: 2008 May 15 19:08 From: "Euler German" <eulerg at gmail.com> Subject: Re: Euphoria Developers Group Discussion > On 15 May 2008 at 11:21, Jeremy Cowgar wrote (maybe snipped): > c.k.lester wrote: > > > > What developers should do is discuss among themselves implementation > > details, then present a vote to the community... MAYBE. As above, > > most changes can be done without consulting the general > > population... and I don't think they'll care! It's just another > > feature they can decide to use or not use. > > Is this what users want? > I hope not. The main target of any product is its user base. May I suggest this willing group of developers get some "moderation", just to keep the train on rails, and avoid that "MAYBEs" fell from where they stand? Please? Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 21114 Date: 2008 May 15 19:11 From: Mike777 <anon4321 at ?mai?.com> Subject: Re: Euphoria Developers Group Discussion Euler German wrote: > > > On 15 May 2008 at 11:21, Jeremy Cowgar wrote (maybe snipped): > > > c.k.lester wrote: > > > > > > What developers should do is discuss among themselves implementation > > > details, then present a vote to the community... MAYBE. As above, > > > most changes can be done without consulting the general > > > population... and I don't think they'll care! It's just another > > > feature they can decide to use or not use. > > > > Is this what users want? > > > > I hope not. The main target of any product is its user base. May I > suggest this willing group of developers get some "moderation", just > to keep the train on rails, and avoid that "MAYBEs" fell from where > they stand? Please? Why do you conclude that developer actions will be completely independent of user input? Mike -= B E G I N =- X-EUFORUM: 21115 Date: 2008 May 15 19:12 From: Matt Lewis <matthewwalkerlewis at gm?il.?om> Subject: Re: Euphoria Developers Group Discussion c.k.lester wrote: > > Changes to the interpreter do not require community input except when those > changes will introduce breaks with old code or will in some way harm the > current performance of Euphoria. Otherwise, it's just another feature they > can decide to use or not use. > > What developers should do is discuss among themselves implementation details, > then present a vote to the community... MAYBE. As above, most changes can > be done without consulting the general population... and I don't think they'll > care! It's just another feature they can decide to use or not use. I think part of the reason we look for validation from the community is that the development model is so open. No one is really in charge at this point. In theory, Rob's opinion would likely weigh more heavily than others, but he's certainly not a dictator (benevolent or otherwise) at this point. When a change is proposed that will have large effects upon the way we code in euphoria, I'm nervous about imposing my views on others without getting feedback first. I think one thing that most of us want to preserve (even while improving the language) is to preserve what we like about euphoria. Of course, this is different for each person. Adding a function here or there is relatively trivial in impact compared to modifying the include system, or changing other syntax. Matt -= B E G I N =- X-EUFORUM: 21116 Date: 2008 May 15 19:16 From: Mike777 <anon4321 at ?mail.c?m> Subject: Re: Euphoria Developers Group Discussion Matt Lewis wrote: > > c.k.lester wrote: > > > > Changes to the interpreter do not require community input except when those > > changes will introduce breaks with old code or will in some way harm the > > current performance of Euphoria. Otherwise, it's just another feature they > > can decide to use or not use. > > > > What developers should do is discuss among themselves implementation details, > > then present a vote to the community... MAYBE. As above, most changes can > > be done without consulting the general population... and I don't think they'll > > care! It's just another feature they can decide to use or not use. > > I think part of the reason we look for validation from the community is that > the development model is so open. No one is really in charge at this point. > In theory, Rob's opinion would likely weigh more heavily than others, but > he's certainly not a dictator (benevolent or otherwise) at this point. > > When a change is proposed that will have large effects upon the way we code > > in euphoria, I'm nervous about imposing my views on others without getting > feedback first. I think one thing that most of us want to preserve (even > while improving the language) is to preserve what we like about euphoria. > Of course, this is different for each person. Adding a function here or > there is relatively trivial in impact compared to modifying the include > system, or changing other syntax. I don't see the bifurcated system as a prescription for avoiding user input on any specific decision. The fact that you feel this way is a very, very good thing and will work to ensure that even if there is 100% consensus amongst the developers somebody will no doubt suggest that it should at least be mentioned on the Forum. Good. Mike -= B E G I N =- X-EUFORUM: 21117 Date: 2008 May 15 19:20 From: Mike777 <anon4321 at gmail.??m> Subject: Re: EUforum in your Email client Jeremy Cowgar wrote: > > A lot of email clients today will support RSS feeds, such as Thunderbird. Simply > add a new feed of: > > <a href="http://www.openeuphoria.org/EUforum/messages_full.xml">http://www.openeuphoria.org/EUforum/messages_full.xml</a> > > And you will now have EUforum in your email :-) > > <a href="http://jeremy.cowgar.com/snap/1210877017858803992.png">http://jeremy.cowgar.com/snap/1210877017858803992.png</a> Thanks. I have assiduously avoided RSS feeds. I think I'm afraid if I start, I'll be addicted. Besides, my email client (Pegasus) requires an add-in and yet another process to be running (or scheduled to run). Am I admitting too much when I say that I've grown weary of such things? Mike -= B E G I N =- X-EUFORUM: 21118 Date: 2008 May 15 19:22 From: c.k.lester <euphoric at ?klester.?om> Subject: Re: Euphoria Developers Group Discussion Matt Lewis wrote: > c.k.lester wrote: > > Changes to the interpreter do not require community input except when those > > changes will introduce breaks with old code or will in some way harm the > > current performance of Euphoria. Otherwise, it's just another feature they > > can decide to use or not use. > > > > What developers should do is discuss among themselves implementation details, > > then present a vote to the community... MAYBE. As above, most changes can > > be done without consulting the general population... and I don't think they'll > > care! It's just another feature they can decide to use or not use. > > I think part of the reason we look for validation from the community is that > the development model is so open. And my argument is that "the community" isn't very vocal, ever. You have a core base of developers who do want to voice their input, but I would say 95% of Euphoria users are happy with the direction Euphoria is going. Otherwise, we'd hear about it. The other possibility is that we're the only ones using Euphoria, and that's why there's so little input. :) > When a change is proposed that will have large effects upon the way we code > in euphoria, I'm nervous about imposing my views on others without getting > feedback first. I somewhat agree, but not really. Generally, the changes the developers agree on will be double-plus-good for Euphoria. Now, on code breakage, I did say a population query would probably be good. But for changes like enum, it doesn't break code and it makes Euphoria coding easier. PLUS, you don't even have to use it. Stick with the old way if you want. The point being, no negatives and only positives means we don't need to consult the other 95% of the people who won't care anyway. -= B E G I N =- X-EUFORUM: 21119 Date: 2008 May 15 19:47 From: CChris <christian.cuvier at agri?ul?ure.gouv.fr> Subject: Re: Feature creep Matt Lewis wrote: > > CChris wrote: > > > > c.k.lester wrote: > > > > > So far with development of 4.0, the only thing I was cautious about was > > > making 'then' and 'do' optional. I would always use those terms simply > > > for maintenance purposes, so my only concern was what if I began using > > > a library that did not use 'then' and 'do?' Could that lead to problems > > > in my own code? > > > > Zero. The parser stops reading a logical expression as soon as it finds any > > token which would not make sense in a conditional expression at the point it > > is. It will keep doing that. > > You didn't answer his question. Of course the parser could be capable of > doing that. But that's only one part of the equation. The programmer must > also be considered. We've already had one person tell us about how this > would absolutely cause him problems. > > > Someone said it would weaken the block structure (how? "if" opens a block, > > not "then"), and at the same time rejected a nice way to make it even more > > visible in code - proper indentation is a good policy, but no one is > > compelled to comply. I must say that I don't quite understand the > > discrepancy. > > Yes, I said it. We must have different definitions of block. I (nor did > Jason) reject proper indentation. I guess we assumed (I certainly did) that > since the topic was modifying the interpreter, so were you. Even so, it's > not uncommon to write multi-line conditionals. I do sometimes miss putting > an "and" or an "or" between lines (just like Salix's example). > What would be the need to indent them? After all, the interpreter knows indentation doesn't count inside a header. > As to the block issue, consider the following: > <eucode> > -- Current syntax: > if foo then > puts(1,"foo") > end if > > -- Optional then syntax: > if foo > puts(1,"foo") > end if > </eucode> > In both cases, the block of code within the if statement is puts(1,"foo"). > In the current example, the block is defined by "then" and "end if". In the > optional example, the block is defined by the end of the logical expression > ("foo") and "end if". > Keep then and friends optional, I see nothing wrong with them apart from having to type them and clutter the screen. > In neither case would I consider "foo" to be part of the block. Nor does > any other language I'm aware of. In fact, many require you to put the > condition inside parenthesis, which euphoria does not. But they spare you the "end <block>". CChris -= B E G I N =- X-EUFORUM: 21120 Date: 2008 May 15 19:58 From: Bob Thompson <getter at ?astmai?.co.uk> Subject: getRichText() memory leak? Chris, I've noticed that the commit charge carries on increasing when getRichText() is run repeatedly using richedit50W on XP. Here's a demo. Any ideas? Regards, Bob <eucode> include Win32Lib.ew without warning --====================================================== constant win = createEx(Window, "demo", 0, 0, 0, 300, 200, 0, 0) constant tool_bar = createEx(ToolBar, "", win, 0, 0, w32Edge, 34, 0, 0) constant edit = createEx(RichEdit, "", win, 0, 0, w32Edge, {w32Edge, +34}, w32or_all({ES_NOHIDESEL}), 0) constant button1 = createEx(PushButton, "get_rich_text", tool_bar, 0, 0, 100, 30, 0, 0) constant button2 = createEx(PushButton, "clear_editor", tool_bar, 100, 0, 100, 30, 0, 0) constant button3 = createEx(PushButton, "reset_editor", tool_bar, 200, 0, 100, 30, 0, 0) setFont({button1, button2, button3}, "Arial", 9, Bold) --===================================================== sequence big_text, word big_text = {} word = {} --====================================================== for n = 1 to 1000000 do for m = 1 to 5 do word &= rand(26) + 96 end for word &= 32 big_text &= word word = {} end for setText(edit, big_text) --====================================================== procedure get_rich_text(atom self, atom event, sequence params) sequence selection selection = getRichText(edit, -1) end procedure setHandler(button1, w32HClick, routine_id("get_rich_text")) --====================================================== procedure clear_editor(atom self, atom event, sequence params) setText(edit, "") end procedure setHandler(button2, w32HClick, routine_id("clear_editor")) -- --====================================================== procedure reset_editor(atom self, atom event, sequence params) setText(edit, big_text) end procedure setHandler(button3, w32HClick, routine_id("reset_editor")) -- --====================================================== WinMain(win, Normal) </eucode> -= B E G I N =- X-EUFORUM: 21121 Date: 2008 May 15 20:04 From: c.k.lester <euphoric at ck?ester?com> Subject: Re: C.K.Lester - Can I have your EU books? Just found another book: "My First wxEuphoria Game" here: http://www.usingeuphoria.com/books/wxeu_game1/index.esp -= B E G I N =- X-EUFORUM: 21122 Date: 2008 May 15 20:06 From: Kat <KAT12 at coosa?s.ne?> Subject: Re: optional then-do, was: Feature creep CChris wrote: <snippage occured> > Keep then and friends optional, I see nothing wrong with them apart from having > to type them and clutter the screen. I vote for optional, and i will keep typing them in any case that spreads across lines in the editor. Ex: <eucode> if blah x = 0 end if if blorpe then -- lotsa code end if if cowabunga then else end if </eucode> I understand as an offshoot of the optional, i could also use "then" in place of "do" and vice versa and not cause an error. <eucode> while lenc do if lenc do goto lenc case lenc do <eucode> > But they spare you the "end <block>". I vote in favor of "end <block>", it proves the interpreter knows what i believe is the end of that block, and i have had to tell the interpreter that from time to time, where the end of which block is... <eucode> while what do -- code if blah then -- do this else -- do that end while --code end if </eucode> That's just my votes, that's all, because "option" doesn't force me to do it that way. Kat -= B E G I N =- X-EUFORUM: 21123 Date: 2008 May 15 20:30 From: CChris <christian.cuvier at agricultu??.gouv.fr> Subject: Re: getRichText() memory leak? Bob Thompson wrote: > > > Chris, > > I've noticed that the commit charge carries on increasing when getRichText() > is run repeatedly using richedit50W on XP. Here's a demo. Any ideas? > > Regards, > > Bob > > <eucode> > > include Win32Lib.ew > without warning > --====================================================== > constant win = createEx(Window, "demo", 0, 0, 0, 300, 200, 0, 0) > constant tool_bar = createEx(ToolBar, "", win, 0, 0, w32Edge, 34, 0, 0) > constant edit = createEx(RichEdit, "", win, 0, 0, w32Edge, {w32Edge, +34}, > w32or_all({ES_NOHIDESEL}), 0) > constant button1 = createEx(PushButton, "get_rich_text", tool_bar, > 0, 0, 100, 30, 0, 0) > constant button2 = createEx(PushButton, "clear_editor", tool_bar, > 100, 0, 100, 30, 0, 0) > constant button3 = createEx(PushButton, "reset_editor", tool_bar, > 200, 0, 100, 30, 0, 0) > setFont({button1, button2, button3}, "Arial", 9, Bold) > --===================================================== > sequence big_text, word > big_text = {} > word = {} > --====================================================== > for n = 1 to 1000000 do > for m = 1 to 5 do > word &= rand(26) + 96 > end for > word &= 32 > big_text &= word > word = {} > end for > setText(edit, big_text) > --====================================================== > procedure get_rich_text(atom self, atom event, sequence params) > sequence selection > selection = getRichText(edit, -1) > end procedure > setHandler(button1, w32HClick, routine_id("get_rich_text")) > --====================================================== > procedure clear_editor(atom self, atom event, sequence params) > setText(edit, "") > end procedure > setHandler(button2, w32HClick, routine_id("clear_editor")) > -- --====================================================== > procedure reset_editor(atom self, atom event, sequence params) > setText(edit, big_text) > end procedure > setHandler(button3, w32HClick, routine_id("reset_editor")) > -- --====================================================== > WinMain(win, Normal) > > </eucode> I'll check for any memory leak, thanks or reporting it. CChris -= B E G I N =- X-EUFORUM: 21124 Date: 2008 May 15 20:36 From: Kat <KAT12 at c?osahs.?et> Subject: overriding vs namespaces Someone once posted a dissertation about namespaces, where internal Eu operators like + and such were redefined, leading to a much worse mess than one could possibly make using goto. The maintainability of code where the words don't mean what you expect leads to Jimmy Carter saying "I have lust for the people of Poland", and other such problems. So, despite NOT being paranoid as some about goto (i goto places all the time!), i vote against *internal* overrides, and suggest the following (which hasn't gone over well on irc): Use of namespaces, and no internal overrides. inside ftp.e: <eucode> function ftp_open(types and varnames) : export as "open" </eucode> inside sqlite.e: <eucode> function sqlite_wrapper_open(types and vars) : export as "open" <eucode> inside LBA_modes.e: <eucode> procedure lba_seek(pointer to 48bit integer) : export as "seek" </eucode> inside mycode.exw: <eucode> include ftp.e as ftp include sqlite.e as sql include LBA_modes.e as LBA include handle = ftp:open(some data about it) -- uses ftp.e's exported "open" writefile = open(filename,wb") -- uses eu's internal open() -- etc sqldata = sql:open(vars) -- uses sqlite.e's "open" LBA:seek(largereadfile,45000000000) -- uses LBA_mode.e's "seek" seek(smallreadfile,1000) -- uses eu's internal seek() </eucode> I am told this breaks the current: <eucode> include ftp.e as ftp handle = ftp:open(stuff) -- uses ftp.e's open() handle2 = open(other stuff) -- continues to use ftp.e's open() (!??!) </eucode> But i see the code which that breaks as a worse bug than allowing forwards and reverse referenceing for routine_id(). I am in favor of both directions of routine_id(). I am not in favor of "sticky namespace referencing", as it's not explicit, whereas referencing, namespace:overriding, and goto are (local in scope) explicit. I believe in overriding in cases where one might want different numbers of variables passed to a function, but we can handle that with nested sequences in Eu. And with namespace resolving of "overrides", an include could export an "open" (or other function names), and code for various parameters and call local (non-global) functions inside that include per various vars and such. Cases where an include defines a funct/proc as "global", would still be able to call that global name. In cases where ":export as "name"" is used, that "name" would also be available. I believe my proposal breaks nothing except the sticky referencing, but allows for namespace resolution of pseudo-overriding. Kat -= B E G I N =- X-EUFORUM: 21125 Date: 2008 May 15 20:40 From: "Euler German" <eulerg at gmail.com> Subject: Re: Real Discussion Forum (was: Feature creep) > On 15 May 2008 at 11:41, Mike777 wrote (maybe snipped): > Euler German wrote: > > > > > On 15 May 2008 at 6:59, yuku wrote (maybe snipped): > > > > > ChrisBurch3 wrote: > > > > Also, there's a lot of voting going on in the list - why not > > > > just use one of the free poll sites to ask a question and see > > > > what the majority want, or, once there is a stable release, then > > > > add new features, and see if poeple wish to retain it? > > > > > > > > Yet another argument for forums, as opposed to the list (though > > > > the threads go a little way to help - will be really useful once > > > > organised by date of the last post). Most forums have an inbuilt > > > > poll. > > > > > > I can provide such a forum - one of the reason if the donation of > > > Derek Parnell that keeps my hosting going - but I don't think > > > anyone will really use it unless this mailing list is deprecated. > > > > > > My guess above is based on several attempts to create a Euphoria > > > forum that never had succeeded. > > > > > > Shall we move from this unthreaded list to a full-featured forum? > > > > > > > I don't like fora, but this is me. My (free) mail client put all > > messages from this list in a convenient threaded chronological form. > > > > OK, I'll byte. > > How do you get the messages from the Forum to be sent to you via > email? I actually thought that would be an advantage available from > an alternate location that is NOT currently available. > Mike, I get them from a Topica account. It was the only way some time ago (5+ years?) and when I left the list I didn't unsubscribe myself, but set it to NoMail. Almost like in Pegasus Mail (you said you use Pmail) list. Me too. I think all you need is send a message to EUforum- subscribe at topica.com (watch for breaking line) from your current address (I'd suggest a throw-away address) and subscribe to an account. I place my posts to EUforum at topica.com and all came out safe'n'sound, my with a slight delay. There's more information at http://www.rapideuphoria.com/listserv.htm below mid-page. Best, Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 21126 Date: 2008 May 15 20:40 From: CChris <christian.cuvier at agricul?u?e.gouv.fr> Subject: Re: Euphoria Developers Group Discussion c.k.lester wrote: > > Matt Lewis wrote: > > c.k.lester wrote: > > > Changes to the interpreter do not require community input except when those > > > changes will introduce breaks with old code or will in some way harm the > > > current performance of Euphoria. Otherwise, it's just another feature they > > > can decide to use or not use. > > > > > > What developers should do is discuss among themselves implementation details, > > > then present a vote to the community... MAYBE. As above, most changes can > > > be done without consulting the general population... and I don't think they'll > > > care! It's just another feature they can decide to use or not use. > > > > I think part of the reason we look for validation from the community is that > > the development model is so open. > > And my argument is that "the community" isn't very vocal, ever. You have a > core base of developers who do want to voice their input, but I would say > 95% of Euphoria users are happy with the direction Euphoria is going. > Otherwise, we'd hear about it. > You know, we are such a small group of vocal people here. There will always be disagreement for the sake of disagreeing. Just have some random reading of this list for the past 18 months, and see how productive it had got. Keep pushing hard, Jeremy. > The other possibility is that we're the only ones using Euphoria, and that's > why there's so little input. :) > I have exactly zero idea of how we forum posters are representative of the user base at large. I don't want to look pessimistic, but I wouldn't be surprised of you were almost right. > > When a change is proposed that will have large effects upon the way we code > > in euphoria, I'm nervous about imposing my views on others without getting > > feedback first. > > I somewhat agree, but not really. Generally, the changes the developers > agree on will be double-plus-good for Euphoria. Now, on code breakage, I > did say a population query would probably be good. But for changes like > enum, it doesn't break code and it makes Euphoria coding easier. PLUS, you > don't even have to use it. Stick with the old way if you want. The point > being, no negatives and only positives means we don't need to consult the > other 95% of the people who won't care anyway. Did you notice how many improvements that would have broken zero code, because they were giving meaning to something currently illegal, were brought down because "name is not right", "one keyword more is too much" and such? A lot. CChris -= B E G I N =- X-EUFORUM: 21127 Date: 2008 May 15 20:46 From: Matt Lewis <matthewwalkerlewis at gm?i?.com> Subject: Re: Euphoria Developers Group Discussion Mike777 wrote: > > I don't see the bifurcated system as a prescription for avoiding user input > on any specific decision. The fact that you feel this way is a very, very > good thing and will work to ensure that even if there is 100% consensus > amongst the developers somebody will no doubt suggest that it should at > least be mentioned on the Forum. Good. Personally, I like the idea of having a developers forum or mailing list, but I'd probably only use it for talking about implementation details that most people wouldn't want to hear. Just like I tend to take conversations about other projects off-line. For example, I don't think that most people are interested in the finer points of crafting a Watcom makefile. Or even hacking on the front end, which is all euphoria. Matt -= B E G I N =- X-EUFORUM: 21128 Date: 2008 May 15 20:52 From: CChris <christian.cuvier at agricultur?.gouv.fr> Subject: Re: overriding vs namespaces Kat wrote: > > > Someone once posted a dissertation about namespaces, where internal Eu operators > like + and such were redefined, leading to a much worse mess than one could > possibly make using goto. The maintainability of code where the words don't > mean what you expect leads to Jimmy Carter saying "I have lust for the people > of Poland", and other such problems. > > So, despite NOT being paranoid as some about goto (i goto places all the time!), > i vote against *internal* overrides, and suggest the following (which hasn't > gone over well on irc): > > Use of namespaces, and no internal overrides. > > inside ftp.e: > <eucode> > function ftp_open(types and varnames) : export as "open" > </eucode> > > inside sqlite.e: > <eucode> > function sqlite_wrapper_open(types and vars) : export as "open" > <eucode> > > inside LBA_modes.e: > <eucode> > procedure lba_seek(pointer to 48bit integer) : export as "seek" > </eucode> > > inside mycode.exw: > <eucode> > include ftp.e as ftp > include sqlite.e as sql > include LBA_modes.e as LBA > include > handle = ftp:open(some data about it) -- uses ftp.e's exported "open" > writefile = open(filename,wb") -- uses eu's internal open() > -- etc > sqldata = sql:open(vars) -- uses sqlite.e's "open" > LBA:seek(largereadfile,45000000000) -- uses LBA_mode.e's "seek" > seek(smallreadfile,1000) -- uses eu's internal seek() > </eucode> > > I am told this breaks the current: > <eucode> > include ftp.e as ftp > handle = ftp:open(stuff) -- uses ftp.e's open() > handle2 = open(other stuff) -- continues to use ftp.e's open() (!??!) > </eucode> > > But i see the code which that breaks as a worse bug than allowing forwards and > reverse referenceing for routine_id(). I am in favor of both directions of routine_id(). > I am not in favor of "sticky namespace referencing", as it's not explicit, whereas > referencing, namespace:overriding, and goto are (local in scope) explicit. > > I believe in overriding in cases where one might want different numbers of variables > passed to a function, but we can handle that with nested sequences in Eu. And > with namespace resolving of "overrides", an include could export an "open" (or > other function names), and code for various parameters and call local (non-global) > functions inside that include per various vars and such. > > Cases where an include defines a funct/proc as "global", would still be able > to call that global name. In cases where ":export as "name"" is used, that "name" > would also be available. > > I believe my proposal breaks nothing except the sticky referencing, but allows > for namespace resolution of pseudo-overriding. > > Kat Assume your scheme is implemented. Then someone wishes to extend the abilities of the Eu builtin "open" by providing some new mode, relying on standard open() for standard opening modes. Then, if I got you right, a user of the library implementing that boosted open() will never be able to call it simply "open", as would seem so natural and was planned by the library coder. She'll have to use a namespace or other creative names. I wouldn't like that at all. So I hope I didn't get you right. However, what I like is the idea that there must be a way to implement different behaviour between exported and non exported global symbols. I have pushed for it for a long time. CChris -= B E G I N =- X-EUFORUM: 21129 Date: 2008 May 15 20:54 From: Jeremy Cowgar <jeremy at cowgar.c??> Subject: Re: Euphoria Developers Group Discussion Matt Lewis wrote: > > Mike777 wrote: > > > > I don't see the bifurcated system as a prescription for avoiding user input > > on any specific decision. The fact that you feel this way is a very, very > > good thing and will work to ensure that even if there is 100% consensus > > amongst the developers somebody will no doubt suggest that it should at > > least be mentioned on the Forum. Good. > > Personally, I like the idea of having a developers forum or mailing list, but > I'd probably only use it for talking about implementation details that most > people wouldn't want to hear. Just like I tend to take conversations about > other projects off-line. > > For example, I don't think that most people are interested in the finer > points of crafting a Watcom makefile. Or even hacking on the front end, > which is all euphoria. > > Matt Agreed. Matt, should I set one up on SF for that use? Anyone who wants to listen to use to chat about the horrors of making a Watcom makefile work on DOS, Win98 and XP/Vista are free to join. I also think it would be OK for us to discuss *possible* improvements on the developer list. For example, I may suggest "Hey, let's get rid of the include statement and just make everyone write it all in a big file. That would be faster for the parser." ... Immediately I'd be shot down on the developer list. No need to panic the userbase about that! :-D But if we propose a function, syntax, etc... and the majority of the developers think its a good idea, we can solicit EUforum for input. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21130 Date: 2008 May 15 20:55 From: jbrown <jbrown106 at ?w?ft-mail.com> Subject: Re: overriding vs namespaces Kat wrote: > > > Someone once posted a dissertation about namespaces, where internal Eu operators > like + and such were redefined, leading to a much worse mess than one could > possibly make using goto. The maintainability of code where the words don't > mean what you expect leads to Jimmy Carter saying "I have lust for the people > of Poland", and other such problems. Namespaces and operator overloading are completely unrelated. I agree with you, lets not go there. :) > > So, despite NOT being paranoid as some about goto (i goto places all the time!), > i vote against *internal* overrides, and suggest the following (which hasn't > gone over well on irc): > > Use of namespaces, and no internal overrides. > > inside ftp.e: > <eucode> > function ftp_open(types and varnames) : export as "open" > </eucode> > > inside sqlite.e: > <eucode> > function sqlite_wrapper_open(types and vars) : export as "open" > <eucode> > > inside LBA_modes.e: > <eucode> > procedure lba_seek(pointer to 48bit integer) : export as "seek" > </eucode> > > inside mycode.exw: > <eucode> > include ftp.e as ftp > include sqlite.e as sql > include LBA_modes.e as LBA > include > handle = ftp:open(some data about it) -- uses ftp.e's exported "open" > writefile = open(filename,wb") -- uses eu's internal open() > -- etc > sqldata = sql:open(vars) -- uses sqlite.e's "open" > LBA:seek(largereadfile,45000000000) -- uses LBA_mode.e's "seek" > seek(smallreadfile,1000) -- uses eu's internal seek() > </eucode> The only bit of your proposal that is new is the use of "export as" which did not appear to solve anything. The conversation moved fast, and I may have missed the part where you explained what it was to be used for. > > I am told this breaks the current: > <eucode> > include ftp.e as ftp > handle = ftp:open(stuff) -- uses ftp.e's open() > handle2 = open(other stuff) -- continues to use ftp.e's open() (!??!) > </eucode> > > But i see the code which that breaks as a worse bug than allowing forwards and > reverse referenceing for routine_id(). I am in favor of both directions of routine_id(). > I am not in favor of "sticky namespace referencing", as it's not explicit, whereas > referencing, namespace:overriding, and goto are (local in scope) explicit. Agreed. This particular example should break. > > I believe in overriding in cases where one might want different numbers of variables > passed to a function, but we can handle that with nested sequences in Eu. And > with namespace resolving of "overrides", an include could export an "open" (or > other function names), and code for various parameters and call local (non-global) > functions inside that include per various vars and such. > In other words, you are against allowing builtin routines to be overriden? If this is limited to files which are included into a namespace, this is acceptable. Builtins and namespaces never fit well together. > Cases where an include defines a funct/proc as "global", would still be able > to call that global name. In cases where ":export as "name"" is used, that "name" > would also be available. > > I believe my proposal breaks nothing except the sticky referencing, but allows > for namespace resolution of pseudo-overriding. This probably the case. True overriding of builtins + use of namespaces is probably rare enough that we effectively don't have to worry about it. I still don't see why export as is necessary. > > Kat -= B E G I N =- X-EUFORUM: 21131 Date: 2008 May 15 20:56 From: c.k.lester <euphoric at ckles?er.c?m> Subject: Re: Euphoria Developers Group Discussion CChris wrote: > Did you notice how many improvements that would have broken zero code, because > they were giving meaning to something currently illegal, were brought down because > "name is not right", "one keyword more is too much" and such? A lot. Such is the dynamics of design by committee. :) -= B E G I N =- X-EUFORUM: 21132 Date: 2008 May 15 20:57 From: Matt Lewis <matthewwalkerlewis at gm?il.com> Subject: Re: Euphoria Developers Group Discussion CChris wrote: > > You know, we are such a small group of vocal people here. There will always > be disagreement for the sake of disagreeing. No there won't! Matt -= B E G I N =- X-EUFORUM: 21133 Date: 2008 May 15 21:03 From: Larry Miller <larrymiller at sasktel.?et> Subject: Re: getRichText() memory leak? I have located the problem. It is in getData() in win32Lib.ew Locate the line "text=peek({buffer,iLength})" at about line 15382. There is more than instance of this code so be sure to get the right line. I inserted "w32release_mem( buffer )" after this line. This is in version .70.4 The memory for buffer was allocated but never freed Larry Miller -= B E G I N =- X-EUFORUM: 21134 Date: 2008 May 15 21:15 From: Kat <KAT12 at coosah?.n?t> Subject: Re: overriding vs namespaces jbrown wrote: > > Kat wrote: > > > > > > Someone once posted a dissertation about namespaces, where internal Eu operators > > like + and such were redefined, leading to a much worse mess than one could > > possibly make using goto. The maintainability of code where the words don't > > mean what you expect leads to Jimmy Carter saying "I have lust for the people > > of Poland", and other such problems. > > Namespaces and operator overloading are completely unrelated. I agree with you, > lets not go there. :) Wel, except that i am against overloading the internals, and putting "overriding" inside namespaces, and ONLY inside namespaces. > > So, despite NOT being paranoid as some about goto (i goto places all the time!), > > i vote against *internal* overrides, and suggest the following (which hasn't > > gone over well on irc): > > > > Use of namespaces, and no internal overrides. > > > > inside ftp.e: > > <eucode> > > function ftp_open(types and varnames) : export as "open" > > </eucode> > > > > inside sqlite.e: > > <eucode> > > function sqlite_wrapper_open(types and vars) : export as "open" > > <eucode> > > > > inside LBA_modes.e: > > <eucode> > > procedure lba_seek(pointer to 48bit integer) : export as "seek" > > </eucode> > > > > inside mycode.exw: > > <eucode> > > include ftp.e as ftp > > include sqlite.e as sql > > include LBA_modes.e as LBA > > include > > handle = ftp:open(some data about it) -- uses ftp.e's exported "open" > > writefile = open(filename,wb") -- uses eu's internal open() > > -- etc > > sqldata = sql:open(vars) -- uses sqlite.e's "open" > > LBA:seek(largereadfile,45000000000) -- uses LBA_mode.e's "seek" > > seek(smallreadfile,1000) -- uses eu's internal seek() > > </eucode> > > The only bit of your proposal that is new is the use of "export as" which did > not appear to solve anything. > The conversation moved fast, and I may have missed the part where you explained > what it was to be used for. It allows for minimal changes to existing code, does not break existing code, and is the ONLY method for "overloading" an internal function, in my proposal. For instance, this would be illegal: <eucode> junk = open(blah) -- as an override of internal open() </eucode) this would be legal inside ftp.e (for example): <eucode> junk = ftp_open(blah): export as "open" </eucode> so it can be used like <eucode> include ftp.e as ftp ftp:open(someplace online) </eucode> > > I am told this breaks the current: > > <eucode> > > include ftp.e as ftp > > handle = ftp:open(stuff) -- uses ftp.e's open() > > handle2 = open(other stuff) -- continues to use ftp.e's open() (!??!) > > </eucode> > > > > But i see the code which that breaks as a worse bug than allowing forwards and > > reverse referenceing for routine_id(). I am in favor of both directions of routine_id(). > > I am not in favor of "sticky namespace referencing", as it's not explicit, whereas > > referencing, namespace:overriding, and goto are (local in scope) explicit. > > Agreed. This particular example should break. > > > > > I believe in overriding in cases where one might want different numbers of variables > > passed to a function, but we can handle that with nested sequences in Eu. And > > with namespace resolving of "overrides", an include could export an "open" (or > > other function names), and code for various parameters and call local (non-global) > > functions inside that include per various vars and such. > > > > In other words, you are against allowing builtin routines to be overriden? Correct. You could use the "include as name" to spec a new open(), and there's no way a plain open() would act any differently than the docs say it will, and you don't need to use internal:open() to use it. > If this is limited to files which are included into a namespace, this is acceptable. > Builtins and namespaces never fit well together. > > > Cases where an include defines a funct/proc as "global", would still be able > > to call that global name. In cases where ":export as "name"" is used, that "name" > > would also be available. > > > > I believe my proposal breaks nothing except the sticky referencing, but allows > > for namespace resolution of pseudo-overriding. > > This probably the case. True overriding of builtins + use of namespaces is probably > rare enough that we effectively don't have to worry about it. > > I still don't see why export as is necessary. So i explained it above some more,, understand now? Kat -= B E G I N =- X-EUFORUM: 21135 Date: 2008 May 15 21:30 From: Matt Lewis <matthewwalkerlewis at gma?l.co?> Subject: Re: overriding vs namespaces Kat wrote: > > It allows for minimal changes to existing code, does not break existing code, > and is the ONLY method for "overloading" an internal function, in my proposal. > For instance, this would be illegal: > <eucode> > junk = open(blah) -- as an override of internal open() > </eucode) > this would be legal inside ftp.e (for example): > <eucode> > junk = ftp_open(blah): export as "open" > </eucode> > so it can be used like > <eucode> > include ftp.e as ftp > ftp:open(someplace online) > </eucode> Actually, this would break some existing code: <eucode> -- print.e global procedure print(...) -- app.ex include print.e print(...) </eucode> Matt -= B E G I N =- X-EUFORUM: 21136 Date: 2008 May 15 21:34 From: Jeremy Cowgar <jeremy at ?owga?.com> Subject: Re: Feature creep ChrisBurch3 wrote: > > Hi > > There are so many changes going on at once, without solid feature > testing (no disrespect Jeremy, but unit tests will only give you back what > you want, and not always how they would react in real life (for this read > all over the place coders like me)) > I agree, however, unit testing catches bugs, especially during development. It also ensures bugs will not re-appear and when an application is under heavy development, it stops bugs. For instance, a change was committed to Euphoria when the function changed was tested with a "test" program. The test program passed with flying colors. However, unit tests failed big time. The change was not counting on the fact that many other functions relied upon that one changed function. I also am head of IT and oversee maintenance of medical software with many units that are tested on a routine basis. Unit testing there has caught so much, I would not dream of ever releasing anything from it w/o unit testing. Unit testing does not catch everything, but it sure catches a lot, if you spend the time to write correct tests. Euphoria's unit testing is still in need of a good round of unit test additions. Currently it is only testing for good input, good output. Proper testing needs good and bad input. Way too often unit tests I see written are exactly that, because they are the easiest to write. Once I figure out the best way to run unit tests that crash Euphoria, then I will start testing bad input as well. Basically, I maintain, if your unit tests do not catch bugs that happen in real life, then your unit tests are not testing properly. Now, the problem is, who can think of every possible situation that can occur in real life? None, but we sure can think of a lot of them. I know this is true and it's easy to prove. Wait for a bug to happen in real life. Then look at your unit tests. Did you check for that type of error? I'm sure the answer is no. Many functions can only be twisted so much, for instance: <eucode> function add(integer a, integer b) </eucode> First, we know that Euphoria is working (because it has other unit tests). So, we know doing: add("John", "Doe") is not going to work. We know add(10.5, 2.43) is not going to work, etc... So, what are the possible values that could be passed? Granted this is an easy function to unit test, but I would venture to say, that you can easily test this function and no amount of real world use is going to extend past your testing. Now, did you spend 3 seconds writing a unit test? Sure, the testing of that function is useless and even this function will fail. But, it's easy to write conclusive tests for that function, as it is for many, many functions. Other functions are more difficult but still doable. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21137 Date: 2008 May 15 21:53 From: Bob Thompson <getter at fast?ail.c?.uk> Subject: Re: getRichText() memory leak? Larry Miller wrote: > > I have located the problem. > It is in getData() in win32Lib.ew > > Locate the line "text=peek({buffer,iLength})" at about line 15382. There is > more than instance of this code so be sure to get the right line. > I inserted "w32release_mem( buffer )" after this line. > > This is in version .70.4 > > The memory for buffer was allocated but never freed > > Larry Miller Thanks, Larry. That sorts the problem with getRichText() in my demo but I suspect more leaks. I have a large program and it took a fair amount of ripping apart to pin the problem down to getRichText() .... but it still has more memory leaks :( Maybe it's with getStream and putStream. I'll be back. Regards, Bob -= B E G I N =- X-EUFORUM: 21138 Date: 2008 May 15 22:03 From: Derek Parnell <ddparnell at b?gpo?d.com> Subject: Re: Euphoria Developers Group Discussion c.k.lester wrote: > > CChris wrote: > > > Did you notice how many improvements that would have broken zero code, because > > they were giving meaning to something currently illegal, were brought down because > > "name is not right", "one keyword more is too much" and such? A lot. > > Such is the dynamics of design by committee. :) Before we accept this assertion, can we have some examples of what you are talking about Chris? -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21139 Date: 2008 May 15 22:07 From: Derek Parnell <ddparnell at bi?po?d.com> Subject: Re: Feature creep Jeremy Cowgar wrote: > unit testing catches bugs, especially during development. It sure does. Unit tests, along with other forms of automated testing must be used. The design of test cases and unit tests is a bit of a black art and some people do it better than others. But not doing it at all is a poor decision. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21140 Date: 2008 May 15 22:15 From: jbrown <jbrown106 at sw?ft-mai?.com> Subject: Re: overriding vs namespaces Kat wrote: > So i explained it above some more,, understand now? > > Kat Yes, thanks for taking the time to do that. I feel that the ability to override a builtin function (the way it was done in euphoria 2.2) is quite useful, though. I don't think this should be thrown away. In your solution, if I have understood correctly, you can't really override a builtin at all. (You must use ftp:open() instead of open(), and it might as well be ftp_open().) This is a logical extension of the way namespaces were handled in 2.3 (if theres a conflict, both identifiers must have a namespace qualifier - except we dont need one for a builtin since it is implied). It is a good idea. -= B E G I N =- X-EUFORUM: 21141 Date: 2008 May 15 22:35 From: ChrisBurch3 <crylex at ?m?il.com> Subject: Re: Euphoria Developers Group Discussion Matt Lewis wrote: > > CChris wrote: > > > > You know, we are such a small group of vocal people here. There will always > > be disagreement for the sake of disagreeing. > > No there won't! > > Matt Tweaked the syntax Yes there Chris -= B E G I N =- X-EUFORUM: 21142 Date: 2008 May 15 22:42 From: ChrisBurch3 <crylex at ?mail.co?> Subject: Re: Feature creep Jeremy Cowgar wrote: > > ChrisBurch3 wrote: > > > > Hi > > > > There are so many changes going on at once, without solid feature > > testing (no disrespect Jeremy, but unit tests will only give you back what > > you want, and not always how they would react in real life (for this read > > all over the place coders like me)) > > > > I agree, however, unit testing catches bugs, especially during development. > It also ensures bugs will not re-appear and when an application is under heavy > development, it stops bugs. For instance, a change was committed to Euphoria > when the function changed was tested with a "test" program. The test program > passed with flying colors. However, unit tests failed big time. The change was > not counting on the fact that many other functions relied upon that one changed > function. > > I also am head of IT and oversee maintenance of medical software with many units > that are tested on a routine basis. Unit testing there has caught so much, I > would not dream of ever releasing anything from it w/o unit testing. > > Unit testing does not catch everything, but it sure catches a lot, if you spend > the time to write correct tests. Euphoria's unit testing is still in need of > a good round of unit test additions. Currently it is only testing for good input, > good output. Proper testing needs good and bad input. Way too often unit tests > I see written are exactly that, because they are the easiest to write. Once > I figure out the best way to run unit tests that crash Euphoria, then I will > start testing bad input as well. > > Basically, I maintain, if your unit tests do not catch bugs that happen in real > life, then your unit tests are not testing properly. Now, the problem is, who > can think of every possible situation that can occur in real life? None, but > we sure can think of a lot of them. I know this is true and it's easy to prove. > Wait for a bug to happen in real life. Then look at your unit tests. Did you > check for that type of error? I'm sure the answer is no. > > Many functions can only be twisted so much, for instance: > > <eucode> > function add(integer a, integer b) > </eucode> > > First, we know that Euphoria is working (because it has other unit tests). So, > we know doing: add("John", "Doe") is not going to work. We know add(10.5, 2.43) > is not going to work, etc... So, what are the possible values that could be > passed? Granted this is an easy function to unit test, but I would venture to > say, that you can easily test this function and no amount of real world use > is going to extend past your testing. Now, did you spend 3 seconds writing a > unit test? Sure, the testing of that function is useless and even this function > will fail. But, it's easy to write conclusive tests for that function, as it > is for many, many functions. Other functions are more difficult but still doable. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Phew, thats me told! Chris (PS, I also am the head of IT - by default! Does anybody know what the universal solution to "its not working" is?) -= B E G I N =- X-EUFORUM: 21143 Date: 2008 May 15 23:26 From: Matt Lewis <matthewwalkerlewis at ?m?il.com> Subject: Re: Feature creep ChrisBurch3 wrote: > > (PS, I also am the head of IT - by default! Does anybody know what the > universal solution to "its not working" is?) Reboot! -= B E G I N =- X-EUFORUM: 21144 Date: 2008 May 15 23:35 From: CChris <christian.cuvier at agricult??e.gouv.fr> Subject: Re: getRichText() memory leak? Larry Miller wrote: > > I have located the problem. > It is in getData() in win32Lib.ew > > Locate the line "text=peek({buffer,iLength})" at about line 15382. There is > more than instance of this code so be sure to get the right line. > I inserted "w32release_mem( buffer )" after this line. > > This is in version .70.4 > > The memory for buffer was allocated but never freed > > Larry Miller Good catch! Thanks a lot. CChris -= B E G I N =- X-EUFORUM: 21145 Date: 2008 May 15 23:36 From: Mike777 <anon4321 at g?ail.com> Subject: Re: Feature creep Matt Lewis wrote: > > ChrisBurch3 wrote: > > > > (PS, I also am the head of IT - by default! Does anybody know what the > > universal solution to "its not working" is?) > > Reboot! I am ashamed to admit that my wife fell victim to the solution being: "Reformat your hard drive." When she called me from the repair shop she was so proud! Mike -= B E G I N =- X-EUFORUM: 21146 Date: 2008 May 16 0:05 From: CChris <christian.cuvier at agr?culture.gou?.fr> Subject: Re: Euphoria Developers Group Discussion Derek Parnell wrote: > > c.k.lester wrote: > > > > CChris wrote: > > > > > Did you notice how many improvements that would have broken zero code, because > > > they were giving meaning to something currently illegal, were brought down because > > > "name is not right", "one keyword more is too much" and such? A lot. > > > > Such is the dynamics of design by committee. :) > > Before we accept this assertion, can we have some examples of what you are talking > about Chris? > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell - Structure field declarations - continue, select ... case - min, max and friends - [] desequence operator - sequence of <type> an many more, didn't keep a complete tally, being tired of the repeating pattern. CChris -= B E G I N =- X-EUFORUM: 21147 Date: 2008 May 16 0:20 From: Matt Lewis <matthewwalkerlewis at g?ail?com> Subject: Re: Euphoria Developers Group Discussion CChris wrote: > > Derek Parnell wrote: > > > > c.k.lester wrote: > > > > > > CChris wrote: > > > > > > > Did you notice how many improvements that would have broken zero code, > > > > because they were giving meaning to something currently illegal, were > > > > brought down because > > > > "name is not right", "one keyword more is too much" and such? A lot. > > > > > > Such is the dynamics of design by committee. :) > > > > Before we accept this assertion, can we have some examples of what you are talking > > about Chris? > > - Structure field declarations This one certainly isn't about "name." There are some serious differences of opinion about how detailed this should be. > - continue, select ... case Could you point out where the name/keyword issue has stopped this? I thought everyone was in agreement about the implementation. Continue is already in there. We could still change the name easily enough. I also thought that we've basically agreed about the need for case, but not the details yet. Either way, your argument doesn't fit. > - min, max and friends There were debates about what sort of arguments, etc, this should take. > - [] desequence operator I don't recall arguments about this one... > - sequence of <type> There are serious performance issues here that I don't think were ever addressed. Plus serious disagreements about how it should behave. > an many more, didn't keep a complete tally, being tired of the repeating > pattern. Sorry, but unless you can find some real examples, I'm calling BS. C'mon, there were substantial disagreements about how most of these things should be implemented. It's too bad that we can't all agree, but that's life. Matt -= B E G I N =- X-EUFORUM: 21148 Date: 2008 May 16 0:42 From: Jeremy Cowgar <jeremy at cowg?r.c?m> Subject: Re: Feature creep ChrisBurch3 wrote: > (PS, I also am the head of IT - by default! Does anybody know what the > universal solution to "its not working" is?) Yes... "You're doing it wrong." http://www.doingitwrong.com/ -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21149 Date: 2008 May 16 0:46 From: Jason Gade <jaygade at y?ho?.com> Subject: Re: Feature creep Matt Lewis wrote: > > ChrisBurch3 wrote: > > > > (PS, I also am the head of IT - by default! Does anybody know what the > > universal solution to "its not working" is?) > > Reboot! Get a bigger hammer. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21150 Date: 2008 May 16 0:50 From: Jason Gade <jaygade at ?a?oo.com> Subject: Another number question Can we guarantee that all positive integral atoms from 2^30 to 2^53 correspond to their actual number, with no loss of precision in that range? If not, what is the highest integral atom that can be represented without losing precision? I'm asking with regards to Kat's query about improving seek(). -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21151 Date: 2008 May 16 1:01 From: Kat <KAT12 at co?sa?s.net> Subject: machine level exception in file.e again It happened again. I still see no reason for it. Kat -= B E G I N =- X-EUFORUM: 21152 Date: 2008 May 16 1:06 From: Jason Gade <jaygade at ?a?oo.com> Subject: Re: machine level exception in file.e again Kat wrote: > > > It happened again. I still see no reason for it. > > Kat I assume in the same place with the same ex.err? -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21153 Date: 2008 May 16 1:11 From: Derek Parnell <ddparnell at bigpond.c??> Subject: Re: Feature creep ChrisBurch3 wrote: > (Does anybody know what the > universal solution to "its not working" is?) Hand it to the marketing department. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21154 Date: 2008 May 16 1:31 From: Matt Lewis <matthewwalkerlewis at gmail?co?> Subject: Re: Another number question Jason Gade wrote: > > Can we guarantee that all positive integral atoms from 2^30 to 2^53 correspond > to their actual number, with no loss of precision in that range? If not, what > is the highest integral atom that can be represented without losing precision? > > I'm asking with regards to Kat's query about improving seek(). The proper way to do this is to use a long long. A 64-bit integer. You could pretend that this was a double, and use float64_to_atom or something similar. Or just allocate the memory and use a pointer. Depends on how you're implementing it. Matt -= B E G I N =- X-EUFORUM: 21155 Date: 2008 May 16 1:41 From: Fernando Bauer <fmbauer at hotm?il?com> Subject: Re: Another number question Jason Gade wrote: > > Can we guarantee that all positive integral atoms from 2^30 to 2^53 correspond > to their actual number, with no loss of precision in that range? Yes, according to this test: <eucode> function PreviousIntegerDistance(atom a) atom i i = 1 while a = a-i do i += 1 end while return i end function function NextIntegerDistance(atom a) atom i i = 1 while a = a+i do i += 1 end while return i end function for i = 10 to 70 do printf(1,"2^%d = %g -> Interval = (-%d,%d)\n",{i,power(2,i),PreviousIntegerDistance(power(2,i)),NextIntegerDistance(power(2,i))}) end for </eucode> Regards, Fernando >If not, what > is the highest integral atom that can be represented without losing precision? > > I'm asking with regards to Kat's query about improving seek(). > > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. -= B E G I N =- X-EUFORUM: 21156 Date: 2008 May 16 1:45 From: jacques deschênes <desja at g??betrotter.net> Subject: Re: Optional "then" and "do" I almost missed it!! What are you trying to do with euphoria? I'm opposed to this. It's not that I like the "then" and "do". But its part of the personnality of euphoria. Is this euphoria or a new language that you want? surely C and Java have it better, a block structure is a block structure and all blocks should be opended and closed with the sames tokens, for exemples: personnality and it should keep it. There is so much posting lately I don't have time to read it all. If I don't comment or vote on every suggestion it is because I lack time. I guess I'm not alone so don't say that people that don't give their opinion, don't care. concerning suggestions for euphoria 4.0, slow don't you move to fast. Jacques Deschênes -= B E G I N =- X-EUFORUM: 21157 Date: 2008 May 16 1:53 From: jacques deschênes <desja at g?obetr?tter.net> Subject: Re: Optional "then" and "do" oops! some of my text have been drop in posting (bug in euforum maybe??) jacques deschênes wrote: > > > I almost missed it!! What are you trying to do with euphoria? I'm opposed to > this. It's not that I like the "then" and "do". But its part of the personnality > of euphoria. Is this euphoria or a new language that you want? > surely C and Java have it better, a block structure is a block structure and > all blocks should be opended and closed with the sames tokens, for exemples: <missing part> opening and closing curly brace open and close all blocks of code in C and Java, I prefer it, but euphoria as is </missing part> > personnality and it should keep it. > > There is so much posting lately I don't have time to read it all. If I don't > comment or vote on every suggestion it is because I lack time. I guess I'm not > alone so don't say that people that don't give their opinion, don't care. > concerning suggestions for euphoria 4.0, slow don't you move to fast. > > Jacques Deschênes -= B E G I N =- X-EUFORUM: 21158 Date: 2008 May 16 1:55 From: Jason Gade <jaygade at y?hoo?com> Subject: Re: Another number question Matt Lewis wrote: > > Jason Gade wrote: > > > > Can we guarantee that all positive integral atoms from 2^30 to 2^53 correspond > > to their actual number, with no loss of precision in that range? If not, what > > is the highest integral atom that can be represented without losing precision? > > > > I'm asking with regards to Kat's query about improving seek(). > > The proper way to do this is to use a long long. A 64-bit integer. You > could pretend that this was a double, and use float64_to_atom or something > similar. Or just allocate the memory and use a pointer. Depends on how > you're implementing it. > > Matt Well, if Euphoria /had/ 64-bit integers that wouldn't be a problem. At this point, the limitation is the fseek() call in the C library, which takes a 32-bit integer, limiting the size of the seek to 4GB. Now, maybe one of these days Kat will have to deal with 18 exabyte files, but that day is not today. If we go with 2^53, then that limits her to only 9 petabyte files. Cry me a river. My idea is this: Euphoria already converts the atom to an unsigned long int. fseek() can also take a relative number using SEEK_CUR (not exposed to Euphoria). So if the atom is larger than an unsigned long int then the C code could loop over relative values to the proper position. Another option is to either allow an optional third parameter to Euphoria's seek() and make the programmer loop herself or make a new command/macine_func that does that. A third option is to use platform-dependent function calls. I like the first option -- seek() already takes an atom. There's no reason that it can't be bigger than 4GB and still work. Fernando Bauer wrote: > > Jason Gade wrote: > > > > Can we guarantee that all positive integral atoms from 2^30 to 2^53 correspond > > to their actual number, with no loss of precision in that range? > > Yes, according to this test: > > <eucode> > function PreviousIntegerDistance(atom a) > atom i > i = 1 > while a = a-i do i += 1 > end while > return i > end function > > function NextIntegerDistance(atom a) > atom i > i = 1 > while a = a+i do i += 1 > end while > return i > end function > > for i = 10 to 70 do > printf(1,"2^%d = %g -> Interval = (-%d,%d)\n",{i,power(2,i),PreviousIntegerDistance(power(2,i)),NextIntegerDistance<font > color="#0000FF">(power(2,i))}) > end for > </eucode> > > Regards, > Fernando > Thanks Fernando, I'll check it out. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21159 Date: 2008 May 16 2:05 From: Kat <KAT12 at coos?hs.net> Subject: Re: Another number question Jason Gade wrote: > > Matt Lewis wrote: > > > > Jason Gade wrote: > > > > > > Can we guarantee that all positive integral atoms from 2^30 to 2^53 correspond > > > to their actual number, with no loss of precision in that range? If not, what > > > is the highest integral atom that can be represented without losing precision? > > > > > > I'm asking with regards to Kat's query about improving seek(). > > > > The proper way to do this is to use a long long. A 64-bit integer. You > > could pretend that this was a double, and use float64_to_atom or something > > similar. Or just allocate the memory and use a pointer. Depends on how > > you're implementing it. > > > > Matt > > Well, if Euphoria /had/ 64-bit integers that wouldn't be a problem. At this > point, the limitation is the fseek() call in the C library, which takes a 32-bit > integer, limiting the size of the seek to 4GB. Both windoseXP and various *nix have functions that can be called with bigger integers. What size, i don't know, but bigger than 32, and prolly 64. > Now, maybe one of these days Kat will have to deal with 18 exabyte files, but > that day is not today. If we go with 2^53, then that limits her to only 9 petabyte > files. Cry me a river. The curent harddrives can handle "only" 48 bits, and i suspect more than a few handle 40 bits. The next step above that is likely going to be RAIDs configured as one "drive" and will be at 64 bits merely for the convienence of the cpu, even tho the drive tables could take 72 bits (3 x 24). But basically, there's OS api calls that exist that Eu isn't using for this, and i am not sure how to pass an integer that Eu can't handle anyhow. Or get one back. Kat -= B E G I N =- X-EUFORUM: 21160 Date: 2008 May 16 2:08 From: Kat <KAT12 at co?sa?s.net> Subject: Re: machine level exception in file.e again Jason Gade wrote: > > Kat wrote: > > > > > > It happened again. I still see no reason for it. > > > > Kat > > I assume in the same place with the same ex.err? Same error, same place in the code, but much further along in the 15gig file it's reading from. Thing is, the dir() is obviously NOT handling the 15gig file, just the dir with 450 megabytes and 97,000 files in it. This is a level well within winxp and eu abilities, and the drive has not failed at any other time, only with this machine call in file.e. And if i restart the app, it runs a few more days, and then crashes again the same way. Kat -= B E G I N =- X-EUFORUM: 21161 Date: 2008 May 16 2:11 From: Jeremy Cowgar <jeremy at ?owg?r.com> Subject: Re: machine level exception in file.e again Kat wrote: > > Same error, same place in the code, but much further along in the 15gig file > it's reading from. Thing is, the dir() is obviously NOT handling the 15gig file, > just the dir with 450 megabytes and 97,000 files in it. This is a level well > within winxp and eu abilities, and the drive has not failed at any other time, > only with this machine call in file.e. And if i restart the app, it runs a few > more days, and then crashes again the same way. > I have run a test for Kat on my Windows Vista box. I created a directory and made an app that created 100,000 files in that directory. I then did a dir() in Euphoria. It took a little under 3 seconds to return the sequence and print a length() on the sequence. I ran it 20 times w/no error. I am not sure what this means or if it means anything. Just providing more information. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21162 Date: 2008 May 16 2:15 From: Jeremy Cowgar <jeremy at ?o?gar.com> Subject: Re: machine level exception in file.e again Jeremy Cowgar wrote: > > I have run a test for Kat on my Windows Vista box. I created a directory and > made an app that created 100,000 files in that directory. I then did a dir() > in Euphoria. It took a little under 3 seconds to return the sequence and print > a length() on the sequence. I ran it 20 times w/no error. > > I am not sure what this means or if it means anything. Just providing more information. > Oh, In Linux the exact same program took 0.298s and completed w/o problem. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21163 Date: 2008 May 16 2:25 From: Jason Gade <jaygade at y?hoo.com> Subject: Re: Another number question Kat wrote: > > Jason Gade wrote: > > > > Matt Lewis wrote: > > > > > > Jason Gade wrote: > > > > > > > > Can we guarantee that all positive integral atoms from 2^30 to 2^53 correspond > > > > to their actual number, with no loss of precision in that range? If not, what > > > > is the highest integral atom that can be represented without losing precision? > > > > > > > > I'm asking with regards to Kat's query about improving seek(). > > > > > > The proper way to do this is to use a long long. A 64-bit integer. You > > > could pretend that this was a double, and use float64_to_atom or something > > > similar. Or just allocate the memory and use a pointer. Depends on how > > > you're implementing it. > > > > > > Matt > > > > Well, if Euphoria /had/ 64-bit integers that wouldn't be a problem. At this > > point, the limitation is the fseek() call in the C library, which takes a 32-bit > > integer, limiting the size of the seek to 4GB. > > Both windoseXP and various *nix have functions that can be called with bigger > integers. What size, i don't know, but bigger than 32, and prolly 64. > > > Now, maybe one of these days Kat will have to deal with 18 exabyte files, but > > that day is not today. If we go with 2^53, then that limits her to only 9 petabyte > > files. Cry me a river. > > The curent harddrives can handle "only" 48 bits, and i suspect more than a few > handle 40 bits. The next step above that is likely going to be RAIDs configured > as one "drive" and will be at 64 bits merely for the convienence of the cpu, > even tho the drive tables could take 72 bits (3 x 24). I don't know what the hardware can handle, but I know that until recently most software could only handle 32 bits. I'm not sure if many OS's use more than 64 bits for offset_t, though. > > But basically, there's OS api calls that exist that Eu isn't using for this, > and i am not sure how to pass an integer that Eu can't handle anyhow. Or get > one back. > > Kat I think that Matt wrote a library for sending either 32-bit integers or larger to OS API calls... Maybe it was only full 32-bits. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21164 Date: 2008 May 16 2:25 From: Kat <KAT12 at coo?ahs.n?t> Subject: Re: machine level exception in file.e again Jeremy Cowgar wrote: > > Kat wrote: > > > > Same error, same place in the code, but much further along in the 15gig file > > it's reading from. Thing is, the dir() is obviously NOT handling the 15gig file, > > just the dir with 450 megabytes and 97,000 files in it. This is a level well > > within winxp and eu abilities, and the drive has not failed at any other time, > > only with this machine call in file.e. And if i restart the app, it runs a few > > more days, and then crashes again the same way. > > > > I have run a test for Kat on my Windows Vista box. I created a directory and > made an app that created 100,000 files in that directory. I then did a dir() > in Euphoria. It took a little under 3 seconds to return the sequence and print > a length() on the sequence. I ran it 20 times w/no error. > > I am not sure what this means or if it means anything. Just providing more information. It runs fast on winxp-sp2 also, except when it crashes. I have added a counter to see if there is a maxdircount per crash or something.... without a huge_seek() tho, it may take till tomorrow just to get back to where it was, and resume. Kat -= B E G I N =- X-EUFORUM: 21165 Date: 2008 May 16 3:07 From: gshingles <gshingles at gmail.c?m> Subject: Re: Enum? Derek Parnell wrote: > The tokens I propose are these below ... (but please feel free to come up with > better ones) > (1) enum:length > (2) enum:min > (3) enum:max > > When used in an enumeration declaration, they do not themselves become values > in the enumeration. > > Example: > > <eucode> > enum > FILE_NO, > LINE_NO, > FILE_PTR, > FILE_START_SYM, > OP_WARNING=-1, > OP_TRACE=-2, > OP_TYPE_CHECK=0, > OP_PROFILE_TIME=18, > OP_PROFILE_STATEMENT=3, > OP_DEFINES=9, > minFILE=enum:min, -- lowest enumeration value > maxFILE=enum:max, -- highest enumeration value > lenFILE=enum:length -- count of items in THIS enumeration > </eucode> Yep. Looks good, if a bit wordy. Isn't ':' for namespaces, or did that become '.' last week? If it is ':' you might have to do a bit of gymnastics in case you have a namespace 'enum' ? I'm for whatever works though and provides the most features with the least barriers to speedy implementation. Gary -= B E G I N =- X-EUFORUM: 21166 Date: 2008 May 16 3:16 From: gshingles <gshingles at ?mai?.com> Subject: Re: Optional "then" and "do" Jason Gade wrote: > > There's already a language that does this, it's called Python. > > Mandatory indentation? No thanks. It's a trade-off. Mandatory indentation does away with a lot of conditionals syntax cruft and ends up looking pretty elegant. I wonder if in 100 years there will be a super-programming-language which everyone uses or languages will continue on a divergent babel-like path to the point where you'll have to start learning programming as an infant to get to grips with a particular language? :) But no, no mandatory indents for Euphoria. Gary -= B E G I N =- X-EUFORUM: 21167 Date: 2008 May 16 3:28 From: gshingles <gshingles at g?ai?.com> Subject: Re: Feature creep Jeremy Cowgar wrote: > So, that's my story and that's how we are where we are today. And more power to you. I have always followed the Euphoria list and it used to be easy to keep up with the 10-20 messages per week at times when someone wanted help with win32lib or something. Since you've initiated this development phase I think there's been an average of about a page of posts per day. All this discussion is good, and so are the changes to the language. This puts Euphoria on a development curve now equivalent to Python, Perl, or PHP and it may become as useful, adopted, and general purpose as those languages because of these changes. Gary -= B E G I N =- X-EUFORUM: 21168 Date: 2008 May 16 3:39 From: gshingles <gshingles at ?mail.c?m> Subject: Re: Enum? Euler German wrote: > > > On 14 May 2008 at 19:08, Alan F wrote (maybe snipped): > > > From what I understand, the first entry in any 'enum' statement is > > always > > set to 1. However, the 'last enumeration value' option would be useful > > (for example, to define a sequence of that length for holding a > > structure), but I wasn't and still am not sure what would be good > > syntax for this. I'm not so sure about the $ syntax proposed. > > > > $ makes sense. It is "euphoric" alright (subscripts), but I'm not > sure about the convenience of "^". Well, I could used to it some day, > but can't get the point. $ and ^ are used in regular expressions to denote 'to the end of it' and 'from the beginning of it', respectively. I personally think we should stay away from Perl syntax as much as possible. It's refreshing to program in a language where you don't have to use as many ! at #$%^&*\ symbols. (But that doesn't mean I don't think we could borrow some more Perl-ish _concepts_) Gary -= B E G I N =- X-EUFORUM: 21169 Date: 2008 May 16 4:08 From: gshingles <gshingles at g?ail.com> Subject: Re: Euphoria Developers Group Discussion c.k.lester wrote: > > Mike777 wrote: > > > > > > With that said, I am strongly in favor of bifurcation. I don't agree with a separate developer forum in the form that seems to be developing. I think users of the language do need to be involved with the discussion of its features, development, and direction. I have looked through the source code for Euphoria but do not have the detailed understanding of how it all works. So I think Jeremy had it right when he said the developer's list (if needed) is more for "What does this block of code do?, How does this stuff work?" etc. But it is a conundrum I agree. Before running off and possibly ruining the momentum that this list has gathered I would like to propose a suggestion for the EUForum itself. What if each thread could be 'tagged' with a section? For example this thread is tagged "Development Organisation" or whatever, a thread on how to make a button change its text is tagged "Win32lib" A thread about the roadmap could be tagged 'Development' etc. etc. When new message is created, you tick the section(s) that apply. Or when replying to a message you change the tick boxes around if it's going off topic. In your preferences for the list you tick the sections you want to see (defaulting to all) When you see the list, you only see what you're interested in, and perhaps a message like "142 messages filtered". Old messages continue to expire to the archive, but perhaps maintain their section tag to enhance their searchability. What this means is that if you are not interested in seeing any developer stuff, or wxEuphoria examples, or off-topic quips they will be efficiently filtered. I'm not sure how this would affect RSS readers. This of course requires Rob's buy-in or whoever is maintaining the EUForum itself, and of course everyone's buy-in to tick the boxes. Gary -= B E G I N =- X-EUFORUM: 21170 Date: 2008 May 16 4:27 From: gshingles <gshingles at ?ma?l.com> Subject: Re: Euphoria Developers Group Discussion c.k.lester wrote: > > Changes to the core, including standard libs. These are things that > newbs aren't interested in and could be overwhelmed by. What 'newbs'? I don't think I've seen more than about 10 new users posting in EUForum in the last three years? (I could be wrong?) Half the time a new name turns out to be an old-hand with a new email address, or just someone who has search out a better way and found Euphoria, ie someone interested in programming principles. Without detailed access logs to the forum, or a proper user survey, I don't think anyone is in a position to say how effective or ineffective 'this way' is. > Changes to the interpreter do not require community input except when those > changes will introduce breaks with old code or will in some way harm the > current performance of Euphoria. Otherwise, it's just another feature they > can decide to use or not use. I don't agree. Sure they can decide whether to use it or not, but if it has been implemented in an 'unusable' (or limited/inefficient) way, that decision will have already been made for them. > What developers should do is discuss among themselves implementation details, > then present a vote to the community... That seems a bit too ... democratic to me... in the negative sense of the word. The community needs to drive the development not make multiple choices about it; given the good graces of the developers who will actually get their hands dirty doing it, of course :) Gary -= B E G I N =- X-EUFORUM: 21171 Date: 2008 May 16 5:22 From: gshingles <gshingles at gmail?co?> Subject: Re: Enum? gshingles wrote: > I personally think we should stay away from Perl syntax as much as possible. > It's refreshing to program in a language where you don't have to use as many ! at > #$%^&*\ symbols. Well that kind of ruined the impact of the pun... "a language where you don't have to use as many !#$%^& symbols." -= B E G I N =- X-EUFORUM: 21172 Date: 2008 May 16 6:26 From: Dan Moyer <danielmoyer at p?odigy.?et> Subject: Re: Feature creep c.k.lester wrote: > > CChris wrote: > > c.k.lester wrote: > > > Therefore, I propose we form a Euphoria Developers Group. Anybody who is > > > interested in developing Euphoria can join. > > There is such a group already, those who have ability to commit to the SVN repository > > because they asked for it and were let in. > > True, but we need to move development discussions to some other forum > besides this one (EuForum). When I ask EuForum if they agree or disagree > with some change to the interpreter, and I get 2-3 responses, I'm not > so enthusiastic about querying the population anymore. They apparently > > 1. don't care about it, or > 2. agree with it, or > 3. don't disagree enough to speak up. > <snip> 4. or, don't yet really understand a proposal well enough to comment, and will wait for more discussion as a basis for understanding the proposal. Dan -= B E G I N =- X-EUFORUM: 21173 Date: 2008 May 16 7:09 From: Dan Moyer <danielmoyer at pro?i?y.net> Subject: Re: Euphoria Developers Group Discussion c.k.lester wrote: > > ChrisBurch2 wrote: > > c.k.lester wrote: > > > So, somebody set up a Euphoria Developers forum and those who care about > > > Euphoria development can join. > > Absolutey bang on the nail CK. A developers group should be split off. > > I nominate <a href="http://www.assembla.com/">http://www.assembla.com/</a> to host the developer's group. :) > > It is faster than SourceForge and free. I don't know if it's as feature-rich, > but it looks like it has all we need. But you guys can look it up and compare. > I am using Assembla for BBCMF development. Or, just split THIS list into two lists, Support & Development, with either (or both combined) selectable at Euphoria Home. or, as a re-design IDEA, http://audacityteam.org/forum/index.php Dan -= B E G I N =- X-EUFORUM: 21174 Date: 2008 May 16 8:15 From: CChris <christian.cuvier at agriculture?g?uv.fr> Subject: Re: Another number question Kat wrote: > > Jason Gade wrote: > > > > Matt Lewis wrote: > > > > > > Jason Gade wrote: > > > > > > > > Can we guarantee that all positive integral atoms from 2^30 to 2^53 correspond > > > > to their actual number, with no loss of precision in that range? If not, what > > > > is the highest integral atom that can be represented without losing precision? > > > > > > > > I'm asking with regards to Kat's query about improving seek(). > > > > > > The proper way to do this is to use a long long. A 64-bit integer. You > > > could pretend that this was a double, and use float64_to_atom or something > > > similar. Or just allocate the memory and use a pointer. Depends on how > > > you're implementing it. > > > > > > Matt > > > > Well, if Euphoria /had/ 64-bit integers that wouldn't be a problem. At this > > point, the limitation is the fseek() call in the C library, which takes a 32-bit > > integer, limiting the size of the seek to 4GB. > > Both windoseXP and various *nix have functions that can be called with bigger > integers. What size, i don't know, but bigger than 32, and prolly 64. > > > Now, maybe one of these days Kat will have to deal with 18 exabyte files, but > > that day is not today. If we go with 2^53, then that limits her to only 9 petabyte > > files. Cry me a river. > > The curent harddrives can handle "only" 48 bits, and i suspect more than a few > handle 40 bits. The next step above that is likely going to be RAIDs configured > as one "drive" and will be at 64 bits merely for the convienence of the cpu, > even tho the drive tables could take 72 bits (3 x 24). > > But basically, there's OS api calls that exist that Eu isn't using for this, > and i am not sure how to pass an integer that Eu can't handle anyhow. Or get > one back. > > Kat I had added a comment in the doc for c_func() a long time ago about passing a 64 bit integer. Just pretend, when define_c_func()ing, that the C routine has two C_POINTER args. c_func() passing low dword first, then high dxord. You can get a long long back using large_return.e in the archive. Feedback appreciated. CChris -= B E G I N =- X-EUFORUM: 21175 Date: 2008 May 16 8:15 From: ZNorQ <znorq at ?olhaug.com> Subject: Win32Lib; Timed events I have a couple of questions in regards to timed events in Win32Lib; a) Why wont this code example work? (PS! The mbox is just another form of message_box, and it works - this isn't the problem.) procedure evnTIM_Timer (integer hControl, integer hEvent, sequence uParameters) mbox("5 seconds just passed...") end procedure setTimer(fmMAF, 12, 5000) setHandler(12, w32HTimer, routine_id("evnTIM_Timer")) b) Is it possible to create timers that aren't 'linked' to a window? Kenneth/ZNorQ -= B E G I N =- X-EUFORUM: 21176 Date: 2008 May 16 8:20 From: CChris <christian.cuvier at ?griculture.go?v.fr> Subject: Re: Win32Lib; Timed events ZNorQ wrote: > > > I have a couple of questions in regards to timed events in Win32Lib; > > a) Why wont this code example work? (PS! The mbox is just another form of message_box, > and it works - this isn't the problem.) > > procedure evnTIM_Timer (integer hControl, integer hEvent, sequence uParameters) > mbox("5 seconds just passed...") > end procedure > setTimer(fmMAF, 12, 5000) > setHandler(12, w32HTimer, routine_id("evnTIM_Timer")) > > b) Is it possible to create timers that aren't 'linked' to a window? > > Kenneth/ZNorQ Of course. Any control will accept a timer AFAIK. As to why the message box doesn't show up: try replacing it with a showMessage() statement, and see if you "get the message". I use this for debugging things where the inspected window must not lose focus to the debugger, so it definitely works. CChris -= B E G I N =- X-EUFORUM: 21177 Date: 2008 May 16 8:41 From: Jeremy Cowgar <jeremy at co?gar.com> Subject: Re: Feature creep Dan Moyer wrote: > > 4. or, don't yet really understand a proposal well enough to comment, > and will wait for more discussion as a basis for understanding the > proposal. I'll try to be more descriptive and give better examples of new proposals. If something is not understood, speak up and those who wrote the proposal should go into more detail. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21178 Date: 2008 May 16 8:45 From: ZNorQ <znorq at holhaug??om> Subject: Re: Win32Lib; Timed events CChris wrote: > > ZNorQ wrote: > > > > > > I have a couple of questions in regards to timed events in Win32Lib; > > > > a) Why wont this code example work? (PS! The mbox is just another form of message_box, > > and it works - this isn't the problem.) > > > > procedure evnTIM_Timer (integer hControl, integer hEvent, sequence uParameters) > > mbox("5 seconds just passed...") > > end procedure > > setTimer(fmMAF, 12, 5000) > > setHandler(12, w32HTimer, routine_id("evnTIM_Timer")) > > > > b) Is it possible to create timers that aren't 'linked' to a window? > > > > Kenneth/ZNorQ > > Of course. Any control will accept a timer AFAIK. > > As to why the message box doesn't show up: try replacing it with a showMessage() > statement, and see if you "get the message". I use this for debugging things > where the inspected window must not lose focus to the debugger, so it definitely > works. > > CChris It works now, not because I used the showMessage (I did, but that didn't change anything), but because I changed from timer ID 12 to 1... So, I guess you can't have 12 timers? (I don't have 12 timers, 12 was just a random number I picked for my routine..) Thank for the feedback, though.. :) Kenneth/ZNorQ -= B E G I N =- X-EUFORUM: 21179 Date: 2008 May 16 8:48 From: ZNorQ <znorq at ho?haug.c?m> Subject: Re: Win32Lib; Timed events Hmmm, linking the timer to a window seems to work, but when I try creating timer that isn't connected to any controls (using zero instead of a control), it no longer works, it seems.. procedure evnTIM_TimerX (integer hControl, integer hEvent, sequence uParameters) -- setText({sbMAF, 1}, "5 seconds passed..") -- end procedure setTimer(0, 1, 5000) setHandler(1, w32HTimer, routine_id("evnTIM_TimerX")) I had to change from showMessage to setText... Kenneth/ZNorQ -= B E G I N =- X-EUFORUM: 21180 Date: 2008 May 16 8:54 From: CChris <christian.cuvier at agric?lture.?ouv.fr> Subject: Re: Win32Lib; Timed events ZNorQ wrote: > > CChris wrote: > > > > ZNorQ wrote: > > > > > > > > > I have a couple of questions in regards to timed events in Win32Lib; > > > > > > a) Why wont this code example work? (PS! The mbox is just another form of message_box, > > > and it works - this isn't the problem.) > > > > > > procedure evnTIM_Timer (integer hControl, integer hEvent, sequence uParameters) > > > mbox("5 seconds just passed...") > > > end procedure > > > setTimer(fmMAF, 12, 5000) > > > setHandler(12, w32HTimer, routine_id("evnTIM_Timer")) > > > > > > b) Is it possible to create timers that aren't 'linked' to a window? > > > > > > Kenneth/ZNorQ > > > > Of course. Any control will accept a timer AFAIK. > > > > As to why the message box doesn't show up: try replacing it with a showMessage() > > statement, and see if you "get the message". I use this for debugging things > > where the inspected window must not lose focus to the debugger, so it definitely > > works. > > > > CChris > > It works now, not because I used the showMessage (I did, but that didn't change > anything), but because I changed from timer ID 12 to 1... So, I guess you can't > have 12 timers? (I don't have 12 timers, 12 was just a random number I picked > for my routine..) > > Thank for the feedback, though.. :) > > Kenneth/ZNorQ I just ran this: <eucode> include win32lib.ew constant w=create(Window,"eee",0,50,50,50,50,0) procedure p(integer id,integer event,sequence s) w32VOID=message_box("5 seconds just passed...","Test passed",MB_OK) end procedure setHandler(w,w32HTimer,routine_id("p")) setTimer(w,12,5000) WinMain(w,Normal) </eucode> and it just works. Message boxes pile up 12 a minute, and each one closes on Ok. CChris -= B E G I N =- X-EUFORUM: 21181 Date: 2008 May 16 8:55 From: CChris <christian.cuvier at agricult?re.g?uv.fr> Subject: Re: Win32Lib; Timed events ZNorQ wrote: > > Hmmm, linking the timer to a window seems to work, but when I try creating timer > that isn't connected to any controls (using zero instead of a control), it no > longer works, it seems.. > > procedure evnTIM_TimerX (integer hControl, integer hEvent, sequence uParameters) > -- > setText({sbMAF, 1}, "5 seconds passed..") > -- > end procedure > setTimer(0, 1, 5000) > setHandler(1, w32HTimer, routine_id("evnTIM_TimerX")) > > I had to change from showMessage to setText... > > Kenneth/ZNorQ I said "any control will do". 0 is not an actual control id, not even a valid handle for Windows. It is a special value which is treated, somewhat consistently, as if refeerring to the desktop window. But it actually doesn't. CChris -= B E G I N =- X-EUFORUM: 21182 Date: 2008 May 16 9:02 From: Kat <KAT12 at coos?hs.?et> Subject: Re: New keywords: ifdef, elsifdef, end ifdef CChris wrote: > > Mike777 wrote: > > > > Kat wrote: > > > > > > Shawn Pringle wrote: > > > > > > <snip> > > > > > > > That would have been useful when win32lib.ew put a string type in their library. > > > > > > Wait,, there's a string type in win32lib?? > > > > type w32string Implements an ASCII string. > > > > Mike > > Sorry to nitpick, but... > > I'll change this doc entry anyway. User defined types in Eu hardly implement > stuff, they just recognise it. A w32string is a plain sequence the contents > of which are printable or control single byte chars. It doesn't implement char[] > or TCHAR[] as such. > > btw I may consider tagging some user ctypes as printable, so as to allow DBCS chars in w32strings. Will > be in 70.4a if it's delayed enough :-) I downloaded the latest win32lib off the user contribs page, and did a wordsearch in it for w32string, and found it is a type. Nothing uses it, nothing manipulates the w32string in memory. Nothing puts a sequence into memory, and nothing moves the w32string into a sequence. Near as i can tell, it's a type-restricted sequence, not a C-type string in memory. Not nearly like Bernie's mixedlib.e, which i'll hereby nominate as "should be in Eu". But with integer values bigger than 32bits, of course. ;-) Kat -= B E G I N =- X-EUFORUM: 21183 Date: 2008 May 16 9:11 From: Jeremy Cowgar <jeremy at ?owgar.?om> Subject: After 4.0 gshingles wrote: > > What 'newbs'? I don't think I've seen more than about 10 new users posting in > EUForum in the last three years? (I could be wrong?) > Half the time a new name turns out to be an old-hand with a new email address, > or just someone who has search out a better way and found Euphoria, ie someone > interested in programming principles. > > Without detailed access logs to the forum, or a proper user survey, I don't > think anyone is in a position to say how effective or ineffective 'this way' > is. Put your newbie helper hats on. I think (hope) everyone agrees that Euphoria growing not only in syntax, speed, ease of use, standard library, etc... is good but also growing in user base. To me, a growing user base adds stability, testing, community, lively hood and of course warm bodies to help Euphoria grow. Once 4.0 is released many things must then occur... not in any order except the randomness of a mind still waking up: 1. Get Euphoria placed in the Computer Language Shootout 2. Encourage current users to write blog entries about the new 4.0. 3. Encourage current users to start talking about Euphoria on other Internet forums they may belong to, at their workplace, etc... 4. Start making packages for download for major repos 5. Get Euphoria into major distributions: 5a. Debian (Ubuntu and it's variants will pick the package up) 5b. GenToo 5c. Fedora 5d. FreeBSD 5e. Mandrivia 5f. OpenSUSE 5g. ArchLinux ....... Many of these will be a submit package, wait, wait, wait and 6mos later adopted. We may have to work on Licensing, the build system but we need to get Euphoria into these distributions and possibly more. 6. There are many places on the net that should have information about Euphoria that does not. We need people to seek these places out and remedy the problem. 7. Write some great OS Euphoria applications. Advertise existing Euphoria apps. Use existing Euphoria apps. When 4.0 is released, I'll create a more formal plan, but all I am saying is there is much to be done! It's important for us to grow, so if you can, even if it's a very small task of simply talking about Euphoria to those you know, we are going to need your help w/4.0. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21184 Date: 2008 May 16 10:07 From: Matt Lewis <matthewwalkerlewis at gma?l.c?m> Subject: Re: Another number question Jason Gade wrote: > > Well, if Euphoria /had/ 64-bit integers that wouldn't be a problem. At this > point, the limitation is the fseek() call in the C library, which takes a 32-bit > integer, limiting the size of the seek to 4GB. > > Now, maybe one of these days Kat will have to deal with 18 exabyte files, but > that day is not today. If we go with 2^53, then that limits her to only 9 petabyte > files. Cry me a river. Hey, not my fault you don't want to do it right. :) I know I've worked with the windows API for large files. Haven't done the same for linux/bsd. Matt -= B E G I N =- X-EUFORUM: 21185 Date: 2008 May 16 10:15 From: Matt Lewis <matthewwalkerlewis at ?mai?.com> Subject: Re: machine level exception in file.e again Kat wrote: > > Jason Gade wrote: > > > > Kat wrote: > > > > > > > > > It happened again. I still see no reason for it. > > > > > > Kat > > > > I assume in the same place with the same ex.err? > > Same error, same place in the code, but much further along in the 15gig file > it's reading from. Thing is, the dir() is obviously NOT handling the 15gig > file, just the dir with 450 megabytes and 97,000 files in it. This is a > level well within winxp and eu abilities, and the drive has not failed at > any other time, only with this machine call in file.e. And if i restart the > app, it runs a few more days, and then crashes again the same way. Does it always crash on a dir with a 15gig file? There could be an overflow in there that's causing problems. You might try Greg H's win_dir libary: http://www.rapideuphoria.com/win_dir.zip Matt -= B E G I N =- X-EUFORUM: 21186 Date: 2008 May 16 10:25 From: ZNorQ <znorq at ??lhaug.com> Subject: Re: Win32Lib; Timed events CChris wrote: > > ZNorQ wrote: > > > > CChris wrote: > > > > > > ZNorQ wrote: > > > > > > > > > > > > I have a couple of questions in regards to timed events in Win32Lib; > > > > > > > > a) Why wont this code example work? (PS! The mbox is just another form of > message_box,</font></i> > > > > and it works - this isn't the problem.) > > > > > > > > procedure evnTIM_Timer (integer hControl, integer hEvent, sequence uParameters) > > > > mbox("5 seconds just passed...") > > > > end procedure > > > > setTimer(fmMAF, 12, 5000) > > > > setHandler(12, w32HTimer, routine_id("evnTIM_Timer")) > > > > > > > > b) Is it possible to create timers that aren't 'linked' to a window? > > > > > > > > Kenneth/ZNorQ > > > > > > Of course. Any control will accept a timer AFAIK. > > > > > > As to why the message box doesn't show up: try replacing it with a showMessage() > > > statement, and see if you "get the message". I use this for debugging things > > > where the inspected window must not lose focus to the debugger, so it definitely > > > works. > > > > > > CChris > > > > It works now, not because I used the showMessage (I did, but that didn't change > > anything), but because I changed from timer ID 12 to 1... So, I guess you can't > > have 12 timers? (I don't have 12 timers, 12 was just a random number I picked > > for my routine..) > > > > Thank for the feedback, though.. :) > > > > Kenneth/ZNorQ > > I just ran this: > <eucode> > include win32lib.ew > > constant w=create(Window,"eee",0,50,50,50,50,0) > procedure p(integer id,integer event,sequence s) > w32VOID=message_box("5 seconds just passed...","Test passed",MB_OK) > end procedure > setHandler(w,w32HTimer,routine_id("p")) > setTimer(w,12,5000) > WinMain(w,Normal) > </eucode> > > and it just works. Message boxes pile up 12 a minute, and each one closes on > Ok. > > CChris Aaah, know what I did wrong. In the setHandler I used same ID as used as TIMER ID in setTimer. In other words - it worked! :) Thanks man. Kenneth/ZNorQ -= B E G I N =- X-EUFORUM: 21187 Date: 2008 May 16 10:28 From: ZNorQ <znorq at hol??ug.com> Subject: Re: Win32Lib; Timed events CChris wrote: > > I said "any control will do". 0 is not an actual control id, not even a valid > handle for Windows. It is a special value which is treated, somewhat consistently, > as if refeerring to the desktop window. But it actually doesn't. > > CChris Ah, ok. But how would i go about then when I'm creating a program that doesn't pop-up a window. I know I can use WinMain(0, Normal), but how do I use the timer in this case? Purpose of the code; Run in the background and run various code in intervals. Kenneth/ZNorQ -= B E G I N =- X-EUFORUM: 21188 Date: 2008 May 16 11:34 From: CChris <christian.cuvier at ag?ic?lture.gouv.fr> Subject: Re: Win32Lib; Timed events ZNorQ wrote: > > CChris wrote: > > > > I said "any control will do". 0 is not an actual control id, not even a valid > > handle for Windows. It is a special value which is treated, somewhat consistently, > > as if refeerring to the desktop window. But it actually doesn't. > > > > CChris > > Ah, ok. But how would i go about then when I'm creating a program that doesn't > pop-up a window. I know I can use WinMain(0, Normal), but how do I use the timer > in this case? > > Purpose of the code; Run in the background and run various code in intervals. > > Kenneth/ZNorQ CreateEx a main window that is not visible and has the WS_EX_NOACTIVATE extended style (so it won't show in the toolbar). Then WinMain(the_window,Minimized). This is probably close to what you want. A cleaner way woul be to support message only windows, but it would work on Win2K only, and currently requires low level API to create it. I'll think about it. CChris -= B E G I N =- X-EUFORUM: 21189 Date: 2008 May 16 11:51 From: ZNorQ <znorq at ho?haug.co?> Subject: Re: Win32Lib; Timed events CChris wrote: > > ZNorQ wrote: > > > > CChris wrote: > > > > > > I said "any control will do". 0 is not an actual control id, not even a valid > > > handle for Windows. It is a special value which is treated, somewhat consistently, > > > as if refeerring to the desktop window. But it actually doesn't. > > > > > > CChris > > > > Ah, ok. But how would i go about then when I'm creating a program that doesn't > > pop-up a window. I know I can use WinMain(0, Normal), but how do I use the timer > > in this case? > > > > Purpose of the code; Run in the background and run various code in intervals. > > > > Kenneth/ZNorQ > > CreateEx a main window that is not visible and has the WS_EX_NOACTIVATE extended > style (so it won't show in the toolbar). Then WinMain(the_window,Minimized). > This is probably close to what you want. > A cleaner way woul be to support message only windows, but it would work on > Win2K only, and currently requires low level API to create it. I'll think about > it. > > CChris I just tried something else before I saw your answer; (VERY abbreviated) mywin= createEx(window, etc...) setTimer(mywin, 1, 1000) setHandler(mywin, etc...) WinMain(0,Normal) And it *seems* to work! I'll have a go at your version as well. As for "message only windows", I'm not that fluent in WinAPI coding to even remotely understand what your are talking about.. :) Thanks for the input, CChris. ZNorQ -= B E G I N =- X-EUFORUM: 21190 Date: 2008 May 16 12:28 From: c.k.lester <euphoric at ckl?st?r.com> Subject: Re: Euphoria Developers Group Discussion gshingles wrote: > c.k.lester wrote: > > Changes to the interpreter do not require community input except when those > > changes will introduce breaks with old code or will in some way harm the > > current performance of Euphoria. Otherwise, it's just another feature they > > can decide to use or not use. > I don't agree. Sure they can decide whether to use it or not, but if it has > been implemented in an 'unusable' (or limited/inefficient) way, that decision > will have already been made for them. That's why I said "those changes that will introduce breaks with old code or will in some way harm the current performance..." It won't be implemented in an unusable/limited/inefficient way. > The community needs to drive the development... This has been tried and it fails. When asked for input, only a few people ever respond, if any. I'm saying gather those interested parties together and leave everybody else alone. I use PHP. I don't care about its development so I'm not part of that developers group. I'm sure there are many Euphoria users who feel the same about Euphoria. But I use Euphoria and I care what happens to it, so I would want to give my input and help guide its development. -= B E G I N =- X-EUFORUM: 21191 Date: 2008 May 16 12:29 From: c.k.lester <euphoric at ckleste?.?om> Subject: Re: Feature creep Dan Moyer wrote: > c.k.lester wrote: > > They apparently > > > > 1. don't care about it, or > > 2. agree with it, or > > 3. don't disagree enough to speak up. > > > > 4. or, don't yet really understand a proposal well enough to comment, > and will wait for more discussion as a basis for understanding the > proposal. If they don't understand something, they better speak up and ask a question instead of holding up development... IMHO. :) -= B E G I N =- X-EUFORUM: 21192 Date: 2008 May 16 12:40 From: CChris <christian.cuvier at a?riculture?gouv.fr> Subject: Re: Win32Lib; Timed events ZNorQ wrote: > > CChris wrote: > > > > ZNorQ wrote: > > > > > > CChris wrote: > > > > > > > > I said "any control will do". 0 is not an actual control id, not even a valid > > > > handle for Windows. It is a special value which is treated, somewhat consistently, > > > > as if refeerring to the desktop window. But it actually doesn't. > > > > > > > > CChris > > > > > > Ah, ok. But how would i go about then when I'm creating a program that doesn't > > > pop-up a window. I know I can use WinMain(0, Normal), but how do I use the timer > > > in this case? > > > > > > Purpose of the code; Run in the background and run various code in intervals. > > > > > > Kenneth/ZNorQ > > > > CreateEx a main window that is not visible and has the WS_EX_NOACTIVATE extended > > style (so it won't show in the toolbar). Then WinMain(the_window,Minimized). > > This is probably close to what you want. > > A cleaner way woul be to support message only windows, but it would work on > > Win2K only, and currently requires low level API to create it. I'll think about > > it. > > > > CChris > > I just tried something else before I saw your answer; (VERY abbreviated) > > mywin= createEx(window, etc...) > setTimer(mywin, 1, 1000) > setHandler(mywin, etc...) > WinMain(0,Normal) > > And it *seems* to work! I'll have a go at your version as well. > > As for "message only windows", I'm not that fluent in WinAPI coding to even > remotely understand what your are talking about.. :) > > Thanks for the input, CChris. > > ZNorQ Other Windows developers had needed a window that would just take and dispatch messages, and nothing else (no switching to it, no taskbar button, no rectagle on screen, no nothing). You can always do this by defining the event loop of the window accordingly.That's how it was done under Win9x. A good recipe for bugs. You can do that using win32lib's setDefaultProcessing(). So, in Win2K and onwards, there is a special sort of window with such a minimalistic functionality, which is called "message only window". win32lib cannot currently createEx() it, but the Windows API sure can (if curious, google for HWND_MESSAGE and check links to MSDN in the result). CChris -= B E G I N =- X-EUFORUM: 21193 Date: 2008 May 16 12:52 From: CChris <christian.cuvier at agric?lture.gouv.f?> Subject: wi32lib: RFC for w32string() Defined in w32utils.e, w32string() is an user defined type which validates sequence of integers in the 0 to 255 range. So, for instance, w32string({5,0,255,7}) is 1, but try naming anything this way, or printing it. Good luck. This is why I suggest changing its meaning slightly to something probably more useful: 1/ create a new String_CT w32CType() class, initially identical to Printable_CT. 2/ change w32string() to validate a sequence of characters in the String_CT class. This would reject the garbage above, and enable anyone to add accented or double byte (UTF-16) characters to the range of what w32strung() accepts. A simpler variant would be to directly tie w32string() to Printable_CT. I don't know about all uses of this char class by Eu code, so uncoupling the two issues is 100% safe, at the cost of a new char class. Any thoughts? CChris -= B E G I N =- X-EUFORUM: 21194 Date: 2008 May 16 13:37 From: Jason Gade <jaygade at y?ho?.com> Subject: Re: Another number question Matt Lewis wrote: > > Jason Gade wrote: > > > > Well, if Euphoria /had/ 64-bit integers that wouldn't be a problem. At this > > point, the limitation is the fseek() call in the C library, which takes a 32-bit > > integer, limiting the size of the seek to 4GB. > > > > Now, maybe one of these days Kat will have to deal with 18 exabyte files, but > > that day is not today. If we go with 2^53, then that limits her to only 9 petabyte > > files. Cry me a river. > > Hey, not my fault you don't want to do it right. :) > > I know I've worked with the windows API for large files. Haven't done the > same for linux/bsd. > > Matt :-) Well, for me "doing it right" means making it pretty much transparent and working the way the user expects it to work. That is, the user gives a number and the pointer seeks to the proper spot in the file, subject only to the OS/filesystem limitations. In a way I think this would be transitional as well, as machines do eventually move more and more to 64-bit. More research is required, I think. Right now I'm mostly just brainstorming anyway. One thought I had this morning, though, was to create a 64-bit integer type internal to the interpreter, and routines or macros or whatever to convert an atom to a 64-bit integer. Then that groundwork will be laid for the future. Still taking baby steps with the source -- I still haven't gotten set back up with subversion or anything and I still spend more time elsewhere on the internet discussing non-programming stuff than I spend doing any programming. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21195 Date: 2008 May 16 13:55 From: Jeremy Cowgar <jeremy at ?owg?r.com> Subject: CChris ... Can you email me? Chris, I've tried to email in the past but got a bounced message. I'm not sure I have your email address right. Tried to use the one listed here in EUforum. Can you email me? I have a few questions. Thanks! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21196 Date: 2008 May 16 14:41 From: Bernie Ryan <xotron at blu?frog?com> Subject: Re: Win32Lib; Timed events ZNorQ wrote: > > CChris wrote: > > > > I said "any control will do". 0 is not an actual control id, not even a valid > > handle for Windows. It is a special value which is treated, somewhat consistently, > > as if refeerring to the desktop window. But it actually doesn't. > > > > CChris > > Ah, ok. But how would i go about then when I'm creating a program that doesn't > pop-up a window. I know I can use WinMain(0, Normal), but how do I use the timer > in this case? > > Purpose of the code; Run in the background and run various code in intervals. > > Kenneth/ZNorQ You can use HWND GetDesktopWindow(VOID) to get a handle to desktop window which is in most cases always available and use that with your timer. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21197 Date: 2008 May 16 15:16 From: c.k.lester <euphoric at ck?ester?com> Subject: Programming Contest (Non-Euphoria) Thought some of you guys might be interested in this one: http://www.xsqlsoftware.com/xSQLPuzzle.aspx -= B E G I N =- X-EUFORUM: 21198 Date: 2008 May 16 15:21 From: Jeremy Cowgar <jeremy at cow?a?.com> Subject: Re: Programming Contest (Non-Euphoria) c.k.lester wrote: > > Thought some of you guys might be interested in this one: > > <a href="http://www.xsqlsoftware.com/xSQLPuzzle.aspx">http://www.xsqlsoftware.com/xSQLPuzzle.aspx</a> I was thinking of a fun contest (no money prize) after 4.0 is released. Not sure what the goal would be, but one it would include is using new features and the new libraries :-) -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21199 Date: 2008 May 16 15:36 From: Peter Robinson <indorlaw at yahoo.?om.?u> Subject: Breaking the silence It's fair enough that people think we don't care when we rarely speak, but just so you don't think it's true ... I think Euphoria's personality, as Jacques correctly put it, is founded on the use of close-to-natural language, like pseudo-code. Things like this:- while 1 label something do whatever while 1 do "top" statements that (perhaps) look sensible when viewed next to traditional programming languages, are complete gibberish in a natural language context. It's got nothing to do with it being English. The constructs in other Western languages are similar. If we want to label something, put the label at the top of the block outside the natural language sentential flow. Because of Euphoria's style, I prefer explicit labelling like:- label outer: while etc However, the more I see the useful discussion on this, and remember my own problems, the more I think we all have to bite the bullet on backward jumps within blocks. You often want to retry something earlier within a block, but it's not always at the start of a block. Sometimes you want to retry the code immediately following the error or validity checking, or some such thing. Sometimes you just want to go back 2 lines, and don't want to wrap it in a procedure that excises the code to a distant place. I favour allowing backward references to labels within blocks. For clarity, I would like the labels to be marked in language, not symbols, and would prefer that they have their own line (like in VB), though that is contrary to usual Euphoria convention. I would include all blocks, if, while, for, proc, func. This need comes up quite often, it is not due to illogical coding, and the alternatives are often barbarous. The demand for forward jumps is less, but the discussion about fall-throughs in case statements highlights that it is an issue. The typical conditional involves a forward jump. Should the default for a case fall-through, or jump to the end. I would support forward jumps to labels in blocks, but would not be horrified if they were omitted. Forward jumps could be used to fall through, and you wouldn't necessarily have to fall to the next level. I'm not mad on optional keywords, don't really like them, but not as horrified as others. I often forget the 'then' or 'do' because I more often code in C. I like the fact that Euphoria makes me state the logic, even though I swear harder than most when I regularly leave out these keywords. One thing I don't do is spend hours figuring out what I did wrong. Not sure how many people I would represent, but I can assure you that there are some lurkers who are actually very interested and concerned at the future of the language. I must have become a registered user in about 1999, and barely a day has gone by since then when I didn't read the list. Best of luck Pete Robinson -= B E G I N =- X-EUFORUM: 21200 Date: 2008 May 16 15:45 From: "Euler German" <eulerg at gmail.com> Subject: Re: Enum? > On 15 May 2008 at 20:39, gshingles wrote (maybe snipped): > Euler German wrote: > > > > > On 14 May 2008 at 19:08, Alan F wrote (maybe snipped): > > > > > From what I understand, the first entry in any 'enum' statement > > > is always > > > set to 1. However, the 'last enumeration value' option would be > > > useful (for example, to define a sequence of that length for > > > holding a structure), but I wasn't and still am not sure what > > > would be good syntax for this. I'm not so sure about the $ syntax > > > proposed. > > > > > > > $ makes sense. It is "euphoric" alright (subscripts), but I'm not > > sure about the convenience of "^". Well, I could used to it some > > day, but can't get the point. > > $ and ^ are used in regular expressions to denote 'to the end of it' > and 'from the beginning of it', respectively. > > I personally think we should stay away from Perl syntax as much as > possible. It's refreshing to program in a language where you don't > have to use as many ! at #$%^&*\ symbols. > > (But that doesn't mean I don't think we could borrow some more > Perl-ish _concepts_) > Gary, Perl regex syntax is sort of reference for regular expressions. If PCRE (Perl Compatible Regular Expressions) is the choice, that's what we'll be using. I think there'll be no problem to use PCRE's regex patterns strings (in fact, I think it's good) but that'll be only for passing the pattern to regex engine. All the rest shall be plain Euphoria. Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 21201 Date: 2008 May 16 16:00 From: c.k.lester <euphoric at ?kleste?.com> Subject: Re: Breaking the silence Peter Robinson wrote: > > It's fair enough that people think we don't care when we rarely speak, but just > so you don't think it's true ... Hey, Peter! Thanks for speaking up... I don't want you to think that I think you don't care. That was one option I suggested that means you don't care to speak up, not that you don't care about Euphoria or its development direction. If you see changes being made to Euphoria with which you vehemently disagree, I would hope that you- and everybody else who feels the same way- would contribute an option or viewpoint in relevant discussion threads. Otherwise, you do leave it up to a select few. Of course, if you trust those select few- like I do- to keep Euphoria usable and fast, you can sit back and work on your programming projects without a concern. > However, the more I see the useful discussion on this, and remember my own problems, > the more I think we all have to bite the bullet on backward jumps within blocks. > You often want to retry something earlier within a block, but it's not always > at the start of a block. Sometimes you want to retry the code immediately following > the error or validity checking, or some such thing. Sometimes you just want > to go back 2 lines, and don't want to wrap it in a procedure that excises the > code to a distant place. I like the ideas of continue, retry, and exit for both program flow control and error handling... even if I can't immediately come up with pseudo-code that demonstrates its effective use. > Not sure how many people I would represent, but I can assure you that there > are some lurkers who are actually very interested and concerned at the future > of the language. I must have become a registered user in about 1999, and barely > a day has gone by since then when I didn't read the list. Howdy, lurkers! I appreciate all of you. :D -= B E G I N =- X-EUFORUM: 21202 Date: 2008 May 16 16:10 From: Kenneth Rhodes <ken_rhodes30436 at ?ahoo.c?m> Subject: compiling translated files on Linux AMD64 Hi, Does anyone know how to compile translated files on Linux AMD64? Specifically my problem is a failure of translated euphoria code to compile under: gcc version 4.2.1 (SUSE Linux 10.3) ken@linux-40ht:~> gcc --ver Using built-in specs. Target: x86_64-suse-linux Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.2.1 --enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib64 --with-system-zlib --enable-shared --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --program-suffix=-4.2 --enable-version-specific-runtime-libs --without-system-libunwind --with-cpu=generic --host=x86_64-suse-linux Thread model: posix Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.0 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21203 Date: 2008 May 16 16:16 From: Jeremy Cowgar <jeremy at cowg?r?com> Subject: Re: compiling translated files on Linux AMD64 Kenneth Rhodes wrote: > > Hi, > > Does anyone know how to compile translated files on Linux AMD64? > > Specifically my problem is a failure of translated euphoria code > to compile under: > > gcc version 4.2.1 (SUSE Linux 10.3) > What is the compile error? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21204 Date: 2008 May 16 16:21 From: Michael J. Sabal <m_sabal at ?ah?o.com> Subject: Re: Optional "then" and "do" Keep in mind, syntax errors (missing and, missing then, missing do) are much easier to find and fix than logic errors (variable being assigned value 1 instead of testing for value 1). This feature should only be allowed by a without header, making then and do still required by default. In other words, if the programs starts, <eucode> without thendo </eucode> and later you see <eucode> if a = 1 b = 2 c = 3 end if </eucode> a will be tested, b will be assigned, and c will be assigned. If the intention was to test b, there will be a logic error that won't appear until much later in the execution. On the other hand, if the without thendo statement is missing, this code will immediately terminate before execution with an error that something is missing, pointing directly to this line in the program, and creating an ex.err file. Even though I think it's a hassle to always type then and do, I would much rather be forced to do that knowing that I won't have any logic errors because of a missing and/or/then than have to spend several hours trying to hunt down why my program isn't working the way it's supposed to. -= B E G I N =- X-EUFORUM: 21205 Date: 2008 May 16 16:23 From: Asa <electro.legacy at gm?il?com> Subject: keyboard input using getc(0) Hi all, I am finding that after using an expression like "choice = getc(0)" the next time getc(0) is called, it doesn't wait for the keystroke. Something left in the keyboard buffer from the first call? I did search the docs before posting, but couldn't find an answer. Thanks. -= B E G I N =- X-EUFORUM: 21206 Date: 2008 May 16 16:27 From: Jeremy Cowgar <jeremy at ?owga?.com> Subject: Re: Optional "then" and "do" Michael J. Sabal wrote: > > Keep in mind, syntax errors (missing and, missing then, missing do) are much > > easier to find and fix than logic errors (variable being assigned value 1 > instead of testing for value 1). > > This feature should only be allowed by a without header, making then and do > still required by default. > > In other words, if the programs starts, > <eucode> > without thendo > </eucode> I don't think we should introduce syntax changes based on with/without settings for two reasons: 1. Now the interpreter every time it hits a if, for, or while loop has to check, "Do we require then/do?" if so, it has to do one thing, otherwise, do something else. To program, this is easy, but do we want to introduce this into the parser? I think we need to keep Eu as fast as reasonably possible. 2. Say John never uses then/do. Jane does. Now John join's Jane's project and he has a hard time understanding some code, reading some code, etc... I think Eu syntax should be the same on John's code or Jane's code. If we allow setting of optional then/do's, we could then also, just as easy, allow the setting of is the keyword "continue" or "next"? So in some code you read you will see continue and in other code you will see next. That's taken a bit further than suggested, but it just helps to make the point. Eu syntax should be Eu syntax. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21207 Date: 2008 May 16 16:28 From: Bernie Ryan <xotron at bluefr?g.co?> Subject: Re: keyboard input using getc(0) Asa wrote: > > Hi all, I am finding that after using an expression like "choice = getc(0)" > the next time getc(0) is called, it doesn't wait for the keystroke. Something > > left in the keyboard buffer from the first call? > > I did search the docs before posting, but couldn't find an answer. > > Thanks. Look up wait_key Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21208 Date: 2008 May 16 16:30 From: Jeremy Cowgar <jeremy at c?wgar.c?m> Subject: Re: keyboard input using getc(0) Asa wrote: > > Hi all, I am finding that after using an expression like "choice = getc(0)" > the next time getc(0) is called, it doesn't wait for the keystroke. Something > > left in the keyboard buffer from the first call? > > I did search the docs before posting, but couldn't find an answer. > getc() will return multiple codes for special keys. wait_key will translate those for you. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21209 Date: 2008 May 16 17:11 From: Kenneth Rhodes <ken_rhodes30436 at yahoo?c?m> Subject: Re: compiling translated files on Linux AMD64 Jeremy Cowgar wrote: > > Kenneth Rhodes wrote: > > > > Hi, > > > > Does anyone know how to compile translated files on Linux AMD64? > > > > Specifically my problem is a failure of translated euphoria code > > to compile under: > > > > gcc version 4.2.1 (SUSE Linux 10.3) > > > > What is the compile error? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: i386 architecture of input file `/home/ken/euphoria/bin/ecu.a(be_machine.o)' is incompatible with i386:x86-64 output Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.0 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21210 Date: 2008 May 16 17:13 From: Jeremy Cowgar <jeremy at co?gar.?om> Subject: Re: compiling translated files on Linux AMD64 Kenneth Rhodes wrote: > > /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: > i386 architecture of input file `/home/ken/euphoria/bin/ecu.a(be_machine.o)' > > is incompatible with i386:x86-64 output > You're going to have to compile Euphoria on the x86 then :-/ That's the only solution. Luckly, it's not hard on Linux. You should be able to change to the source directory and type make. That will build new binaries and a new ecu.a. Save your previous ecu.a and then copy the new ecu.a to the ../bin dir of euphoria and give it another go and see what happens. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21211 Date: 2008 May 16 17:17 From: CChris <christian.cuvier at ag?iculture.gouv?fr> Subject: Re: CChris ... Can you email me? Jeremy Cowgar wrote: > > Chris, > > I've tried to email in the past but got a bounced message. I'm not sure I have > your email address right. Tried to use the one listed here in EUforum. > > Can you email me? I have a few questions. Thanks! > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Done. CChris -= B E G I N =- X-EUFORUM: 21212 Date: 2008 May 16 17:54 From: jacques deschênes <desja at globe?rot?er.net> Subject: a summary of my position I don't have time for long discussions (and I'm a man few words) so is a summary of my votes: standars libraries: yes enum: yes optional 'then' 'do': no goto and labels: should be limited to inside block of code (while, for proc,func) namespace: forget it for 4.0 if no agreement, euphoria lived without for many years. conditional include: yes with define=TAG: yes regards, jacques d. -= B E G I N =- X-EUFORUM: 21213 Date: 2008 May 16 17:55 From: Kenneth Rhodes <ken_rhodes30436 at yahoo?co?> Subject: Re: compiling translated files on Linux AMD64 Jeremy Cowgar wrote: > > Kenneth Rhodes wrote: > > > > /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: > > i386 architecture of input file `/home/ken/euphoria/bin/ecu.a(be_machine.o)' > > > > is incompatible with i386:x86-64 output > > > > You're going to have to compile Euphoria on the x86 then :-/ That's the only > solution. Luckly, it's not hard on Linux. You should be able to change to the > source directory and type make. That will build new binaries and a new ecu.a. > Save your previous ecu.a and then copy the new ecu.a to the ../bin dir of euphoria > and give it another go and see what happens. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> No joy... it appears that a bit of editing needs to be done to the source files before compiling under Linux, and 32bit Linux at that: from the readme file in the source directory: ----------------------------------------------------------------------- Euphoria for Linux, exu GNU C ===== You'll have to convert the line terminators in the source files to the Linux standard of \n, rather than the Windows/DOS form of \r\n, otherwise several files will give you errors. You can use: exu fixline.ex for this. Also, when you save a file using ed.ex, it will let you convert to \n terminators. You should also ensure that all source file names are lower case (unzip -L). build exu with: imakeu Make sure it has \n line-terminators, and execute permission (chmod +x imakeu). exu will run at full speed. -DINT_CODES is not used. The interactive trace, trace(1) should fully work. ----------------------------------------------------------------------- I'll do all the above and try again. But I'm a bit confused ..... I was thinking that there might be a switch for gcc to allow it to emit 32bit code. Or a GNU cross compiler or something. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.0 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21214 Date: 2008 May 16 18:00 From: Jeremy Cowgar <jeremy at c??gar.com> Subject: Re: a summary of my position jacques deschênes wrote: > > I don't have time for long discussions (and I'm a man few words) so is a summary > of my votes: > > standars libraries: yes > enum: yes > optional 'then' 'do': no > goto and labels: should be limited to inside block of code (while, for proc,func) > namespace: forget it for 4.0 if no agreement, euphoria lived without for many > years. > > conditional include: yes > with define=TAG: yes > Great! Someone I agree with, almost :-D ... The namespace debate has put a hold on standard library due to naming conflicts of functions. Standard library cannot/should not continue until namespace problems are either solved or a new naming scheme is adopted. We do not want to release new standard library w/awkward naming due to a lack of namespace and then in 4.1 fix namespace and either have to change all code written for the standard library in 4.0 or live with the bad names chosen. To me, namespace must get resolved one way or another. Meaning, use it or don't. And I am not for not using it, if there is hope of it being fixed in the future. I think the fix needs to come now. If even necessary, we have not even settled that yet :-/ -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21215 Date: 2008 May 16 18:15 From: Michael J. Sabal <m_sabal at y?hoo?com> Subject: Re: Optional "then" and "do" Jeremy Cowgar wrote: > > I don't think we should introduce syntax changes based on with/without settings > for two reasons: > > 1. Now the interpreter every time it hits a if, for, or while loop has to check, > "Do we require then/do?" if so, it has to do one thing, otherwise, do something > else. To program, this is easy, but do we want to introduce this into the parser? > I think we need to keep Eu as fast as reasonably possible. > > 2. Say John never uses then/do. Jane does. Now John join's Jane's project and > he has a hard time understanding some code, reading some code, etc... > > I think Eu syntax should be the same on John's code or Jane's code. > > If we allow setting of optional then/do's, we could then also, just as easy, > allow the setting of is the keyword "continue" or "next"? So in some code you > read you will see continue and in other code you will see next. That's taken > a bit further than suggested, but it just helps to make the point. Eu syntax > should be Eu syntax. Then absolutely remove this change! I like fixing bugs in 2 minutes rather than two hours. Don't break a good thing. Rob was very slow to make changes because Euphoria FORCED you code correctly, as much as it could. Removing that removes the core of what makes Euphoria a superior language. This is a deal-breaker issue. I'll go along with rearranging the standard includes. I'll support improving namespaces. Heck, I don't care if you continue, exit, or goto. None of those changes are going to (had better not) slow down the creation, debugging, or execution of my code. Making conditional statement end-tags optional is akin to chopping off one of the legs of a three-legged stool. DON'T DO IT! -= B E G I N =- X-EUFORUM: 21216 Date: 2008 May 16 18:15 From: Asa <electro.legacy at gmai?.?om> Subject: Re: keyboard input using getc(0) I have done that already, but would like to at least know what was up with getc(0)though. Before I switched to wait_key() i was doing this: choice = getc(0) choice = getc(0) the first call would "clear the pipes" and the second, would work as expected :) -= B E G I N =- X-EUFORUM: 21217 Date: 2008 May 16 18:17 From: Jeremy Cowgar <jeremy at cowgar.c??> Subject: Re: Optional "then" and "do" Michael J. Sabal wrote: > > Then absolutely remove this change! I like fixing bugs in 2 minutes rather > than two hours. Don't break a good thing. Rob was very slow to make > changes because Euphoria FORCED you code correctly, as much as it could. > Removing that removes the core of what makes Euphoria a superior language. > This is a deal-breaker issue. I'll go along with rearranging the standard > includes. I'll support improving namespaces. Heck, I don't care if you > continue, exit, or goto. None of those changes are going to (had better not) > slow down the creation, debugging, or execution of my code. Making > conditional statement end-tags optional is akin to chopping off one of the > legs of a three-legged stool. DON'T DO IT! Yuku has already removed that change he committed after a few people asked him to do so. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21218 Date: 2008 May 16 18:24 From: Jeremy Cowgar <jeremy at ?owga?.com> Subject: Re: keyboard input using getc(0) Some keys cannot be expressed with only one ASCII code. For instance, F1 on Linux is expressed as 3 ascii codes: 27, 79 and 80. So, using getc(0) would first return 27. The very next call, 79 and again 80. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21219 Date: 2008 May 16 18:33 From: Jeremy Cowgar <jeremy at co?gar.?om> Subject: Re: compiling translated files on Linux AMD64 Kenneth Rhodes wrote: > > > I'll do all the above and try again. > > But I'm a bit confused ..... I was thinking that there might be a > switch for gcc to allow it to emit 32bit code. Or a GNU cross compiler > or something. > It would be nice to be able to make a 64bit app. I am not sure of the ramifications. I did find this for you: http://www.cyberciti.biz/tips/compile-32bit-application-using-gcc-64-bit-linux.html Maybe that will help for the interim? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21220 Date: 2008 May 16 19:02 From: Arthur Crump <arthur.crump at nt?world.co?> Subject: Re: overriding vs namespaces For overriding existing routines, can I suggest a new Euphoria keyword: Forget open This could be used on variables as well as routines. Arthur Crump Matt Lewis wrote: > > Kat wrote: > > > > It allows for minimal changes to existing code, does not break existing code, > > and is the ONLY method for "overloading" an internal function, in my proposal. > > For instance, this would be illegal: > > <eucode> > > junk = open(blah) -- as an override of internal open() > > </eucode) > > this would be legal inside ftp.e (for example): > > <eucode> > > junk = ftp_open(blah): export as "open" > > </eucode> > > so it can be used like > > <eucode> > > include ftp.e as ftp > > ftp:open(someplace online) > > </eucode> > > Actually, this would break some existing code: > <eucode> > -- print.e > global procedure print(...) > > -- app.ex > include print.e > > print(...) > </eucode> > > Matt -= B E G I N =- X-EUFORUM: 21221 Date: 2008 May 16 19:05 From: Kat <KAT12 at coo?ah?.net> Subject: Re: machine level exception in file.e again Matt Lewis wrote: > > Kat wrote: <snip> > > it's reading from. Thing is, the dir() is obviously NOT handling the 15gig > > file, just the dir with 450 megabytes and 97,000 files in it. This is a <snip> > Does it always crash on a dir with a 15gig file? There could be an overflow 1) the 15 gig file is not handled, not seen, by dir 2) the 15 gig file is never in a folder i run dir on 3) the 15 gig file may be on another drive 4) i have had dir troubles before on win95 and winxp-sp2 5) the 15 gig file is not an issue 6) i am getting real sorry i mentioned the topic 7) this is about dir, which doesn't open the files 8) if dir cracked up on a particular file, i'd have said so > in there that's causing problems. You might try Greg H's win_dir > libary: > > <a href="http://www.rapideuphoria.com/win_dir.zip">http://www.rapideuphoria.com/win_dir.zip</a> > I have it, it seems to be a program to munge normal dir output. Munging such data cannot be the problem if dir never returns. I asked if i can trap the non-returning dir, called in file.e, in the machine call, and been told no, so i don't see why another lib of eu code could. Kat -= B E G I N =- X-EUFORUM: 21222 Date: 2008 May 16 19:14 From: Kat <KAT12 at coos?hs.n?t> Subject: Re: wi32lib: RFC for w32string() CChris wrote: > > > Defined in w32utils.e, w32string() is an user defined type which validates sequence > of integers in the 0 to 255 range. <snip> > Any thoughts? Yes, w32string is an eu sequence, calling it a string is a misnomer. Kat -= B E G I N =- X-EUFORUM: 21223 Date: 2008 May 16 19:27 From: Kenneth Rhodes <ken_rhodes30436 at ya?o?.com> Subject: Re: compiling translated files on Linux AMD64 Jeremy Cowgar wrote: > It would be nice to be able to make a 64bit app. I am not sure of the ramifications. > I did find this for you: > > <a href="http://www.cyberciti.biz/tips/compile-32bit-application-using-gcc-64-bit-linux.html">http://www.cyberciti.biz/tips/compile-32bit-application-using-gcc-64-bit-linux.html</a> > > Maybe that will help for the interim? > > -- > Jeremy Cowgar Thanks Jeremy. I'll play around with it all a bit and see what I can come up with. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21224 Date: 2008 May 16 19:32 From: Phil Russell <pg_russell at l?ne?ne.net> Subject: Re: Optional "then" and "do" <unlurk> Somewhat belatedly, I *don't* want "then" and "do" to be optional. I wouldn't like the current straightforward syntax to be complicated just to save a couple of keystrokes. wrt goto: I'm with Jacques Deschenes on this one - within a code block only. That said, I haven't used one in 15 years, and I ain't about to start now... Cheers, Phil </unlurk> -= B E G I N =- X-EUFORUM: 21225 Date: 2008 May 16 19:52 From: Arthur Crump <arthur.crump at ntl??rld.com> Subject: Re: Optional "then" and "do" I use Judith Evan's editor which fills in 'if' and 'for' blocks, so I don't have anything extra to type. However, I agree with Phil Russell that they should not be optional, although it is only a slight preference. As for 'goto' I do not approve of 'goto'. I started programming with low level languages (in 1958) and moved on to languages in which 'goto' was the only method of flow control. Now that it is not there, I don't miss it and would not use it if it was implemented, provided that a 'next' (or 'continue' if that is what it has to be) was implemented. Arthur Crump Phil Russell wrote: > > <unlurk> > > Somewhat belatedly, I *don't* want "then" and "do" to > be optional. I wouldn't like the current straightforward > syntax to be complicated just to save a couple of keystrokes. > > wrt goto: I'm with Jacques Deschenes on this one - within a > code block only. That said, I haven't used one in 15 years, > and I ain't about to start now... > > Cheers, > > Phil > </unlurk> -= B E G I N =- X-EUFORUM: 21226 Date: 2008 May 16 20:32 From: ChrisBurch3 <crylex at gmai??com> Subject: Re: compiling translated files on Linux AMD64 Hi I've never been able to compile under 64 bit Linux either. There's a fundamental incompatability in the C emitted and used, that the version of gcc doesn't like (can't remember what it is right now, though I have posted about it here before). This includes translated programs. I've tried various switches, with no success. It works fine on my 32 bit system, but I don't bother any more, because the translated and compiled program was 5 times the size of the bound program. Just no need. Chris -= B E G I N =- X-EUFORUM: 21227 Date: 2008 May 16 20:36 From: ChrisBurch3 <crylex at gma??.com> Subject: Re: keyboard input using getc(0) Asa wrote: > > Hi all, I am finding that after using an expression like "choice = getc(0)" > the next time getc(0) is called, it doesn't wait for the keystroke. Something > > left in the keyboard buffer from the first call? > > I did search the docs before posting, but couldn't find an answer. > > Thanks. Hi Run this after your getc while get_key() != -1 do end while end procedure or while getc() != -1 do end while end procedure Chris -= B E G I N =- X-EUFORUM: 21228 Date: 2008 May 16 20:38 From: Jeremy Cowgar <jeremy at cowgar?co?> Subject: Re: compiling translated files on Linux AMD64 ChrisBurch3 wrote: > > It works fine on my 32 bit system, but I don't bother any more, because > the translated and compiled program was 5 times the size of the bound program. > Just no need. > Really??? -rwxr-xr-x 1 jeremy jeremy 242K 2008-05-16 16:36 hello.bound -rw-r--r-- 1 jeremy jeremy 25 2008-05-16 16:32 hello.e -rwxr-xr-x 1 jeremy jeremy 134K 2008-05-16 16:32 hello.translated -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21229 Date: 2008 May 16 20:41 From: ChrisBurch3 <crylex at g?ail.co?> Subject: Re: compiling translated files on Linux AMD64 Yup, really, try it with a large program, like jetvet. Chris -= B E G I N =- X-EUFORUM: 21230 Date: 2008 May 16 20:43 From: Jeremy Cowgar <jeremy at c?w?ar.com> Subject: Bind/Translate ... code size and speed ChrisBurch3 wrote: > > Yup, really, try it with a large program, like jetvet. > Have you benchmarked it? I am curious about speed differences in a large application like that. I mean, a large app it's not that big of a deal if it's 300k or 2mb or larger. How large are we talking about? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21231 Date: 2008 May 16 20:46 From: Bernie Ryan <xotron at ?luef?og.com> Subject: Re: machine level exception in file.e again Kat wrote: > > Matt Lewis wrote: > > > > Kat wrote: > > <snip> > > > > it's reading from. Thing is, the dir() is obviously NOT handling the 15gig > > > file, just the dir with 450 megabytes and 97,000 files in it. This is a > > <snip> > > > Does it always crash on a dir with a 15gig file? There could be an overflow > > 1) the 15 gig file is not handled, not seen, by dir > 2) the 15 gig file is never in a folder i run dir on > 3) the 15 gig file may be on another drive > 4) i have had dir troubles before on win95 and winxp-sp2 > 5) the 15 gig file is not an issue > 6) i am getting real sorry i mentioned the topic > 7) this is about dir, which doesn't open the files > 8) if dir cracked up on a particular file, i'd have said so > > > in there that's causing problems. You might try Greg H's win_dir > > libary: > > > > <a href="http://www.rapideuphoria.com/win_dir.zip">http://www.rapideuphoria.com/win_dir.zip</a> > > > > I have it, it seems to be a program to munge normal dir output. Munging such > data cannot be the problem if dir never returns. I asked if i can trap the non-returning > dir, called in file.e, in the machine call, and been told no, so i don't see > why another lib of eu code could. > Kat: I took a look at win_dir and I see that WIN32_FIND_DATA structure is commented out and greg is using a constant that computes to size of 32819 bytes. constant WIN32_FIND_DATA_SIZE = 40 + 32767 + 12 When I use my software to calculate the structure size using a MAX_PATH of 260 bytes (win32 default) and TCHAR as a UNICODE character. My software says that WIN32_FIND_DATA_SIZE should be 592 bytes. The wrong size structure could be causing windows to over-write something in memory causing the exception problem. But maybe greg is using a different path size for his calculation but I don't think it would be that different. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21232 Date: 2008 May 16 21:05 From: Kenneth Rhodes <ken_rhodes30436 at yah??.com> Subject: Re: compiling translated files on Linux AMD64 ChrisBurch3 wrote: > > Hi > > I've never been able to compile under 64 bit Linux either. There's a fundamental > incompatability in the C emitted and used, that the version of gcc doesn't > like (can't remember what it is right now, though I have posted about it here > before). This includes translated programs. I've tried various switches, with > no success. I haven't had any success with translated code using the switches taken from the page Jeremy referenced in a previous post. If the source code in the euphoria Linux package is "broken" for AMD64, then the documentation should reflect that-- especially the blurbs on the download page. Likewise, Euphoria to C translation for AMD64 is broken and this should be noted in the documentation and relevant web pages. Is the only fix for this going to be a true port of Euphoria to AMD64? > > It works fine on my 32 bit system, but I don't bother any more, because > the translated and compiled program was 5 times the size of the bound program. > Just no need. > Did you use UPX? Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21233 Date: 2008 May 16 21:09 From: Jeremy Cowgar <jeremy at cowga?.co?> Subject: Re: compiling translated files on Linux AMD64 Kenneth Rhodes wrote: > > I haven't had any success with translated code using the switches > taken from the page Jeremy referenced in a previous post. > Bummer. Sorry. > If the source code in the euphoria Linux package is "broken" for AMD64, > then the documentation should reflect that-- especially the blurbs on > the download page. Likewise, Euphoria to C translation for AMD64 is broken > and this should be noted in the documentation and relevant web pages. Yes. It should. I have an AMD64 box here, but it currently only has Windows Vista on it (it's my wifes computer). I will find a HD laying around and put Linux on it and see what I can figure out, but that probably will not be until this weekend. I hope that's OK. > Is the only fix for this going to be a true port of Euphoria to AMD64? I'll have more info this weekend. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21234 Date: 2008 May 16 21:21 From: Kenneth Rhodes <ken_rhodes30436 at yahoo?com> Subject: Re: compiling translated files on Linux AMD64 Jeremy Cowgar wrote: > Yes. It should. I have an AMD64 box here, but it currently only has Windows > Vista on it (it's my wifes computer). I will find a HD laying around and put > Linux on it and see what I can figure out, but that probably will not be until > this weekend. I hope that's OK. > > > Is the only fix for this going to be a true port of Euphoria to AMD64? > > I'll have more info this weekend. Rots a ruck. Maybe with two hard drives there is someway to dual boot, but I was told by the salesman at Best Buy that Vista would not allow dual booting. Does Euphoria compile with no problems on AMD64 under Windows? Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21235 Date: 2008 May 16 21:23 From: Jeremy Cowgar <jeremy at co??ar.com> Subject: Re: compiling translated files on Linux AMD64 Kenneth Rhodes wrote: > > Rots a ruck. Maybe with two hard drives there is someway to dual boot, > but I was told by the salesman at Best Buy that Vista would not allow > dual booting. > He doesn't know what he's talking about. I dual boot vista all the time on my box. Same HD. > Does Euphoria compile with no problems on AMD64 under Windows? Never tried. I try to let my wife's PC be hers, otherwise, I have a tendency to slowly overtake it and always *need* it when she wants to use it :-/ I can add that to the list :-) -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21236 Date: 2008 May 16 21:24 From: CChris <christian.cuvier at agr?culture?gouv.fr> Subject: Re: wi32lib: RFC for w32string() Kat wrote: > > CChris wrote: > > > > > > Defined in w32utils.e, w32string() is an user defined type which validates sequence > > of integers in the 0 to 255 range. > > <snip> > > > Any thoughts? > > Yes, w32string is an eu sequence, calling it a string is a misnomer. > > Kat I'd only half agree here. It's a plain Eu sequence, representing (usually) a printable string. Oh, and after all I didn't coin that name ;) CChris -= B E G I N =- X-EUFORUM: 21237 Date: 2008 May 16 21:35 From: Kenneth Rhodes <ken_rhodes30436 at yahoo.c?m> Subject: Re: compiling translated files on Linux AMD64 Jeremy Cowgar wrote: > > Kenneth Rhodes wrote: > > > > Rots a ruck. Maybe with two hard drives there is someway to dual boot, > > but I was told by the salesman at Best Buy that Vista would not allow > > dual booting. > > > > He doesn't know what he's talking about. I dual boot vista all the time on my > box. Same HD. > Hmmmmm, sounds like a bit more MS propaganda to fend off Linux. So which version of Linux are you using? I've been thinking about migrating to Ubuntu/Kubuntu. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21238 Date: 2008 May 16 21:41 From: Jeremy Cowgar <jeremy at cowgar?co?> Subject: Linux Versions Kenneth Rhodes wrote: > > Hmmmmm, sounds like a bit more MS propaganda to fend off Linux. > Either that or he just doesn't know anything, like alot of the best buy/compusa/circuit city sales people. > So which version of Linux are you using? I've been thinking about > migrating to Ubuntu/Kubuntu. I use Debian on servers and ArchLinux on my own desktop. ArchLinux to me is simple, up to date, fast, reliable and easy to add my own packages or fix packages when I want to do something strange. http://archlinux.org Ubuntu is nice also. Choosing between Ubuntu and Kubuntu is a hard choice. Do you want Gnome or KDE? IMHO KDE is better, but for it to be better, you really need to lock into the KDE apps. For me, living in dual computer world (Windows and Linux), I cannot lock into KDE because they are not cross platform. So, I stick w/a simple gnome install. When I get tired of it not really managing windows for me like a window manager should, I install Ion or Awesome as the window manager and live life there for a while until I realize sometimes things would just be easier if I could move the window with my mouse :-) -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21239 Date: 2008 May 16 21:46 From: Kat <KAT12 at co?sahs.n?t> Subject: Re: machine level exception in file.e again Bernie Ryan wrote: > > Kat wrote: > > > > Matt Lewis wrote: > > > > > > Kat wrote: > > > > <snip> > > > > > > it's reading from. Thing is, the dir() is obviously NOT handling the 15gig > > > > file, just the dir with 450 megabytes and 97,000 files in it. This is a > > > > <snip> > > > > > Does it always crash on a dir with a 15gig file? There could be an overflow > > > > 1) the 15 gig file is not handled, not seen, by dir > > 2) the 15 gig file is never in a folder i run dir on > > 3) the 15 gig file may be on another drive > > 4) i have had dir troubles before on win95 and winxp-sp2 > > 5) the 15 gig file is not an issue > > 6) i am getting real sorry i mentioned the topic > > 7) this is about dir, which doesn't open the files > > 8) if dir cracked up on a particular file, i'd have said so > > > > > in there that's causing problems. You might try Greg H's win_dir > > > libary: > > > > > > <a href="http://www.rapideuphoria.com/win_dir.zip">http://www.rapideuphoria.com/win_dir.zip</a> > > > > > > > I have it, it seems to be a program to munge normal dir output. Munging such > > data cannot be the problem if dir never returns. I asked if i can trap the non-returning > > dir, called in file.e, in the machine call, and been told no, so i don't see > > why another lib of eu code could. > > > > Kat: > > I took a look at win_dir and I see that WIN32_FIND_DATA structure is > > commented out and greg is using a constant that computes to > > size of 32819 bytes. > > constant WIN32_FIND_DATA_SIZE = 40 + 32767 + 12 > > When I use my software to calculate the structure size > > using a MAX_PATH of 260 bytes (win32 default) and TCHAR as a UNICODE > > character. > > My software says that WIN32_FIND_DATA_SIZE should be 592 bytes. > > The wrong size structure could be causing windows to over-write something > > in memory causing the exception problem. But maybe greg is using a different > > path size for his calculation but I don't think it would be that different. Thanks, Bernie. The app is currently running, but again i don't know for how long. I do suspect that if it's a "length of dir contents" problem, it should crash the very next time i dir() that dir it crashed on? So far, since yesterday when i restarted it, it's dir()'d ~130,000 times (i added a counter yesterday), at about 3 dir()s per second. In this app, dir() is merely verifying the path exists that i want to write a file to, else dropping to code to createDir() (win32fil.ew by Jeffrey Fielding and Brian Broker -- come on guys, add some more stuff!) if it doesn't exist. I don't use the dir listing in this app, i only verify it's not -1. Any how, 130k+ times to run dir(), and it runs ok so far, it must be an oddball problem that's causing the crash. Next crash, i'll include win_dir and give that a try. Kat -= B E G I N =- X-EUFORUM: 21240 Date: 2008 May 16 21:49 From: ChrisBurch3 <crylex at g?ail.c?m> Subject: Re: Bind/Translate ... code size and speed Jeremy Cowgar wrote: > > ChrisBurch3 wrote: > > > > Yup, really, try it with a large program, like jetvet. > > > > Have you benchmarked it? I am curious about speed differences in a large application > like that. I mean, a large app it's not that big of a deal if it's 300k or 2mb > or larger. How large are we talking about? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Hi Speed about the same - not really an issue in a database / client patient management system, and all the database functions are handled by sqlite. Size - bound (just done it now) 522665, translated 2380276, and no, I haven't used UPX (again, I'm happy with binding, so I haven't gone any further. Chris -= B E G I N =- X-EUFORUM: 21241 Date: 2008 May 16 22:05 From: Matt Lewis <matthewwalkerlewis at gmail??om> Subject: Re: machine level exception in file.e again Kat wrote: > > > http://www.rapideuphoria.com/win_dir.zip > > > > I have it, it seems to be a program to munge normal dir output. Munging such > data cannot be the problem if dir never returns. I asked if i can trap the non-returning > dir, called in file.e, in the machine call, and been told no, so i don't see > why another lib of eu code could. Yeah, this is basically what I was thinking: the c-library routine for dir choked on the big file size. Which is why I asked about that file. You could build a debug version of euphoria, and use the watcom debugger to step through. This won't go into the internals of the c-library, though. I was talking about the munging going on to prepare the data returned by dir. Since Greg's library uses Win32 calls, I thought it might avoid a potential problem with the watcom runtime library. I promise not to try to be helpful on this thread anymore. Matt -= B E G I N =- X-EUFORUM: 21242 Date: 2008 May 16 22:11 From: ChrisBurch3 <crylex at gmai?.co?> Subject: Program line count Hi Just out of curiosity..... Once upon a time Euphoria had to be able to count code lines, as there was a 300 statement limit for error checking (or something) I was wondering if this was still in the interpreter, and if there was any way to access it. If not, has anyone got anything that will count the lines of your program, before I go getting distracted and scribbling something together. (Still working on the Sub Commander - see how easily distracted I get!) Chris -= B E G I N =- X-EUFORUM: 21243 Date: 2008 May 16 22:15 From: Kenneth Rhodes <ken_rhodes30436 at yaho?.c?m> Subject: Re: Program line count ChrisBurch3 wrote: > > Hi > > Just out of curiosity..... > > Once upon a time Euphoria had to be able to count code lines, as there was > a 300 statement limit for error checking (or something) > > I was wondering if this was still in the interpreter, and if there was any > way to access it. > > If not, has anyone got anything that will count the lines of your program, > before I go getting distracted and scribbling something together. > > (Still working on the Sub Commander - see how easily distracted I get!) > > Chris look at lines.ex in the bin directory Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21244 Date: 2008 May 16 22:16 From: Jeremy Cowgar <jeremy at c?wgar.?om> Subject: Re: Program line count ChrisBurch3 wrote: > > Hi > > Just out of curiosity..... > > Once upon a time Euphoria had to be able to count code lines, as there was > a 300 statement limit for error checking (or something) > > I was wondering if this was still in the interpreter, and if there was any > way to access it. > > If not, has anyone got anything that will count the lines of your program, > before I go getting distracted and scribbling something together. > > (Still working on the Sub Commander - see how easily distracted I get!) > There is lines.ex (lines.bat, lines) in Eu's bin dir... $ lines *.e* lines nb-lines nb-nc-lines chars 392 343 319 9254 doc.exw 107 86 77 2461 docgen.e 74 64 54 1538 genhtx.ex 290 244 220 7897 html.e 31 27 11 832 masschange.ex 217 217 189 5475 setupae.exw 26 23 23 474 sortcheck.ex 20 14 13 421 spell.ex 257 223 168 7221 spellchk.ex 47 35 34 848 tasktut.ex 1461 1276 1108 36421 total -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21245 Date: 2008 May 16 22:23 From: ChrisBurch3 <crylex at ?ma?l.com> Subject: Re: Program line count Hi Thanks, but not quite what I wanted. I wanted the number of statements in the program (excluding comments and whitespaces) - this would include the includes, a little more complex perhaps, but it was handled by the interpreter in the olden days (I think) Chris -= B E G I N =- X-EUFORUM: 21246 Date: 2008 May 16 22:25 From: Jeremy Cowgar <jeremy at cowga??com> Subject: Re: Program line count ChrisBurch3 wrote: > > Hi > > Thanks, but not quite what I wanted. I wanted the number of statements in the > program (excluding comments and whitespaces) - this would include the includes, > a little more complex perhaps, but it was handled by the interpreter in the > olden days (I think) > Chris, If you patch lines.ex to scan includes as well, that would be a nice addition to it, as a command line option. Many people will want to know what their line count is. If you make the addition, I'll commit it to the 4.0 release. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21247 Date: 2008 May 16 22:33 From: Kat <KAT12 at coosahs??et> Subject: Re: machine level exception in file.e again Matt Lewis wrote: > > Kat wrote: > > > > > <a href="http://www.rapideuphoria.com/win_dir.zip">http://www.rapideuphoria.com/win_dir.zip</a> > > > > > > > I have it, it seems to be a program to munge normal dir output. Munging such > > data cannot be the problem if dir never returns. I asked if i can trap the non-returning > > dir, called in file.e, in the machine call, and been told no, so i don't see > > why another lib of eu code could. > > Yeah, this is basically what I was thinking: the c-library routine for > dir choked on the big file size. Which is why I asked about that file. What big file? Dir() is seeing only a lot of ~100K files, i don't think but a few are 2 megabytes or so, and many are under 1k bytes. > You could build a debug version of euphoria, and use the watcom debugger to > step through. This won't go into the internals of the c-library, though. I keep asking where watcom is, why when i look for it that it's not sold or supported anymore, and i never get a source for it, so i don't have it. Not in all the time i have been using Euphoria. Besides, i'd need it to run full speed til there's an abnormality, and since there are legitimate -1 returned, sitting here for day after day watching it ask me "is this ok?", "is this ok?" every few minutes would just be too much. I believe Jeremy is now compiling eu v4.0 on openwatcom, which isn't the same beast as watcom. > I was talking about the munging going on to prepare the data returned by dir. > Since Greg's library uses Win32 calls, I thought it might avoid a potential > problem with the watcom runtime library. That's a possibility, yeas. Doesn't dir() use such win32 calls? Does it use bios calls? > I promise not to try to be helpful on this thread anymore. I think our emails are crossing, and this conversation is desync'd. I appreciate your help, but atm i think we don't have a clue what the other is talking about. I know i am confused why people think i keep running dir() with a huge file in the dir, and thinking it's the problem, and why i don't move it to another dir, when in fact it's been in other dirs and different drives all this time. Kat -= B E G I N =- X-EUFORUM: 21248 Date: 2008 May 16 22:52 From: ChrisBurch3 <crylex at gmail?co?> Subject: Re: Program line count Jeremy Cowgar wrote: > > ChrisBurch3 wrote: > > > > Hi > > > > Thanks, but not quite what I wanted. I wanted the number of statements in the > > program (excluding comments and whitespaces) - this would include the includes, > > a little more complex perhaps, but it was handled by the interpreter in the > > olden days (I think) > > > > Chris, > > If you patch lines.ex to scan includes as well, that would be a nice addition > to it, as a command line option. Many people will want to know what their line > count is. If you make the addition, I'll commit it to the 4.0 release. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Ya had to go and do it didn't ya. Now look at me. I'm all distracted! Give me 6 months. Chris -= B E G I N =- X-EUFORUM: 21249 Date: 2008 May 16 22:54 From: Jeremy Cowgar <jeremy at co?gar?com> Subject: Re: Program line count ChrisBurch3 wrote: > > > Ya had to go and do it didn't ya. Now look at me. I'm all distracted! > > Give me 6 months. > Ok. We will hold on on the 4.0 release. Let me know when we can release an alpha w/your change :-) Seriously, you don't have to. I just thought if you were writing the logic, the lines.ex may give you a huge starting point and it might be something other people would enjoy. No biggie, don't be pressured. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21250 Date: 2008 May 16 23:16 From: Jason Gade <jaygade at yahoo??om> Subject: For Kat: Openwatcom Openwatcom: http://www.openwatcom.org/index.php/Main_Page Download: http://www.openwatcom.org/index.php/Download -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21251 Date: 2008 May 16 23:21 From: CChris <christian.cuvier at agriculture.g?u?.fr> Subject: Building exw.exe at rev 471 OW1.6's wlink complains: Error! E2028: _4reverse_comp_ is an undefined reference file .\backobj\init-.obj(C:\EuphoriA\source\backobj\init-.c): undefined symbol _ 4reverse_comp_ Only reported error, but one is enough... reverse_comp() is in sort.e, yet is indeed listed in the initial values for _rt00. CChris -= B E G I N =- X-EUFORUM: 21252 Date: 2008 May 16 23:34 From: Kat <KAT12 at c?osahs?net> Subject: Re: For Kat: Openwatcom Jason Gade wrote: > > Openwatcom: > <a href="http://www.openwatcom.org/index.php/Main_Page">http://www.openwatcom.org/index.php/Main_Page</a> > > Download: > <a href="http://www.openwatcom.org/index.php/Download">http://www.openwatcom.org/index.php/Download</a> Like i said, openwatcom != watcom, and version 3.1 was compiled with watcom, not openwatcom. So if i try to fix the bug in 3.1, i need watcom, because who knows if it will compile properly, or exibit the same behavior, with openwatcom? Jeremy told me in #euphoria they were at one time the same. But they aren't now, as openwatcom has evolved. So they aren't the same. So i can not compile 3.1 the same way RDS did it, and still try to debug it,, or i can wait for 4.0 in a week or so and ,, no, i do not want to run that same app over again, it's been running 6 days, 24-7, and it's only 1/2 thru, i think. Or i can use Matt's and MikeS's suggestions. > A complex system that works is invariably found to have evolved from a simple > system that works. Lets go back to that system! Kat -= B E G I N =- X-EUFORUM: 21253 Date: 2008 May 16 23:34 From: Jason Gade <jaygade at yah?o?com> Subject: Re: machine level exception in file.e again I was going to look at your error dump again, but I guess it was removed/expired. Memory problems can be notoriously hard to track down. I was going to suggest stack overflow in the interpreter but it seems like the only stuff that gets allocated on the stack are pointers. I see some Euphoria allocations that I don't know how/when they get freed back up again but they might be garbage collected somewhere else. Hmm. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21254 Date: 2008 May 16 23:36 From: Jason Gade <jaygade at ?ahoo.co?> Subject: Re: For Kat: Openwatcom Sorry, just trying to help. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21255 Date: 2008 May 16 23:37 From: Jeremy Cowgar <jeremy at ?owga?.com> Subject: Re: Building exw.exe at rev 471 CChris wrote: > > > OW1.6's wlink complains: > Error! E2028: _4reverse_comp_ is an undefined reference > file .\backobj\init-.obj(C:\EuphoriA\source\backobj\init-.c): undefined symbol > _ > 4reverse_comp_ > > Only reported error, but one is enough... > reverse_comp() is in sort.e, yet is indeed listed in the initial values for > _rt00. > Chris should be fixed. svn up to 472 :-) You maybe have problems building ex.exe. If so, you can jump on SVN and I'll help out. I cannot readily build the dos version as the dos version no longer works on newer window systems (Vista). They have removed dos support. I am in the process of setting up a Win 98 box as it seems that's another problem build. Maybe between the two we will be able to keep these up to date. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21256 Date: 2008 May 16 23:39 From: Jeremy Cowgar <jeremy at cowg?r.?om> Subject: Re: For Kat: Openwatcom Kat wrote: > > Jeremy told me in #euphoria they were at one time the same. But they aren't > now, as openwatcom has evolved. So they aren't the same. I said: "I'd say it (watcom to open watcom) hasn't changed that much, if it (speaking about the bug) exists in 3.1, it'll be there in 4.0 as well." -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21257 Date: 2008 May 17 0:09 From: CChris <christian.cuvier at agr?culture.?ouv.fr> Subject: Re: Building exw.exe at rev 471 Jeremy Cowgar wrote: > > CChris wrote: > > > > > > OW1.6's wlink complains: > > Error! E2028: _4reverse_comp_ is an undefined reference > > file .\backobj\init-.obj(C:\EuphoriA\source\backobj\init-.c): undefined symbol > > _ > > 4reverse_comp_ > > > > Only reported error, but one is enough... > > reverse_comp() is in sort.e, yet is indeed listed in the initial values for > > _rt00. > > > > Chris should be fixed. svn up to 472 :-) > You maybe have problems building ex.exe. If so, you can jump on SVN and I'll help out. I cannot > readily build the dos version as the dos version no longer works on newer window systems (Vista). > They have removed dos support. > > I am in the process of setting up a Win 98 box as it seems that's another problem > build. Maybe between the two we will be able to keep these up to date. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Fixed indeed. DOS stuff won't build (bad status), but I don't mind, I use exwc for everything console based. CChris -= B E G I N =- X-EUFORUM: 21258 Date: 2008 May 17 0:43 From: Kat <KAT12 at co?sahs?net> Subject: Re: For Kat: Openwatcom Jeremy Cowgar wrote: > > Kat wrote: > > > > Jeremy told me in #euphoria they were at one time the same. But they aren't > > now, as openwatcom has evolved. So they aren't the same. > > I said: "I'd say it (watcom to open watcom) hasn't changed that much, if it > (speaking about the bug) exists in 3.1, it'll be there in 4.0 as well." Yes, this is true. Does it contradict what i said you said? Is there some page/email layout you'd prefer i used to denote meaning, for better understanding, like indentation or something? But just as "upgrading" mirc broke script, and "upgrading" (lol) windoze broke code, and "upgrading" euphoria over the years (and win32lib, owie!) broke things, i can't help but think that "upgrading" openwatcom over the years has also changed how RDS's watcom built the exe. Why is it when someone calls my code a 4-letter word for excrement on irc, i shouldn't take it so hard,,, but anything i say that is way way short of that, or is even a complement, or acceptance with a grain of salt, is taken so hard in this webmail context? Kat -= B E G I N =- X-EUFORUM: 21259 Date: 2008 May 17 1:33 From: Shawn Pringle <shawn.pringle at ??ail.com> Subject: Re: overriding vs namespaces This is just the thing that is missing. Right now, you either have the function go into the global namespace, no namespace or the global namespace and named namespace. It cannot yet go into only a named namespace. Shawn Pringle Kat wrote: > > > Someone once posted a dissertation about namespaces, where internal Eu operators > like + and such were redefined, leading to a much worse mess than one could > possibly make using goto. The maintainability of code where the words don't > mean what you expect leads to Jimmy Carter saying "I have lust for the people > of Poland", and other such problems. > > So, despite NOT being paranoid as some about goto (i goto places all the time!), > i vote against *internal* overrides, and suggest the following (which hasn't > gone over well on irc): > > Use of namespaces, and no internal overrides. > > inside ftp.e: > <eucode> > function ftp_open(types and varnames) : export as "open" > </eucode> > > inside sqlite.e: > <eucode> > function sqlite_wrapper_open(types and vars) : export as "open" > <eucode> > > inside LBA_modes.e: > <eucode> > procedure lba_seek(pointer to 48bit integer) : export as "seek" > </eucode> > > inside mycode.exw: > <eucode> > include ftp.e as ftp > include sqlite.e as sql > include LBA_modes.e as LBA > include > handle = ftp:open(some data about it) -- uses ftp.e's exported "open" > writefile = open(filename,wb") -- uses eu's internal open() > -- etc > sqldata = sql:open(vars) -- uses sqlite.e's "open" > LBA:seek(largereadfile,45000000000) -- uses LBA_mode.e's "seek" > seek(smallreadfile,1000) -- uses eu's internal seek() > </eucode> > > I am told this breaks the current: > <eucode> > include ftp.e as ftp > handle = ftp:open(stuff) -- uses ftp.e's open() > handle2 = open(other stuff) -- continues to use ftp.e's open() (!??!) > </eucode> > > But i see the code which that breaks as a worse bug than allowing forwards and > reverse referenceing for routine_id(). I am in favor of both directions of routine_id(). > I am not in favor of "sticky namespace referencing", as it's not explicit, whereas > referencing, namespace:overriding, and goto are (local in scope) explicit. > > I believe in overriding in cases where one might want different numbers of variables > passed to a function, but we can handle that with nested sequences in Eu. And > with namespace resolving of "overrides", an include could export an "open" (or > other function names), and code for various parameters and call local (non-global) > functions inside that include per various vars and such. > > Cases where an include defines a funct/proc as "global", would still be able > to call that global name. In cases where ":export as "name"" is used, that "name" > would also be available. > > I believe my proposal breaks nothing except the sticky referencing, but allows > for namespace resolution of pseudo-overriding. > > Kat -= B E G I N =- X-EUFORUM: 21260 Date: 2008 May 17 1:43 From: Shawn Pringle <shawn.pringle at ?mail?com> Subject: Re: overriding vs namespaces Matt Lewis wrote: > > Kat wrote: > > > > It allows for minimal changes to existing code, does not break existing code, > > and is the ONLY method for "overloading" an internal function, in my proposal. > > For instance, this would be illegal: > > <eucode> > > junk = open(blah) -- as an override of internal open() > > </eucode) > > this would be legal inside ftp.e (for example): > > <eucode> > > junk = ftp_open(blah): export as "open" > > </eucode> > > so it can be used like > > <eucode> > > include ftp.e as ftp > > ftp:open(someplace online) > > </eucode> > > Actually, this would break some existing code: > <eucode> > -- print.e > global procedure print(...) > > -- app.ex > include print.e > > print(...) > </eucode> > > Matt How is this new export as construct exclusive to practice of overriding builtins? Shawn Pringle -= B E G I N =- X-EUFORUM: 21261 Date: 2008 May 17 2:53 From: Jerry Story <story.jerry at g?a?l.com> Subject: Re: Linux Versions Jeremy Cowgar wrote: > sometimes things would just be easier if I could move > the window with my mouse :-) If I understand you correctly, on Ubuntu (and probably other distros) you can move a window by pressing ALT and then using the left mouse button. (This little trick was useful to me when I had a dialog with the font too large and the OK button was off-screen.) -= B E G I N =- X-EUFORUM: 21262 Date: 2008 May 17 3:10 From: Jason Gade <jaygade at y?hoo.?om> Subject: Re: Linux Versions I'm not using any at the moment, but my favorites are Xubuntu (I love Xfce under /any/ distro) and Knoppix (mainly as a rescue disk). -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21263 Date: 2008 May 17 4:49 From: Jeremy Cowgar <jeremy at cow?a?.com> Subject: Re: Linux Versions Jerry Story wrote: > > Jeremy Cowgar wrote: > > > sometimes things would just be easier if I could move > > the window with my mouse :-) > > If I understand you correctly, on Ubuntu (and probably other distros) you can > move a window by pressing ALT and then using the left mouse button. > > (This little trick was useful to me when I had a dialog with the font too large > and the OK button was off-screen.) In Window tiled window managers such at the mentioned ones, there are no title bars. All windows will share a common title bar. There is no wasted space on your screen either. Here is a typical screen shot: http://awesome.naquadah.org/screenshots/gigamo.png I use the same applications 99.9% of the time: Editor, Email, IRC/IM (I work in a distributed company and IM is crucial tool for us), Web and a few console windows. When I run Awesome, I turn my computer on, login and all applications are launched, placed in the appropriate place by Awesome, sized, etc... I never need to do a thing. They are always setup exactly how I want them. Most "window managers" do not manage windows. They simply present a title bar and borders which allow you to manage the windows. Not so with Awesome or Ion. They truly manage the window for you. What I was speaking about sometimes it would be nice to move the window around is that. Say you run Gimp (a paint program w/many windows to control things). Programs like that normally do not work well in tiled window managers. For more information on tiled window managers: http://en.wikipedia.org/wiki/Tiling_window_manager -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21264 Date: 2008 May 17 5:09 From: Jason Gade <jaygade at y?hoo.co?> Subject: Re: Linux Versions Heh. Another window manager I liked back in the day was Amiwm. http://xwinman.org/screenshots/amiwm-matt.gif Man, I really miss my Amiga sometimes... -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21265 Date: 2008 May 17 5:43 From: Derek Parnell <ddparnell at bigpond.?om> Subject: Re: Linux Versions Jason Gade wrote: > > Heh. Another window manager I liked back in the day was Amiwm. > <a href="http://xwinman.org/screenshots/amiwm-matt.gif">http://xwinman.org/screenshots/amiwm-matt.gif</a> > > Man, I really miss my Amiga sometimes... Have you heard of AROS? http://aros.sourceforge.net/ " The AROS Research Operating System is a lightweight, efficient and flexible desktop operating system, designed to help you make the most of your computer. It's an independent, portable and free project, aiming at being compatible with AmigaOS 3.1 at the API level (like Wine, unlike UAE), while improving on it in many areas. The source code is available under an open source license, which allows anyone to freely improve upon it. " -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21266 Date: 2008 May 17 5:52 From: Jason Gade <jaygade at yah??.com> Subject: Re: Linux Versions Derek Parnell wrote: > > Jason Gade wrote: > > > > Heh. Another window manager I liked back in the day was Amiwm. > > <a href="http://xwinman.org/screenshots/amiwm-matt.gif">http://xwinman.org/screenshots/amiwm-matt.gif</a> > > > > Man, I really miss my Amiga sometimes... > > Have you heard of AROS? > > <a href="http://aros.sourceforge.net/">http://aros.sourceforge.net/</a> > > " > The AROS Research Operating System is a lightweight, efficient and flexible > desktop operating system, designed to help you make the most of your computer. > It's an independent, portable and free project, aiming at being compatible with > AmigaOS 3.1 at the API level (like Wine, unlike UAE), while improving on it > in many areas. The source code is available under an open source license, which > allows anyone to freely improve upon it. > " > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell Yup, heard about it years ago, but I haven't tried it out yet. I first heard about it on OSNews. http://www.osnews.com/ Hmm. Apparently I haven't been there in awhile, the site is totally different. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21267 Date: 2008 May 17 9:21 From: ChrisBurch2 <crylex at freeuk?c?.uk> Subject: Re: Program line count Jeremy Cowgar wrote: > > ChrisBurch3 wrote: > > > > > > Ya had to go and do it didn't ya. Now look at me. I'm all distracted! > > > > Give me 6 months. > > > > Ok. We will hold on on the 4.0 release. Let me know when we can release an alpha w/your change :-) > > Seriously, you don't have to. I just thought if you were writing the logic, > the lines.ex may give you a huge starting point and it might be something other > people would enjoy. No biggie, don't be pressured. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> LOL Sorry I went to bed to do that sleep thing, and planned the entire program! Now I just have to write it. May even be quicker than 6 months. And you know when you say don't be pressured....... Chris -= B E G I N =- X-EUFORUM: 21268 Date: 2008 May 17 13:34 From: Shawn Pringle <shawn.pringle at g?ail.c?m> Subject: Re: Win32Lib; Timed events ZNorQ wrote: > > CChris wrote: > > > > ZNorQ wrote: > > > > > > > > > I have a couple of questions in regards to timed events in Win32Lib; > > > > > > a) Why wont this code example work? (PS! The mbox is just another form of message_box, > > > and it works - this isn't the problem.) > > > > > > procedure evnTIM_Timer (integer hControl, integer hEvent, sequence uParameters) > > > mbox("5 seconds just passed...") > > > end procedure > > > setTimer(fmMAF, 12, 5000) > > > setHandler(12, w32HTimer, routine_id("evnTIM_Timer")) > It works now, not because I used the showMessage (I did, but that didn't change > anything), but because I changed from timer ID 12 to 1... So, I guess you can't > have 12 timers? (I don't have 12 timers, 12 was just a random number I picked > for my routine..) > > Thank for the feedback, though.. :) > > Kenneth/ZNorQ It works now, not because you picked a lower number. setHandler takes a Window id - not a timer id, 1 just happens to be the same value as a Window id. -= B E G I N =- X-EUFORUM: 21269 Date: 2008 May 17 14:00 From: Shawn Pringle <shawn.pringle at g?a?l.com> Subject: enum One problem I forsee with enum is the large number of integers that will have come from enum symbols will not be traceable back to their symbol name. EUPHORIA print statements will only print the integer value and the symbol name is lost and we cannot do a search of the source code as with the old way in order to figure out which symbol is meant by a given integer. Shawn Pringle -= B E G I N =- X-EUFORUM: 21270 Date: 2008 May 17 15:16 From: Shawn Pringle <shawn.pringle at ?mail.c?m> Subject: Re: a summary of my position Jeremy Cowgar wrote: > > > standars libraries: yes > > enum: yes > > optional 'then' 'do': no > > goto and labels: no > > namespace: somethings should go into a namespace exclusively > > conditional include: yes > > with define=TAG: yes > > > > To me, namespace must get resolved one way or another. Meaning, use it or don't. > And I am not for not using it, if there is hope of it being fixed in the future. > I think the fix needs to come now. If even necessary, we have not even settled > that yet :-/ > I tried to say this before in the IRC debate. The only thing that is needed is to add the ability to include things as in namespace without being accesible the old way. I never meant to propose a change the default behavior of how namespaces function or overriding builtins. I have been using this language since the early nineties and I loved overriding. However, since EUPHORIA is being extended and changed anyway can we EXTEND the INCLUDE syntax to allow things for example: you can access and use open() from ftp.e as "ftp:open" but not as "open" and open is still the builtin open, yet you can overide that. Shawn Pringle -= B E G I N =- X-EUFORUM: 21271 Date: 2008 May 17 15:39 From: Jeremy Cowgar <jeremy at c?wg?r.com> Subject: Developers mailing list I have created a developers mailing list on our SourceForge mailing list. I have automatically subscribed all developers that are listed on the SourceForge page. If you do not wish to be part of the development list, please unsubscribe and/or let us know you do not wish to be part of the development team any longer. Now, what is this list? 1. It's public. Anyone can join and participate on it. You do not have to be listed as a developer on the Euphoria project to participate. 2. It is not for making critical syntax changes, feature additions, etc... We will remain a user driven development team. 3. To discuss internal issues that related directly to developers not really the general public. For instance, right now the build system is somewhat broken on Windows ME, 98 and 95. We have been exchanging emails about ways we can make the Makefile more cross platform independent. A bug was found w/Windows 98 and Euphoria, we are discussing debug techniques of fixing that bug, etc... What is this list not? 1. It is not a way for users to make feature suggestions. That should be done on EUforum. 2. It is not a way for users to provide additional information about feature discussions going on in EUforum. That should also be done on EUforum. 3. It is not a way to submit bug reports. That should be done on the SourceForge bug list page. The reason this list was created is because there have been 30-40 emails going on between developers on a big CC list about fixing this, or how that works or can we eliminate this 1 line of code and get better performance, etc... Things like that would simply clutter EUforum making it hard to use. Again, this list is public and open to anyone who wishes to join. To join: http://lists.sourceforge.net/lists/listinfo/rapideuphoria-develop You can also view the archives: http://sourceforge.net/mailarchive/forum.php?forum_name=rapideuphoria-develop (note: I just created the list, you will get an error message stating no messages to view until we send one on the new list). The bug report page I referenced is: http://sourceforge.net/tracker/?group_id=182827&atid=902782 If you have any questions about this mailing list or it's use, please let us know right here on this thread. Thanks! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21272 Date: 2008 May 17 20:45 From: Jason Gade <jaygade at ?aho?.com> Subject: Re: Developers mailing list Okay, so my inbox is filling up with messages from the list, but my own reply has not showed up yet. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21273 Date: 2008 May 17 21:03 From: Jeremy Cowgar <jeremy at cow?ar.c?m> Subject: Re: Developers mailing list Jason Gade wrote: > > Okay, so my inbox is filling up with messages from the list, but my own reply > has not showed up yet. > Welcome to the joys of SourceForge :-) ... I'm sure it will appear. Sometimes it appears instantly, other times, well, you wait a bit :-( -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21274 Date: 2008 May 17 21:09 From: Jeremy Cowgar <jeremy at cowg?r.c?m> Subject: Re: Developers mailing list Jason Gade wrote: > > Okay, so my inbox is filling up with messages from the list, but my own reply > has not showed up yet. > Ah... I see what happened. I got a message for approval. I subscribed you w/the only email address I knew, which is your SF user account name @ users.sourceforge.net... You posted with your real email address. I approved your message and changed your email address, so it should not allow you to post unmoderated. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21275 Date: 2008 May 17 21:28 From: Jason Gade <jaygade at yahoo?c?m> Subject: Re: Developers mailing list Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > Okay, so my inbox is filling up with messages from the list, but my own reply > > has not showed up yet. > > > > Ah... I see what happened. I got a message for approval. I subscribed you w/the > only email address I knew, which is your SF user account name @ users.sourceforge.net... > You posted with your real email address. I approved your message and changed > your email address, so it should not allow you to post unmoderated. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Thanks. That's weird, though, since it was sending the emails to one of my normal addresses. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21276 Date: 2008 May 17 21:36 From: Jeremy Cowgar <jeremy at c?wg?r.com> Subject: Re: Developers mailing list Jason Gade wrote: > > Thanks. That's weird, though, since it was sending the emails to one of my normal > addresses. > Your usercode @ users.sf.net is just a redirect, not a real email. So you would have gotten it to whatever email address you have listed on your SF account. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21277 Date: 2008 May 17 22:57 From: Robert Craig <rds at RapidEuphoria.??m> Subject: Re: Developers mailing list Jeremy Cowgar wrote: > I have created a developers mailing list on our SourceForge mailing list. Thanks. I think that's an excellent idea. I'm now receiving messages (which my email filter pushes into a separate folder). There have been a lot of messages per day lately, and I've been unusually busy with RL, so I've had trouble keeping up with the EUforum discussions. I'm sure others have had trouble as well. This will help to alleviate that problem. Everyone should know that no significant change will be made to the language without people on the main EUforum being made aware of it, and given ample opportunity to comment, and voice their opinion, yay or nay. The developers forum will enable developers to discuss internal details of the source code, e.g. how to compile, how to fix a bug, C problems, SVN problems, etc., without tying up the main EUforum. I'm still catching up on a lot of RL stuff. I'm very pleased with the active discussions, and the real progress that has been taking place lately. I've had many years to inject my ideas into Euphoria. I'm quite happy to sit back a bit, and let others come up with some fresh ideas! :-) Thanks, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com -= B E G I N =- X-EUFORUM: 21278 Date: 2008 May 17 23:47 From: George Orr <gorr at woh.rr?c?m> Subject: Euphoria 4.0 build on Linux Ubuntu Jeremy - I'm sure you have provided instruction on how to build Euphoria 4.0 on Linux, but I can't seem to find it. I can use the command line svn you posted to get euphoria-4.0. I run this from my home directory. Then I get lost. I have gone to the source directory in the new euphoria-4.0 directory, run ./configure, and run make only to get a bunch of error messages. I have tried numerous other things (including running buildu) but again with only errors to show for my effort. Clearly, as a very part time programmer newly converted from windows, I need guidance. Can you point me to help? Thanks! And thanks for all your work on 4.0. George -= B E G I N =- X-EUFORUM: 21279 Date: 2008 May 18 0:23 From: Jeremy Cowgar <jeremy at c?wgar.co?> Subject: Re: Euphoria 4.0 build on Linux Ubuntu George Orr wrote: > > I'm sure you have provided instruction on how to build Euphoria 4.0 on Linux, but I can't seem to find it. > I have not yet, sorry. > I can use the command line svn you posted to get euphoria-4.0. > I run this from my home directory. > > Then I get lost. I have gone to the source directory in the new euphoria-4.0 > > directory, run ./configure, and run make only to get a bunch of error messages. You're doing a fine job so far. Everything you've done is right. Can you paste here what the output of the configure is? That obviously should not be erring out on you. So we need to solve that step first. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21280 Date: 2008 May 18 3:14 From: Jerry Story <story.jerry at g?ail.?om> Subject: wxEuphoria: "<unknown>:2459: Gtk-Warning" I get this mysterious warning while running a wxEuphoria based program. ---[begin quote]----- (<unknown>:2459): Gtk-WARNING **: /build/buildd/gtk+2.0-2.12.9/gtk/gtkwidget.c:8547: widget class `GtkPizza' has no property named `row-ending-details' ---[end quote]---- It doesn't seem to do any damage, just doesn't look right. What's with this mysterious GTK warning? -= B E G I N =- X-EUFORUM: 21281 Date: 2008 May 18 8:57 From: Peter Robinson <indorlaw at yahoo.c?m.?u> Subject: Re: Breaking the silence Hi CK Thanks for reply. I certainly wasn't bothered by anyone's comments, nor by their actions in advancing Euphoria. In view of the fact that I'm responsible for not speaking up often, I think it's fair enough that people read some indifference into that. But I have been looking at a pattern requiring backward jumps:- <pre-loop loop-related initialisations> <pre-loop loop-related statements> <outer loop start> <stuff> <inner loop start> <error tests> <general data check> <if start> <case 1> -- data passes with flying colours <do the business> <case 2> -- data not right, but not hopeless <modify or prune data> <retry> -- goto ???????????? <case 3> -- different data not right, not hopeless <modify or prune data> <retry> -- goto ???????????? <case 4> -- hopeless data <return or exit> <end if> <end inner loop> <end outer loop> This is a fairly typical pattern where you might want to back up. The <elements> could represent statements or groups of statements with or without more loops and conditionals. What are the likely re-try points for the retries in this pattern? I think they could easily be before the pre-loop code, at the start of the outer loop (either before or after another increment of the loop), after the error tests or the general data check (since the data has already passed those tests) or before case 1. I don't think you can say that one of those is overwhelmingly more likely than another. Nor can you say that a programmer who visualises an algorithm in this way is off his scone. So, the software tool (the language) should allow him to map these thoughts to code as directly as possible, without having to re-frame them or translate them into a different concept. The present solutions sometimes have problems. If you want to jump to the pre-initialisation point you could wrap up the pre-code in a procedure, the loop in a different procedure, then call both (the second recursively) from within the conditional. But this can be awkward if the two retry cases want different parts of the precode, or if the excised code, removed from context, is meaningless (leading to a mysterious procedure dissociated from its context), or if it's all just too messy. Jumping within a loop is more complicated because a procedure may need to read and write substantial local data that has to be passed or globalised. It can also be harder to hive off code into a procedure because the desired code is in the midst of nested blocks. For example, the desired routine might include the 'end if', but not the 'if' (e.g Its natural start is an 'elsif'. In this case, you have to break up the select-case flow into pieces). In the example, if you want to jump back to the start of the conditional, you could simply jump back to the start of the inner loop and redundantly re-run code that you know will pass because the data has already passed that way. I suspect a lot of us do that to save trouble. Flags, or tagging the reformed data, can also be a solution, but it means extra conditional checks on the majority data to check for a minority cases. If someone thinks these solutions are good, they should ask themselves why they want a 'continue' construct, as the same solutions apply to it. Since the problem involves retreats to different spots, things like 'continue' can only ever be a partial solution. So after reading all the stuff on 'continue', I have gone over to the 'jumps within blocks' stable. Cheers Peter Robinson -= B E G I N =- X-EUFORUM: 21282 Date: 2008 May 18 11:09 From: Peter Robinson <indorlaw at ?ahoo.com?au> Subject: Sequnce of sequence A recent comment from CChris made me think that the position with two polls I conducted on this list may have been misunderstood. I conducted polls on sequence of sequence and typing/naming of sequence elements and wrote up the results as web pages. I uploaded them to SourceFourge documents folder which said that the administrator had to check them before release. I had in mind that the administrator (presumably Rob) would get a message about this automatically. I'm not sure whether this happened, and failed follow it up. No issues about any of this, except that CChris suggested that the sequence of sequnce proposal had been shelved because of subsequent discussions about the appropriate syntax. I didn't understand it this way. The polls led to clear results on certain questions, even though they are not yet implemented. I feel that polling from time to time is a good way to resolve issues when the community is agreed in principle but may not be able to agree unanimously on syntax. The results should be available on the website as a guide to decisions made but possibly not yet implemented. If there is an administrator out there, could you check the files and open them to the public? I have copies. Peter Robinson -= B E G I N =- X-EUFORUM: 21283 Date: 2008 May 18 12:00 From: CChris <christian.cuvier at agricultu?e.gou?.fr> Subject: Re: Breaking the silence Peter Robinson wrote: > > Hi CK > > Thanks for reply. I certainly wasn't bothered by anyone's comments, nor by their > actions in advancing Euphoria. In view of the fact that I'm responsible for > not speaking up often, I think it's fair enough that people read some indifference > into that. > > But I have been looking at a pattern requiring backward jumps:- > > <pre-loop loop-related initialisations> > <pre-loop loop-related statements> > <outer loop start> > <stuff> > <inner loop start> > <error tests> > <general data check> > <if start> > <case 1> -- data passes with flying colours > <do the business> > <case 2> -- data not right, but not hopeless > <modify or prune data> > <retry> -- goto ???????????? > <case 3> -- different data not right, not hopeless > <modify or prune data> > <retry> -- goto ???????????? > <case 4> -- hopeless data > <return or exit> > <end if> > <end inner loop> > <end outer loop> > > This is a fairly typical pattern where you might want to back up. The <elements> > could represent statements or groups of statements with or without more loops > and conditionals. > > What are the likely re-try points for the retries in this pattern? > > I think they could easily be before the pre-loop code, at the start of the outer > loop (either before or after another increment of the loop), after the error > tests or the general data check (since the data has already passed those tests) > or before case 1. I don't think you can say that one of those is overwhelmingly > more likely than another. Nor can you say that a programmer who visualises an > algorithm in this way is off his scone. Thanks so much for stating the following: > So, the software tool (the language) > should allow him to map these thoughts to code as directly as possible, without > having to re-frame them or translate them into a different concept. > I'd like to see this principle overriding any simplicity based concept in the design of Euphoria. Quite a few things need to be done to this end. > The present solutions sometimes have problems. If you want to jump to the pre-initialisation > point you could wrap up the pre-code in a procedure, the loop in a different > procedure, then call both (the second recursively) from within the conditional. > But this can be awkward if the two retry cases want different parts of the precode, > or if the excised code, removed from context, is meaningless (leading to a mysterious > procedure dissociated from its context), or if it's all just too messy. > > Jumping within a loop is more complicated because a procedure may need to read > and write substantial local data that has to be passed or globalised. It can > also be harder to hive off code into a procedure because the desired code is > in the midst of nested blocks. For example, the desired routine might include > the 'end if', but not the 'if' (e.g Its natural start is an 'elsif'. In this > case, you have to break up the select-case flow into pieces). > > In the example, if you want to jump back to the start of the conditional, you > could simply jump back to the start of the inner loop and redundantly re-run > code that you know will pass because the data has already passed that way. I > suspect a lot of us do that to save trouble. > > Flags, or tagging the reformed data, can also be a solution, but it means extra > conditional checks on the majority data to check for a minority cases. > > If someone thinks these solutions are good, they should ask themselves why they > want a 'continue' construct, as the same solutions apply to it. > > Since the problem involves retreats to different spots, things like 'continue' > can only ever be a partial solution. So after reading all the stuff on 'continue', > I have gone over to the 'jumps within blocks' stable. > If "retry" makes its way into the language (who knows, after all Æ has it), then you can do <eucode> label "retry-it" while <whatever> do <code to jump back to> if do_that_again() then retry "retry-it" end if -- stuff end while </eucode> > Cheers > Peter Robinson CChris -= B E G I N =- X-EUFORUM: 21284 Date: 2008 May 18 12:01 From: Shawn Pringle <shawn.pringle at ?mail.co?> Subject: Re: Optional "then" and "do" I suppose you have used cobol and fortran then. I myself have never used those two languages and I get the impression that most people here are of the C/Java syntax users. I used to use basic but that is as early as I get. Is there anything missing, in terms of library functions or constructs that these languages had that EUPHORIA should? Shawn Pringle Arthur Crump wrote: > > I use Judith Evan's editor which fills in 'if' and 'for' blocks, so > I don't have anything extra to type. However, I agree with Phil Russell > that they should not be optional, although it is only a slight preference. > > As for 'goto' I do not approve of 'goto'. > I started programming with low level languages (in 1958) and moved on to > languages in which 'goto' was the only method of flow control. Now that > it is not there, I don't miss it and would not use it if it was implemented, > provided that a 'next' (or 'continue' if that is what it has to be) was > implemented. > > Arthur Crump > > > Phil Russell wrote: > > > > <unlurk> > > > > Somewhat belatedly, I *don't* want "then" and "do" to > > be optional. I wouldn't like the current straightforward > > syntax to be complicated just to save a couple of keystrokes. > > > > wrt goto: I'm with Jacques Deschenes on this one - within a > > code block only. That said, I haven't used one in 15 years, > > and I ain't about to start now... > > > > Cheers, > > > > Phil > > </unlurk> -= B E G I N =- X-EUFORUM: 21285 Date: 2008 May 18 12:11 From: CChris <christian.cuvier at agricultu?e.gou?.fr> Subject: Re: Sequnce of sequence Peter Robinson wrote: > > A recent comment from CChris made me think that the position with two polls > I conducted on this list may have been misunderstood. > > I conducted polls on sequence of sequence and typing/naming of sequence elements > and wrote up the results as web pages. I uploaded them to SourceFourge documents > folder which said that the administrator had to check them before release. I > had in mind that the administrator (presumably Rob) would get a message about > this automatically. I'm not sure whether this happened, and failed follow it > up. > > No issues about any of this, except that CChris suggested that the sequence > of sequnce proposal had been shelved because of subsequent discussions about > the appropriate syntax. I didn't understand it this way. The polls led to clear > results on certain questions, even though they are not yet implemented. > > I feel that polling from time to time is a good way to resolve issues when the > community is agreed in principle but may not be able to agree unanimously on > syntax. The results should be available on the website as a guide to decisions > made but possibly not yet implemented. > > If there is an administrator out there, could you check the files and open them > to the public? I have copies. > > Peter Robinson Just to be clear: there was no criticism about the polls themselves in the comment. Quite the contrary, actually; I wish there had been more of them in earlier years. Many earlier discussions got shelved in part because there was no poll following up, and some got shelved in spite of there being a poll. The only issue I'd raise is about how representative the voters are of the whole community the results may have some impact on. Since we don't know (any finger raised?), we can unsafely assume that of course we are. We are not in a large number enough for the law of large numbers to help us achieve some otherwise untested representativity. I could even volunteer to organise and monitor some polling. CChris -= B E G I N =- X-EUFORUM: 21286 Date: 2008 May 18 12:24 From: Peter Robinson <indorlaw at ya?oo.?om.au> Subject: Re: Breaking the silence Yes, and it reads simply, intuitively, wherever the jump label occurs. If the placement is constrained by a block, then I don't see a risk of accidental spaghetti code. Of course, if you think like spaghetti ... GIGO Cheers Peter -= B E G I N =- X-EUFORUM: 21287 Date: 2008 May 18 12:24 From: Matt Lewis <matthewwalkerlewis at g?ail.c?m> Subject: Re: Breaking the silence CChris wrote: > > Peter Robinson wrote: > > > So, the software tool (the language) > > should allow him to map these thoughts to code as directly as possible, > > without having to re-frame them or translate them into a different concept. > > I'd like to see this principle overriding any simplicity based concept in the > design of Euphoria. Quite a few things need to be done to this end. I don't disagree with this sentiment, but we've obviously had disagreements about how to translate something into code in the past. It's relatively easy to do this for a special purpose language or library. Less so for something meant to be general purpose. But I don't think that we should ignore simplicity. Especially when something simple gets the same job done as something complex. In general, simpler things are easier to remember, and easier to do correctly. Also, different people will see different methods of framing as direct maps. Matt -= B E G I N =- X-EUFORUM: 21288 Date: 2008 May 18 12:33 From: Matt Lewis <matthewwalkerlewis at g?ail?com> Subject: Re: wxEuphoria: "<unknown>:2459: Gtk-Warning" Jerry Story wrote: > > I get this mysterious warning while running a wxEuphoria based program. > > ---[begin quote]----- > (<unknown>:2459): Gtk-WARNING **: /build/buildd/gtk+2.0-2.12.9/gtk/gtkwidget.c:8547: > widget class `GtkPizza' has no property named `row-ending-details' > ---[end quote]---- > > It doesn't seem to do any damage, just doesn't look right. > > What's with this mysterious GTK warning? I found this: http://www.nabble.com/--wxwindows-Bugs-1950163---GTK-warning-after-updating-GTK-to-2.12.9-td17002624.html Matt -= B E G I N =- X-EUFORUM: 21289 Date: 2008 May 18 13:05 From: Jeremy Cowgar <jeremy at cow?ar.co?> Subject: Re: Breaking the silence CChris wrote: > > If "retry" makes its way into the language (who knows, after all Æ has it), > then you can do > <eucode> > label "retry-it" > while <whatever> do > <code to jump back to> > if do_that_again() then > retry "retry-it" > end if > -- stuff > end while > </eucode> > I think retry should be put into the language, however, for labeling, I really do like the idea of: <eucode> while <whatever> label "retry-it" do ....... end while </eucode> To me, that's much clearer that the label is associated with the while statement. Otherwise people will be trying: <eucode> label "hello" puts(1, "Hello\n") if ask_user_sayitagain() then retry "hello" end if </eucode> Now, maybe that's valid in AE? If it is, I think retry is the wrong name, it should be goto. Otherwise, I think the labeling needs to be part of the while statement. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21290 Date: 2008 May 18 14:13 From: CChris <christian.cuvier at agriculture?gouv.fr> Subject: Re: Breaking the silence Jeremy Cowgar wrote: > > CChris wrote: > > > > If "retry" makes its way into the language (who knows, after all Æ has it), > > then you can do > > <eucode> > > label "retry-it" > > while <whatever> do > > <code to jump back to> > > if do_that_again() then > > retry "retry-it" > > end if > > -- stuff > > end while > > </eucode> > > > > I think retry should be put into the language, however, for labeling, I really > do like the idea of: > > <eucode> > while <whatever> label "retry-it" do > ....... > end while > </eucode> > > To me, that's much clearer that the label is associated with the while statement. > Otherwise people will be trying: > > <eucode> > label "hello" > puts(1, "Hello\n") > if ask_user_sayitagain() then > retry "hello" > end if > </eucode> > > Now, maybe that's valid in AE? If it is, I think retry is the wrong name, it > should be goto. Otherwise, I think the labeling needs to be part of the while > statement. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I have no religion on this. I simply wonder whether a label clause at the end of a long text line that doesn't wrap is clearer than a plain label statement, indented like the block header that follows, since it it would be yet another statement. It would be ignored if not followed by a block header - so far -, so retry is not a goto, even with a label. But again, I have nothing against either. What about allowing both forms? The separate label statement has been valid at some point in Æ, and I turned to a label clause instead for ease of implementation only. This shows how much the distinction matters to me. CChris -= B E G I N =- X-EUFORUM: 21291 Date: 2008 May 18 14:36 From: Jeremy Cowgar <jeremy at co?gar.?om> Subject: Re: Breaking the silence CChris wrote: > > Jeremy Cowgar wrote: > > > > CChris wrote: > > > > > > If "retry" makes its way into the language (who knows, after all Æ has it), > > > then you can do > > > <eucode> > > > label "retry-it" > > > while <whatever> do > > > <code to jump back to> > > > if do_that_again() then > > > retry "retry-it" > > > end if > > > -- stuff > > > end while > > > </eucode> > > > > > > > I think retry should be put into the language, however, for labeling, I really > > do like the idea of: > > > > <eucode> > > while <whatever> label "retry-it" do > > ....... > > end while > > </eucode> > > > > To me, that's much clearer that the label is associated with the while statement. > > Otherwise people will be trying: > > > > <eucode> > > label "hello" > > puts(1, "Hello\n") > > if ask_user_sayitagain() then > > retry "hello" > > end if > > </eucode> > > > > Now, maybe that's valid in AE? If it is, I think retry is the wrong name, it > > should be goto. Otherwise, I think the labeling needs to be part of the while > > statement. > > > > I have no religion on this. I simply wonder whether a label clause at the end > of a long text line that doesn't wrap is clearer than a plain label statement, > indented like the block header that follows, since it it would be yet another > statement. It would be ignored if not followed by a block header - so far -, > so retry is not a goto, even with a label. > > But again, I have nothing against either. What about allowing both forms? I do not think we should allow both forms. I think syntax should be set in stone so one Euphoria application looks like another. Obviously there are style differences puts( 1, "John" ) vs. puts(1, "John"), but everything is in the same order. If we allow things to be rearranged, things become confusing when working with other people or figuring out code in a library you are using. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21292 Date: 2008 May 18 17:32 From: George Orr <gorr at ?oh.rr.?om> Subject: Re: Euphoria 4.0 build on Linux Ubuntu Jeremy - Thanks for the help! I downloaded build 478 of euphoria-4.0 into my home directory. I went to the source subdirectory and ran ./configure > configure.txt After completion, I got two messages not in the configure.txt file which follows: /bin/bash: /home/george/euphoria-4.0/source/pcre/missing: No such file or directory configure: WARNING: 'missing' script is too old or missing Output from configure was checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking for a BSD-compatible install... /usr/bin/install -c checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognize dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for xlf... no checking for f77... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for xlf90... no checking for f90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for xlf95... no checking for f95... no checking for fort... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 98304 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking for correct ltmain.sh version... yes checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... no checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking whether ln -s works... yes checking for ANSI C header files... (cached) yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking for sys/types.h... (cached) yes checking for sys/stat.h... (cached) yes checking dirent.h usability... yes checking dirent.h presence... yes checking for dirent.h... yes checking windows.h usability... no checking windows.h presence... no checking for windows.h... no checking for an ANSI C-conforming const... yes checking for size_t... yes checking for long long... yes checking for unsigned long long... yes checking for bcopy... yes checking for memmove... yes checking for strerror... yes checking for strtoq... yes checking for strtoll... yes checking for _strtoi64... no checking zlib.h usability... yes checking zlib.h presence... yes checking for zlib.h... yes checking for gzopen in -lz... yes checking bzlib.h usability... no checking bzlib.h presence... no checking for bzlib.h... no checking for BZ2_bzopen in -lbz2... no checking readline/readline.h usability... yes checking readline/readline.h presence... yes checking for readline/readline.h... yes checking readline/history.h usability... yes checking readline/history.h presence... yes checking for readline/history.h... yes checking for readline in -lreadline... yes configure: creating ./config.status config.status: creating Makefile config.status: creating libpcre.pc config.status: creating libpcrecpp.pc config.status: creating pcre-config config.status: creating pcre.h config.status: creating pcre_stringpiece.h config.status: creating pcrecpparg.h config.status: creating config.h config.status: executing depfiles commands config.status: executing script-chmod commands config.status: executing delete-old-chartables commands pcre-7.6 configuration summary: Install prefix .................. : /usr/local C preprocessor .................. : gcc -E C compiler ...................... : gcc C++ preprocessor ................ : g++ -E C++ compiler .................... : g++ Linker .......................... : /usr/bin/ld C preprocessor flags ............ : C compiler flags ................ : -O2 C++ compiler flags .............. : -O2 Linker flags .................... : Extra libraries ................. : Build C++ library ............... : no Enable UTF-8 support ............ : yes Unicode properties .............. : no Newline char/sequence ........... : lf \R matches only ANYCRLF ......... : no EBCDIC coding ................... : no Rebuild char tables ............. : no Use stack recursion ............. : yes POSIX mem threshold ............. : 10 Internal link size .............. : 2 Match limit ..................... : 10000000 Match limit recursion ........... : MATCH_LIMIT Build shared libs ............... : no Build static libs ............... : yes Link pcregrep with libz ......... : no Link pcregrep with libbz2 ....... : no Link pcretest with libreadline .. : no -= B E G I N =- X-EUFORUM: 21293 Date: 2008 May 18 18:15 From: ChrisBurch2 <crylex at f?eeuk.?o.uk> Subject: What has happened to Pete Lomax? Hi See subject Chris -= B E G I N =- X-EUFORUM: 21294 Date: 2008 May 18 19:04 From: Kat <KAT12 at ?oosahs.n?t> Subject: Re: Another number question Jason Gade wrote: > > Matt Lewis wrote: > > > > Jason Gade wrote: > > > > > > Well, if Euphoria /had/ 64-bit integers that wouldn't be a problem. At this > > > point, the limitation is the fseek() call in the C library, which takes a 32-bit > > > integer, limiting the size of the seek to 4GB. > > > > > > Now, maybe one of these days Kat will have to deal with 18 exabyte files, but > > > that day is not today. If we go with 2^53, then that limits her to only 9 petabyte > > > files. Cry me a river. > > > > Hey, not my fault you don't want to do it right. :) > > > > I know I've worked with the windows API for large files. Haven't done the > > same for linux/bsd. > > > > Matt > :-) > > Well, for me "doing it right" means making it pretty much transparent and working > the way the user expects it to work. That is, the user gives a number and the > pointer seeks to the proper spot in the file, subject only to the OS/filesystem > limitations. > > In a way I think this would be transitional as well, as machines do eventually > move more and more to 64-bit. > > More research is required, I think. Right now I'm mostly just brainstorming > anyway. > > One thought I had this morning, though, was to create a 64-bit integer type > internal to the interpreter, and routines or macros or whatever to convert an > atom to a 64-bit integer. > > Then that groundwork will be laid for the future. > > Still taking baby steps with the source -- I still haven't gotten set back up > with subversion or anything and I still spend more time elsewhere on the internet > discussing non-programming stuff than I spend doing any programming. This might be done easier and faster by one of the developers of Falcon who is on this list, since Falcon already has internal 64bit integers. And some of the Asian, S American, and Europeans here asked for unicode strings (and asked years ago), and Falcon has unicode strings/sequences, and you can even name your functions and varnames in unicode16 as well if you can enter/display 16bit in the editor you use. And developer(s) of Falcon are on Euphorum. So i am wondering which way the technology is moving: Euphoria to/from D/Falcon/wxBasic/Blender/etc. And why. And can i get "goto" ? I am not objecting to the cross-development that seems to be going on, just that when someone is working on more than one open source language, and a feature is asked for, why it isn't possible to say "oh, i already wrote that for X language" instead of people sitting here saying they'll work on it, or waiting on it to be added to Euphoria. Basicly, where, in a way, Euphoria going to be fixed in RDS's 1985 vision, and people here who already added requested features into other languages, can neither say they did, nor add those features to Euphoria. I am just curious, so i asked. Kat -= B E G I N =- X-EUFORUM: 21295 Date: 2008 May 18 19:12 From: Jeremy Cowgar <jeremy at c?w?ar.com> Subject: Re: Euphoria 4.0 build on Linux Ubuntu That output looks fine. You should be able to simply type make now. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21296 Date: 2008 May 18 21:09 From: Matt Lewis <matthewwalkerlewis at gm??l.com> Subject: Re: Euphoria 4.0 build on Linux Ubuntu George Orr wrote: > > > Jeremy - Thanks for the help! > > I downloaded build 478 of euphoria-4.0 into my home directory. > > I went to the source subdirectory and ran ./configure > configure.txt > > After completion, I got two messages not in the configure.txt file which follows: > > /bin/bash: /home/george/euphoria-4.0/source/pcre/missing: No such file or directory > configure: WARNING: 'missing' script is too old or missing > > Output from configure was > > checking for a BSD-compatible install... /usr/bin/install -c <snip> That output was actually from pcre's configure. What error do you get after running make? Matt -= B E G I N =- X-EUFORUM: 21297 Date: 2008 May 18 21:09 From: Jason Gade <jaygade at yahoo?c?m> Subject: Re: Another number question Kat wrote: > > Jason Gade wrote: > > > > Matt Lewis wrote: > > > > > > Jason Gade wrote: > > > > > > > > Well, if Euphoria /had/ 64-bit integers that wouldn't be a problem. At this > > > > point, the limitation is the fseek() call in the C library, which takes a > 32-bit</font></i> > > > > integer, limiting the size of the seek to 4GB. > > > > > > > > Now, maybe one of these days Kat will have to deal with 18 exabyte files, but > > > > that day is not today. If we go with 2^53, then that limits her to only 9 > petabyte</font></i> > > > > files. Cry me a river. > > > > > > Hey, not my fault you don't want to do it right. :) > > > > > > I know I've worked with the windows API for large files. Haven't done the > > > same for linux/bsd. > > > > > > Matt > > :-) > > > > Well, for me "doing it right" means making it pretty much transparent and working > > the way the user expects it to work. That is, the user gives a number and the > > pointer seeks to the proper spot in the file, subject only to the OS/filesystem > > limitations. > > > > In a way I think this would be transitional as well, as machines do eventually > > move more and more to 64-bit. > > > > More research is required, I think. Right now I'm mostly just brainstorming > > anyway. > > > > One thought I had this morning, though, was to create a 64-bit integer type > > internal to the interpreter, and routines or macros or whatever to convert an > > atom to a 64-bit integer. > > > > Then that groundwork will be laid for the future. > > > > Still taking baby steps with the source -- I still haven't gotten set back up > > with subversion or anything and I still spend more time elsewhere on the internet > > discussing non-programming stuff than I spend doing any programming. > > This might be done easier and faster by one of the developers of Falcon who > is on this list, since Falcon already has internal 64bit integers. I have the feeling that I've asked this before, but what is "Falcon"? > And some of the Asian, S American, and Europeans here asked for unicode strings > (and asked years ago), and Falcon has unicode strings/sequences, and you can > even name your functions and varnames in unicode16 as well if you can enter/display > 16bit in the editor you use. And developer(s) of Falcon are on Euphorum. Unicode strings should be doable. > So i am wondering which way the technology is moving: Euphoria to/from D/Falcon/wxBasic/Blender/etc. > And why. And can i get "goto" ? I am not objecting to the cross-development > that seems to be going on, just that when someone is working on more than one > open source language, and a feature is asked for, why it isn't possible to say > "oh, i already wrote that for X language" instead of people sitting here saying > they'll work on it, or waiting on it to be added to Euphoria. Basicly, where, > in a way, Euphoria going to be fixed in RDS's 1985 vision, and people here who > already added requested features into other languages, can neither say they > did, nor add those features to Euphoria. I am just curious, so i asked. > > Kat I don't know how to answer your question as I don't know who here is implementing features in other open source languages, other than in their own forks of Euphoria. I think that Irv Mullins left here to work on Qu, and Derek Parnell does stuff with the D language. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21298 Date: 2008 May 18 21:10 From: George Orr <gorr at wo??rr.com> Subject: Re: Euphoria 4.0 build on Linux Ubuntu Jeremy - I still have a problem. I have redirected the make output and copied below. mkdir -p intobj/back mkdir -p transobj/back mkdir -p libobj/back mkdir -p backobj/back cd pcre && make libpcre.la make[1]: Entering directory `/home/george/euphoria-4.0/source/pcre' /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_compile.lo -MD -MP -MF .deps/pcre_compile.Tpo -c -o pcre_compile.lo pcre_compile.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_compile.lo -MD -MP -MF .deps/pcre_compile.Tpo -c pcre_compile.c -o pcre_compile.o mv -f .deps/pcre_compile.Tpo .deps/pcre_compile.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_config.lo -MD -MP -MF .deps/pcre_config.Tpo -c -o pcre_config.lo pcre_config.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_config.lo -MD -MP -MF .deps/pcre_config.Tpo -c pcre_config.c -o pcre_config.o mv -f .deps/pcre_config.Tpo .deps/pcre_config.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_dfa_exec.lo -MD -MP -MF .deps/pcre_dfa_exec.Tpo -c -o pcre_dfa_exec.lo pcre_dfa_exec.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_dfa_exec.lo -MD -MP -MF .deps/pcre_dfa_exec.Tpo -c pcre_dfa_exec.c -o pcre_dfa_exec.o mv -f .deps/pcre_dfa_exec.Tpo .deps/pcre_dfa_exec.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_exec.lo -MD -MP -MF .deps/pcre_exec.Tpo -c -o pcre_exec.lo pcre_exec.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_exec.lo -MD -MP -MF .deps/pcre_exec.Tpo -c pcre_exec.c -o pcre_exec.o mv -f .deps/pcre_exec.Tpo .deps/pcre_exec.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_fullinfo.lo -MD -MP -MF .deps/pcre_fullinfo.Tpo -c -o pcre_fullinfo.lo pcre_fullinfo.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_fullinfo.lo -MD -MP -MF .deps/pcre_fullinfo.Tpo -c pcre_fullinfo.c -o pcre_fullinfo.o mv -f .deps/pcre_fullinfo.Tpo .deps/pcre_fullinfo.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_get.lo -MD -MP -MF .deps/pcre_get.Tpo -c -o pcre_get.lo pcre_get.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_get.lo -MD -MP -MF .deps/pcre_get.Tpo -c pcre_get.c -o pcre_get.o mv -f .deps/pcre_get.Tpo .deps/pcre_get.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_globals.lo -MD -MP -MF .deps/pcre_globals.Tpo -c -o pcre_globals.lo pcre_globals.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_globals.lo -MD -MP -MF .deps/pcre_globals.Tpo -c pcre_globals.c -o pcre_globals.o mv -f .deps/pcre_globals.Tpo .deps/pcre_globals.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_info.lo -MD -MP -MF .deps/pcre_info.Tpo -c -o pcre_info.lo pcre_info.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_info.lo -MD -MP -MF .deps/pcre_info.Tpo -c pcre_info.c -o pcre_info.o mv -f .deps/pcre_info.Tpo .deps/pcre_info.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_maketables.lo -MD -MP -MF .deps/pcre_maketables.Tpo -c -o pcre_maketables.lo pcre_maketables.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_maketables.lo -MD -MP -MF .deps/pcre_maketables.Tpo -c pcre_maketables.c -o pcre_maketables.o mv -f .deps/pcre_maketables.Tpo .deps/pcre_maketables.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_newline.lo -MD -MP -MF .deps/pcre_newline.Tpo -c -o pcre_newline.lo pcre_newline.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_newline.lo -MD -MP -MF .deps/pcre_newline.Tpo -c pcre_newline.c -o pcre_newline.o mv -f .deps/pcre_newline.Tpo .deps/pcre_newline.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_ord2utf8.lo -MD -MP -MF .deps/pcre_ord2utf8.Tpo -c -o pcre_ord2utf8.lo pcre_ord2utf8.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_ord2utf8.lo -MD -MP -MF .deps/pcre_ord2utf8.Tpo -c pcre_ord2utf8.c -o pcre_ord2utf8.o mv -f .deps/pcre_ord2utf8.Tpo .deps/pcre_ord2utf8.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_refcount.lo -MD -MP -MF .deps/pcre_refcount.Tpo -c -o pcre_refcount.lo pcre_refcount.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_refcount.lo -MD -MP -MF .deps/pcre_refcount.Tpo -c pcre_refcount.c -o pcre_refcount.o mv -f .deps/pcre_refcount.Tpo .deps/pcre_refcount.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_study.lo -MD -MP -MF .deps/pcre_study.Tpo -c -o pcre_study.lo pcre_study.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_study.lo -MD -MP -MF .deps/pcre_study.Tpo -c pcre_study.c -o pcre_study.o mv -f .deps/pcre_study.Tpo .deps/pcre_study.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_tables.lo -MD -MP -MF .deps/pcre_tables.Tpo -c -o pcre_tables.lo pcre_tables.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_tables.lo -MD -MP -MF .deps/pcre_tables.Tpo -c pcre_tables.c -o pcre_tables.o mv -f .deps/pcre_tables.Tpo .deps/pcre_tables.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_try_flipped.lo -MD -MP -MF .deps/pcre_try_flipped.Tpo -c -o pcre_try_flipped.lo pcre_try_flipped.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_try_flipped.lo -MD -MP -MF .deps/pcre_try_flipped.Tpo -c pcre_try_flipped.c -o pcre_try_flipped.o mv -f .deps/pcre_try_flipped.Tpo .deps/pcre_try_flipped.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_ucp_searchfuncs.lo -MD -MP -MF .deps/pcre_ucp_searchfuncs.Tpo -c -o pcre_ucp_searchfuncs.lo pcre_ucp_searchfuncs.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_ucp_searchfuncs.lo -MD -MP -MF .deps/pcre_ucp_searchfuncs.Tpo -c pcre_ucp_searchfuncs.c -o pcre_ucp_searchfuncs.o mv -f .deps/pcre_ucp_searchfuncs.Tpo .deps/pcre_ucp_searchfuncs.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_valid_utf8.lo -MD -MP -MF .deps/pcre_valid_utf8.Tpo -c -o pcre_valid_utf8.lo pcre_valid_utf8.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_valid_utf8.lo -MD -MP -MF .deps/pcre_valid_utf8.Tpo -c pcre_valid_utf8.c -o pcre_valid_utf8.o mv -f .deps/pcre_valid_utf8.Tpo .deps/pcre_valid_utf8.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_version.lo -MD -MP -MF .deps/pcre_version.Tpo -c -o pcre_version.lo pcre_version.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_version.lo -MD -MP -MF .deps/pcre_version.Tpo -c pcre_version.c -o pcre_version.o mv -f .deps/pcre_version.Tpo .deps/pcre_version.Plo /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_xclass.lo -MD -MP -MF .deps/pcre_xclass.Tpo -c -o pcre_xclass.lo pcre_xclass.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_xclass.lo -MD -MP -MF .deps/pcre_xclass.Tpo -c pcre_xclass.c -o pcre_xclass.o mv -f .deps/pcre_xclass.Tpo .deps/pcre_xclass.Plo rm -f pcre_chartables.c ln -s ./pcre_chartables.c.dist pcre_chartables.c /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_chartables.lo -MD -MP -MF .deps/pcre_chartables.Tpo -c -o pcre_chartables.lo pcre_chartables.c gcc -DHAVE_CONFIG_H -I. -O2 -MT pcre_chartables.lo -MD -MP -MF .deps/pcre_chartables.Tpo -c pcre_chartables.c -o pcre_chartables.o mv -f .deps/pcre_chartables.Tpo .deps/pcre_chartables.Plo /bin/bash ./libtool --tag=CC --mode=link gcc -O2 -version-info 0:1:0 -o libpcre.la -rpath /usr/local/lib pcre_compile.lo pcre_config.lo pcre_dfa_exec.lo pcre_exec.lo pcre_fullinfo.lo pcre_get.lo pcre_globals.lo pcre_info.lo pcre_maketables.lo pcre_newline.lo pcre_ord2utf8.lo pcre_refcount.lo pcre_study.lo pcre_tables.lo pcre_try_flipped.lo pcre_ucp_searchfuncs.lo pcre_valid_utf8.lo pcre_version.lo pcre_xclass.lo pcre_chartables.lo mkdir .libs ar cru .libs/libpcre.a pcre_compile.o pcre_config.o pcre_dfa_exec.o pcre_exec.o pcre_fullinfo.o pcre_get.o pcre_globals.o pcre_info.o pcre_maketables.o pcre_newline.o pcre_ord2utf8.o pcre_refcount.o pcre_study.o pcre_tables.o pcre_try_flipped.o pcre_ucp_searchfuncs.o pcre_valid_utf8.o pcre_version.o pcre_xclass.o pcre_chartables.o ranlib .libs/libpcre.a creating libpcre.la (cd .libs && rm -f libpcre.la && ln -s ../libpcre.la libpcre.la) make[1]: Leaving directory `/home/george/euphoria-4.0/source/pcre' make exu OBJDIR=intobj EBSD= make[1]: Entering directory `/home/george/euphoria-4.0/source' echo Translating int.ex to create common.e main.e mode.e pathopen.e error.e symtab.e scanner.e scientific.e emit.e parser.e opnames.e reswords.e keylist.e global.e compress.e backend.e c_out.e cominit.e intinit.e int.ex Translating int.ex to create common.e main.e mode.e pathopen.e error.e symtab.e scanner.e scientific.e emit.e parser.e opnames.e reswords.e keylist.e global.e compress.e backend.e c_out.e cominit.e intinit.e int.ex cd ./intobj && exu -i ../../include ../ec.ex -I ../../include ../int.ex Can't open -i.exu Press Enter gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer -O2 -I../ ./intobj/main-.c -I/usr/share/euphoria -o./intobj/main-.o make[1]: Leaving directory `/home/george/euphoria-4.0/source' After this I get a few more messages: make[1]: [intobj.main.c] Error 1 (ignored) gcc: ./intobj/main-.c: no such file or directory gcc: no input files make[1]: ***[intobj/main -o] Error 1 make: [interpreter] Error 2 I hope this makes more sense to you than to me! Thanks again! -= B E G I N =- X-EUFORUM: 21299 Date: 2008 May 18 21:10 From: ChrisBurch2 <crylex at ?reeu?.co.uk> Subject: Line count Hi I've submitted enhanced lines to count program lines - based on lines.ex, using the same code. I haven't include the path yet, and it can't handle some cases (like ..\), but it does inform you that it can't find the files. I would like to include the conf file, but have the rules for it been solidified yet - can't remember where the definition was. Try it out, let me know where I can improve it. Chris -= B E G I N =- X-EUFORUM: 21300 Date: 2008 May 18 21:50 From: Jeremy Cowgar <jeremy at cowgar?c?m> Subject: Re: Another number question Jason Gade wrote: > > > I don't know how to answer your question as I don't know who here is implementing > features in other open source languages, other than in their own forks of Euphoria. She is speaking of me as I implemented a DBI module for Falcon which was accepted into the core, and thus I was listed as an author. But, as her and I spoke on IRC, I have done nothing with the internals of Falcon, so in reference to the statement that since Falcon has 64bit integers and unicode that I should be able to therefore implement unicode and 64bit integers in Euphoria is wrong and she understands that now from our IRC conversations. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21301 Date: 2008 May 18 21:54 From: Jeremy Cowgar <jeremy at co?g?r.com> Subject: Re: Euphoria 4.0 build on Linux Ubuntu George Orr wrote: > cd ./intobj && exu -i ../../include ../ec.ex -I ../../include ../int.ex > Can't open -i.exu > > Press Enter The build file is still very sensitive and it seems that the build is only working with people who already have Eu 4.0, is that right Matt? Open Makefile and go to line 375. It should read: -cd ./$(OBJDIR) && exu -i ../../include ../ec.ex -I ../../include ../$(EU_TARGET) Change that to: -cd ./$(OBJDIR) && exu ../ec.ex ../$(EU_TARGET) Be certain that your EUDIR is pointing to your new SVN checked out copy of 4.0 and if your EUINC is set, make sure it is pointing to your new SVN checked out copy's include directory. You should then be good to build 4.0. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21302 Date: 2008 May 18 22:03 From: Kat <KAT12 at co?sahs.net> Subject: Re: Another number question Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > > > I don't know how to answer your question as I don't know who here is implementing > > features in other open source languages, other than in their own forks of Euphoria. > > She is speaking of me as I implemented a DBI module for Falcon which was accepted > into the core, and thus I was listed as an author. But, as her and I spoke on > IRC, I have done nothing with the internals of Falcon, so in reference to the > statement that since Falcon has 64bit integers and unicode that I should be > able to therefore implement unicode and 64bit integers in Euphoria is wrong > and she understands that now from our IRC conversations. Yes. But there was a 2nd part to the post, and to the discussion on irc, and that is both languages are open sourced, even tho Falcon is built with C++ and Eu is built with C, perhaps what is called on the various api for OSs Falcon supports, or how it supports unicode strings all over itself, or strings in general, is of some aid in doing the same with C for Euphoria. Ergo, Jason, maybe tis a path for you to know. Kat -= B E G I N =- X-EUFORUM: 21303 Date: 2008 May 18 22:10 From: Jeremy Cowgar <jeremy at ?owg?r.com> Subject: Re: Another number question Kat wrote: > > Yes. > > But there was a 2nd part to the post, and to the discussion on irc, and that > is both languages are open sourced, even tho Falcon is built with C++ and Eu > is built with C, perhaps what is called on the various api for OSs Falcon supports, > or how it supports unicode strings all over itself, or strings in general, is > of some aid in doing the same with C for Euphoria. Ergo, Jason, maybe tis a > path for you to know. > Giancarlo and I have talked about implementing Unicode some as I was asking him in regards to an editor. Unicode strings in Falcon are implemented 100% as a class which makes it incompatible with C. I am not sure about anything in regards to how 64bit integers are implemented. You can look into Falcon, but it being C++, I would venture to say if you need examples of how it is implemented you would be much better going to a language written in C for that example, but I am not sure it's really examples that we need. We need man power. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21304 Date: 2008 May 18 22:13 From: gshingles <gshingles at ?mail?com> Subject: Re: Breaking the silence CChris wrote: > > Jeremy Cowgar wrote: > > I think retry should be put into the language, however, for labeling, I really > > do like the idea of: > > ... > I have no religion on this. I simply wonder whether a label clause at the end > of a long text line that doesn't wrap is clearer than a plain label statement, > indented like the block header that follows, since it it would be yet another > statement. It would be ignored if not followed by a block header - so far -, > so retry is not a goto, even with a label. > > But again, I have nothing against either. What about allowing both forms? The > separate label statement has been valid at some point in Æ, and I turned to > a label clause instead for ease of implementation only. This shows how much > the distinction matters to me. I think that's a good point about the label not standing out, particularly if it is at the end of a very long line. I don't know if it is bad practise to put so many conditional tests in a loop condition test but it is the way I tend to work in Euphoria, rapidly, and Euphoria greatly reduces the chances that you are accidentally assigning, or incrementing, or looking at the wrong pointer, or not dereferencing the array reference instead of the array index etc etc in any of the tests, that I am comfortable doing that. However, if you see a 'retry label' later in the code it probably won't take that much effort to track down which loop it is referring to. Gary -= B E G I N =- X-EUFORUM: 21305 Date: 2008 May 18 22:27 From: Jason Gade <jaygade at yaho?.?om> Subject: Re: Another number question Is there a link for this "Falcon" language? Anyway, implementing 64-bit integers internal to the interpreter (not exposed to the user) should be relatively easy. Unicode strings might be a little more difficult. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21306 Date: 2008 May 18 22:37 From: Jeremy Cowgar <jeremy at cow?ar?com> Subject: Re: Another number question Jason Gade wrote: > > Is there a link for this "Falcon" language? > > Anyway, implementing 64-bit integers internal to the interpreter (not exposed > to the user) should be relatively easy. > > Unicode strings might be a little more difficult. > Well, I hate to go advertising other languages as I really enjoy and think we should concentrate on Euphoria, but a link to it can be found from my home page. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21307 Date: 2008 May 18 22:48 From: Jason Gade <jaygade at yaho?.c?m> Subject: Re: Another number question Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > Is there a link for this "Falcon" language? > > > > Anyway, implementing 64-bit integers internal to the interpreter (not exposed > > to the user) should be relatively easy. > > > > Unicode strings might be a little more difficult. > > > > Well, I hate to go advertising other languages as I really enjoy and think we > should concentrate on Euphoria, but a link to it can be found from my home page. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Thanks, found it. Heh. I have no problems with cribbing ideas from other languages, as long as those ideas make sense within the context of what Euphoria already is. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21308 Date: 2008 May 18 23:14 From: Jeremy Cowgar <jeremy at cowga?.co?> Subject: Re: Another number question Jason Gade wrote: > > Heh. I have no problems with cribbing ideas from other languages, as long as > those ideas make sense within the context of what Euphoria already is. > Ah, indeed. Might as well learn from as many sources as possible. Everyone has good ideas. I think you will find Falcon has quite a few nice features, but it's a totally different language. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21309 Date: 2008 May 19 0:26 From: George Orr <gorr at w?h?rr.com> Subject: Re: Euphoria 4.0 build on Linux Ubuntu Jeremy - I made the changes to the Makefile and adjusted my $EUDIR and $EUINC I am still having the same problem. It appears the exu file is not being generated I think I'll just wait a little longer until 4.0 becomes a bit more stable. It was getting hard to follow some of the threads on the forum without a working copy, but I guess I can wait! Thanks for trying! -= B E G I N =- X-EUFORUM: 21310 Date: 2008 May 19 0:43 From: Matt Lewis <matthewwalkerlewis at g?ail.co?> Subject: Re: Euphoria 4.0 build on Linux Ubuntu George Orr wrote: > > I made the changes to the Makefile and adjusted my $EUDIR and $EUINC > I am still having the same problem. It appears the exu file is not being > generated > > I think I'll just wait a little longer until 4.0 becomes a bit more stable. > It was getting hard to follow some of the threads on the forum without a > working copy, but I guess I can wait! Were you getting an error about mybsd not being initialized? I fixed that. Also the GNU build process should now be able to handle having only a v3 interpreter installed. When you run configure, pass --with-eu3 on the command line: $ ./configure --with-eu3 It should set the correct environment variables when it runs the translator. Matt -= B E G I N =- X-EUFORUM: 21311 Date: 2008 May 19 3:28 From: George Orr <gorr at woh.r??com> Subject: Re: Euphoria 4.0 build on Linux Ubuntu Matt - I did not see any errors about mybsd. I tried again with your configure option. Got as far as Translating int.ex New error message is ../parser.e:1847 remove has not been declared OpDefines=remove(OpDefines,idx) George -= B E G I N =- X-EUFORUM: 21312 Date: 2008 May 19 3:34 From: Jeremy Cowgar <jeremy at cowgar.?om> Subject: Re: Euphoria 4.0 build on Linux Ubuntu George Orr wrote: > > > Matt - > > I did not see any errors about mybsd. > > I tried again with your configure option. Got as far as Translating int.ex > > New error message is > > ../parser.e:1847 > remove has not been declared > OpDefines=remove(OpDefines,idx) > > George At the top of parser.e, can you add: include sequence.e and tell me what happens? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21313 Date: 2008 May 19 6:27 From: ZNorQ <znorq at holha??.com> Subject: Re: Win32Lib; Timed events CChris wrote: > > ZNorQ wrote: > > > > CChris wrote: > > > > > > ZNorQ wrote: > > > > > > > > CChris wrote: > > > > > > > > > > I said "any control will do". 0 is not an actual control id, not even a > valid</font></i> > > > > > handle for Windows. It is a special value which is treated, somewhat consistently, > > > > > as if refeerring to the desktop window. But it actually doesn't. > > > > > > > > > > CChris > > > > > > > > Ah, ok. But how would i go about then when I'm creating a program that doesn't > > > > pop-up a window. I know I can use WinMain(0, Normal), but how do I use the > timer</font></i> > > > > in this case? > > > > > > > > Purpose of the code; Run in the background and run various code in intervals. > > > > > > > > Kenneth/ZNorQ > > > > > > CreateEx a main window that is not visible and has the WS_EX_NOACTIVATE extended > > > style (so it won't show in the toolbar). Then WinMain(the_window,Minimized). > > > This is probably close to what you want. > > > A cleaner way woul be to support message only windows, but it would work on > > > Win2K only, and currently requires low level API to create it. I'll think about > > > it. > > > > > > CChris > > > > I just tried something else before I saw your answer; (VERY abbreviated) > > > > mywin= createEx(window, etc...) > > setTimer(mywin, 1, 1000) > > setHandler(mywin, etc...) > > WinMain(0,Normal) > > > > And it *seems* to work! I'll have a go at your version as well. > > > > As for "message only windows", I'm not that fluent in WinAPI coding to even > > remotely understand what your are talking about.. :) > > > > Thanks for the input, CChris. > > > > ZNorQ > > Other Windows developers had needed a window that would just take and dispatch > messages, and nothing else (no switching to it, no taskbar button, no rectagle > on screen, no nothing). > > You can always do this by defining the event loop of the window accordingly.That's > how it was done under Win9x. A good recipe for bugs. You can do that using win32lib's > setDefaultProcessing(). > > So, in Win2K and onwards, there is a special sort of window with such a minimalistic > functionality, which is called "message only window". win32lib cannot currently > createEx() it, but the Windows API sure can (if curious, google for HWND_MESSAGE > and check links to MSDN in the result). > > > CChris Ok, but my solution for now is creating a dummy window that the timer is 'linked' to, and just never use it in the WinMain() procedure. It seems to work perfectly for me now. Would there be any reason this is a bad idea, in this situation? ZNorQ -= B E G I N =- X-EUFORUM: 21314 Date: 2008 May 19 6:29 From: ZNorQ <znorq at ho?haug.com> Subject: Re: Win32Lib; Timed events Bernie Ryan wrote: > > ZNorQ wrote: > > > > CChris wrote: > > > > > > I said "any control will do". 0 is not an actual control id, not even a valid > > > handle for Windows. It is a special value which is treated, somewhat consistently, > > > as if refeerring to the desktop window. But it actually doesn't. > > > > > > CChris > > > > Ah, ok. But how would i go about then when I'm creating a program that doesn't > > pop-up a window. I know I can use WinMain(0, Normal), but how do I use the timer > > in this case? > > > > Purpose of the code; Run in the background and run various code in intervals. > > > > Kenneth/ZNorQ > > You can use HWND GetDesktopWindow(VOID) to get a handle to desktop > > window which is in most cases always available and use that with your timer. > > Bernie > > My files in archive: > WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API > > Can be downloaded here: > <a href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a> Ok, but I'm not really after the desktop handle, unless I can use that for attaching my timer to it...? As you've problably read earlier in my posts, I create a dummy window that I link my timer to, but I never use the window, by starting with WinMain(0, Normal). Don't know if this is the best way to do it, but it seems to work for me. :) ZNorQ -= B E G I N =- X-EUFORUM: 21315 Date: 2008 May 19 6:32 From: ZNorQ <znorq at holh?ug.?om> Subject: Re: Win32Lib; Timed events Shawn Pringle wrote: > > ZNorQ wrote: > > > > CChris wrote: > > > > > > ZNorQ wrote: > > > > > > > > > > > > I have a couple of questions in regards to timed events in Win32Lib; > > > > > > > > a) Why wont this code example work? (PS! The mbox is just another form of > message_box,</font></i> > > > > and it works - this isn't the problem.) > > > > > > > > procedure evnTIM_Timer (integer hControl, integer hEvent, sequence uParameters) > > > > mbox("5 seconds just passed...") > > > > end procedure > > > > setTimer(fmMAF, 12, 5000) > > > > setHandler(12, w32HTimer, routine_id("evnTIM_Timer")) > > > It works now, not because I used the showMessage (I did, but that didn't change > > anything), but because I changed from timer ID 12 to 1... So, I guess you can't > > have 12 timers? (I don't have 12 timers, 12 was just a random number I picked > > for my routine..) > > > > Thank for the feedback, though.. :) > > > > Kenneth/ZNorQ > > It works now, not because you picked a lower number. > setHandler takes a Window id - not a timer id, 1 just happens to be > the same value as a Window id. Yeah, when I finally understood how it was used, I kinda figured that out myself. Thanks for the heads-up anyway. :) ZNorQ -= B E G I N =- X-EUFORUM: 21316 Date: 2008 May 19 8:09 From: CChris <christian.cuvier at agric?lture.g?uv.fr> Subject: Re: Win32Lib; Timed events ZNorQ wrote: > > CChris wrote: > > > > ZNorQ wrote: > > > > > > CChris wrote: > > > > > > > > ZNorQ wrote: > > > > > > > > > > CChris wrote: > > > > > > > > > > > > I said "any control will do". 0 is not an actual control id, not even a > > valid</font></i> > > > > > > handle for Windows. It is a special value which is treated, somewhat > consistently,</font></i> > > > > > > as if refeerring to the desktop window. But it actually doesn't. > > > > > > > > > > > > CChris > > > > > > > > > > Ah, ok. But how would i go about then when I'm creating a program that doesn't > > > > > pop-up a window. I know I can use WinMain(0, Normal), but how do I use the > > timer</font></i> > > > > > in this case? > > > > > > > > > > Purpose of the code; Run in the background and run various code in intervals. > > > > > > > > > > Kenneth/ZNorQ > > > > > > > > CreateEx a main window that is not visible and has the WS_EX_NOACTIVATE extended > > > > style (so it won't show in the toolbar). Then WinMain(the_window,Minimized). > > > > This is probably close to what you want. > > > > A cleaner way woul be to support message only windows, but it would work on > > > > Win2K only, and currently requires low level API to create it. I'll think about > > > > it. > > > > > > > > CChris > > > > > > I just tried something else before I saw your answer; (VERY abbreviated) > > > > > > mywin= createEx(window, etc...) > > > setTimer(mywin, 1, 1000) > > > setHandler(mywin, etc...) > > > WinMain(0,Normal) > > > > > > And it *seems* to work! I'll have a go at your version as well. > > > > > > As for "message only windows", I'm not that fluent in WinAPI coding to even > > > remotely understand what your are talking about.. :) > > > > > > Thanks for the input, CChris. > > > > > > ZNorQ > > > > Other Windows developers had needed a window that would just take and dispatch > > messages, and nothing else (no switching to it, no taskbar button, no rectagle > > on screen, no nothing). > > > > You can always do this by defining the event loop of the window accordingly.That's > > how it was done under Win9x. A good recipe for bugs. You can do that using win32lib's > > setDefaultProcessing(). > > > > So, in Win2K and onwards, there is a special sort of window with such a minimalistic > > functionality, which is called "message only window". win32lib cannot currently > > createEx() it, but the Windows API sure can (if curious, google for HWND_MESSAGE > > and check links to MSDN in the result). > > > > > > CChris > > Ok, but my solution for now is creating a dummy window that the timer is 'linked' > to, and just never use it in the WinMain() procedure. It seems to work perfectly > for me now. > > Would there be any reason this is a bad idea, in this situation? > > ZNorQ It is not, as long as your application is concerned. Now you may have an extra button on the taskbar, and a dummy window listed when you press Alt-Tab. If they don't bother you, that's fine indeed. CChris -= B E G I N =- X-EUFORUM: 21317 Date: 2008 May 19 8:37 From: Kenneth Rhodes <ken_rhodes30436 at yahoo.co?> Subject: 64bit Dysphoria More problems with Euphoria under AMD64/SUSE Linux 10.3. I decided to take another stab at working with the current version of ed.ex sans ncurses. Under almost every terminal emulator I tried, I found that once an additional ed.ex "window" (pane would be a better term) is opened, pressing the F1 key to return to the initial pane simply places the cursor on the editor's top line with together with a couple of symbols. This happens under several different terminal emulators in KDE, XFCE, and VFWM. I was really surprized to find that it also happens when I drop out of the window manager/desktop to one of the actual Linux consoles. However, using the Linux32 Konsole in XFCE, but not KDE, the F1 key functioned normally. Is this an ed.ex bug, or a Euphoria bug? I'm beginning to think losing ncurses was not a good idea. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21318 Date: 2008 May 19 8:56 From: ChrisBurch3 <crylex at gm?il?com> Subject: Re: 64bit Dysphoria Kenneth Rhodes wrote: > > More problems with Euphoria under AMD64/SUSE Linux 10.3. > > I decided to take another stab at working with the current version of > ed.ex sans ncurses. > > Under almost every terminal emulator I tried, I found that > once an additional ed.ex "window" (pane would be a better term) > is opened, pressing the F1 key to return to the initial pane simply > places the cursor on the editor's top line with together with a > couple of symbols. This happens under several different terminal > emulators in KDE, XFCE, and VFWM. I was really surprized to find > that it also happens when I drop out of the window manager/desktop > to one of the actual Linux consoles. > > However, using the Linux32 Konsole in XFCE, but not KDE, the F1 > key functioned normally. > > Is this an ed.ex bug, or a Euphoria bug? > > I'm beginning to think losing ncurses was not a good idea. > > > Ken Rhodes > Folding at Home: <a href="http://folding.stanford.edu/">http://folding.stanford.edu/</a> > 100% MicroSoft Free > SuSE Linux 10.3 > No AdWare, SpyWare, or Viruses! > Life is Good, :-) Hi No, its a console bug - the consoles each work differently, or more precisely they emulate different terminals which have a different set of terminal control codes. With konsole, you can set the terminal emulation, which may help. There are some console commands that select terminal types and line displays for instance from ee echo -e "\\033(U" there are probably others, never really successful, so didn't really pursue them you can try setterm - see man setterm for (extensive) details. When I lost ncurses, I modified one of my includes to cope - the changes are summarised here http://euwiki.ayo.biz/Text_mode Chris -= B E G I N =- X-EUFORUM: 21319 Date: 2008 May 19 9:20 From: Kenneth Rhodes <ken_rhodes30436 at ??hoo.com> Subject: Re: 64bit Dysphoria ChrisBurch3 wrote: > <a href="http://euwiki.ayo.biz/Text_mode">http://euwiki.ayo.biz/Text_mode</a> > OK... thanks for the link/info. I'll give it a whirl! Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21320 Date: 2008 May 19 10:58 From: George Orr <gorr at woh.rr?com> Subject: Re: Euphoria 4.0 build on Linux Ubuntu Jeremy - That seems to have done it! I used ./configure --with-eu3 as Matt suggested and added the line to parser.e Everything compiled, and the exu in the source directory says it is 4.0! I'll check it out more when I get back from a business trip. Thanks to you and Matt for your help. George -= B E G I N =- X-EUFORUM: 21321 Date: 2008 May 19 11:02 From: MBianchi <mebian at tiscal?n?t.it> Subject: Re: Euphoria 4.0 build on Linux Ubuntu Jeremy Cowgar wrote: > > George Orr wrote: > > > > > > Matt - > > > > I did not see any errors about mybsd. > > > > I tried again with your configure option. Got as far as Translating int.ex > > > > New error message is > > > > ../parser.e:1847 > > remove has not been declared > > OpDefines=remove(OpDefines,idx) > > > > George > > At the top of parser.e, can you add: > > include sequence.e > > and tell me what happens? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Seems compiling fine on my Sidux Debian, at least I have no error messages from make and I can get to exu 4.0 interpreter welcome message. BTW: I can't get --prefix switch to work in configure, and I cannot install in /usr/local a testing package, could you help with this in the script? TIA. Please take note (if not known): in Debian there is another package named euphoria already, and this caused me conflicts when I tried to install the 3.20 deb package with apt). Cheers. MBianchi -= B E G I N =- X-EUFORUM: 21322 Date: 2008 May 19 11:58 From: ChrisBurch2 <crylex at fr?euk.co.u?> Subject: euinc.conf Matt Hi Is there a document somewhere that gives the rules for euinc.conf, eg search for an include in 1. current directory 2. EUINC environment 3. euinc.conf in current directory 4. euinc.conf in /usr/bin OR euphoria\bin 5. euinc.conf in users home OR c:\ stop searching when include file found, or throw an error if not found euinc.conf contains a list of include location folders or such like I seem to remember one on sourceforge, but can't seem to find it now. Can it contain other information too, if it were laid out like an ini file. For instance [include] c:\euphoria\pincs [info] Author="Joe Coder" etc etc This may be a step too far, taking away from the euinc part of euinc.conf. Just thinking aloud. Chris -= B E G I N =- X-EUFORUM: 21323 Date: 2008 May 19 13:09 From: Shawn Pringle <shawn.pringle at ?m?il.com> Subject: specifying include directories There is a feature which I wish other versions had that would be invaluable for testing various versions of large libraries. A command line switch for specifying the include directory to search for. I will have to port all my stuff to 4.0. Often one version of Euphoria will not work with some versions of win32lib.ew and some versions of win32lib.ew will not work with ide.exw. There would be utility in the ability to have this feature if it would be searched before the EUINC variable. Sometimes software upgrades breaks existing software, lets save 4.0+ users from that headache. What do you say Jeremy and friends? Is this something you are willing to put into the EUPHORIA programming interpreter? Shawn Pringle -= B E G I N =- X-EUFORUM: 21324 Date: 2008 May 19 13:23 From: Matt Lewis <matthewwalkerlewis at gma?l.?om> Subject: Re: euinc.conf Matt ChrisBurch2 wrote: > > > Hi > > Is there a document somewhere that gives the rules for euinc.conf, eg I think that the most comprehensive document is probably here: http://rapideuphoria.wiki.sourceforge.net/nix+config We [I] obviously need to put this into the documentation in a formal fashion. > Can it contain other information too, if it were laid out like an ini file. > For instance > > [include] > c:\euphoria\pincs > > [info] > Author="Joe Coder" > > etc etc > > This may be a step too far, taking away from the euinc part of euinc.conf. > Just thinking aloud. I think I'd like to keep the euinc.conf file to just include directories. We can add different sort of configuration. Matt -= B E G I N =- X-EUFORUM: 21325 Date: 2008 May 19 13:27 From: Matt Lewis <matthewwalkerlewis at gm?il.c?m> Subject: Re: specifying include directories Shawn Pringle wrote: > > There is a feature which I wish other versions had that would be invaluable > for > testing various versions of large libraries. A command line switch for > specifying the include directory to search for. I will have to port all my > stuff to 4.0. > > Often one version of Euphoria will not work with some versions of win32lib.ew > and some versions of win32lib.ew will not work with ide.exw. There would be > utility in the ability to have this feature if it would be searched before > the EUINC variable. Sometimes software upgrades breaks existing software, > lets save 4.0+ users from that headache. > > What do you say Jeremy and friends? Is this something you are willing to put > into the EUPHORIA programming interpreter? Yes. There are two ways to do this. You can either create a euinc.conf file with a list of directories, or specify directories right on the command line with the -i switch before the file: $ exu -i ~/foo app.exu There's additional (possibly somewhat out of date) information about using euinc.conf files here: http://rapideuphoria.wiki.sourceforge.net/nix+config It is the fact that we require 4.0 to do this that has caused some difficulties with building on a system with only 3.x installed. I *think* these issues have been solved. Matt -= B E G I N =- X-EUFORUM: 21326 Date: 2008 May 19 16:12 From: ChrisBurch2 <crylex at ?reeuk.?o.uk> Subject: Re: specifying include directories Hi Does this mean that the include location information will be available to your program? Much like getenv, perhaps a getconf function, without actually having to use the search list to hunt for the conf file? Chris -= B E G I N =- X-EUFORUM: 21327 Date: 2008 May 19 16:19 From: OtterDad <otter at full-moon?c?m> Subject: Re: For Kat: Openwatcom Kat wrote: > Like i said, openwatcom != watcom, and version 3.1 was compiled with watcom, > not openwatcom. So if i try to fix the bug in 3.1, i need watcom, because who > knows if it will compile properly, or exibit the same behavior, with openwatcom? > > > Kat here's what looks like an old link that still works. hope it helps. http://openwatcom.mirrors.pair.com/11.0c/ Yours, OtterDad Don't sweat it -- it's not real life. It's only ones and zeroes. Gene Spafford -= B E G I N =- X-EUFORUM: 21328 Date: 2008 May 19 16:36 From: Matt Lewis <matthewwalkerlewis at gmail.?o?> Subject: Re: specifying include directories ChrisBurch2 wrote: > > Hi > > Does this mean that the include location information will be available to > your program? Much like getenv, perhaps a getconf function, without actually > having to use the search list to hunt for the conf file? That's not currently in there, but I suppose it could be. You can get the information in the option switches that were passed on the command line. Matt -= B E G I N =- X-EUFORUM: 21329 Date: 2008 May 19 16:52 From: Jeremy Cowgar <jeremy at cow?ar.com> Subject: Re: specifying include directories Matt Lewis wrote: > > ChrisBurch2 wrote: > > > > Hi > > > > Does this mean that the include location information will be available to > > your program? Much like getenv, perhaps a getconf function, without actually > > having to use the search list to hunt for the conf file? > > That's not currently in there, but I suppose it could be. You can get the > information in the option switches that were passed on the command line. > > Matt I do not think that's entirely true. The parameters that are used by the interpreter are consumed by it, from what I can tell in code and example. For instance: myprog.ex --------- <eucode> include misc.e pretty_print(1, command_line(), {2}) </eucode> $ exu -I /opt/eu40/include -D debug -D shareware hello.e John Doe { "/opt/euphoria-4.0/source/exu", "/home/jeremy/hello.e", "John", "Doe" } -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21330 Date: 2008 May 19 17:03 From: Jason Gade <jaygade at yaho?.?om> Subject: Re: specifying include directories Jeremy Cowgar wrote: > > Matt Lewis wrote: > > > > ChrisBurch2 wrote: > > > > > > Hi > > > > > > Does this mean that the include location information will be available to > > > your program? Much like getenv, perhaps a getconf function, without actually > > > having to use the search list to hunt for the conf file? > > > > That's not currently in there, but I suppose it could be. You can get the > > information in the option switches that were passed on the command line. > > > > Matt > > I do not think that's entirely true. The parameters that are used by the interpreter > are consumed by it, from what I can tell in code and example. For instance: > > myprog.ex > --------- > <eucode> > include misc.e > pretty_print(1, command_line(), {2}) > </eucode> > > $ exu -I /opt/eu40/include -D debug -D shareware hello.e John Doe > { > "/opt/euphoria-4.0/source/exu", > "/home/jeremy/hello.e", > "John", > "Doe" > } > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> That's the behavior that I would expect. Maybe euinc.conf and command-line switches should set EUINC and EUDIR during the duration of the program (which the program can then read) and then set it back when finished? That seems like the simplest solution. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21331 Date: 2008 May 19 17:05 From: Jeremy Cowgar <jeremy at cowgar.c?m> Subject: Re: specifying include directories Jason Gade wrote: > > > $ exu -I /opt/eu40/include -D debug -D shareware hello.e John Doe > > { > > "/opt/euphoria-4.0/source/exu", > > "/home/jeremy/hello.e", > > "John", > > "Doe" > > } > > > > -- > > Jeremy Cowgar > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > That's the behavior that I would expect. > > Maybe euinc.conf and command-line switches should set EUINC and EUDIR during > the duration of the program (which the program can then read) and then set it > back when finished? > > That seems like the simplest solution. > Or maybe easier a function called include_paths() or something. that returns a sequence that EU is looking in: <eucode> include_paths() -- {"c:\\euphoria\\include", "c:\\eulibs"} </eucode> -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21332 Date: 2008 May 19 18:35 From: CChris <christian.cuvier at agriculture.?ou?.fr> Subject: Feature suggestion: without keyword= One of the reasons new keywords are not easily accepted into the language is that they will break code that used the previously available identifier as a var/routine name. While additions to 4.0 will have this undsirable effect - can't help -, we could avoid further breakage by introducing a new directive: <eucode> without keywords= <comma separated list on one line> </eucode> This would instruct the interpreter to accept identifiers in the list as normal identifiers, and prevent it from considering any of them as a keyword. Symetrically, "with keywords" would disable such filtering. Both directives would behave like "with trace" or similar, ie you can change them at any point, and they are restored when parsing resumes after including a file. This way, Eu 4.1 would be able to run pre-4.1 code that might break with only minor editing. I guess there could be a command line switch to set the initial state of the filter. At startup, and without such instruction, the interpreter would start "with keywords". Any thoughts? CChris -= B E G I N =- X-EUFORUM: 21333 Date: 2008 May 19 18:51 From: Jeremy Cowgar <jeremy at co?gar.?om> Subject: Re: Feature suggestion: without keyword= CChris wrote: > > <eucode> > without keywords= <comma separated list on one line> > </eucode> > I kind of think that we should just accept the fact that some things are going to break with 4.0. Hopefully not too much. The location of a few functions that were previously in misc.e and are now in a more appropriate place is about all. There are a few new keywords that could cause a conflict in source code, for instance if you use a variable named "continue" But other than that, I do not really think we have a problem with 4.0 breaking things? win32lib works out of the box as does anything else I have ever tested. All my code works fine. ed.ex used the variable "continue" in the function search(). A search/replace for continue to continue_search remedied that problem in about 5 seconds. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21334 Date: 2008 May 19 22:13 From: Arthur Crump <arthur.crump at ?t?world.com> Subject: Re: Feature suggestion: without keyword= Jeremy Cowgar wrote: > > CChris wrote: > > > > <eucode> > > without keywords= <comma separated list on one line> > > </eucode> > > > > I kind of think that we should just accept the fact that some things are going > to break with 4.0. Hopefully not too much. The location of a few functions that > were previously in misc.e and are now in a more appropriate place is about all. > There are a few new keywords that could cause a conflict in source code, for > instance if you use a variable named "continue" > etc. > > without keyword = <comma separated list on one line> seems like a good idea. Perhaps restricted to new keywords. If Jeremy Cowgar doesn't want to use it, there is no need to. Arthur Crump. -= B E G I N =- X-EUFORUM: 21335 Date: 2008 May 19 22:24 From: Jeremy Cowgar <jeremy at cowg?r.?om> Subject: Re: Feature suggestion: without keyword= Arthur Crump wrote: > > > > without keyword = <comma separated list on one line> > seems like a good idea. Perhaps restricted to new keywords. > If Jeremy Cowgar doesn't want to use it, there is no need to. > It's not a matter of if John or Jane will use it, it's a matter of what's best for the entire community. I think we need some more discussion on this. Any other thoughts from others? Once concern I have is the complexity it may add (I say may because I have not thought out how it would work) and potential slow down to the parser having to check if a keyword is allowed in this file or not. Chris, can you speak to those two concerns? The last concern I have is then a division in how Euphoria programmers program. I've said many times that consistency in the language is paramount. Starting to enable/disable parts of the language sounds very dangerous to me. To me if you have an application that will only run on Eu 3.1 simply because of one keyword (continue) then you should either update your application or continue to run it under 3.1. I do not think we should introduce new parsing routines and possible/probable? slow downs into 4.0 just so someone does not have to update a variable name that could easily be done w/a simple search/replace. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21336 Date: 2008 May 19 23:09 From: gshingles <gshingles at ?mai?.com> Subject: Re: Feature suggestion: without keyword= Jeremy Cowgar wrote: > > Arthur Crump wrote: > > > > > > without keyword = <comma separated list on one line> > > seems like a good idea. Perhaps restricted to new keywords. > > If Jeremy Cowgar doesn't want to use it, there is no need to. > > > > It's not a matter of if John or Jane will use it, it's a matter of what's best > for the entire community. I think we need some more discussion on this. Any > other thoughts from others? I think it's a good idea that might not be economic to implement. The idea seems to be allowing code written for 4.0 using an identifier (eg 'xxxxxx') which later becomes a keyword in 4.1x to be run in 4.1x by ignoring the fact that 'xxxxxx' is a keyword now. I think the case is very common, for example using "continue" as a loop control variable ('while continue do'), but I think a search and replace could cure that in 3 seconds vs. X hours to implement/test/document 'please ignore this' in the interpreter. I also think its use would be limited to new programs include'ing old includes because if you were trying to run an 'old' program you would have to edit it anyway to add the 'without keywords....' for either the program or its includes. So you may as well search/replace the identifier in question at the time of doing that. However it would be a very handy feature if you were using a lot of Euphoria includes on a network drive or server host environment that you absolutely could not get updated. So my position is, if someone wants to do it and it doesn't have any adverse effects, then I'm neither for nor against it. :-) Gary -= B E G I N =- X-EUFORUM: 21337 Date: 2008 May 20 0:09 From: jacques deschênes <desja at globetrotter.??t> Subject: Re: Feature suggestion: without keyword= I vote NO, I agree with Jeremy on that. Jacques CChris wrote: > > One of the reasons new keywords are not easily accepted into the language is > that they will break code that used the previously available identifier as a > var/routine name. > > While additions to 4.0 will have this undsirable effect - can't help -, we could > avoid further breakage by introducing a new directive: > <eucode> > without keywords= <comma separated list on one line> > </eucode> > > This would instruct the interpreter to accept identifiers in the list as normal > identifiers, and prevent it from considering any of them as a keyword. > > Symetrically, "with keywords" would disable such filtering. > > Both directives would behave like "with trace" or similar, ie you can change > them at any point, and they are restored when parsing resumes after including > a file. > > This way, Eu 4.1 would be able to run pre-4.1 code that might break with only > minor editing. I guess there could be a command line switch to set the initial > state of the filter. At startup, and without such instruction, the interpreter > would start "with keywords". > > Any thoughts? > > CChris -= B E G I N =- X-EUFORUM: 21338 Date: 2008 May 20 0:23 From: Matt Lewis <matthewwalkerlewis at gmai??com> Subject: Re: specifying include directories Jeremy Cowgar wrote: > > Matt Lewis wrote: > > > > ChrisBurch2 wrote: > > > > > > Hi > > > > > > Does this mean that the include location information will be available to > > > your program? Much like getenv, perhaps a getconf function, without actually > > > having to use the search list to hunt for the conf file? > > > > That's not currently in there, but I suppose it could be. You can get the > > information in the option switches that were passed on the command line. > > > > Matt > > I do not think that's entirely true. The parameters that are used by the interpreter > are consumed by it, from what I can tell in code and example. For instance: You missed a line. :) <eucode> include misc.e pretty_print(1, command_line(), {2}) pretty_print(1, option_switches(), {2}) </eucode> I thought that the switches shouldn't interfere with the normal command line handling, but that it might be useful to have access to it, so I added the option_switches() built-in. And yes, dad, it's on my list of stuff to document.... Matt -= B E G I N =- X-EUFORUM: 21339 Date: 2008 May 20 0:24 From: Matt Lewis <matthewwalkerlewis at gmail.?o?> Subject: Re: Feature suggestion: without keyword= CChris wrote: > > This would instruct the interpreter to accept identifiers in the list as normal > identifiers, and prevent it from considering any of them as a keyword. > Symetrically, "with keywords" would disable such filtering. > Any thoughts? Sounds like Perl 6. For what that's worth. Matt -= B E G I N =- X-EUFORUM: 21340 Date: 2008 May 20 0:26 From: Matt Lewis <matthewwalkerlewis at gm?il?com> Subject: Re: Feature suggestion: without keyword= Matt Lewis wrote: > > CChris wrote: > > > > This would instruct the interpreter to accept identifiers in the list as normal > > identifiers, and prevent it from considering any of them as a keyword. > > > Symetrically, "with keywords" would disable such filtering. > > > Any thoughts? > > Sounds like Perl 6. For what that's worth. Also, I think we could get away with this through conditional compilation. The important bits, at least. Matt -= B E G I N =- X-EUFORUM: 21341 Date: 2008 May 20 0:59 From: Jeremy Cowgar <jeremy at cowg?r.co?> Subject: Short-circuit warning Is this warning really valid: Warning: ../bin/indent.ex:53 - call to matches() might be short-circuited Well, maybe valid, but useful? For instance, I specifically made the if statement to short-circuit, that's the way I want it. I program all the time counting on short circuits and do not really feel as though I need a warning about it. I thought short-circuits were a benefit? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21342 Date: 2008 May 20 1:03 From: Jason Gade <jaygade at y?ho?.com> Subject: Re: Short-circuit warning Jeremy Cowgar wrote: > > Is this warning really valid: > > Warning: ../bin/indent.ex:53 - call to matches() might be short-circuited > > Well, maybe valid, but useful? For instance, I specifically made the if statement > to short-circuit, that's the way I want it. I program all the time counting > on short circuits and do not really feel as though I need a warning about it. > I thought short-circuits were a benefit? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I think it was a valid warning when short-circuiting was new to Euphoria. I guess the question is whether short-circuiting is expected behavior by people new or relatively new to programming? Personally, I say do away with it and make it very clear in the docs that that is how things work. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21343 Date: 2008 May 20 1:04 From: Jason Gade <jaygade at y?ho?.com> Subject: Re: Feature suggestion: without keyword= Matt Lewis wrote: > > Matt Lewis wrote: > > > > CChris wrote: > > > > > > This would instruct the interpreter to accept identifiers in the list as normal > > > identifiers, and prevent it from considering any of them as a keyword. > > > > > Symetrically, "with keywords" would disable such filtering. > > > > > Any thoughts? > > > > Sounds like Perl 6. For what that's worth. > > Also, I think we could get away with this through conditional compilation. > The important bits, at least. > > Matt Agreed. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21344 Date: 2008 May 20 1:09 From: Jeremy Cowgar <jeremy at co?g?r.com> Subject: Re: Short-circuit warning Jason Gade wrote: > > > I think it was a valid warning when short-circuiting was new to Euphoria. I > guess the question is whether short-circuiting is expected behavior by people > new or relatively new to programming? > > Personally, I say do away with it and make it very clear in the docs that that > is how things work. > Short circuiting should be explained in the manual and it should be taught in any elementary programming course. I do not think that Euphoria should consider everyone a newbie or a dummy. It's a programming language. There are some things you should know when programming. Short circuiting is one of those, IMHO. I've not seen any language (I'm sure that it may exist) that has given a warning about short circuiting. That's almost as bad as: Warning: if statement may branch if it's condition is true Um, we know that :-) To me the short-circuit warnings galore just mask a real warning. Makes me want to turn off warnings, but I know that would be bad. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21345 Date: 2008 May 20 1:52 From: Matt Lewis <matthewwalkerlewis at gmail?c?m> Subject: Re: Short-circuit warning Jeremy Cowgar wrote: > > Is this warning really valid: > > Warning: ../bin/indent.ex:53 - call to matches() might be short-circuited > > Well, maybe valid, but useful? For instance, I specifically made the if statement > to short-circuit, that's the way I want it. I program all the time counting > on short circuits and do not really feel as though I need a warning about it. > I thought short-circuits were a benefit? Yes, they are, but if the part that is being short circuited has side effects, you may not really want to short circuit. I think that was the real reason for the warning. And it's still valid. I think we probably should keep it, but we might be able to improve it by eliminating cases where we can prove that there are no side effects. I haven't studied that part of the code, so I'm not sure how feasible this is. Matt -= B E G I N =- X-EUFORUM: 21346 Date: 2008 May 20 2:02 From: Jeremy Cowgar <jeremy at co?g?r.com> Subject: Re: Short-circuit warning Matt Lewis wrote: > > Yes, they are, but if the part that is being short circuited has side effects, > you may not really want to short circuit. I think that was the real reason > for the warning. And it's still valid. I think we probably should keep it, > but we might be able to improve it by eliminating cases where we can prove > that there are no side effects. I haven't studied that part of the code, > so I'm not sure how feasible this is. > I would say that it would be very difficult to analyze that. Here's an example of where I get short-circuit warnings that are flooding the output making it hard to even see the output of my program: if in_if or re:matches(else_if, line) then ... elsif in_continue and length(line) > 5 and equal(line[1..5], ...) ... end if I guess that's the way I have always programmed. I wonder, maybe we should add something like: <eucode> without xyz_warning </eucode> ?? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21347 Date: 2008 May 20 2:48 From: Derek Parnell <ddparnell at bigpond.??m> Subject: Re: Short-circuit warning Jeremy Cowgar wrote: > > Is this warning really valid: Ditch it. Its PITA. Either don't allow short-ciruiting or allow it, but if its okay to use short circiuiting then let me make my own mistakes - once at least. If we really must have a warning then allow the "with warning" statement to have fine granularity. without warning(short-circuit,unused-local-constants) -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21348 Date: 2008 May 20 3:15 From: Jason Gade <jaygade at ya?o?.com> Subject: svn co Okay, so I'm making progress. On my laptop I downloaded both tortoisesvn and command line svn today and checked out the Euphoria svn tree. I plan on first working on my port to Digital Mars C compiler and then maybe on large file support. No deadlines, though! I'm probably already over committing myself. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21349 Date: 2008 May 20 8:11 From: ZNorQ <znorq at holha?g?com> Subject: Re: Win32Lib; Timed events CChris wrote: > > Now you may have an extra button on the taskbar, and a dummy window listed when > you press Alt-Tab. > > CChris Thats weird, because I don't. The only trace of the program is in the taskmanager list; It doesn't show the form in either system tray nor the task bar, which is fine since it's the way I want it.. ZNorQ -= B E G I N =- X-EUFORUM: 21350 Date: 2008 May 20 8:12 From: CChris <christian.cuvier at ?griculture.go?v.fr> Subject: Re: Feature suggestion: without keyword= Jeremy Cowgar wrote: > > Arthur Crump wrote: > > > > > > without keyword = <comma separated list on one line> > > seems like a good idea. Perhaps restricted to new keywords. > > If Jeremy Cowgar doesn't want to use it, there is no need to. > > > > It's not a matter of if John or Jane will use it, it's a matter of what's best > for the entire community. I think we need some more discussion on this. Any > other thoughts from others? > > Once concern I have is the complexity it may add (I say may because I have not > thought out how it would work) and potential slow down to the parser having > to check if a keyword is allowed in this file or not. > > Chris, can you speak to those two concerns? > This directive is not meant to be used in new code. It is meant to enable code that might otherwise suddenly start breaking to keep going. How it would work is to select which parser switchboard is being used, one that doesn't test (current) and one which does. So * using code without keywords (the default) has no noticeabe effect performance - IncludePush() and IncludePop() push and pop one more item. * using code with keywords= incurs a parsing time penalty (one test for each potential keyword). Execution is not affected. And now that I think about it, it's even simpler to implement this inside the symbol identification routine proper, ie in scanning. No dual parser, just an ifdef and a check when "with keywords" is on and a keyword is identified. While I agree that, for a developer, editing the offending code is not more than 5 seconds of text manipulation, this may not be true for the average user. It's easy to forget using the Whole word only option, and Notepad doesn't have a Search/replace across project option. Upgrading the application is obviously better, but if the maintainer is no longer there or just too busy? Not upgrading the interpreter may be a pain because you'll wind up having several versions and juggle with various paths. Adding a one line directive at the top of a couple files may appear as a lesser nuisance. One last thing: John Doe wrote an app that uses a 3rd party lib which starts breaking. True, he can fix the lib. But this means that he will now distribute a modified version of a lib. Licensing may not be a problem, but what will happen when the author of the 3rd party lib upgrades it any time later, and users will get the new and old versions installed? CChris > The last concern I have is then a division in how Euphoria programmers program. > I've said many times that consistency in the language is paramount. Starting > to enable/disable parts of the language sounds very dangerous to me. > > To me if you have an application that will only run on Eu 3.1 simply because > of one keyword (continue) then you should either update your application or > continue to run it under 3.1. I do not think we should introduce new parsing > routines and possible/probable? slow downs into 4.0 just so someone does not > have to update a variable name that could easily be done w/a simple search/replace. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> -= B E G I N =- X-EUFORUM: 21351 Date: 2008 May 20 8:19 From: CChris <christian.cuvier at agricul?ure.gou?.fr> Subject: Re: Short-circuit warning Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > > > I think it was a valid warning when short-circuiting was new to Euphoria. I > > guess the question is whether short-circuiting is expected behavior by people > > new or relatively new to programming? > > > > Personally, I say do away with it and make it very clear in the docs that that > > is how things work. > > > > Short circuiting should be explained in the manual and it should be taught in > any elementary programming course. I do not think that Euphoria should consider > everyone a newbie or a dummy. It's a programming language. There are some things > you should know when programming. Short circuiting is one of those, IMHO. I've > not seen any language (I'm sure that it may exist) that has given a warning > about short circuiting. That's almost as bad as: > > Warning: if statement may branch if it's condition is true > > Um, we know that :-) To me the short-circuit warnings > galore just mask a real warning. Makes me want to turn off warnings, but I know that would be bad. > Which is what I routinely do, and not only because of this particular warning. "local variable is not used" occur a lot when you create GUI apps, and these useless warnings just clutter the output. I also heard that it harms CGI programs, but didn't play with this. Pete Lomax was recommending a with warning= directive to selectively turn warnings on or off. This would be harmless in terms of performance, and might make it workable, or even useful, to turn warnings on. CChris > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> -= B E G I N =- X-EUFORUM: 21352 Date: 2008 May 20 8:22 From: CChris <christian.cuvier at a?ricult?re.gouv.fr> Subject: Re: Win32Lib; Timed events ZNorQ wrote: > > CChris wrote: > > > > Now you may have an extra button on the taskbar, and a dummy window listed when > > you press Alt-Tab. > > > > CChris > > Thats weird, because I don't. The only trace of the program is in the taskmanager > list; It doesn't show the form in either system tray nor the task bar, which > is fine since it's the way I want it.. > > ZNorQ Good to know, thanks for input. CChris -= B E G I N =- X-EUFORUM: 21353 Date: 2008 May 20 12:51 From: Kat <KAT12 at co?sa?s.net> Subject: Re: For Kat: Openwatcom OtterDad wrote: > > Kat wrote: > > > Like i said, openwatcom != watcom, and version 3.1 was compiled with watcom, > > not openwatcom. So if i try to fix the bug in 3.1, i need watcom, because who > > knows if it will compile properly, or exibit the same behavior, with openwatcom? > > > > > > Kat > > here's what looks like an old link that still works. hope it helps. > > <a href="http://openwatcom.mirrors.pair.com/11.0c/">http://openwatcom.mirrors.pair.com/11.0c/</a> Wow, thanks, Otterdad! Others besides me were happy to get that url too. Kat -= B E G I N =- X-EUFORUM: 21354 Date: 2008 May 20 13:02 From: Jeremy Cowgar <jeremy at cowga?.com> Subject: Re: Feature suggestion: without keyword= Chris, I think even if this is easy and does not cost in performance, it's a dangerous idea. I'm not a dictator and everything has to go up for vote, but I will be voting a very firm no to this proposal. I think we are making a complex solution to a problem we do not have and I see no good coming out of being able to alter the core language. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21355 Date: 2008 May 20 13:17 From: Arthur Crump <arthur.crump at ntlwo?l?.com> Subject: Re: Short-circuit warning I would like to see the Short-circuit warning disappear However, CChris also mentioned the 'local variable is not used' warning. I find I can lose some of those warnings by putting 'without warning' as the very last line of the program so that earlier warnings are not lost. Arthur Crump CChris wrote: > > Jeremy Cowgar wrote: > > > > Jason Gade wrote: > > > > > > > > > I think it was a valid warning when short-circuiting was new to Euphoria. I > > > guess the question is whether short-circuiting is expected behavior by people > > > new or relatively new to programming? > > > > > > Personally, I say do away with it and make it very clear in the docs that that > > > is how things work. > > > > > > > Short circuiting should be explained in the manual and it should be taught in > > any elementary programming course. I do not think that Euphoria should consider > > everyone a newbie or a dummy. It's a programming language. There are some things > > you should know when programming. Short circuiting is one of those, IMHO. I've > > not seen any language (I'm sure that it may exist) that has given a warning > > about short circuiting. That's almost as bad as: > > > > Warning: if statement may branch if it's condition is true > > > > Um, we know that :-) To me the short-circuit warnings > > galore just mask a real warning. Makes me want to turn off warnings, but I > know that would be bad.</font></i> > > > > Which is what I routinely do, and not only because of this particular warning. > "local variable is not used" occur a lot when you create GUI apps, and these > useless warnings just clutter the output. I also heard that it harms CGI programs, > but didn't play with this. > > Pete Lomax was recommending a with warning= directive to selectively turn warnings > on or off. This would be harmless in terms of performance, and might make it > workable, or even useful, to turn warnings on. > > CChris > > > -- > > Jeremy Cowgar > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> -= B E G I N =- X-EUFORUM: 21356 Date: 2008 May 20 13:43 From: Jeremy Cowgar <jeremy at c?wgar.com> Subject: Re: Developers mailing list The archives are now populated. It took a while. I had submitted bug report to SF.net and they said there is an initial delay. Jim in IRC noticed that the SF archive page now has content... So, anyone who was waiting on that to see what the dev's were talking about can now view the archive: http://sourceforge.net/mailarchive/forum.php?forum_name=rapideuphoria-develop -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21357 Date: 2008 May 20 13:57 From: Jason Gade <jaygade at yah?o.co?> Subject: Re: Short-circuit warning Arthur Crump wrote: > > I would like to see the Short-circuit warning disappear > However, CChris also mentioned the 'local variable is not used' warning. > I find I can lose some of those warnings by putting 'without warning' > as the very last line of the program so that earlier warnings are not lost. > > Arthur Crump Yeah, I was thinking about it. Make "-w strict" a command line option, and "with/without strict" a keyword option? I don't think want multiple levels of warnings like a C compiler but I guess I can see how these two warnings bug a lot of people. Not sure if with or without should be the default, though. Probably with. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21358 Date: 2008 May 20 14:00 From: Bernie Ryan <xotron at blu?frog.c?m> Subject: Re: Short-circuit warning Jeremy Cowgar wrote: > > Is this warning really valid: > > Warning: ../bin/indent.ex:53 - call to matches() might be short-circuited > > Well, maybe valid, but useful? For instance, I specifically made the if statement > to short-circuit, that's the way I want it. I program all the time counting > on short circuits and do not really feel as though I need a warning about it. > I thought short-circuits were a benefit? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=xotron&keywords=short-circuit Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21359 Date: 2008 May 20 14:10 From: Jeremy Cowgar <jeremy at cowg?r.com> Subject: Re: Short-circuit warning Bernie Ryan wrote: > > <a href="http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=xotron&keywords=short-circuit">http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=xotron&keywords=short-circuit</a> > Bernie, I agree 100% with what you said (slightly edited :-)) "I can write CORRECT code that runs with NO ERRORS and when the program completes running it pops a STUPID short-circuit message. Why is it necessary for the user to have to edit his program to prevent this popup window from displaying. It would be fine if this was a compiler but its and interpter and it should not be displaying that message." Further: "If the code is correct it should run without warnings or errors It's not up to the interpter to second guess some users logic." The key that I found in Bernies post that none of us have said in the past is that the code "IS CORRECT". Again, I maintain if we are going to begin telling the interpreter logic as warning messages then we need to add a few more: Warning: if statement may branch if tested condition is true Warning: while loop may repeat more than once Warning: for 1 to 10 will execute multiple times unless an exit is encountered Warning: puts will write something somewhere. Warning: open will try to open a file but may fail if the file does not exist or could not be created Warning: append will append Maybe I'm just making up funny examples, but they are not too far from the short-circuit warning. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21360 Date: 2008 May 20 14:13 From: Michael J. Sabal <m_sabal at y?hoo?com> Subject: Re: Feature suggestion: without keyword= Jeremy Cowgar wrote: > > > Once concern I have is the complexity it may add (I say may because I have not > thought out how it would work) and potential slow down to the parser having > to check if a keyword is allowed in this file or not. > I don't believe the complexity or parsing time would be significant, as long as this statement were limited to the first line(s) of code. Essentially, all you're doing is manipulating the symbol table. If the entry doesn't exist among the built-in symbols, then it can't get an opcode and will cause no conflict. I think this is an incredibly valuable feature that can let me evaluate older contributions easily without having to scan through several thousand lines of code to rename variables that conflict with new language features. > The last concern I have is then a division in how Euphoria programmers program. > I've said many times that consistency in the language is paramount. Starting > to enable/disable parts of the language sounds very dangerous to me. Nobody's disabling anything. Think of it more as a backwards-compatibility switch, reverting the interpreter to an earlier state temporarily. > To me if you have an application that will only run on Eu 3.1 simply because > of one keyword (continue) then you should either update your application or > continue to run it under 3.1. I do not think we should introduce new parsing > routines and possible/probable? slow downs into 4.0 just so someone does not > have to update a variable name that could easily be done w/a simple search/replace. Simple search and replace is rarely so simple, especially in code. By telling people to maintain multiple versions of the interpreter in their environments, it's as bad as Microsoft telling us we have to use .NET v1.1 for feature a, but .NET v3.0 for feature b; and the two aren't compatible. If you want to fork off Eu 4.0, by all means go ahead. But mark my words, nothing will kill this language or community faster than forking versions. -= B E G I N =- X-EUFORUM: 21361 Date: 2008 May 20 14:17 From: Jason Gade <jaygade at ya?oo.com> Subject: Re: Short-circuit warning Well, you /are/ making up silly examples. Short circuiting is not intuitive to people new to programming. Not everyone new to programming will have taken a class on it. Even reading the manual short-circuiting may not appear very clear to people who are new to boolean algebra. The least-surprise assumption is that both conditions are tested and then a decision is made. We only think differently because we're used to it. Now, short-circuiting is very useful. I still suggest "with/without strict" for the short-circuit warning and for the unused local vars warning. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21362 Date: 2008 May 20 14:18 From: Andy Drummond <andy at k?strelt?le.com> Subject: Re: Short-circuit warning Jason Gade wrote: > > Jeremy Cowgar wrote: > > > > Is this warning really valid: > > > > Warning: ../bin/indent.ex:53 - call to matches() might be short-circuited > > > > Well, maybe valid, but useful? For instance, I specifically made the if statement > > to short-circuit, that's the way I want it. I program all the time counting > > on short circuits and do not really feel as though I need a warning about it. > > I thought short-circuits were a benefit? > > > > -- > > Jeremy Cowgar > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > I think it was a valid warning when short-circuiting was new to Euphoria. I > guess the question is whether short-circuiting is expected behavior by people > new or relatively new to programming? > > Personally, I say do away with it and make it very clear in the docs that that > is how things work. > When I first used Euphoria the docs DID describe the short-circuiting process. It was very clear, and made coding easier with things like: <eucode> if atom(res) or length(res)=0 or res[1]='+' then do something end if </eucode> To do that with three nested if statements would be silly. As is the process of hiding side-effects within if statements. An if statement is a condition testing statement, and just because you CAN hide assignments within it hardly makes for clear coding and good practice. So please stick with short-circuiting if statements and recommend that users do actually read the original Euphoria documentation first. > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. -= B E G I N =- X-EUFORUM: 21363 Date: 2008 May 20 14:22 From: Jeremy Cowgar <jeremy at ?owgar.c?m> Subject: Re: Feature suggestion: without keyword= Michael J. Sabal wrote: > > > I don't believe the complexity or parsing time would be significant, as long > as this statement were limited to the first line(s) of code. Essentially, > all you're doing is manipulating the symbol table. If the entry doesn't > exist among the built-in symbols, then it can't get an opcode and will cause > no conflict. > The symbol table is global. You cannot modify the symbol table for just one file (I don't think?). > > Simple search and replace is rarely so simple, especially in code. Hm, I just did a sed in euphoria/include and replaced the variable named fn with replace_fn_var_for_testing. It worked fine, all unit tests still pass. > By telling > people to maintain multiple versions of the interpreter in their environments, > it's as bad as Microsoft telling us we have to use .NET v1.1 for feature a, > > but .NET v3.0 for feature b; and the two aren't compatible. No matter about incompatibilities in syntax, there are going to be other incompatibilities. Removing a keyword is going to fix very little code. For instance, 3.1 code requires a few functions in misc.e that are no longer there. 3.1 code will break regardless if the continue keyword is present. Adding this option is *not* going to enable 3.1 code to run. The only way 3.1 code will run is to have 3.1. If you do not want to maintain multiple installs of Euphoria (which is actually, super simple) then you can bind or translate the 3.1 program and call it independent of any Euphoria install. > If you want to > fork off Eu 4.0, by all means go ahead. But mark my words, nothing will kill > this language or community faster than forking versions. How did we get to forking? That's a terrible idea. My statement was simple: "I do not like this idea, but everything has to come up for a vote. I am simply saying that I will vote a firm no to this proposal." Does that sound like someone who wants to fork Euphoria? But please, the main grunt of this message here is that disabling a keyword *is not* going to enable you to run 3.1 code. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21364 Date: 2008 May 20 14:24 From: Jason Gade <jaygade at y?hoo.c?m> Subject: Re: Short-circuit warning Andy Drummond wrote: > When I first used Euphoria the docs DID describe the short-circuiting process. > It was very clear, and made coding easier with things like: > <eucode> > if atom(res) or length(res)=0 or res[1]='+' then > do something > end if > </eucode> > To do that with three nested if statements would be silly. As is the process > of hiding side-effects within if statements. An if statement is a condition > testing statement, and just because you CAN hide assignments within it hardly > makes for clear coding and good practice. > So please stick with short-circuiting if statements and recommend that users > do actually read the original Euphoria documentation first. No one is talking about doing away with short circuiting. We're talking about whether there should be a warning in the short circuiting case. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21365 Date: 2008 May 20 14:33 From: Andy Drummond <andy at ke?t?eltele.com> Subject: Re: Short-circuit warning Jason Gade wrote: > > Andy Drummond wrote: > > When I first used Euphoria the docs DID describe the short-circuiting process. > > It was very clear, and made coding easier with things like: > > <eucode> > > if atom(res) or length(res)=0 or res[1]='+' then > > do something > > end if > > </eucode> > > To do that with three nested if statements would be silly. As is the process > > of hiding side-effects within if statements. An if statement is a condition > > testing statement, and just because you CAN hide assignments within it hardly > > makes for clear coding and good practice. > > So please stick with short-circuiting if statements and recommend that users > > do actually read the original Euphoria documentation first. > > No one is talking about doing away with short circuiting. We're talking about > whether there should be a warning in the short circuiting case. I misunderstood what was being said then. In which case I agree with the contributer who thought up a whole pile of silly warnings. That could be economised with a single one: warning: This language follows the documentation. I have one concern. Don't break existing code. After that almost any change can be considered and maybe implemented. -= B E G I N =- X-EUFORUM: 21366 Date: 2008 May 20 14:36 From: Jeremy Cowgar <jeremy at ?owg?r.com> Subject: Re: Short-circuit warning Jason Gade wrote: > > No one is talking about doing away with short circuiting. We're talking about > whether there should be a warning in the short circuiting case. > Here is my proposal. Add an option to ecu/ex/exw/exwc called -lint. lint is a common tool name that checks for common mistakes that may pass the parser but may cause problems later. Disable such warnings as Short-circuit. Encourage new programmers to use the -lint option frequently to analyze their code. After a very short amount of time even a new programmer should not need the short circuit warning. Euphoria may be a good first programming language but the percentage of people who are using Euphoria as a first language I would say is low (but that is just a guess, I have no data to back that up except that the questions asked here in EUforum are not newbie type questions). Now, even when a newbie comes or if we have a lot of newbies, they are new and they are going to have to spend much time in the manual to do anything. They need to learn and they will learn or they will quit. You cannot be a new programmer and not spend time in a manual. The fact that you are new probably means you do not understand many things and you will be reading, you will be asking question. The Euphoria users manual has an entire section on Short Circuiting that is quite good. Let's rely on the Users Manual to help new programmers. That's where they should be. Let's not clutter the output of an advanced program with multiple pages of warnings about common newbie mistakes, and that is no joke. I began programming the PgSQL wrapper and I converted all the PgSQL types, error messages and other constants over, than began programming. My first test had 9 pages of warnings. I couldn't see the output of my program even. I could have added a wait_key() but I was doing automated testing on it checking the exit code. I wound up disabling warnings which made me miss a few good ones that could have helped. We should program, see real warnings, we should run exwc -lint on our programs once in a while or as often as we would like. But polluting the output w/so many warnings that real warnings or program output cannot be found is counter productive. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21367 Date: 2008 May 20 14:37 From: Jeremy Cowgar <jeremy at cowga?.co?> Subject: Re: Short-circuit warning Oh, I forgot to paste the link for the manual section on Short Circuiting: http://rapideuphoria.com/refman_2.htm#shortcir -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21368 Date: 2008 May 20 14:43 From: Jason Gade <jaygade at yahoo.??m> Subject: Re: Short-circuit warning Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > No one is talking about doing away with short circuiting. We're talking about > > whether there should be a warning in the short circuiting case. > > > > Here is my proposal. Add an option to ecu/ex/exw/exwc called -lint. lint is > a common tool name that checks for common mistakes that may pass the parser > but may cause problems later. > > Disable such warnings as Short-circuit. Encourage new programmers to use the > -lint option frequently to analyze their code. After a very short amount of > time even a new programmer should not need the short circuit warning. [snip] I could go with that. I've never used lint but I'm familiar with the concept. But I also like with/without strict. I need to refresh my memory of what all the (useful) warnings are. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21369 Date: 2008 May 20 15:21 From: Derek Parnell <ddparnell at big?o?d.com> Subject: Re: Short-circuit warning Andy Drummond wrote: > > When I first used Euphoria the docs DID describe the short-circuiting process. > It was very clear, and made coding easier with things like: > <eucode> > if atom(res) or length(res)=0 or res[1]='+' then > do something > end if > </eucode> > To do that with three nested if statements would be silly. By the way, it used to be that short ciruiting was significantly slower than coding multiple IFs. I don't know if that situation has changed or not. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21370 Date: 2008 May 20 15:26 From: Andy Drummond <andy at kest?eltele.co?> Subject: Re: Short-circuit warning Derek Parnell wrote: > > Andy Drummond wrote: > > > > When I first used Euphoria the docs DID describe the short-circuiting process. > > It was very clear, and made coding easier with things like: > > <eucode> > > if atom(res) or length(res)=0 or res[1]='+' then > > do something > > end if > > </eucode> > > To do that with three nested if statements would be silly. > > By the way, it used to be that short ciruiting was significantly slower than > coding multiple IFs. I don't know if that situation has changed or not. > > I never tested it but I always assumed that it had to be quicker; in effect the short-circuit is just a paraphrase for the multiple-if method. Strange! That's one reason I wanted it kept - though I gather there is no suggestion that it should go. I evidently misunderstood what some people were saying! > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21371 Date: 2008 May 20 15:28 From: Jeremy Cowgar <jeremy at cowg?r?com> Subject: Re: Short-circuit warning Derek Parnell wrote: > > By the way, it used to be that short ciruiting was significantly slower than > coding multiple IFs. I don't know if that situation has changed or not. > > Wow! Why is that? I just tested it, Derek is right. test1.e ------------------------ <eucode> object a, b a = 10 for i = 1 to 100000000 do if atom(a) then if a > 5 then if a = 10 then b = a end if end if end if end for </eucode> test2.e ------------------------ <eucode> object a, b a = 10 for i = 1 to 100000000 do if atom(a) and a > 5 and a = 10 then b = a end if end for </eucode> Is that a valid test? Here are the results: [jeremy@jdesk euphoria]$ time exu test1.e real 0m1.503s user 0m1.503s sys 0m0.000s [jeremy@jdesk euphoria]$ time exu test2.e real 0m2.171s user 0m2.167s sys 0m0.003s -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21372 Date: 2008 May 20 15:52 From: Derek Parnell <ddparnell at bigpond?c?m> Subject: Re: Short-circuit warning > Wow! Why is that? Can you examine the IL code to see what is actualy being generated? -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21373 Date: 2008 May 20 16:04 From: Jeremy Cowgar <jeremy at cowgar.c?m> Subject: Re: Short-circuit warning Derek Parnell wrote: > > > > Wow! Why is that? > > Can you examine the IL code to see what is actualy being generated? > I understand the generated C code better, I realize it's not the same, but look at this... This is for the nested if's: // for i = 1 to 100000000 do { int _1i; _1i = 1; L1: if (_1i > 100000000) goto L2; // if atom(a) then _8 = 1; if (_8 == 0) goto L3; // if a > 5 then // if a = 10 then // b = a _1b = 10; L4: L5: L3: // end for _1i = _1i + 1; goto L1; L2: So, it is optimizing the nested ifs. The code generated for the short-circuting is not at all optimized. It checks each condition. Maybe my test was flawed, in that it allowed optimization in one sense. But, you would think if it could optimize the nested ifs than it could have optimized the single if. I'll come up with a different test and see if the result is the same. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21374 Date: 2008 May 20 16:19 From: Jeremy Cowgar <jeremy at cowga??com> Subject: Re: Short-circuit timing (was warning) Ok, not really analyzed code any more but I did this: <eucode> atom a, b a = 1 for i = 1 to 100000000 do b = rand(1000) if atom(a + b) and a + b > 20 and a + b > 10 then b = a end if end for </eucode> and the other variant of nested ifs. [jeremy@jdesk test3]$ time exu nested.e real 0m5.782s user 0m5.776s sys 0m0.003s [jeremy@jdesk test3]$ time exu short.e real 0m6.439s user 0m6.436s sys 0m0.003s I then translated to C and ran the tests on the C versions: [jeremy at jdesk test3]$ time ./nested real 0m1.836s user 0m1.833s sys 0m0.003s [jeremy at jdesk test3]$ time ./short real 0m1.833s user 0m1.830s sys 0m0.007s So. What does that tell us? #1 translated code is quite a bit faster, as we knew, #2 that the translated code is not taking advantage of the optimizations in the interpreter? Anyone else who has more experiencing analyzing the IL want to run these tests and see what you find? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21375 Date: 2008 May 20 16:31 From: Matt Lewis <matthewwalkerlewis at ?ma?l.com> Subject: Re: Short-circuit warning Derek Parnell wrote: > > > > Wow! Why is that? > > Can you examine the IL code to see what is actualy being generated? The short circuit generates longer IL. There are 7 ops in the short circuit code, but only 4 in the nested case. I think the issue is that the short circuit handles the and/or logic, but you still need the opcodes to do the actual comparisons. The short circuit logic is baked into the nested ifs. I started with this: <eucode> with trace procedure test1() object a, b a = 10 for i = 1 to 100000000 do if atom(a) then if a > 5 then if a = 10 then b = a end if end if end if end for end procedure procedure test2() object a, b a = 10 for i = 1 to 100000000 do if atom(a) and a > 5 and a = 10 then b = a end if end for end procedure test1() test2() </eucode> ...and I get the following IL: SubProgram [_toplevel_:00114] 1: 058 29 # STARTLINE: ss.exw(29)<<test1()>> 3: 027 116 # PROC: [test1:116] 5: 089 # UPDATE_GLOBALS: 6: 058 30 # STARTLINE: ss.exw(30)<<test2()>> 8: 027 125 # PROC: [test2:125] 10: 089 # UPDATE_GLOBALS: 11: 034 # RETURNT: End SubProgram [_toplevel_:00114] SubProgram [test1:00116] 1: 088 116 # ERASE_PRIVATE_NAMES: [test1:116] 3: 089 # UPDATE_GLOBALS: 4: 058 5 # STARTLINE: ss.exw(5)<<a = 10>> 6: 018 119 117 # [LIT 10:119] => [a:117] 9: 087 117 # DISPLAY_VAR: [a:117] 11: 058 7 # STARTLINE: ss.exw(7)<<for i = 1 to 100000000 # do>> 13: 125 121 122 121 116 120 56 # FOR_I: inc [LIT 1:121], lim [LIT 100000000:122], # initial [LIT 1:121], lv [i:120], jmp 0056 20: 087 120 # DISPLAY_VAR: [i:120] 22: 058 8 # STARTLINE: ss.exw(8)<<if atom(a) then>> 24: 067 117 123 # IS_AN_ATOM: [a:117] [_temp_:123] 27: 020 123 49 # IF: [_temp_:123] = 0 goto 0049 30: 058 9 # STARTLINE: ss.exw(9)<<if a > 5 then>> 32: 107 117 124 49 # GREATER_IFW [a:117] > [LIT 5:124] goto 0036 # else goto 0049 36: 058 10 # STARTLINE: ss.exw(10)<<if a = 10 then>> 38: 104 117 119 49 # IFW [a:117] = [LIT 10:119] goto 0042 else # goto 0049 42: 058 11 # STARTLINE: ss.exw(11)<<b = a>> 44: 018 117 118 # [a:117] => [b:118] 47: 087 118 # DISPLAY_VAR: [b:118] 49: 058 15 # STARTLINE: ss.exw(15)<<end for>> 51: 054 20 122 120 121 # ENDFOR_INT_UP1: top 0020, lim: [LIT 100000000:122], # lv [i:120] 56: 090 120 # ERASE_SYMBOL: [i:120] 58: 058 16 # STARTLINE: ss.exw(16)<<end procedure>> 60: 088 116 # ERASE_PRIVATE_NAMES: [test1:116] 62: 029 116 # RETURNP End SubProgram [test1:00116] SubProgram [test2:00125] 1: 088 125 # ERASE_PRIVATE_NAMES: [test2:125] 3: 089 # UPDATE_GLOBALS: 4: 058 20 # STARTLINE: ss.exw(20)<<a = 10>> 6: 018 119 126 # [LIT 10:119] => [a:126] 9: 087 126 # DISPLAY_VAR: [a:126] 11: 058 22 # STARTLINE: ss.exw(22)<<for i = 1 to 100000000 # do>> 13: 125 121 122 121 125 128 63 # FOR_I: inc [LIT 1:121], lim [LIT 100000000:122], # initial [LIT 1:121], lv [i:128], jmp 0063 20: 087 128 # DISPLAY_VAR: [i:128] 22: 058 23 # STARTLINE: ss.exw(23)<<if atom(a) and a # > 5 and a = 10 then>> 24: 067 126 129 # IS_AN_ATOM: [a:126] [_temp_:129] 27: 143 129 129 38 # SC1_AND: [_temp_:129], [_temp_:129], 0038 31: 006 126 124 130 # GREATER: [a:126], [LIT 5:124] => [_temp_:130] 35: 144 130 129 # SC2_AND: [_temp_:130], [_temp_:129] 38: 148 129 130 56 # SC1_AND_IF: [_temp_:129], [_temp_:130], # 0056 42: 003 126 119 129 # EQUALS: [a:126], [LIT 10:119] => [_temp_:129] 46: 020 129 56 # IF: [_temp_:129] = 0 goto 0056 49: 058 24 # STARTLINE: ss.exw(24)<<b = a>> 51: 018 126 127 # [a:126] => [b:127] 54: 087 127 # DISPLAY_VAR: [b:127] 56: 058 26 # STARTLINE: ss.exw(26)<<end for>> 58: 054 20 122 128 121 # ENDFOR_INT_UP1: top 0020, lim: [LIT 100000000:122], # lv [i:128] 63: 090 128 # ERASE_SYMBOL: [i:128] 65: 058 27 # STARTLINE: ss.exw(27)<<end procedure>> 67: 088 125 # ERASE_PRIVATE_NAMES: [test2:125] 69: 029 125 # RETURNP End SubProgram [test2:00125] -= B E G I N =- X-EUFORUM: 21376 Date: 2008 May 20 17:13 From: Bernie Ryan <xotron at ?luefrog.c?m> Subject: EXU mouse ?? Is the gpm mouse being compiled into the exu binary ? Where is EGPM turn on in the source ? Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21377 Date: 2008 May 20 18:36 From: Jeremy Cowgar <jeremy at cowgar??om> Subject: Re: EXU mouse ?? Bernie Ryan wrote: > Is the gpm mouse being compiled into the exu binary ? > Where is EGPM turn on in the source ? Bernie, I was trying to look at the build system to see if there was a flag or not. I see plenty of #ifdef EGPM's in .c source and in globals.e I see constant EGPM=0 I then went to the Release Notes and for version 3.0.0, I see: http://www.rapideuphoria.com/relnotes.htm "Also, the use of libgpm (console mouse support) has been dropped on Linux. (It was never supported by Euphoria on FreeBSD)." In the section with dropping ncurses. Sorry, I don't know what more to do. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21378 Date: 2008 May 20 18:41 From: Bernie Ryan <xotron at ?l?efrog.com> Subject: Re: EXU mouse ?? Jeremy Cowgar wrote: > > Bernie Ryan wrote: > > Is the gpm mouse being compiled into the exu binary ? > > Where is EGPM turn on in the source ? > > Bernie, > > I was trying to look at the build system to see if there was a flag or not. > I see plenty of #ifdef EGPM's in .c source and in globals.e I see constant EGPM=0 > > I then went to the Release Notes and for version 3.0.0, I see: > > <a href="http://www.rapideuphoria.com/relnotes.htm">http://www.rapideuphoria.com/relnotes.htm</a> > > "Also, the use of libgpm (console mouse support) has been dropped on Linux. > (It was never supported by Euphoria on FreeBSD)." > > In the section with dropping ncurses. > > Sorry, I don't know what more to do. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Does that mean that no user can use a mouse with the exu code ? Boy that's going to impress the Linux users. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21379 Date: 2008 May 20 19:03 From: Jeremy Cowgar <jeremy at cow??r.com> Subject: Re: EXU mouse ?? Bernie Ryan wrote: > > Does that mean that no user can use a mouse with the exu code ? > Boy that's going to impress the Linux users. > Not sure, sounds like it. I am not sure why it was removed. It does say that it never worked in FreeBSD. I do not think libgpm works in FreeBSD, so that was not a fault of Euphoria there. I do not know all the decision logic that went into removing it. Maybe someone else knows here on EUforum? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21380 Date: 2008 May 20 19:09 From: Matt Lewis <matthewwalkerlewis at gmai?.c?m> Subject: Re: EXU mouse ?? Bernie Ryan wrote: > > Does that mean that no user can use a mouse with the exu code ? > > Boy that's going to impress the Linux users. I use the mouse all the time with euphoria in linux. Just not in the console. But I don't think I ever use a mouse in the console. Is this really a common thing? Matt -= B E G I N =- X-EUFORUM: 21381 Date: 2008 May 20 19:09 From: Kenneth Rhodes <ken_rhodes30436 at y?hoo?com> Subject: Re: EXU mouse ?? Bernie Ryan wrote: > > Jeremy Cowgar wrote: > > > > Bernie Ryan wrote: > > > Is the gpm mouse being compiled into the exu binary ? > > > Where is EGPM turn on in the source ? > > > > Bernie, > > > > > "Also, the use of libgpm (console mouse support) has been dropped on Linux. > > (It was never supported by Euphoria on FreeBSD)." > > > > In the section with dropping ncurses. > > > > Sorry, I don't know what more to do. > > Bring back ncurses? Just exactly what was/is the great benefit of Euphoria sans ncurses? A little speed increase, a relatively modest size increase? Ed.ex since 3.0 in my experience has been practically unusable under SUSE 10.0 32bit Linux and SUSE 10.3 64bit Linux. I think that for Linux an ed.ex keyboard setup utility program is needed to tune the ed.ex key codes to the user's specific terminal. > > Does that mean that no user can use a mouse with the exu code ? > > Boy that's going to impress the Linux users. > > Bernie You got that right. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21382 Date: 2008 May 20 19:20 From: Bernie Ryan <xotron at ?luefr?g.com> Subject: Re: EXU mouse ?? Matt Lewis wrote: > > Bernie Ryan wrote: > > > > Does that mean that no user can use a mouse with the exu code ? > > > > Boy that's going to impress the Linux users. > > I use the mouse all the time with euphoria in linux. Just not in the console. > > But I don't think I ever use a mouse in the console. Is this really a > common thing? > Matt: I am trying to find a way to use the mouse in frame buffer programming. I have everything working except for access to the mouse. Since Euphoria is not a compiler I have no other way of building or using mouse control into Euphoria code. You are using the mouse because it is built into code other than Euphoria that is compiled. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21383 Date: 2008 May 20 19:26 From: Jeremy Cowgar <jeremy at cowgar?co?> Subject: Re: EXU mouse ?? Matt Lewis wrote: > > But I don't think I ever use a mouse in the console. Is this really a > common thing? > I'm not going to say it's common, but I use it occasionally. Even over SSH. Not in a Euphoria app, because I have not written any real console app in Euphoria. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21384 Date: 2008 May 20 19:50 From: Michael J. Sabal <m_sabal at yahoo.?o?> Subject: Re: EXU mouse ?? Bernie Ryan wrote: > > Does that mean that no user can use a mouse with the exu code ? > > Boy that's going to impress the Linux users. IIRC, the debate revolved around the need for external dependencies. Not every Linux installation includes ncurses or libgpm by default. Since the functionality for both libs is available via .so, the argument went that those users who required either ncurses or gpm functionality could simply tap into the appropriate .so. It also resolved the issue of which VERSION of ncurses and gpm would be supported, since not every distro follows the best practice of linking the versionless file to the versioned file. -= B E G I N =- X-EUFORUM: 21385 Date: 2008 May 20 19:51 From: Jeremy Cowgar <jeremy at cow?ar.com> Subject: Beta test indent.ex? I am wondering if a few people would beta test indent.ex for me? It's a pretty hard program to test because I always code with the same style. I am thinking of adding a few more features, cleaning the code up, adding some command line switches and releasing it as a tool with Euphoria. What it does is indents Euphoria source. Right now it uses tabs as indent characters. One of the options will be tab/space if space how many. Anyway, it should take totally malformed euphoria code (malformed as in not indented correctly) and indent it. Right now it saves the source as input_file.new ... so if you pass it hello.e you will have a new file hello.e.new but be careful please. Usage: exu/exwc indent.ex filea.e fileb.ex filec.exw .... <eucode> if 10 then puts(1, "John\n") puts(1, "Jane\n") end if </eucode> should turn out: <eucode> if 10 then puts(1, "John\n") puts(1, "Jane\n") end if </eucode> I've tested it on my code, the includes in euphoria/include as well as a few in euphoria/source The URL is: http://jeremy.cowgar.com/files/indent.ex Thanks! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21386 Date: 2008 May 20 20:02 From: Jeremy Cowgar <jeremy at ?owg?r.com> Subject: Re: Beta test indent.ex? Sorry guys/gals, I forgot to mention that this requires 4.0. I probably should have posted to the dev list. Once a few more issues are ironed out, we will make a binary distribution of 4.0 alpha. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21387 Date: 2008 May 20 20:12 From: Kenneth Rhodes <ken_rhodes30436 at yahoo?com> Subject: Re: Beta test indent.ex? Jeremy Cowgar wrote: > > Sorry guys/gals, I forgot to mention that this requires 4.0. I probably should > have posted to the dev list. > > Once a few more issues are ironed out, we will make a binary distribution of > 4.0 alpha. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I think you may be reinventing the wheel. Jiri Babor's neat little utility program "tidy.ex" is in the archives: http://www.rapideuphoria.com/tidy.zip Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21388 Date: 2008 May 20 20:32 From: Kenneth Rhodes <ken_rhodes30436 at yah?o?com> Subject: Re: Beta test indent.ex? Kenneth Rhodes wrote: > > Jeremy Cowgar wrote: > > > > Sorry guys/gals, I forgot to mention that this requires 4.0. I probably should > > have posted to the dev list. > > > > Once a few more issues are ironed out, we will make a binary distribution of > > 4.0 alpha. > > > > -- > > Jeremy Cowgar > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > I think you may be reinventing the wheel. Jiri Babor's neat little > utility program "tidy.ex" is in the archives: > > <a href="http://www.rapideuphoria.com/tidy.zip">http://www.rapideuphoria.com/tidy.zip</a> > > Well, now tidy.ex crashes on my system. I used it for several years prior to Euphoria 3.0 with no problem. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21389 Date: 2008 May 20 21:22 From: Jeremy Cowgar <jeremy at c?wgar.co?> Subject: Re: Beta test indent.ex? Kenneth Rhodes wrote: > > > I think you may be reinventing the wheel. Jiri Babor's neat little > > utility program "tidy.ex" is in the archives: > > > > <a href="http://www.rapideuphoria.com/tidy.zip">http://www.rapideuphoria.com/tidy.zip</a> > > > > > Well, now tidy.ex crashes on my system. I used it for several years prior > to Euphoria 3.0 with no problem. Ken, Probably a whole lot easier to resurrect tidy.ex though. I did a search, I'm not sure how I missed that. Thanks for the pointer, I'll look into it. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21390 Date: 2008 May 20 21:46 From: c.k.lester <euphoric at ckl?ster?com> Subject: [OT] About .Net Why is the .Net download > 60MB? What exactly is .Net? -= B E G I N =- X-EUFORUM: 21391 Date: 2008 May 20 21:50 From: Jeremy Cowgar <jeremy at cow?ar.c?m> Subject: Re: Beta test indent.ex? Kenneth Rhodes wrote: > > > Well, now tidy.ex crashes on my system. I used it for several years prior > to Euphoria 3.0 with no problem. > I added "type" to it's definition of what should be indented and that seems to have fixed the problem. I did some comparisons: <eucode> constant name = 10, age = 30 global type abc(object o) ? 0 end type if 10 and 20 and 40 then puts(1, "John\n") elsifhello = 20 def=30 end if function long_name_with_parameters(sequence abc, sequence def) return 0 end function while 10 and 20 and 30 and 40 do puts(1, "Go") end while if 10 and 20 and 30 and 40 then ? 0 end if </eucode> turns into with tidy.ex: <eucode> constant name = 10, age = 30 global type abc(object o) ? 0 end type if 10 and 20 and 40 then puts(1, "John\n") elsifhello = 20 def=30 end if function long_name_with_parameters(sequence abc, sequence def) return 0 end function while 10 and 20 and 30 and 40 do puts(1, "Go") end while if 10 and 20 and 30 and 40 then ? 0 end if </eucode> with indent it turns into: <eucode> constant name = 10, age = 30 global type abc(object o) ? 0 end type if 10 and 20 and 40 then puts(1, "John\n") elsifhello = 20 def=30 end if function long_name_with_parameters(sequence abc, sequence def) return 0 end function while 10 and 20 and 30 and 40 do puts(1, "Go") end while if 10 and 20 and 30 and 40 then ? 0 end if </eucode> Line counts: lines nb-lines nb-nc-lines chars 253 253 235 6510 tidy.ex 142 131 127 3820 indent.ex However, that's not totally valid as I saw in tidy.ex such functions as rtrim, ltrim which I use from the standard library and did not have to implement in my own code. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21392 Date: 2008 May 20 21:53 From: Jeremy Cowgar <jeremy at cowgar.??m> Subject: Re: [OT] About .Net c.k.lester wrote: > > Why is the .Net download > 60MB? What exactly is .Net? Is 60mb for the runtime or the SDK as well? .net is a common language runtime. You know how you write a java program, compile it into .class files and then execute it on any platform with the JRE (java runtime environment) ? .net is the same thing, but for Microsoft. Obviously there are differences internally, I do not mean .net is Java or that one is better than the other. I was making a high level comparison. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21393 Date: 2008 May 20 21:59 From: c.k.lester <euphoric at ck?ester.co?> Subject: Re: [OT] About .Net Jeremy Cowgar wrote: > c.k.lester wrote: > > Why is the .Net download > 60MB? What exactly is .Net? > Is 60mb for the runtime or the SDK as well? I was only wanting the runtime, so I'm guessing just the runtime. > .net is a common language runtime. I thought .Net was a language, like Java is a language. Now that I think about it, C# is the language... I think. :D > You know how you write a java program, compile it into .class files and then > execute it on any platform with the JRE (java runtime environment) ? Okay; how is this better than having a cross-platform language, especially when .Net is just for Windows (right?)? Java goes everywhere, from what I hear. And Euphoria works in multiple platforms. I don't get it. -= B E G I N =- X-EUFORUM: 21394 Date: 2008 May 20 22:13 From: Jeremy Cowgar <jeremy at ?owgar.c?m> Subject: Re: [OT] About .Net c.k.lester wrote: > > > I was only wanting the runtime, so I'm guessing just the runtime. > > > .net is a common language runtime. > > I thought .Net was a language, like Java is a language. Now that I think > about it, C# is the language... I think. :D > .net is what MS calls a CLR, common language runtime. You know how Euphoria will parse code and save IL internally that it then executes? Well, imagine you write out the IL to a file. You can then send that file to 50 different people who have Euphoria installed on Linux, FreeBSD, Windows, DOS, etc... They can then run that. Now, say John comes around and says, Euphoria executes it's IL very fast, wow, that's great but I hate the language. He then writes his own language that outputs the exact same IL. So, Euphoria's interpreter could then execute that IL. Euphoria has no idea it didn't come from Euphoria source. It's the same IL, it could care less. Now, Jane comes along and says the same thing but doesn't like Euphoria or Johns and she creates yet another. That is the CLR concept and .net has many, many languages that compile to it's "IL". Not just by Microsoft but other developers, open source authors, etc... > > You know how you write a java program, compile it into .class files and then > > execute it on any platform with the JRE (java runtime environment) ? > > Okay; how is this better than having a cross-platform language, especially > when .Net is just for Windows (right?)? Java goes everywhere, from what I > hear. And Euphoria works in multiple platforms. > > I don't get it. There is the Mono project that is sponsored I think by Novel? It is used big time in Gnome. It is a .net runtime for Linux/FreeBSD and I may be mistaken, but is it ported to Mac OSX? Anyway, the compatability between Mono and Windows .NET is getting better but there are many parts of .NET's Windows API that are closed and will never be implemented in Mono, specifically, almost anything to do with Windows. GUI, Windows DLLs and such. Mono wraps GTK and allows you to write GTK apps on both Linux and Windows, but anyone who has used GTK on Windows knows its a memory hog and although it's getting much, much better, it still has it's issues on Windows. So... how is it better? Um, I use Euphoria! That's how much better I think it is :-D -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21395 Date: 2008 May 20 22:17 From: Kenneth Rhodes <ken_rhodes30436 at y?h?o.com> Subject: enhanced lines.ex Chris, http://www.rapideuphoria.com/l2.ex Works like a charm for me. I'd suggest that the usage directions reported on the contributions listed be included with the standard directions at the top of the actual file. I also suggest, if you don't mind, that your enhanced lines.ex code replace the lines.ex code currently included in the Euphoria distributions. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21396 Date: 2008 May 20 22:24 From: gshingles <gshingles at ??ail.com> Subject: Re: Short-circuit warning Jeremy Cowgar wrote: > > Oh, I forgot to paste the link for the manual section on Short Circuiting: > > <a href="http://rapideuphoria.com/refman_2.htm#shortcir">http://rapideuphoria.com/refman_2.htm#shortcir</a> Thanks for that Jeremy. It contains the line "Older versions (pre-2.1) of Euphoria did not use short-circuit evaluation..." which perhaps explains the existence of the warning. In which case I would say the warning is redundant now, two major versions later. Gary -= B E G I N =- X-EUFORUM: 21397 Date: 2008 May 20 22:51 From: Matt Lewis <matthewwalkerlewis at gm??l.com> Subject: Re: EXU mouse ?? Bernie Ryan wrote: > > I am trying to find a way to use the mouse in frame buffer programming. > I have everything working except for access to the mouse. > Since Euphoria is not a compiler I have no other way of building or using > mouse control into Euphoria code. > You are using the mouse because it is built into code other than Euphoria > that is compiled. Yes, I know how I'm using the mouse. Have you tried wrapping libgpm? Matt -= B E G I N =- X-EUFORUM: 21398 Date: 2008 May 20 22:55 From: Matt Lewis <matthewwalkerlewis at gma?l.c?m> Subject: Re: [OT] About .Net c.k.lester wrote: > > Jeremy Cowgar wrote: > > c.k.lester wrote: > > > Why is the .Net download > 60MB? What exactly is .Net? > > Is 60mb for the runtime or the SDK as well? > > I was only wanting the runtime, so I'm guessing just the runtime. > > > .net is a common language runtime. > > I thought .Net was a language, like Java is a language. Now that I think > about it, C# is the language... I think. :D There are many languages. They get compiled to IL code. There's even a .NET version of ooeu. > > You know how you write a java program, compile it into .class files and then > > execute it on any platform with the JRE (java runtime environment) ? > > Okay; how is this better than having a cross-platform language, especially > when .Net is just for Windows (right?)? Java goes everywhere, from what I > hear. And Euphoria works in multiple platforms. There are gotchas with java. There's also Mono, which is basically a cross platform .NET implementation. It may be better if you're working with a 100% MS stack. But if you want cross platform, I'd say that Java is better. Matt -= B E G I N =- X-EUFORUM: 21399 Date: 2008 May 20 22:58 From: Jeremy Cowgar <jeremy at ?owgar?com> Subject: Re: enhanced lines.ex Kenneth Rhodes wrote: > > I also suggest, if you don't mind, that your > enhanced lines.ex code replace the lines.ex > code currently included in the Euphoria distributions. > Already done :-) I did it w/Chris's permission yesterday. It was indeed a nice addition to the lines.ex program. Thanks Chris, publicly this time :-) -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21400 Date: 2008 May 20 23:23 From: Bernie Ryan <xotron at ?luef?og.com> Subject: Re: EXU mouse ?? Matt Lewis wrote: > > Bernie Ryan wrote: > > > > I am trying to find a way to use the mouse in frame buffer programming. > > I have everything working except for access to the mouse. > > Since Euphoria is not a compiler I have no other way of building or using > > mouse control into Euphoria code. > > You are using the mouse because it is built into code other than Euphoria > > that is compiled. > > Yes, I know how I'm using the mouse. > > Have you tried wrapping libgpm? > Matt: What do I do about all the externs in GPM.H Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21401 Date: 2008 May 20 23:25 From: Bernie Ryan <xotron at blu?frog.?om> Subject: Re: [OT] About .Net .Net sounds like a re-run of Microsoft's old Microsoft P-Code Technology reborn. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21402 Date: 2008 May 20 23:45 From: Matt Lewis <matthewwalkerlewis at ?mail?com> Subject: Re: EXU mouse ?? Bernie Ryan wrote: > > What do I do about all the externs in GPM.H I'm not sure I understand the question. I don't really know anything about gpm itself. What are they? Functions? Variables? What do they do? Matt -= B E G I N =- X-EUFORUM: 21403 Date: 2008 May 20 23:50 From: Bernie Ryan <xotron at blu?f?og.com> Subject: Re: EXU mouse ?? Matt Lewis wrote: > > Bernie Ryan wrote: > > > > What do I do about all the externs in GPM.H > > I'm not sure I understand the question. I don't really know anything about > gpm itself. What are they? Functions? Variables? What do they do? > Matt: /*....................................... Global variables for the client */ extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; extern int gpm_zerobased; extern int gpm_visiblepointer; extern int gpm_mx, gpm_my; /* max x and y to fit margins */ extern struct timeval gpm_timeout; extern unsigned char _gpm_buf[]; extern unsigned short * _gpm_arg; extern Gpm_Handler *gpm_handler; extern void *gpm_data; extern Gpm_Handler *gpm_roi_handler; extern void *gpm_roi_data; extern Gpm_Roi *gpm_roi; extern Gpm_Roi *gpm_current_roi; Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21404 Date: 2008 May 21 0:09 From: Kenneth Rhodes <ken_rhodes30436 at y?hoo.?om> Subject: utility program suggestions I made this pitch to Robert Craig once I believe -thought I'd give it another try. Jiri Babor has written several wonderful utility programs which I think would make worthwhile additions to the those already included in /bin/. http://www.rapideuphoria.com/tidy.zip Well, actually Jeremy's amended version. From Jiri's Euphoria page. I suppose his permission might be needed to add these utilities: http://homepages.paradise.net.nz/~jbabor/eu/text/replace.zip command line utility program replaces text in several different files This routine might be a useful addition to 4.0: http://homepages.paradise.net.nz/~jbabor/eu/misc/bfind.zip Binary search of a sorted sequence. Gabriel Boehme code. Earlier Joe Otto's routine is almost identical. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21405 Date: 2008 May 21 0:09 From: Matt Lewis <matthewwalkerlewis at ?mail?com> Subject: Re: EXU mouse ?? Bernie Ryan wrote: > > Matt Lewis wrote: > > > > Bernie Ryan wrote: > > > > > > What do I do about all the externs in GPM.H > > > > I'm not sure I understand the question. I don't really know anything about > > gpm itself. What are they? Functions? Variables? What do they do? > > > Matt: > > /*....................................... Global variables for the client */ > > extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; > > extern int gpm_zerobased; > extern int gpm_visiblepointer; > extern int gpm_mx, gpm_my; /* max x and y to fit margins */ > extern struct timeval gpm_timeout; > > extern unsigned char _gpm_buf[]; > extern unsigned short * _gpm_arg; > > extern Gpm_Handler *gpm_handler; > extern void *gpm_data; > > extern Gpm_Handler *gpm_roi_handler; > extern void *gpm_roi_data; > > extern Gpm_Roi *gpm_roi; > extern Gpm_Roi *gpm_current_roi; > I guess the short answer is: define_c_var Matt -= B E G I N =- X-EUFORUM: 21406 Date: 2008 May 21 0:22 From: Kenneth Rhodes <ken_rhodes30436 at yahoo.c?m> Subject: Re: utility program suggestions Jeremy and all: This a suggestion for a global function extractor/ keyword syntax file generator. Although, the code for this already exists in several different Euphoria editors, having a small command line utility which generates a syntax file would be useful: 1. The output could be used to update existing syntax files as euphoria grows. It follows that the syntax files could also be used to implement context sensitive help systems which are easily kept up-to-date. 2. The output or the utility itself could be extended to create syntax files for non-euphoria editors such as Kate, Jedit, vim, etc. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21407 Date: 2008 May 21 1:36 From: Kenneth Rhodes <ken_rhodes30436 at y?h?o.com> Subject: wxEditor suggestions Hi Greg, I thought I'd make some comments and suggestions regarding your wxEditor project. I realize my comments might be naive, but I useless comments can be easily ignored and perhaps something will be useful. This is kind of a wish list: 1. Color Syntax / Context sensitive help. please consider my previous post regarding a stand alone small utility program to generate syntax files which can also be used for context sensitive help: http://www.openeuphoria.org/EUforum/m21406.html If your editor uses an external syntax file such as ed.ex's keyword.e, then only the external file needs to be updated as Euphoria grows. An external utility program which generates syntax files might also be used to provide syntax/context sensitive help for 3rd party libraries. Consider Jueren Luethje's euhthelp code: http://www.rapideuphoria.com/euhthelp_1.3.tar 2. Please consider using a function hotkey, such as F11, for context sensitive help. 3. Easy access to Utility programs such as lines.ex, guru.ex, search.ex, where.ex, tidy.ex, etc. via menus and hotkeys without having to shell out to the console or terminal editor - for example: guru.ex can be used as an extended context sensitive help for current "words" which are not specifically supported in syntax/context sensitive help files. The guru.out file can be automatically opened in a new window. I appreciate your efforts in developing wxEditor. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21408 Date: 2008 May 21 1:50 From: Greg Haberek <ghaberek at gm??l.com> Subject: Re: wxEditor suggestions Kenneth Rhodes wrote: > > 1. Color Syntax / Context sensitive help. > please consider my previous post regarding a stand alone small > utility program to generate syntax files which can also be used > for context sensitive help: > <a href="http://www.openeuphoria.org/EUforum/m21406.html">http://www.openeuphoria.org/EUforum/m21406.html</a> > > If your editor uses an external syntax file such as ed.ex's keyword.e, > then only the external file needs to be updated as Euphoria grows. Trust me, color syntax highlighting is my #1 priority (along with proper 4-space tabbing, I can't stand 8-space tabs). I'm basically rolling my own, and there's *a lot* to even a basic editor. I hope to make it modular so I can load in any language I want. > An external utility program which generates syntax files might also > be used to provide syntax/context sensitive help for 3rd party > libraries. > > Consider Jueren Luethje's euhthelp code: > <a href="http://www.rapideuphoria.com/euhthelp_1.3.tar">http://www.rapideuphoria.com/euhthelp_1.3.tar</a> I'll have a look at it. I would like to have some sort of background processing setup where files that are included are scanned, and the highlighting is updated accordingly. > 2. Please consider using a function hotkey, such as F11, > for context sensitive help. This is a great idea. I think one thing that may help is if the Reference Manual came in EDS format. That way I could "look up" a keyword in the table and display the help accordingly. > 3. Easy access to Utility programs such as lines.ex, guru.ex, search.ex, > where.ex, tidy.ex, etc. via menus and hotkeys without > having to shell out to the console or terminal editor - for example: > guru.ex can be used as an extended context sensitive help for current > "words" which are not specifically supported in syntax/context sensitive > help files. The guru.out file can be automatically opened in a new window. This is a good idea, but perhaps too specific. I think I might add some type of user-customizable menu wherein the user can add any type of custom menu item or toolbar button they want. I also plan on adding an automatic "reformat" option to clean up code. > I appreciate your efforts in developing wxEditor. And I appreciate your input! You and I are both full-time Linux users, and we deserve a great Euphoria editor! Once I get a more proper version going, I'll upload the code into the SVN so I can add other developers to the project. Feel free to hop aboard! :) -Greg -= B E G I N =- X-EUFORUM: 21409 Date: 2008 May 21 1:51 From: Jeremy Cowgar <jeremy at cowgar?co?> Subject: Re: utility program suggestions Kenneth Rhodes wrote: > > I made this pitch to Robert Craig once I believe -thought I'd > give it another try. Jiri Babor has written several wonderful > utility programs which I think would make worthwhile additions > to the those already included in /bin/. > I think utilities that have a direct relation to helping the Euphoria programmer is good, however, we also need to think about how much we are adding to Euphoria for the developers to continue to maintain. If we adopt the code we are really saying we will continue to maintain it. I think there needs to be a balance. I am not sure yet, what that balance may be. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21410 Date: 2008 May 21 1:53 From: Jeremy Cowgar <jeremy at cowga??com> Subject: Re: utility program suggestions Kenneth Rhodes wrote: > > Jeremy and all: > > This a suggestion for a global function extractor/ keyword syntax file > generator. Although, the code for this already exists in several > different Euphoria editors, having a small command line utility which > generates a syntax file would be useful: > I'm not really sure what you mean. We currently maintain bin/keywords.e which contains internals. in two global sequences that any program can use. Can you expand a bit on what you suggesting? (me might just be tired and not understanding anyone :-/) -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21411 Date: 2008 May 21 2:01 From: Jason Gade <jaygade at yaho?.c?m> Subject: Re: utility program suggestions Jeremy Cowgar wrote: > > Kenneth Rhodes wrote: > > > > Jeremy and all: > > > > This a suggestion for a global function extractor/ keyword syntax file > > generator. Although, the code for this already exists in several > > different Euphoria editors, having a small command line utility which > > generates a syntax file would be useful: > > > > I'm not really sure what you mean. We currently maintain bin/keywords.e which > contains internals. in two global sequences that any program can use. > > Can you expand a bit on what you suggesting? (me might just be tired and not > understanding anyone :-/) > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I think something like ctags (although I've never really used that) may be what he's talking about? http://en.wikipedia.org/wiki/Ctags I know that I've thought about doing that. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21412 Date: 2008 May 21 2:05 From: Jeremy Cowgar <jeremy at cowga??com> Subject: Re: utility program suggestions Jason Gade wrote: > > > I think something like ctags (although I've never really used that) may be what > he's talking about? > > <a href="http://en.wikipedia.org/wiki/Ctags">http://en.wikipedia.org/wiki/Ctags</a> > > I know that I've thought about doing that. Many editors support ctags already. I wonder if we should submit a patch to the ctags project so that it would then know about Euphoria source. That would probably be a better route than creating our own ctags. Exposure and instant support for all sorts of editors. There are a few other programs we should write Euphoria parsers for such as a few generic code2html programs and enscript (code to ps/pdf). I am sure there are others that are widely accepted that would probably be pretty easy to do. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21413 Date: 2008 May 21 3:56 From: Kenneth Rhodes <ken_rhodes30436 at yahoo.??m> Subject: Re: utility program suggestions Jeremy Cowgar wrote: > > Kenneth Rhodes wrote: > > > > Jeremy and all: > > > > This a suggestion for a global function extractor/ keyword syntax file > > generator. Although, the code for this already exists in several > > different Euphoria editors, having a small command line utility which > > generates a syntax file would be useful: > > > > I'm not really sure what you mean. We currently maintain bin/keywords.e which > contains internals. in two global sequences that any program can use. > > Can you expand a bit on what you suggesting? (me might just be tired and not > understanding anyone :-/) > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I wasn't clear. Keywords.e contains only two small sequences-- "keywords" "builtins". These two sequences together are only a small fraction of the total stock Euphoria "library" of commands available in the various *.e files located in the include directory. In order to support the additional Euphoria commands add a sequence-- lets call it "library" or "externals" and add a color. I'm suggesting that a utility program be used to extract the global keywords from the various *.e files, append them together in a sequence, sort them and you have a sequence, "library" which gives you color syntax support for the total Euphoria package of commands. Now all those global keywords could be extracted manually. Euphoria is a small language. Lets consider adding support for wxEuphoria-- probably arround 500 global keywords. EuGTK? There's some pretty big libraries out there. But wait, there is more :-) Color syntax support in an editor is nice, but the real power comes from using the color as a que to let you know that you have true context sensitive help-- the color highlighted current word is passed together with a htm "tag" to a browser. See Juergen Leuthje's EuHthelp: http://www.rapideuphoria.com/euhthelp_1.3.tar A global extractor tool would make it easy to for a Euphoria editor to support virtually any third party library. It also could be used as a starting point for a utility program to generate a syntax support for Euphoria syntax support files for non Euphoria editors such as Kate, Jedit, Vim. These editors have Euphoria color syntax support - but they would be much easier to keep up to date with a utility program to generate current files to support Euphoria and its third party libraries. Hope this helps. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21414 Date: 2008 May 21 4:09 From: Jason Gade <jaygade at yah??.com> Subject: Re: utility program suggestions You know, both Jeremy and I have entries in the archive for Vim. (Although mine isn't actually by me -- it's by Travis Beaty). http://www.rapideuphoria.com/vim-euphoria.zip http://www.rapideuphoria.com/euphoria-vim.zip They both contain breakdowns for what you are proposing, but they should probably be updated. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21415 Date: 2008 May 21 5:17 From: Kenneth Rhodes <ken_rhodes30436 at ?ahoo?com> Subject: Re: wxEditor suggestions Greg Haberek wrote: > > > 2. Please consider using a function hotkey, such as F11, > > for context sensitive help. > > This is a great idea. I think one thing that may help is if the Reference Manual > came in EDS format. That way I could "look up" a keyword in the table and display > the help accordingly. No, no... Juergen has done all that for you. <eucode> include EuHTHelp.e euhelp(sequence browser, sequence word) </eucode> All you have to do is pass the current word to Juergen's routine. I had written a lot of circuitous code which accomplished this in my version of ed.ex- it worked, but I nearly flipped when I saw Juergen's code. I ripped all my code out and put in two lines of Juergen's code. Moreover. If you use EuHTHelp.e, it can easily be extended to support other third party libraries. Hang in there! Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21416 Date: 2008 May 21 5:25 From: Kenneth Rhodes <ken_rhodes30436 at yaho?.com> Subject: Re: utility program suggestions Jason Gade wrote: > > You know, both Jeremy and I have entries in the archive for Vim. (Although mine > isn't actually by me -- it's by Travis Beaty). > <a href="http://www.rapideuphoria.com/vim-euphoria.zip">http://www.rapideuphoria.com/vim-euphoria.zip</a> > <a href="http://www.rapideuphoria.com/euphoria-vim.zip">http://www.rapideuphoria.com/euphoria-vim.zip</a> > > They both contain breakdowns for what you are proposing, but they should probably > be >>> updated <<<<. > > j. Exactly. My vision is to have a utility program which not only update Euphoria core language support, but also generate context sensitive help support files for Euphoria and "external" third party libraries and at least color syntax support for non-euphoria editor's such as Kate, Vim, and Jed - further context sensitive help support for external libraries could be made available for these editors thru Juergen's EuHTHelp.ex command line program. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21417 Date: 2008 May 21 5:48 From: Kenneth Rhodes <ken_rhodes30436 at yaho??com> Subject: Re: utility program suggestions Jeremy Cowgar wrote: > > Kenneth Rhodes wrote: > > > > I made this pitch to Robert Craig once I believe -thought I'd > > give it another try. Jiri Babor has written several wonderful > > utility programs which I think would make worthwhile additions > > to the those already included in /bin/. > > > > I think utilities that have a direct relation to helping the Euphoria programmer > is good, however, we also need to think about how much we are adding to Euphoria > for the developers to continue to maintain. If we adopt the code we are really > saying we will continue to maintain it. > > I think there needs to be a balance. I am not sure yet, what that balance may > be. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Point taken. One question: How long did it take you to "maintain" Jiri's tidy.ex to the point where you dropped your indent project? How much time would you have saved had tidy.ex been there in the bin directory? One comment: Replace.ex has all of 88 lines of code- take a look at Jiri's code; the man is a Euphoria programming super star! ----------------------------------------------- I don't really mean to belabor the point. I've referenced Jiri's utility programs several times in response to inquiries in this forum. I can keep doing it. :) Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21418 Date: 2008 May 21 8:36 From: ChrisBurch2 <crylex at ?reeuk.co.?k> Subject: Re: enhanced lines.ex Kenneth Rhodes wrote: > > Chris, > > <a href="http://www.rapideuphoria.com/l2.ex">http://www.rapideuphoria.com/l2.ex</a> > > Works like a charm for me. I'd suggest that > the usage directions reported on the contributions > listed be included with the standard directions > at the top of the actual file. > > I also suggest, if you don't mind, that your > enhanced lines.ex code replace the lines.ex > code currently included in the Euphoria distributions. > > Ken Rhodes > Folding at Home: <a href="http://folding.stanford.edu/">http://folding.stanford.edu/</a> > 100% MicroSoft Free > SuSE Linux 10.3 > No AdWare, SpyWare, or Viruses! > Life is Good, :-) Hi Thanks. Working on it handling relative includes (..\..\my_includes) and when I get around to compilng / installing a binary of 4.0, the euinc.conf file too. Chris -= B E G I N =- X-EUFORUM: 21419 Date: 2008 May 21 9:17 From: Kenneth Rhodes <ken_rhodes30436 at yaho?.?om> Subject: Re: compiling translated files on Linux AMD64 Success! In order to use the -m32 switch, the 32bit version of gcc must be installed in addition to the native gcc 64 bit compiler. ./ecu ed.ex -- generated the *.c files and emake edit the emake file to include the -m32 switch: echo compiling with GNU C echo main-.c gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer main-.c echo ed.c gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer ed.c echo ed_0.c gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer ed_0.c echo ed_1.c gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer ed_1.c echo graphics.c gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer graphics.c echo get.c gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer get.c echo file.c gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer file.c echo wildcard.c gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer wildcard.c echo dll.c gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer dll.c echo syncolor.c gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer syncolor.c echo init-.c gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer init-.c echo linking gcc -m32 ed.o main-.o ed_0.o ed_1.o graphics.o get.o file.o wildcard.o dll.o syncolor.o init-.o /home/ken/euphoria/bin/ecu.a -lm -ldl -oed rm -f *.o echo you can now execute: ./ed rm main-.c rm main-.h rm init-.c rm ed.c rm ed_0.c rm ed_1.c rm graphics.c rm get.c Everything is sooooooooo simple-- in retrospect. I'm not sure what would happen if the -m32 switch was added to the emake generation code. If under a 32bit system the switch is just ignored, then we've got a genuine kludge, eh? Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21420 Date: 2008 May 21 10:12 From: CChris <christian.cuvier at ag?iculture.g?uv.fr> Subject: Re: can_add() and linear() CChris wrote: > > CChris wrote: > > > > I'd suggest two additions to sequence.e, which I hope will appear pretty natural: > > > > <eucode> > > global function can_add(object a,object b) > > -- Determines whether a+b would crash the interpreter. > > -- Returns 1 if addition possible, else 0. > > if atom(a) or atom(b) then > > return 1 > > end if > > if length(a)!=length(b) then > > return 0 > > end if > > for i=1 to length(a) do > > if not can_add(a[i],b[i]) then > > return 0 > > end if > > end for > > return 1 > > end function > > > > global funtion linear(object start,object increment,integer count) > > -- Returns 0 on failure, or a sequence of count objects. > > -- The first one is start, and the whole sequence is a linear progrssion using increment. > > sequence result > > > > if count<0 or not can_add(start,increment) then > > return 0 > > end if > > result=repeat(start,count) > > for i=2 to count do > > start+=increment > > result[i]=start > > end for > > return result > > end function > > </eucode> > > > > The latter might go to math.e just as well, but for its dependency on can_add(). > > > > CChris > > More suggestions: > > global function project(sequence vectors,sequence coords) -- currently in sets.e > -- vectors is a rectangular matrix > -- coords is a list of coordinate lists > -- returns a sequence the length of vectors. Each element is a sequence, > -- the length of coords, of sequences. Each inner sequence is made of the > -- coordinates of the vector for the given coord list. > sequence result,current_vector,coord_set,result_item,projection > integer current_index > > result=vectors > for i=1 to length(vectors) do > result_item=coords > current_vector=vectors[i] > for j=1 to length(coords) do > coord_set=coords[j] > projection=coord_set > for k=1 to length(coords_set) do > current_index=coords[k] > if current_index<1 or current_index>length(current_vector) then > crash("Invalid coordinate %d in set %d for vector #%d",{coords[k],j,i}) > end if > projection[k]=current_vector[current_index] > end for > result_item[j]=projection > end for > result[i]=result_item > end for > return result > end function > </eucode> > > fetch() and store() are useful too - they deal with variable length indexing > of sequences. The implementation is close to J. Babor's: > <eucode> > global function fetch(sequence s,sequence indexes) > for i=1 to length(indexes)-1 do > s=s[indexes[i]] > end for > return s[indexes[$]] > end function > > function store-(sequence s,sequence indexes,integer index,object x) > integer n > > n=indexes[index] > if index=length(indexes) then > s[n]=x > else > s[n]=store_(s[n],indexes,index+1,x) > end if > return s > end function > > global function store(sequence s,sequence indexes,object x) > return store_(s,indexes,1,x) > end function > </eucode> > > For the sake of simplicity, I didn't consider using slices. A complete version is to be found in <a href="http://oedoc.free.fr/Fichiers/ESL/seqops.zip,">http://oedoc.free.fr/Fichiers/ESL/seqops.zip,</a> > which agrees with the OpenEu extended index specification. > > CChris There hasn't been a single comment regarding this post for the past 8 days. May I assume that I can go ahead with the additions/moves? CChris -= B E G I N =- X-EUFORUM: 21421 Date: 2008 May 21 10:48 From: CChris <christian.cuvier at ag?iculture?gouv.fr> Subject: stdlib: Binary search function This has been an oft requested functionality, and was in principle agreed, even by Rob: http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=&keywords=binary_find http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=&keywords=bfind Some implementations have been mentioned already (G. Boehme, J. Babor,...). Now, the devil is in the details. What shall the function do? * accept only strictly increasing sequences * accept only strictly monotoni sequences * accept loosely monotonic sequences (with possible duplicates) * only cope with <any selection above>, not checking I think everyone agrees it should return like db_find_key(), ie n>0 when found, n<0 with ordered insertion resulting in item lading at position -n. And another point which wasn't agreed upon: would this go to sort.e or sequence.e? The version I use in sets.e has a from and to extra parameters. They could be easily defaulted. Monoony could be passed as a parameter too, depending on the option chosen. CChris -= B E G I N =- X-EUFORUM: 21422 Date: 2008 May 21 11:12 From: CChris <christian.cuvier at agricult?re.gouv.?r> Subject: Re: Current implementation of exp() is faulty. Matt Lewis wrote: > > Jason Gade wrote: > > > > Here's an excerpt from Matt's scientific.e documentation: > > > <snip> > > Yes. Also, it's only currently used for scientific notation encountered. > It should be fairly easy to make it parse all floating point, though this > would slow things down a little. Not sure where the sweet spot would > be (i.e., when do we lose precision in the current "naive" algorithm). > > Matt Precision is lost when you add roundoff errors together. If, when parsing, you add 16 numbers of the form n.0E-p, none of them is exactly representable, so you get 16 times the maximum error, on bad days. I have coded an alternative which performs arithmetic on the digits of the string being parsed, so as to never combine inexact results. It supports an exact mode (givve this many bits of precision) and an auto-round mode (give as much precision as one can get with the available digits). I'll benchmark it against scientific.e - it's probably slower and more accurate - and post the findings. A few other things to do these days... CChris -= B E G I N =- X-EUFORUM: 21423 Date: 2008 May 21 11:23 From: Kenneth Rhodes <ken_rhodes30436 at ?aho?.com> Subject: Re: stdlib: Binary search function CChris wrote: > > > This has been an oft requested functionality, and was in principle agreed, even > by Rob: > <a href="http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=&keywords=binary_find">http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=&keywords=binary_find</a> > <a href="http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=&keywords=bfind">http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=&keywords=bfind</a> > > Some implementations have been mentioned already (G. Boehme, J. Babor,...). > > Now, the devil is in the details. What shall the function do? > * accept only strictly increasing sequences > * accept only strictly monotoni sequences > * accept loosely monotonic sequences (with possible duplicates) > * only cope with <any selection above>, not checking > > I think everyone agrees it should return like db_find_key(), ie n>0 when found, > n<0 with ordered insertion resulting in item lading at position -n. > > And another point which wasn't agreed upon: would this go to sort.e or sequence.e? > > The version I use in sets.e has a from and to extra parameters. They could be > easily defaulted. Monoony could be passed as a parameter too, depending on the > option chosen. > > CChris Well, if the Devil is in the details, lets see the details. Babor, Boehme, and Otto's bfind is short sweet and simple. <eucode> global function bfind(object x, sequence s) -- does a binary search on a sorted sequence -- returns index location if found, 0 if not -- assumes that sequence s has been sorted prior to this call -- Gabriel Boehme's code -- Earlier Joe Otto's routine is almost identical. integer lo, hi, mid, c lo = 1 hi = length(s) while lo <= hi do mid = floor((lo + hi) / 2) c = compare(x, s[mid]) if c < 0 then -- x < s[mid] hi = mid - 1 elsif c > 0 then -- x > s[mid] lo = mid + 1 else -- x = s[mid] return mid end if end while return 0 end function </eucode> It sounds as though your binary find may be a bit of a swiss army knife approach. Please post your bfind code from sets.e and let us play arround with it-- But if there are many details, there might be more Devils! Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21424 Date: 2008 May 21 13:04 From: egg <egege at ramble??ru> Subject: Re: stdlib: Binary search function integer found --flag function findPos(sequence s, sequence ss) --bynary search in a sorted array of strings --it returns position of found string or position where it could be iserted --which one is found we know by the flag integer lo,hi,mid,c lo = 1 hi = length(ss) c = compare(s,ss[1]) if c<0 then found = 0 return 1 elsif not c then found = 1 return 1 end if c = compare(s,ss[hi]) if c>0 then found = 0 return hi+1 elsif not c then found = 1 return hi end if while 1 do w = hi - lo if not w then found = 0 return hi elsif w<10 then lo += 1 while 1 do c = compare(s,ss[lo]) if not c then found = 1 return lo elsif c<0 then found = 0 return lo else lo += 1 end if end while else --(hi-lo)>=10 mid = floor((lo + hi) / 2) c = compare(s,ss[mid]) if c<0 then -- x < ss[mid] hi = mid elsif c>0 then -- x > ss[mid] lo = mid else -- x = ss[mid] found = 1 return mid end if end if end while end function --findPos -= B E G I N =- X-EUFORUM: 21425 Date: 2008 May 21 13:24 From: CChris <christian.cuvier at agri?ul?ure.gouv.fr> Subject: Re: stdlib: Binary search function Kenneth Rhodes wrote: > > CChris wrote: > > > > > > This has been an oft requested functionality, and was in principle agreed, even > > by Rob: > > <a href="http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=&keywords=binary_find">http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=&keywords=binary_find</a> > > <a href="http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=&keywords=bfind">http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=&keywords=bfind</a> > > > > Some implementations have been mentioned already (G. Boehme, J. Babor,...). > > > > Now, the devil is in the details. What shall the function do? > > * accept only strictly increasing sequences > > * accept only strictly monotoni sequences > > * accept loosely monotonic sequences (with possible duplicates) > > * only cope with <any selection above>, not checking > > > > I think everyone agrees it should return like db_find_key(), ie n>0 when found, > > n<0 with ordered insertion resulting in item lading at position -n. > > > > And another point which wasn't agreed upon: would this go to sort.e or sequence.e? > > > > The version I use in sets.e has a from and to extra parameters. They could be > > easily defaulted. Monoony could be passed as a parameter too, depending on the > > option chosen. > > > > CChris > > Well, if the Devil is in the details, lets see the details. > Babor, Boehme, and Otto's bfind is short sweet and simple. > > > <eucode> > global function bfind(object x, sequence s) > -- does a binary search on a sorted sequence > -- returns index location if found, 0 if not > -- assumes that sequence s has been sorted prior to this call > -- Gabriel Boehme's code > -- Earlier Joe Otto's routine is almost identical. > integer lo, hi, mid, c > lo = 1 > hi = length(s) > > while lo <= hi do > mid = floor((lo + hi) / 2) > c = compare(x, s[mid]) > if c < 0 then -- x < s[mid] > hi = mid - 1 > elsif c > 0 then -- x > s[mid] > lo = mid + 1 > else -- x = s[mid] > return mid > end if > end while > > return 0 > end function > </eucode> > > It sounds as though your binary find may be a bit of > a swiss army knife approach. Please post your bfind > code from sets.e and let us play arround with it-- > But if there are many details, there might be more Devils! > > > Ken Rhodes > Folding at Home: <a href="http://folding.stanford.edu/">http://folding.stanford.edu/</a> > 100% MicroSoft Free > SuSE Linux 10.3 > No AdWare, SpyWare, or Viruses! > Life is Good, :-) The bfind() I use (can posy it only tonight) only assumes sorted sequences without duplicates, as that's all it needs, and haas extra parms (lo and hi in the above code). Given the discussions referenced above, is this enough? I forgot to mention: according to whether you expect hits to be more frequent than misses, or the other way round, you can tweak the algorithm differently for more overall speed. In the routine you posted, if the sequence is not sorted, which is not checked, results are undefined (but there is a result). CChris -= B E G I N =- X-EUFORUM: 21426 Date: 2008 May 21 13:41 From: Jeremy Cowgar <jeremy at ?o?gar.com> Subject: Re: utility program suggestions Kenneth Rhodes wrote: > > > One question: How long did it take you to "maintain" Jiri's tidy.ex > to the point where you dropped your indent project? How much time > would you have saved had tidy.ex been there in the bin directory? > I didn't drop my indent program because it does a much better job. Did you look at the results of the two? It is also 1/2 the line count and understands all the new syntax. > > One comment: > Replace.ex has all of 88 lines of code- take a look at Jiri's code; > the man is a Euphoria programming super star! > ----------------------------------------------- > I have not looked at it. I know I do things with sed, but it's pretty complex and I goof the syntax all the time. A simple search/replace may be invaluable when helping people upgrade to 4.0. For instance, search/replace continue. For 88 lines of code, it certainly seems worth while. I wonder, maybe an offshoot of that we can make an "auto-upgrade" script :-) but that might be going too far :-/ -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21427 Date: 2008 May 21 13:42 From: Matt Lewis <matthewwalkerlewis at gmail.??m> Subject: Re: Current implementation of exp() is faulty. CChris wrote: > > Matt Lewis wrote: > > > > Yes. Also, it's only currently used for scientific notation encountered. > > It should be fairly easy to make it parse all floating point, though this > > would slow things down a little. Not sure where the sweet spot would > > be (i.e., when do we lose precision in the current "naive" algorithm). > > > > Matt > > Precision is lost when you add roundoff errors together. If, when parsing, > you add 16 numbers of the form n.0E-p, none of them is exactly representable, > so you get 16 times the maximum error, on bad days. Yes, this was what I was referring to with respect to the current "naive" algorithm. > I have coded an alternative which performs arithmetic on the digits of the > string being parsed, so as to never combine inexact results. It supports an > exact mode (givve this many bits of precision) and an auto-round mode (give > as much precision as one can get with the available digits). > > I'll benchmark it against scientific.e - it's probably slower and more > accurate - and post the findings. A few other things to do these days... I suspect from this comment that you haven't really looked at scientific.e. It converts decimal strings to binary, and does manipulations based upon the binary representation with as much precision as is possible to capture with a double floating point representation. Matt -= B E G I N =- X-EUFORUM: 21428 Date: 2008 May 21 13:42 From: Jeremy Cowgar <jeremy at c?wgar?com> Subject: Re: enhanced lines.ex ChrisBurch2 wrote: > > Working on it handling relative includes (..\..\my_includes) and when I get > around to compilng / installing a binary of 4.0, the euinc.conf file too. > When you make a change to it, you can just email it to me, I'll update the SVN copy so when 4.0 comes out, it'll be the latest and greatest. If you want to still put it in the Archives, you can do that as well, but you could reference the SVN copy of the file so it's always up to date: http://rapideuphoria.svn.sourceforge.net/svnroot/rapideuphoria/trunk/bin/lines.ex -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21429 Date: 2008 May 21 13:54 From: Jason Gade <jaygade at ??hoo.com> Subject: Re: Current implementation of exp() is faulty. Right. And what I was trying to say was that converting from double to string to double again loses information. Better to do one conversion and compare apples to apples. I think that CChris is talking about an arbitrary precision library. Doesn't one of those already exist in the archive? -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21430 Date: 2008 May 21 13:54 From: Jeremy Cowgar <jeremy at cowg?r.?om> Subject: Re: can_add() and linear() CChris wrote: > > > There hasn't been a single comment regarding this post for the past 8 days. > May I assume that I can go ahead with the additions/moves? > I am not certain if I would use the can_add and linear, but the fetch and store seem pretty useful. Now, about can_add and linear.... just because I wouldn't use them doesn't at all mean that others will not. I've added many functions to the standard library that I would not use but was deemed as useful to the general public. The rule is simple... will the general public find it useful? If so, you can added it, document it and create unit tests for it, then commit. When I say general public, I do not mean 2% of the Euphoria crowd, I mean > 50%. That's an awfully hard number to judge, but all we can do is use our best judgment. Once we hit an alpha stage, we are going to expect that most of the developers are going to go over the docs for the standard library and functions one sees "largely" questionable will be brought up for discussion. We also hope that when an alpha is released that those interested in the future development of Euphoria will also go over the new docs and do the same thing. So, I would be pretty easy going about what goes into the standard library right now trusting that each developer has a good head on their shoulders and is not going to commit something like "days_until_chriss_birthday()" :-D -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21431 Date: 2008 May 21 13:59 From: Jeremy Cowgar <jeremy at ?owgar.co?> Subject: Re: compiling translated files on Linux AMD64 Kenneth Rhodes wrote: > > Success! > Great job! This is very good news. Thank you for working on this so long. I am going to ask one thing, if you would... Can you add your instructions to the wiki so that they do not get lost? http://euwiki.ayo.biz/Main_Page That wiki will soon be moving to openeuphoria.org :-) > In order to use the -m32 switch, the 32bit version of gcc must be > installed in addition to the native gcc 64 bit compiler. > > ./ecu ed.ex -- generated the *.c files and emake > edit the emake file to include the -m32 switch: > <snip> > > Everything is sooooooooo simple-- in retrospect. > hehe. Everything (well, almost) always does. > I'm not sure what would happen if the -m32 switch was > added to the emake generation code. If under a 32bit system > the switch is just ignored, then we've got a genuine kludge, eh? > I wonder if we should add a parameter to ecu/ecw that will pass parameters on to the compiler/linker: ./ecu -cparams "-m32 -abc -def" -ldparams "-??? -???" myprog.ex Or something like that? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21432 Date: 2008 May 21 14:04 From: Jeremy Cowgar <jeremy at ?owgar?com> Subject: Re: utility program suggestions Kenneth Rhodes wrote: > > > Exactly. My vision is to have a utility program which not only update > Euphoria core language support, but also generate context sensitive help > support files for Euphoria and "external" third party libraries and at > least color syntax support for non-euphoria editor's such as Kate, Vim, > and Jed - further context sensitive help support for external libraries > could be made available for these editors thru Juergen's EuHTHelp.ex > command line program. > The new docs for Euphoria are a modified version of the .htx files used in previous version. It has been greatly simplified and also has very nice PDF and text generation now also! http://jeremy.cowgar.com/euphoria/combined.pdf http://jeremy.cowgar.com/euphoria/combined.txt (both of those are very old and have been made even better yet) It also now has inline function documentation that generates Table of Contents, Alphabetical Indexes, Automatic API Linking, etc... <eucode> --** -- Sort the elements of a sequence into ascending order. -- -- The elements can be atoms or sequences. The standard compare() -- routine is used to compare elements. -- -- Parameters: -- x = The sequence to be sorted. -- -- Returns: -- sequence - The original sequence in ascending order -- -- Comments: -- This uses the "Shell" sort algorithm. -- -- This sort is not "stable", i.e. elements that are considered equal might -- change position relative to each other. -- -- Example 1: -- constant student_ages = {18,21,16,23,17,16,20,20,19} -- sequence sorted_ages -- sorted_ages = sort( student_ages ) -- -- result is {16,16,17,18,19,20,20,21,23} -- -- See Also: -- compare -- sort_reverse -- sort_user -- custom_sort global function sort(sequence x) ... </eucode> The doc tool already extracts the documentation and function/procedure signatures. It probably would not be a far stretch to make it a generic program extracting the information into a common format that people could use for such tasks as you are speaking. Without a common documentation means, though, it would be impossible for a common program to extract function and documentation from source. It could potentially know a few different doc styles and do it's best. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21433 Date: 2008 May 21 15:45 From: Matt Lewis <matthewwalkerlewis at gma?l.?om> Subject: Re: compiling translated files on Linux AMD64 Jeremy Cowgar wrote: > > Kenneth Rhodes wrote: > > > I'm not sure what would happen if the -m32 switch was > > added to the emake generation code. If under a 32bit system > > the switch is just ignored, then we've got a genuine kludge, eh? > > > > I wonder if we should add a parameter to ecu/ecw that will pass parameters on > to the compiler/linker: > > ./ecu -cparams "-m32 -abc -def" -ldparams "-??? -???" myprog.ex > > Or something like that? That would be useful. It might also make sense to add a specific switch for 64-bit platforms, since these are likely to become more common. I'd think something like: -64 Or maybe there's a way to detect this by default and make it happen automagically? I think it should be available through uname, which we are already using in configure in the build process. I suppose we could also see if this causes problems on a 32-bit system, and if not, just add it by default. This seems like it would work, but is just not very elegant. Matt -= B E G I N =- X-EUFORUM: 21434 Date: 2008 May 21 15:48 From: Jeremy Cowgar <jeremy at c?w?ar.com> Subject: Re: compiling translated files on Linux AMD64 Matt Lewis wrote: > > Or maybe there's a way to detect this by default and make it happen > automagically? I think it should be available through uname, which we > are already using in configure in the build process. > Do we have these problems on Windows when using say 64bit Vista? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21435 Date: 2008 May 21 16:04 From: CChris <christian.cuvier at agri?u?ture.gouv.fr> Subject: Re: Current implementation of exp() is faulty. Jason Gade wrote: > > Right. And what I was trying to say was that converting from double to string > to double again loses information. Better to do one conversion and compare apples > to apples. > > I think that CChris is talking about an arbitrary precision library. The parsercan return any nmber of bits in exact mode. Otherwise, it returns as many bits as the number of digits provided allows in a safe way. > Doesn't > one of those already exist in the archive? There are some: 1/ Extended Precision Arithmetic (A. Tammer) 2/ Big Number Arithmetic (Craig Gilbert), but which is somewhat buggy. 3/ Big Math (Matt) 4/ Calculations with long numbers (D. Money) They are more or less practical, more or less extensible. They will cover the basic 4 operations, not sure how they extend to arbitrary precision real computations - they don't appear to handle anything related to fuzziness or roundoff. I haven't investigated them thoroughl - I have some unsubmitted stuff. Still, I prefer using other languages or software to experiment in these areas. CChris > > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. -= B E G I N =- X-EUFORUM: 21436 Date: 2008 May 21 16:13 From: Jason Gade <jaygade at yahoo.c??> Subject: Re: Current implementation of exp() is faulty. CChris wrote: > > Jason Gade wrote: > > > > Right. And what I was trying to say was that converting from double to string > > to double again loses information. Better to do one conversion and compare apples > > to apples. > > > > I think that CChris is talking about an arbitrary precision library. > > The parsercan return any nmber of bits in exact mode. Otherwise, it returns > as many bits as the number of digits provided allows in a safe way. Never mind. Either you are agreeing with me and I just don't see it, or no matter how simply I try and explain you are missing it. I thought that we had already resolved the issue. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21437 Date: 2008 May 21 17:21 From: c.k.lester <euphoric at ckle?ter.c?m> Subject: routine_id() Discovery Maybe this is common knowledge, but I just discovered this... A routine doesn't have to be global in order to call it from what would otherwise require a global definition. For example, this would normally fail: -- mylib.e func myfunc() end func -- myprog.e x = myfunc() with myfunc() is not defined (I think). But, if I add the routine_id() of myfunc() to a global list, then I can call it from myprog.e with call_func(). That means it can be exported but not made global... right? -= B E G I N =- X-EUFORUM: 21438 Date: 2008 May 21 17:40 From: CChris <christian.cuvier at agriculture.gouv.?r> Subject: Re: routine_id() Discovery c.k.lester wrote: > > Maybe this is common knowledge, but I just discovered this... > > A routine doesn't have to be global in order to call it from what would > otherwise require a global definition. > > For example, this would normally fail: > > -- mylib.e > func myfunc() > end func > > -- myprog.e > x = myfunc() > > with myfunc() is not defined (I think). > > But, if I add the routine_id() of myfunc() to a global list, then I can > call it from myprog.e with call_func(). > > That means it can be exported but not made global... right? This turns a global function into a global variable to hold or pass the routine_id. Great. It still needs being hidden. CChris -= B E G I N =- X-EUFORUM: 21439 Date: 2008 May 21 18:20 From: Matt Lewis <matthewwalkerlewis at gmai?.co?> Subject: Re: Current implementation of exp() is faulty. CChris wrote: > > Jason Gade wrote: > > > > Right. And what I was trying to say was that converting from double to string > > to double again loses information. Better to do one conversion and compare apples > > to apples. > > > > I think that CChris is talking about an arbitrary precision library. > > The parser can return any nmber of bits in exact mode. Otherwise, it returns > as many bits as the number of digits provided allows in a safe way. OK, I thought you were talking about creating doubles. scientific.e could be extended to however many bits you wanted. I just stopped where doubles left off. Matt -= B E G I N =- X-EUFORUM: 21440 Date: 2008 May 21 18:22 From: Matt Lewis <matthewwalkerlewis at ?mail.co?> Subject: Re: compiling translated files on Linux AMD64 Jeremy Cowgar wrote: > > Matt Lewis wrote: > > > > Or maybe there's a way to detect this by default and make it happen > > automagically? I think it should be available through uname, which we > > are already using in configure in the build process. > > > > Do we have these problems on Windows when using say 64bit Vista? This is really a compiler issue. I don't believe that OpenWatcom supports 64-bit targets, so there should be no problem. Off the top of my head, I'd guess that BCC doesn't either, and that LCC might. Matt -= B E G I N =- X-EUFORUM: 21441 Date: 2008 May 21 18:25 From: Matt Lewis <matthewwalkerlewis at gmail.?o?> Subject: Re: routine_id() Discovery c.k.lester wrote: > > Maybe this is common knowledge, but I just discovered this... You already knew about this, but you didn't realize it... > A routine doesn't have to be global in order to call it from what would > otherwise require a global definition. > > For example, this would normally fail: > > -- mylib.e > func myfunc() > end func > > -- myprog.e > x = myfunc() > > with myfunc() is not defined (I think). > > But, if I add the routine_id() of myfunc() to a global list, then I can > call it from myprog.e with call_func(). Or add it to some local variable in myprog.e through some routine like, say, myprog:set_event_handler(). > That means it can be exported but not made global... right? Yes, but in an annoying way [for most purposes]. call_func/proc don't care about scope. Matt -= B E G I N =- X-EUFORUM: 21442 Date: 2008 May 21 18:46 From: c.k.lester <euphoric at ?kleste?.com> Subject: Re: routine_id() Discovery Matt Lewis wrote: > c.k.lester wrote: > > But, if I add the routine_id() of myfunc() to a global list, then I can > > call it from myprog.e with call_func(). > Or add it to some local variable in myprog.e through some routine like, say, > myprog:set_event_handler(). Well, what I'm actually doing is having the included file with the function call an add_func( "routine_name", routine_id("routine_name") ) which adds the routine info to a list (the list is not global). Then later it can be called with call_func( a_routine(a), {} ) > > That means it can be exported but not made global... right? > Yes, but in an annoying way [for most purposes]. call_func/proc don't care > about scope. That explains the behavior, I guess. They don't care about scope. :D It just seems funny to me that I have access to a non-global function from where it's not in the global space. I got to this point, though, because some funcs/procs weren't being seen anymore by the calling code. I mean, I had call_func( routine_id("a_global_func"), {} ) that wasn't able to find a_global_func(). But, I'm dealing with over 40 include files and I threw my hands in the air and just decided to add all the functions to a global list instead of trying to manage the include files (put them in proper order). grrrrrr. So, the best solution is for me to ensure that all my funcs/procs are in nice order and sort my include requests appropriately... but until such time, I'm just going to have to use this work-around... although, it might be better this way since now I don't expose the funcs/procs to other libs (by using 'global'), just to the main calling program. What I need is for some guru (or two) to look over my code and tell me where things can be done better. Any volunteers? 8) -= B E G I N =- X-EUFORUM: 21443 Date: 2008 May 21 21:12 From: irv mullins <irvm at ellij?y?com> Subject: Houston: euphoria programmer needed Anybody near enough to do a day or two of work? Requires installing a program & checking for correct operation. -= B E G I N =- X-EUFORUM: 21444 Date: 2008 May 21 21:35 From: Matt Lewis <matthewwalkerlewis at ?mail.co?> Subject: Re: routine_id() Discovery c.k.lester wrote: > > It just seems funny to me that I have access to a non-global function from > where it's not in the global space. Yeah, well, like I said, if you've been using win32lib or wxEuphoria, you've been doing this forever. :) Matt -= B E G I N =- X-EUFORUM: 21445 Date: 2008 May 21 22:28 From: ChrisBurch3 <crylex at ?ma?l.com> Subject: Re: routine_id() Discovery c.k.lester wrote: > > Matt Lewis wrote: > > c.k.lester wrote: > > > But, if I add the routine_id() of myfunc() to a global list, then I can > > > call it from myprog.e with call_func(). > > Or add it to some local variable in myprog.e through some routine like, say, > > myprog:set_event_handler(). > > Well, what I'm actually doing is having the included file with the function > call an add_func( "routine_name", routine_id("routine_name") ) which adds > the routine info to a list (the list is not global). > > Then later it can be called with > > call_func( a_routine(a), {} ) > > > > That means it can be exported but not made global... right? > > Yes, but in an annoying way [for most purposes]. call_func/proc don't care > > about scope. > > That explains the behavior, I guess. They don't care about scope. :D > > It just seems funny to me that I have access to a non-global function from > where it's not in the global space. > > I got to this point, though, because some funcs/procs weren't being seen > anymore by the calling code. I mean, I had > > call_func( routine_id("a_global_func"), {} ) > > that wasn't able to find a_global_func(). But, I'm dealing with over 40 > include files and I threw my hands in the air and just decided to add all > the functions to a global list instead of trying to manage the include > files (put them in proper order). grrrrrr. coughforwardreferincingcough > > So, the best solution is for me to ensure that all my funcs/procs are in nice > order and sort my include requests appropriately... but until such time, I'm > just going to have to use this work-around... although, it might be better > this way since now I don't expose the funcs/procs to other libs (by using > 'global'), just to the main calling program. > > What I need is for some guru (or two) to look over my code and tell me > where things can be done better. Any volunteers? 8) -= B E G I N =- X-EUFORUM: 21446 Date: 2008 May 21 22:39 From: Mike <vulcan at w?n.co?nz> Subject: Re: routine_id() Discovery Hi CK, > What I need is for some guru (or two) to look over my code and tell me > where things can be done better. Any volunteers? 8) Here's a radical idea. Why not consider using Orac for your project. Admittedly, it's a bit disobedient at times (by, well, crashing) but it can encapsulate like nothing else (in the Euphoria world). 40 include files? No problemo. Of course, you have to convert the app (by adding more include statements) and once you do it's difficult to go back, though, would you want to? As an enticement, I'll happily do the conversion (should take about an hour) but you'll need to actually maintain the program. The use of routine_id reduces vastly under Orac since forward routine calls are possible. Even when routine_id has to be used, instead of call_func/call_proc you can use the variable itself in a calling format, eg: int a = routine_id(.. // Euphoria call_proc( a, {}) // Orac a() You can use dot notation for sequence access too so accessing a stable of routine ids is a piece of cake. Eg: seq op ... op.class.item(whatever) // voila! kind regards, Mike c.k.lester wrote: > > Matt Lewis wrote: > > c.k.lester wrote: > > > But, if I add the routine_id() of myfunc() to a global list, then I can > > > call it from myprog.e with call_func(). > > Or add it to some local variable in myprog.e through some routine like, say, > > myprog:set_event_handler(). > > Well, what I'm actually doing is having the included file with the function > call an add_func( "routine_name", routine_id("routine_name") ) which adds > the routine info to a list (the list is not global). > > Then later it can be called with > > call_func( a_routine(a), {} ) > > > > That means it can be exported but not made global... right? > > Yes, but in an annoying way [for most purposes]. call_func/proc don't care > > about scope. > > That explains the behavior, I guess. They don't care about scope. :D > > It just seems funny to me that I have access to a non-global function from > where it's not in the global space. > > I got to this point, though, because some funcs/procs weren't being seen > anymore by the calling code. I mean, I had > > call_func( routine_id("a_global_func"), {} ) > > that wasn't able to find a_global_func(). But, I'm dealing with over 40 > include files and I threw my hands in the air and just decided to add all > the functions to a global list instead of trying to manage the include > files (put them in proper order). grrrrrr. > > So, the best solution is for me to ensure that all my funcs/procs are in nice > order and sort my include requests appropriately... but until such time, I'm > just going to have to use this work-around... although, it might be better > this way since now I don't expose the funcs/procs to other libs (by using > 'global'), just to the main calling program. > > What I need is for some guru (or two) to look over my code and tell me > where things can be done better. Any volunteers? 8) -= B E G I N =- X-EUFORUM: 21447 Date: 2008 May 21 23:09 From: c.k.lester <euphoric at ckl?ster?com> Subject: Re: routine_id() Discovery ChrisBurch3 wrote: > c.k.lester wrote: > > that wasn't able to find a_global_func(). But, I'm dealing with over 40 > > include files and I threw my hands in the air and just decided to add all > > the functions to a global list instead of trying to manage the include > > files (put them in proper order). grrrrrr. > > coughforwardreferincingcough I believe in the no-forward-referencing paradigm. :) But I don't believe in quoting entire messages for one line of text. :P -= B E G I N =- X-EUFORUM: 21448 Date: 2008 May 22 0:38 From: c.k.lester <euphoric at cklester?c?m> Subject: Re: routine_id() Discovery Mike wrote: > > > What I need is for some guru (or two) to look over my code and tell me > > where things can be done better. Any volunteers? 8) > > Here's a radical idea. Why not consider using Orac for your project. I don't know enough about Orac to even begin to consider it. :) I don't even know what an optimizing incremental x-compiler is! I'll download it and check it out. -= B E G I N =- X-EUFORUM: 21449 Date: 2008 May 22 3:18 From: Jason Gade <jaygade at ??hoo.com> Subject: scientific.e -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21450 Date: 2008 May 22 3:23 From: Jason Gade <jaygade at ?ahoo.?om> Subject: scientific.e scientific_to_atom() crashed with an input of "1" slice upper index is less than 0 (-1) s = {49'1'} dp = 0 e = 0 exp = 1 int_bits = <no value> frac_bits = <no value> mbits = <no value> ebits = <no value> sbits = {0} Line 278 is: s = s[1..e-1] - '0 Just seems that non-scientific input should be rejected. Moving on... -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21451 Date: 2008 May 22 3:58 From: Shawn Pringle <shawn.pringle at ?mail.com> Subject: Re: Short-circuit warning Jeremy, I want to show you the differences between short-circut evaluation and non-short-circut evaluation. Himm... If you want to modify a variable while you compare it: while (flag && ++c < 10) { .. } -- oops that is C. We can't do that in Euphoria, anyway. When you want to assign a variable so you don't need so many []'s: if ( node[N_NEXT][4][6] == True && (color = node[N_NEXT][4][3]) == Red ) { -- oops, that is C also. When you want obtain information using pass by reference: if ( foo == 5 or get_bar_value( &bar ) == false ) { .. -- careful not to use bar here. -- oops, that is also C. You have to put a lot effort to construct a situation where shortcircuting would keep a variable from being assigned or updated properly. The examples I gave are not even possible in EUPHORIA. Unless you construct a function for updating a global variable and bury it in the logic of an if-statement. You see how difficult it is for short-circuting to be a problem with program logic? So, yes, I think think you have guessed correctly. I am on Jeremy's side on this issue. Shawn Pringle -= B E G I N =- X-EUFORUM: 21452 Date: 2008 May 22 4:01 From: Shawn Pringle <shawn.pringle at gmail?co?> Subject: Re: scientific.e I suggest, we create a new type even if it is a local type: scientific_string that would check to makesure that this function can convert the type. Instead of crashing the program in the conversion function it should crash with a type check error. Shawn Pringle -= B E G I N =- X-EUFORUM: 21453 Date: 2008 May 22 4:10 From: Kenneth Rhodes <ken_rhodes30436 at ?ahoo.?om> Subject: Re: compiling translated files on Linux AMD64 Jeremy Cowgar wrote: > > Kenneth Rhodes wrote: > > > > Success! > > > > Great job! This is very good news. Thank you for working on this so long. I > am going to ask one thing, if you would... Can you add your instructions to > the wiki so that they do not get lost? > > <a href="http://euwiki.ayo.biz/Main_Page">http://euwiki.ayo.biz/Main_Page</a> > Ok... I'll do that. -= B E G I N =- X-EUFORUM: 21454 Date: 2008 May 22 4:11 From: Jason Gade <jaygade at yaho?.com> Subject: Re: scientific.e Shawn Pringle wrote: > > I suggest, we create a new type even if it is a local type: scientific_string > that would check to makesure that this function can convert the type. Instead > of crashing the program in the conversion function it should crash with a > type check error. > > Shawn Pringle Huh? I was just pointing out a bug in Matt's scientific.e, which I was using to try and illustrate a different point. It's a case that should be handled by the library or should be documented. Other than a string type, I am wholly opposed to creating new built-in types for Euphoria. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21455 Date: 2008 May 22 5:32 From: Kenneth Rhodes <ken_rhodes30436 at yaho?.?om> Subject: Re: compiling translated files on Linux AMD64 Kenneth Rhodes wrote: > > Jeremy Cowgar wrote: > > > > Kenneth Rhodes wrote: > > > > > > Success! > > > > > > > Great job! This is very good news. Thank you for working on this so long. I > > am going to ask one thing, if you would... Can you add your instructions to > > the wiki so that they do not get lost? > > > > <a href="http://euwiki.ayo.biz/Main_Page">http://euwiki.ayo.biz/Main_Page</a> > > > > Ok... I'll do that. Well, I mucked up my first bout at editing a wiki page. I think I was able to clean up my mess. I'll keep working on it.... Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21456 Date: 2008 May 22 5:52 From: Alex Caracatsanis <sunpsych at ncable.?om.?u> Subject: Auto-completion in ed.ex Can anyone please tell me whether it's easy to tweak ed.ex such that when I type "if" (and press Enter), it will automatically complete the construct: <eucode> if then else end if </eucode> Oh, and if it is easy, can someone please tell me how to do it? Thank you Alex Caracatsanis -= B E G I N =- X-EUFORUM: 21457 Date: 2008 May 22 6:21 From: Jeremy Cowgar <jeremy at c?wgar?com> Subject: Do you currently use namespaces? Please respond with a yes or no. We are simply curious how widely used the feature is as this point. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21458 Date: 2008 May 22 6:25 From: Derek Parnell <ddparnell at bigp?n?.com> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > > Please respond with a yes or no. We are simply curious how widely used the feature > is as this point. Yes. Even when not required to. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21459 Date: 2008 May 22 7:04 From: Kenneth Rhodes <ken_rhodes30436 at yaho?.co?> Subject: Re: Auto-completion in ed.ex Alex Caracatsanis wrote: > > Can anyone please tell me whether it's easy to tweak ed.ex such that when I > type "if" (and press Enter), it will automatically complete the construct: > <eucode> > if then > > else > > end if > </eucode> > Oh, and if it is easy, can someone please tell me how to do it? > > Thank you > > Alex Caracatsanis Short answer... yes, it can be done, but I doubt its worth doing to save only 4 keystrokes. Ed.ex almost does that now: Expandable words which are found in the constant expand_word are automatically completed after the word is typed and a space is entered. if<space> currently expands to: if then end if Do you really want to change that so that every if statement expands to an "if then else end if" construct? Or is it you just want to differentiate a new "if then else end if" construct by use of the enter key in lieu of the space key? <eucode> -- make sure this constant at line 153 is set to true. constant WANT_AUTO_COMPLETE = TRUE -- FALSE if you don't want -- auto-completion of Euphoria statements -- The relevant code starts at line 1,970 with the comment: -- expandable words & corresponding text constant expand_word = {"if", "for", "while", "elsif", "procedure", "type", "function"}, expand_text = {" then", "= to by do", " do", " then", "()", "()", "()" } procedure try_auto_complete(char key) -- check for a keyword that can be automatically completed sequence word, this_line, white_space, leading_white, begin natural first_non_blank, wordnum if key = ' ' then insert(key) end if this_line = buffer[b_line] white_space = this_line = ' ' or this_line = '\t' first_non_blank = find(0, white_space) -- there's always '\n' at end leading_white = this_line[1..first_non_blank - 1] if auto_complete and first_non_blank < b_col - 2 then if not find(0, white_space[b_col..length(white_space)-1]) then word = this_line[first_non_blank..b_col - 1 - (key = ' ')] wordnum = find(word, expand_word) if key = CR and equal(word, "else") then leading_white &= '\t' elsif wordnum > 0 then sound(1000) -- expandable word (only word on line) begin = expand_text[wordnum] & CR & leading_white if equal(word, "elsif") then insert_string(begin & '\t') elsif find(word, {"function", "type"}) then insert_string(begin & CR & leading_white & "\treturn" & CR & "end " & expand_word[wordnum]) else insert_string(begin & '\t' & CR & leading_white & "end " & expand_word[wordnum]) end if delay(0.07) -- or beep is too short sound(0) end if end if end if if key = CR then if b_col >= first_non_blank then buffer[b_line] = buffer[b_line][1..b_col-1] & leading_white & buffer[b_line][b_col..length(buffer[b_line])] insert(CR) skip_white() else insert(CR) end if end if end procedure </eucode> Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21460 Date: 2008 May 22 7:05 From: Kenneth Rhodes <ken_rhodes30436 at yahoo?co?> Subject: Re: Do you currently use namespaces? no Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21461 Date: 2008 May 22 8:15 From: CChris <christian.cuvier at ?griculture.gouv.?r> Subject: Re: Do you currently use namespaces? No CChris -= B E G I N =- X-EUFORUM: 21462 Date: 2008 May 22 8:22 From: yuku <yuku at ?kitek.?om> Subject: Re: Do you currently use namespaces? no -= B E G I N =- X-EUFORUM: 21463 Date: 2008 May 22 9:01 From: ChrisBurch2 <crylex at freeuk.c?.u?> Subject: Re: Do you currently use namespaces? No -= B E G I N =- X-EUFORUM: 21464 Date: 2008 May 22 9:10 From: Matt Lewis <matthewwalkerlewis at ?m?il.com> Subject: Re: scientific.e Jason Gade wrote: > > scientific_to_atom() crashed with an input of "1" <snip> > Just seems that non-scientific input should be rejected. > > Moving on... It assumes that you're passing it good data. I blame you. :P Matt -= B E G I N =- X-EUFORUM: 21465 Date: 2008 May 22 9:13 From: Matt Lewis <matthewwalkerlewis at gmai?.co?> Subject: Re: scientific.e Jason Gade wrote: > > I was just pointing out a bug in Matt's scientific.e, which I was using to try > and illustrate a different point. It's a case that should be handled by the > library or should be documented. It is documented: --/topic Scientific Notation --/func scientific_to_float64( sequence s ) -- --Takes a string reprepresentation of a number in scientific notation --/topic Scientific Notation --/func scientific_to_atom( sequence s ) -- --Takes a string reprepresentation of a number in scientific notation http://blogs.msdn.com/oldnewthing/archive/2008/05/05/8459022.aspx Matt -= B E G I N =- X-EUFORUM: 21466 Date: 2008 May 22 9:15 From: Matt Lewis <matthewwalkerlewis at gm?i?.com> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > > Please respond with a yes or no. We are simply curious how widely used the feature > is as this point. Yes. Minimally, to resolve conflicts. Matt -= B E G I N =- X-EUFORUM: 21467 Date: 2008 May 22 9:26 From: Salix <salix at fr?e?ail.hu> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > > Please respond with a yes or no. We are simply curious how widely used the feature > is as this point. > No. Salix -= B E G I N =- X-EUFORUM: 21468 Date: 2008 May 22 9:27 From: ZNorQ <znorq at hol?aug.?om> Subject: Re: Do you currently use namespaces? Yes. -= B E G I N =- X-EUFORUM: 21469 Date: 2008 May 22 10:02 From: Judith Evans <camping at cce?b.?et> Subject: Re: Do you currently use namespaces? no. -= B E G I N =- X-EUFORUM: 21470 Date: 2008 May 22 10:09 From: Mike777 <anon4321 at gmail?co?> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > > Please respond with a yes or no. We are simply curious how widely used the feature > is as this point. Yes. -= B E G I N =- X-EUFORUM: 21471 Date: 2008 May 22 10:47 From: Jerry Story <story.jerry at gma?l.co?> Subject: Re: Do you currently use namespaces? No. -= B E G I N =- X-EUFORUM: 21472 Date: 2008 May 22 11:04 From: Shawn Pringle <shawn.pringle at ?m?il.com> Subject: Re: scientific.e Matt Lewis and Jason Gade: I don't think it is clear what is going on to everyone here. The scientific_to_float64 probably expects a string of the form (+-)d\.d\+e(+-)dd. Therefore if you have no 'e' the function crashes. You want to pass 1 it should be "1e+0". I suggest you use a type for your function for the sake of illistration let us suppose there is a regex.e in the archive and a regex_match that does what perl's // operator does. Then the following is what you could use as a type. include regex.e type scientific_string( sequence s ) return regex_match( s, "(+-)\d\.\d\+e(+-)\d\d" ) end type Then you declare scientific_to_float64 as: atom scientific_to_float64( scientific_string s ) If the user enters garbage he is told it is his bad data instead of getting an error in the body of your function and no I am not talking about adding builtins. Shawn Pringle -= B E G I N =- X-EUFORUM: 21473 Date: 2008 May 22 11:17 From: Arthur Crump <arthur.crump at ntl?orld?com> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > > Please respond with a yes or no. We are simply curious how widely used the feature > is as this point. > ... no Arthur Crump -= B E G I N =- X-EUFORUM: 21474 Date: 2008 May 22 11:21 From: Shawn Pringle <shawn.pringle at gm?il.co?> Subject: Namespaces? There are lots of potential problems with modifying the interpreter, one could introduce undefined behavior or some bugs into the interpreter itself. I know some of the keywords will improve the experience of EUPHORIA but changing namespace behavior so that you can use builtin names without overriding must be too difficult for those who are getting into the interpreter guts to do or we would have seen it already. :) I would like to point out that you can use namespaces without overriding builtins. Sure connecting to an ftp site is abstractly similiar to opening a file but you can use the function name 'connnect' instead. Consider these psuedocode These identifiers you can use over and over again in some ftp.e, http.e, map.e etc.: type kind( object x ) -- verifies that x is the type that would be returned by connect() or new(). function connect( UnicodeString resource_string, sequence data_sequence ) -- connect to some resource that already exists. procedure disconnect( object connectionhandle ) -- disconnect to a resource. function new( sequence data ) -- create a new instance of something. function set( object x, object key, object y ) -- Sets x of key, key, to y. -- As in a map class. function get( object x, object key ) function exists( object x, object key ) Okay, none of these use reserved names and they are short you use namespaces with them all. There is no need to modify how EUPHORIA does namespacing because they do not use any names from the builtins. include get.e as get include ftp.e as ftp include http.e as http -- everyone is happy. Right? Shawn Pringle -= B E G I N =- X-EUFORUM: 21475 Date: 2008 May 22 11:22 From: Shawn Pringle <shawn.pringle at ??ail.com> Subject: Re: Do you currently use namespaces? yes -= B E G I N =- X-EUFORUM: 21476 Date: 2008 May 22 12:13 From: Matt Lewis <matthewwalkerlewis at gmai?.?om> Subject: Re: scientific.e Shawn Pringle wrote: > > Matt Lewis and Jason Gade: > > I don't think it is clear what is going on > to everyone here. > The scientific_to_float64 probably expects a > string of the form (+-)d\.d\+e(+-)dd. > I suggest you use a type for your function > for the sake of illistration let us suppose > there is a regex.e in the archive and a > regex_match that does what perl's // operator > does. Then the following is what you > could use as a type. Yes, I understood what you were saying. > include regex.e > type scientific_string( sequence s ) > return regex_match( s, "(+-)\d\.\d\+e(+-)\d\d" ) > end type I think a correct regex would be (including capturing all of the interesting substrings): "(-?)(\\d+)(?:\\.(\\d+))?[eE][+\\-]?(\\d+)" Matt -= B E G I N =- X-EUFORUM: 21477 Date: 2008 May 22 12:19 From: Larry Miller <larrymiller at sask??l.net> Subject: Re: Do you currently use namespaces? No -= B E G I N =- X-EUFORUM: 21478 Date: 2008 May 22 13:23 From: Jason Gade <jaygade at ya??o.com> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > > Please respond with a yes or no. We are simply curious how widely used the feature > is as this point. I've never needed to, but only because I haven't done any large projects. So, no. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21479 Date: 2008 May 22 13:24 From: Jason Gade <jaygade at ya??o.com> Subject: Re: scientific.e Matt Lewis wrote: > > Jason Gade wrote: > > > > I was just pointing out a bug in Matt's scientific.e, which I was using to try > > and illustrate a different point. It's a case that should be handled by the > > library or should be documented. > > It is documented: > > --/topic Scientific Notation > --/func scientific_to_float64( sequence s ) > -- > --Takes a string reprepresentation of a number in scientific notation > > --/topic Scientific Notation > --/func scientific_to_atom( sequence s ) > -- > --Takes a string reprepresentation of a number in scientific notation > > <a href="http://blogs.msdn.com/oldnewthing/archive/2008/05/05/8459022.aspx">http://blogs.msdn.com/oldnewthing/archive/2008/05/05/8459022.aspx</a> > > Matt Oh, sure, just assume that I've diligently read all of the documentation! :P (But thanks.) -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21480 Date: 2008 May 22 13:24 From: Bernie Ryan <xotron at bluefr?g?com> Subject: Re: Do you currently use namespaces? No, because it never really worked that well. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21481 Date: 2008 May 22 13:38 From: Jason Gade <jaygade at ?ahoo.?om> Subject: Re: scientific.e Matt Lewis wrote: > > Shawn Pringle wrote: > > > > Matt Lewis and Jason Gade: > > > > I don't think it is clear what is going on > > to everyone here. > > The scientific_to_float64 probably expects a > > string of the form (+-)d\.d\+e(+-)dd. > > > I suggest you use a type for your function > > for the sake of illistration let us suppose > > there is a regex.e in the archive and a > > regex_match that does what perl's // operator > > does. Then the following is what you > > could use as a type. > > Yes, I understood what you were saying. > > > include regex.e > > type scientific_string( sequence s ) > > return regex_match( s, "(+-)\d\.\d\+e(+-)\d\d" ) > > end type > > I think a correct regex would be (including capturing all of the interesting > substrings): > > "(-?)(\\d+)(?:\\.(\\d+))?[eE][+\\-]?(\\d+)" > > Matt Sorry, I /hadn't/ understood. My reading comprehension skills seem to be lacking a little lately. My apologies. As Matt pointed out in another post, this behavior is documented and I missed it. The other numbers I passed the function were in the form "x.xxxxxxxxxxxxxxx" without an 'e' and those were parsed just fine. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21482 Date: 2008 May 22 13:39 From: Jeremy Cowgar <jeremy at ?owgar.?om> Subject: Re: Namespaces? Shawn Pringle wrote: > > There are lots of potential problems with modifying the interpreter, > one could introduce undefined behavior or some bugs into the interpreter > itself. > On the dev list we have exchanged over 130 emails thus far amongst the developers talking about any impact. We are still working on the final changes if any. > I know some of the keywords will improve the experience of EUPHORIA but > changing namespace behavior so that you can use builtin names without > overriding must be too difficult for those who are getting into the > interpreter guts to do or we would have seen it already. :) > It's actually already done. Matt changed ~8 lines of code to make this work. > I would like to point out that you can use namespaces without overriding > builtins. Sure connecting to an ftp site is abstractly similiar to opening > a file but you can use the function name 'connnect' instead. Consider these > psuedocode > First, the technically correct term for ftp is not connect, it is open(). Even in your FTP client, you type ftp> open ftp.gnu.org. So, due to limitations in Euphoria's namespacing you are suggesting we cannot wrap a library correctly, we must alter correct names to incorrect names due to Euphoria's limitations. Secondly, there are all sorts of other examples such as sqlite:open (again you *are* opening a file, not connecting to a file or connecting to a database server), zip:open(), stream:open(), etc... Secondly, the whole idea of allowing the overriding w/o replacing built-ins is summed up pretty well by a post by Derek. It deals with creative naming as you are suggesting: "I want to locate a certain letter in a line of text, so do I use 'search', 'find', 'locate', 'match', 'inquire', 'whereis', 'scan', 'lookup', 'index', ... ? Even today, how many people continue to confuse the usage of the built-in functions 'find' and 'match'?" > These identifiers you can use over and over again in some > ftp.e, http.e, map.e etc.: > As was discussed on the mailing list, what we do in the standard library is going to be mimiced by Euphoria programmers for a long time to come. Creative naming is what they will see. > type kind( object x ) > -- verifies that x is the type that would be returned by connect() or new(). > > function connect( UnicodeString resource_string, sequence data_sequence ) > -- connect to some resource that already exists. > procedure disconnect( object connectionhandle ) > -- disconnect to a resource. > > function new( sequence data ) > -- create a new instance of something. > > function set( object x, object key, object y ) -- Sets x of key, key, to y. > -- As in a map class. > > function get( object x, object key ) > > function exists( object x, object key ) > > Okay, none of these use reserved names and they are short you use namespaces > with them all. There is no need to modify how EUPHORIA does namespacing > because they do not use any names from the builtins. > You have given an example of something very easy. Please try something like ftp.e, stream.e, zip.e, regexp.e. > include get.e as get > include ftp.e as ftp > include http.e as http > -- everyone is happy. Right? > I do not see where it solves anything, sorry. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21483 Date: 2008 May 22 13:44 From: Jeremy Cowgar <jeremy at ?owgar.co?> Subject: Re: Do you currently use namespaces? Yes, I use namespaces, as like Derek even when not required, for clarities sake. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21484 Date: 2008 May 22 16:53 From: Pete Stoner <stoner.pete at gmail?c?m> Subject: Re: Do you currently use namespaces? No, except when forced to resolve conflicts -= B E G I N =- X-EUFORUM: 21485 Date: 2008 May 22 17:20 From: "Euler German" <eulerg at gmail.com> Subject: Re: Do you currently use namespaces? > On 22 May 2008 at 9:53, Pete Stoner wrote (maybe snipped): > > No, except when forced to resolve conflicts > Same here. Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 21486 Date: 2008 May 22 17:40 From: ken mortenson <kenneth_john at yaho?.c?m> Subject: About my project Hello, I've decide to give Euphoria another try. Of course I've run into a snag. I've got a DLL that I wrote in PowerBasic to use an Access database. I should be able to use it with Euphoria for the same purpose. The problem is I'm getting an 'invalid routine id' on my call and reading through the forum hasn't enlightened me. ;-) Here's the code... atom dbSQL dbSQL = open_dll("dbSQL.dll") if (dbSQL=0) then MsgAbort("Could not open dbSQL.dll") end if atom rid_dbOpen rid_dbOpen = define_c_func(dbSQL, "dbOpen", {C_POINTER}, C_LONG) global function dbOpen(sequence sPath) atom text_ptr, nResult text_ptr = allocate_string(sPath) nResult = call_func(rid_dbOpen, text_ptr) -- zero=fail return nResult end function ----------------------------- rid_dbOpen has a value of 2, which seems a little odd to me unless part of some vector table, but I don't know the internals of Euphoria. In any case any helpful solution that gets me moving forward again would be greatly appreciated. I'm working on a windows project. The intent is a multi-user game. When I'm done I'll upload the source here. I'm writing the code for unlimited players, but expect performance to be limited to a dozen or so. Anyway, I'm stuck until I get past this hurdle. Thanks. -= B E G I N =- X-EUFORUM: 21487 Date: 2008 May 22 18:14 From: Jason Gade <jaygade at yahoo??om> Subject: Re: About my project ken mortenson wrote: > > Hello, > > I've decide to give Euphoria another try. Of course I've run into a snag. > > I've got a DLL that I wrote in PowerBasic to use an Access database. > I should be able to use it with Euphoria for the same purpose. > > The problem is I'm getting an 'invalid routine id' on my call and reading > through the forum hasn't enlightened me. ;-) > > Here's the code... > > atom dbSQL > dbSQL = open_dll("dbSQL.dll") > if (dbSQL=0) then > MsgAbort("Could not open dbSQL.dll") > end if > > atom rid_dbOpen > rid_dbOpen = define_c_func(dbSQL, "dbOpen", {C_POINTER}, C_LONG) > > global function dbOpen(sequence sPath) > atom text_ptr, nResult > text_ptr = allocate_string(sPath) > nResult = call_func(rid_dbOpen, text_ptr) -- zero=fail > return nResult > end function > > ----------------------------- > rid_dbOpen has a value of 2, which seems a little odd to me unless > part of some vector table, but I don't know the internals of Euphoria. > > In any case any helpful solution that gets me moving forward again > would be greatly appreciated. > > I'm working on a windows project. The intent is a multi-user game. > When I'm done I'll upload the source here. > > I'm writing the code for unlimited players, but expect performance to > be limited to a dozen or so. > > Anyway, I'm stuck until I get past this hurdle. Thanks. You need c_func() instead of call_func(). call_func() is for Euphoria functions, c_func() is for C functions. http://www.rapideuphoria.com/lib_c_d.htm#c_func Hope that helps! -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21488 Date: 2008 May 22 19:54 From: Lucius L. Hilley III <euphoria at unkma?.com> Subject: Re: Houston: euphoria programmer needed irv mullins wrote: > > Anybody near enough to do a day or two of work? > Requires installing a program & checking for correct > operation. Does the computer have internet? Could it be done by remote control? http://www.unkmar.com/ Lucius L. Hilley III - Unkmar -= B E G I N =- X-EUFORUM: 21489 Date: 2008 May 22 20:19 From: Lucius L. Hilley III <euphoria at unkma?.?om> Subject: Re: Current implementation of exp() is faulty. CChris wrote: > > Jason Gade wrote: > > > > Right. And what I was trying to say was that converting from double to string > > to double again loses information. Better to do one conversion and compare apples > > to apples. > > > > I think that CChris is talking about an arbitrary precision library. > > The parsercan return any nmber of bits in exact mode. Otherwise, it returns > as many bits as the number of digits provided allows in a safe way. > > > Doesn't > > one of those already exist in the archive? > > There are some: > 1/ Extended Precision Arithmetic (A. Tammer) > 2/ Big Number Arithmetic (Craig Gilbert), but which is somewhat buggy. > 3/ Big Math (Matt) > 4/ Calculations with long numbers (D. Money) > > They are more or less practical, more or less extensible. > > They will cover the basic 4 operations, not sure how they extend to arbitrary > precision real computations - they don't appear to handle anything related to > fuzziness or roundoff. I haven't investigated them thoroughl - I have some unsubmitted > stuff. Still, I prefer using other languages or software to experiment in these > areas. > > CChris > > > > > -- > > A complex system that works is invariably found to have evolved from a simple > > system that works. > > --John Gall's 15th law of Systemantics. > > > > "Premature optimization is the root of all evil in programming." > > --C.A.R. Hoare > > > > j. I worked on some of that as well. I managed to get past the 4 basic functions. Worked out some code to do exp() and don't remember if I managed to write code for ln(). I'll see if I can dig it up. Lucius L. Hilley III - Unkmar -= B E G I N =- X-EUFORUM: 21490 Date: 2008 May 22 20:24 From: Matt Lewis <matthewwalkerlewis at gm?il.co?> Subject: Re: Do you currently use namespaces? Bernie Ryan wrote: > > > No, because it never really worked that well. I hear this complaint a fair amount. Bernie, could you elaborate on what didn't work well for you? Thanks, Matt -= B E G I N =- X-EUFORUM: 21491 Date: 2008 May 22 20:46 From: ken mortenson <kenneth_john at ?ahoo?com> Subject: Re: About my project Jason Gade wrote: with regard to... > > atom rid_dbOpen > > rid_dbOpen = define_c_func(dbSQL, "dbOpen", {C_POINTER}, C_LONG) > > > > global function dbOpen(sequence sPath) > > atom text_ptr, nResult > > text_ptr = allocate_string(sPath) > > nResult = call_func(rid_dbOpen, text_ptr) -- zero=fail > > return nResult > > end function > > You need c_func() instead of call_func(). call_func() is for Euphoria functions, > c_func() is for C functions. > > <a href="http://www.rapideuphoria.com/lib_c_d.htm#c_func">http://www.rapideuphoria.com/lib_c_d.htm#c_func</a> > > Hope that helps! What a bonehead I am. Yes, that got me moving forward again. I still have issues to work through, but that certain did help. Thanks, ken. -= B E G I N =- X-EUFORUM: 21492 Date: 2008 May 22 20:54 From: Bernie Ryan <xotron at blue?ro?.com> Subject: Re: Do you currently use namespaces? Matt Lewis wrote: > > Bernie Ryan wrote: > > > > > > No, because it never really worked that well. > > I hear this complaint a fair amount. Bernie, could you elaborate on what > didn't work well for you? > Matt: When ever I tried to use it was because I ran into a conflict with a function name so I would assign some qualifier to the include file. Then when I added that include file some function would conflict with some other file. In larger programs it just cascaded into having to add too many function qualifiers. I became very frustrated, so I quit using other user's libraries and just started writing my own functions and using only libraries that come with the Euphoria install. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21493 Date: 2008 May 22 20:58 From: Bernie Ryan <xotron at blu?frog?com> Subject: open_dll ?? Why dont Euphoria's open_dll() search the EUINC path for DLLs or SOs or the current directory ? Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21494 Date: 2008 May 22 21:09 From: Lucius L. Hilley III <euphoria at u?km?r.com> Subject: arbitrary precision library - preference? > CChris wrote: > > > > Jason Gade wrote: > > > I think that CChris is talking about an arbitrary precision library. > > > > The parsercan return any nmber of bits in exact mode. Otherwise, it returns > > as many bits as the number of digits provided allows in a safe way. > > > > > Doesn't > > > one of those already exist in the archive? > > > > There are some: > > 1/ Extended Precision Arithmetic (A. Tammer) > > 2/ Big Number Arithmetic (Craig Gilbert), but which is somewhat buggy. > > 3/ Big Math (Matt) > > 4/ Calculations with long numbers (D. Money) > > > > They are more or less practical, more or less extensible. > > > > They will cover the basic 4 operations, not sure how they extend to arbitrary > > precision real computations - they don't appear to handle anything related to > > fuzziness or roundoff. I haven't investigated them thoroughl - I have some unsubmitted > > stuff. Still, I prefer using other languages or software to experiment in these > > areas. > > > > CChris > > > > > j. Any of you have a preference on those libs. I looked over A. Tammer's years ago and it didn't appear to work right was using VooDoo magic. I couldn't extended it. Lucius L. Hilley III - Unkmar -= B E G I N =- X-EUFORUM: 21495 Date: 2008 May 22 21:19 From: gshingles <gshingles at g?ail.?om> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > > Please respond with a yes or no. We are simply curious how widely used the feature > is as this point. No. But I would a lot more if they provided a greater degree of OO. For example if the namespace was declared in the include file rather than by the end user, and if the namespace was taken from the relative path name and folders, like <eucode> -- math/matrix.e package math:matrix constant VERSION = 1.2.3 type matrix ... function identity() ..etc export matrix,identity(),mult(),add(),VERSION -- program include math:matrix.e matrix bob bob = identity() if isa(bob,math:matrix.e) then puts(1, "It's from the matrix include") end if </eucode> Like Perl :) But that's a large thorny topic so I'm happy with the current system as it is until around version 6... Gary -= B E G I N =- X-EUFORUM: 21496 Date: 2008 May 22 21:28 From: Jason Gade <jaygade at ?ah?o.com> Subject: Re: arbitrary precision library - preference? Lucius L. Hilley III wrote: > > Any of you have a preference on those libs. I looked over A. Tammer's years > ago and it didn't appear to work right was using VooDoo magic. I couldn't extended > it. > > Lucius L. Hilley III - Unkmar I haven't really used any of them, I was just kind of playing around with bits and doubles and stuff. Welcome back, by the way. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21497 Date: 2008 May 22 21:56 From: irv mullins <irvm at el?ijay.co?> Subject: Re: Houston: euphoria programmer needed Lucius L. Hilley III wrote: > > Does the computer have internet? > Could it be done by remote control? > <a href="http://www.unkmar.com/">http://www.unkmar.com/</a> > Yes, and no. Remember, these are people who are having trouble copying an exe to the C: drive and getting it to run. Asking them to set up remote desktop - well, I don't want to even think about it. -= B E G I N =- X-EUFORUM: 21498 Date: 2008 May 22 22:27 From: Alex Caracatsanis <sunpsych at ncable.?om.?u> Subject: Re: Auto-completion in ed.ex - END Kenneth Rhodes wrote: > > Alex Caracatsanis wrote: > > > > Can anyone please tell me whether it's easy to tweak ed.ex > > Short answer... yes, it can be done, but I doubt its worth > doing to save only 4 keystrokes. Hi Ken I understand. I've been writing some small apps that needed a series of if/else/end if constructs, some of them nested, and I found ed.ex's auto- completion very useful to help me keep track of which 'if' corresponded to which 'end if'; and I wanted to extend that convenience to the corresponding 'else'. As a value-added benefit I thought that if I could learn how to achieve this form of auto-completion, then I could try my own hand at doing 'if then/elsif then/else/end if'; else I would just forget about it :-) For all the above reasons, thanks for replying. I'll study your code and see what I can learn from it. Regards Alex Caracatsanis -= B E G I N =- X-EUFORUM: 21499 Date: 2008 May 22 23:41 From: Matt Lewis <matthewwalkerlewis at gmai??com> Subject: Re: Do you currently use namespaces? Bernie Ryan wrote: > > Matt Lewis wrote: > > > > Bernie Ryan wrote: > > > > > > > > > No, because it never really worked that well. > > > > I hear this complaint a fair amount. Bernie, could you elaborate on what > > didn't work well for you? > > > > Matt: > > When ever I tried to use it was because I ran into a conflict with > a function name so I would assign some qualifier to the include file. > Then when I added that include file some function would conflict with > some other file. In larger programs it just cascaded into having to > add too many function qualifiers. I became very frustrated, so I quit > using other user's libraries and just started writing my own functions > and using only libraries that come with the Euphoria install. Is this an accurate example of what you were seeing? <eucode> -- libfoo.e global procedure baz(...) ... baz(...) -- libbar.e global procedure baz(...) ... baz(...) -- app.ex include libfoo.e include libbaz.e .... </eucode> In other words, there were conflicts not just in your code, but within the libraries themselves? This was a problem. It's fixed now. Otherwise, it sounds like they were doing exactly what they were designed to do. How else would you have solved the problem? Matt -= B E G I N =- X-EUFORUM: 21500 Date: 2008 May 22 23:42 From: Matt Lewis <matthewwalkerlewis at gmail?c?m> Subject: Re: open_dll ?? Bernie Ryan wrote: > > > Why dont Euphoria's open_dll() search the EUINC path for DLLs or SOs > or the current directory ? It uses the searching done natively by the OS. In windows, this means it has to be in the PATH, or a subdirectory of your executable. In *nix, it usually means it needs to be in either a directory cached by ldconfig, or pointed to by LD_LIBRARY_PATH. Matt -= B E G I N =- X-EUFORUM: 21501 Date: 2008 May 22 23:49 From: Kenneth Rhodes <ken_rhodes30436 at yah?o.co?> Subject: Re: Auto-completion in ed.ex - END for Alex Caracatsanis I'm sure there's a better way to do it, but this will do to get you started... enter ife<space> and see what happens! <eucode> -- modified lines are commented "for Alex" -- expandable words & corresponding text constant expand_word = {"if", "for", "while", "elsif", "procedure", "type", "function", "ife" -- for Alex }, expand_text = {" then", "= to by do", " do", " then", "()", "()", "()", "" -- for Alex } procedure try_auto_complete(char key) -- check for a keyword that can be automatically completed sequence word, this_line, white_space, leading_white, begin natural first_non_blank, wordnum if key = ' ' then insert(key) end if this_line = buffer[b_line] white_space = this_line = ' ' or this_line = '\t' first_non_blank = find(0, white_space) -- there's always '\n' at end leading_white = this_line[1..first_non_blank - 1] if auto_complete and first_non_blank < b_col - 2 then if not find(0, white_space[b_col..length(white_space)-1]) then word = this_line[first_non_blank..b_col - 1 - (key = ' ')] wordnum = find(word, expand_word) if key = CR and equal(word, "else") then leading_white &= '\t' elsif wordnum > 0 then sound(1000) -- expandable word (only word on line) begin = expand_text[wordnum] & CR & leading_white if equal(word, "elsif") then insert_string(begin & '\t') elsif find(word, {"function", "type"}) then insert_string(begin & CR & leading_white & "\treturn" & CR & "end " & expand_word[wordnum]) -- for Alex elsif equal(word, "ife") then add_queue(BS & BS & BS & BS) insert_string("if" & '\t' & "then " & CR & CR & leading_white & "else" & CR & CR & "end if") else insert_string(begin & '\t' & CR & leading_white & "end " & expand_word[wordnum]) end if delay(0.07) -- or beep is too short sound(0) end if end if end if if key = CR then if b_col >= first_non_blank then buffer[b_line] = buffer[b_line][1..b_col-1] & leading_white & buffer[b_line][b_col..length(buffer[b_line])] insert(CR) skip_white() else insert(CR) end if end if end procedure </eucode> Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21502 Date: 2008 May 23 0:48 From: Lucius L. Hilley III <euphoria at ?nk?ar.com> Subject: Re: Houston: euphoria programmer needed They don't have to setup remote desktop. That was my point. Try out UHelpMe which is listed at my website. http://www.unkmar.com/ You will need to call me. Lucius L. Hilley III - Unkmar -= B E G I N =- X-EUFORUM: 21503 Date: 2008 May 23 3:27 From: "Euler German" <eulerg at gmail.com> Subject: Re: Houston: euphoria programmer needed > On 22 May 2008 at 14:57, irv mullins wrote (maybe snipped): > Lucius L. Hilley III wrote: > > > > Does the computer have internet? > > Could it be done by remote control? > > <a href="http://www.unkmar.com/">http://www.unkmar.com/</a> > > > Yes, and no. > Remember, these are people who are having trouble copying an exe to > the C: drive and getting it to run. Asking them to set up remote > desktop - well, I don't want to even think about it. > Maybe using something like UltraVNC Single Click could help. Nothing can be easiest than open a remote access clicking in a single executable. I do it all the time. Best, Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 21504 Date: 2008 May 23 3:30 From: Lucius L. Hilley III <euphoria at u??mar.com> Subject: Re: Houston: euphoria programmer needed Euler German wrote: > > > On 22 May 2008 at 14:57, irv mullins wrote (maybe snipped): > > > Lucius L. Hilley III wrote: > > > > > > Does the computer have internet? > > > Could it be done by remote control? > > > <a href="http://www.unkmar.com/">http://www.unkmar.com/</a> > > > > > Yes, and no. > > Remember, these are people who are having trouble copying an exe to > > the C: drive and getting it to run. Asking them to set up remote > > desktop - well, I don't want to even think about it. > > > Maybe using something like UltraVNC Single Click could help. Nothing > can be easiest than open a remote access clicking in a single > executable. I do it all the time. > > Best, > Euler > That is what my UHelpMe program is built upon. It is the usual result of my projects. At least 3 languages to accomplish the work. Lucius L. Hilley III - Unkmar -= B E G I N =- X-EUFORUM: 21505 Date: 2008 May 23 4:48 From: Shawn Pringle <shawn.pringle at gmai?.co?> Subject: Re: Namespaces? Jeremy Cowgar wrote: > > Shawn Pringle wrote: > > I know some of the keywords will improve the experience of EUPHORIA but > > changing namespace behavior so that you can use builtin names without > > overriding must be too difficult for those who are getting into the > > interpreter guts to do or we would have seen it already. :) > > > > It's actually already done. Matt changed ~8 lines of code to make this work. > This was preferable state to me. I was suggesting we could over and over again the same routine names for things that are common to most classes libraries: a constructor called new(), a type function kind(). The benefit of this is you do not have to reinvent and the user doesn't have to remember constructor names. Naming to new() & kind() instead of the include name adds a kind of flexibility. As an example: One map may be implemented with a two-element sequence: one with the keys and the other with the values in mapskv.e. Another may be implemented as a sequence of key,value pairs: mapkvs.e. You can use <eucode> include mapkvs.e as Process_map_t </eucode>, and use that for everything using kind() and new(). As long as these two libraries use the same routine names you can drop in one for the other simply by changing the include line to say: <eucode> include mapskv as Process_map_t </eucode>. So, I guess I want to say when you have two things that are different implementations of the same abstract thing, it is beneficial to use the same routine names in both. Ofcourse, you could name kind() as map() and new() as new_map but I think using kind() and new() is more elegant. Shawn Pringle -= B E G I N =- X-EUFORUM: 21506 Date: 2008 May 23 7:49 From: Dan Moyer <danielmoyer at prodigy.?e?> Subject: Re: Do you currently use namespaces? No. Dan M. -= B E G I N =- X-EUFORUM: 21507 Date: 2008 May 23 8:05 From: CChris <christian.cuvier at a?riculture.?ouv.fr> Subject: Re: Houston: euphoria programmer needed Euler German wrote: > > > On 22 May 2008 at 14:57, irv mullins wrote (maybe snipped): > > > Lucius L. Hilley III wrote: > > > > > > Does the computer have internet? > > > Could it be done by remote control? > > > <a href="http://www.unkmar.com/">http://www.unkmar.com/</a> > > > > > Yes, and no. > > Remember, these are people who are having trouble copying an exe to > > the C: drive and getting it to run. Asking them to set up remote > > desktop - well, I don't want to even think about it. > > > Maybe using something like UltraVNC Single Click could help. Nothing > can be easiest than open a remote access clicking in a single > executable. I do it all the time. > > Best, > Euler > Confirmed. They only need an instruction on how to fetch and communicate their server name, and not forget to set a password. Indeed, they have nothing else to do beyond that point. Oh yes, launch and shut down the vnc server... CChris > -- > _ > _| euler f german > _| sete lagoas, mg, brazil > _| efgerman{AT}gmail{DOT}com > > -= B E G I N =- X-EUFORUM: 21508 Date: 2008 May 23 8:36 From: Mike777 <anon4321 at gma?l.co?> Subject: Debug, debug, debug... and 4.0 I've said it on IRC, so I thought I'd raise it here. If the debug system could be enhanced within the roadmap of 4.0, that would be a real enhancement to the language. I've mentioned a few things: Turn the trace window into an immediate window and allow real time substitution of variable values. Enhance the trace window's display capability so that sequences aren't effectively hidden. Enhance the trace window's interrogation capability so that subscripts can be used (and subscripts which are variables would be even better). I think I saw a variable dump in EUOO. That would be nice. I'm sure I could think of more if I wasn't so busy debugging. <G> Mike -= B E G I N =- X-EUFORUM: 21509 Date: 2008 May 23 11:45 From: jacques deschênes <desja at globetrott?r.n?t> Subject: Re: Do you currently use namespaces? rarely, only to resolve conflict. jacques d. -= B E G I N =- X-EUFORUM: 21510 Date: 2008 May 23 14:56 From: CChris <christian.cuvier at agriculture.gouv.?r> Subject: Re: stdlib: Binary search function Kenneth Rhodes wrote: > > CChris wrote: > > > > > > This has been an oft requested functionality, and was in principle agreed, even > > by Rob: > > <a href="http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=&keywords=binary_find">http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=&keywords=binary_find</a> > > <a href="http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=&keywords=bfind">http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=&keywords=bfind</a> > > > > Some implementations have been mentioned already (G. Boehme, J. Babor,...). > > > > Now, the devil is in the details. What shall the function do? > > * accept only strictly increasing sequences > > * accept only strictly monotoni sequences > > * accept loosely monotonic sequences (with possible duplicates) > > * only cope with <any selection above>, not checking > > > > I think everyone agrees it should return like db_find_key(), ie n>0 when found, > > n<0 with ordered insertion resulting in item lading at position -n. > > > > And another point which wasn't agreed upon: would this go to sort.e or sequence.e? > > > > The version I use in sets.e has a from and to extra parameters. They could be > > easily defaulted. Monoony could be passed as a parameter too, depending on the > > option chosen. > > > > CChris > > Well, if the Devil is in the details, lets see the details. > Babor, Boehme, and Otto's bfind is short sweet and simple. > > > <eucode> > global function bfind(object x, sequence s) > -- does a binary search on a sorted sequence > -- returns index location if found, 0 if not > -- assumes that sequence s has been sorted prior to this call > -- Gabriel Boehme's code > -- Earlier Joe Otto's routine is almost identical. > integer lo, hi, mid, c > lo = 1 > hi = length(s) > > while lo <= hi do > mid = floor((lo + hi) / 2) > c = compare(x, s[mid]) > if c < 0 then -- x < s[mid] > hi = mid - 1 > elsif c > 0 then -- x > s[mid] > lo = mid + 1 > else -- x = s[mid] > return mid > end if > end while > > return 0 > end function > </eucode> > > It sounds as though your binary find may be a bit of > a swiss army knife approach. Please post your bfind > code from sets.e and let us play arround with it-- > But if there are many details, there might be more Devils! > > > Ken Rhodes > Folding at Home: <a href="http://folding.stanford.edu/">http://folding.stanford.edu/</a> > 100% MicroSoft Free > SuSE Linux 10.3 > No AdWare, SpyWare, or Viruses! > Life is Good, :-) I realised I forgot about your request: <eucode> constant SETS_1 = {-1,1,-2} -- endgame for length 1 function bfind_(object x,sequence s,integer startpoint,integer endpoint) -- the actul bfind() sanitizes args, then calls this -- assumes s sorted with no duplicates, length(s)>=startpoint<=endpoint>0. No checking. integer mid,c if length(s)=0 then return -1 end if if startpoint<=0 then startpoint=1 end if if endpoint>length(s) then endpoint=length(s) end if -- check for outliers, which are worst cases c=compare(x,s[startpoint]) if c=-1 then return -1 elsif c=0 then return 1 end if c=compare(x,s[endpoint]) if c=1 then return -endpoint-1 elsif c=0 then return endpoint end if -- main loop while endpoint-startpoint>1 do -- handling of duplicates -- if equal(s[startpoint],s[endpoint]) then -- return startpoint -- end if mid=floor((startpoint+endpoint)/2) c=compare(x,s[mid]) if c=1 then startpoint=mid elsif c=-1 then endpoint=mid else return mid end if end while return -startpoint end function </eucode> One can change the order of the tests if it is thought that there will be more hits than misses or the other way round. Results are undefined is s is not increasing. When x has more than one instance in s, the commented out handling code causes the choice of the exac index to be undefined amongst the several possible answers. If s is decreasing, and the slope is knon somehow, then some 1 and -1 may be replaced by ±slope. CChris -= B E G I N =- X-EUFORUM: 21511 Date: 2008 May 23 15:23 From: Bernie Ryan <xotron at bl?efrog.?om> Subject: Re: Do you currently use namespaces? Matt Lewis wrote: > > Bernie Ryan wrote: > > > > Matt Lewis wrote: > > > > > > Bernie Ryan wrote: > > > > > > > > > > > > No, because it never really worked that well. > > > > > > I hear this complaint a fair amount. Bernie, could you elaborate on what > > > didn't work well for you? > > > > > > > Matt: > > > > When ever I tried to use it was because I ran into a conflict with > > a function name so I would assign some qualifier to the include file. > > Then when I added that include file some function would conflict with > > some other file. In larger programs it just cascaded into having to > > add too many function qualifiers. I became very frustrated, so I quit > > using other user's libraries and just started writing my own functions > > and using only libraries that come with the Euphoria install. > > Is this an accurate example of what you were seeing? > <eucode> > -- libfoo.e > global procedure baz(...) > > ... > baz(...) > > -- libbar.e > global procedure baz(...) > > ... > baz(...) > > -- app.ex > include libfoo.e > include libbaz.e > > .... > </eucode> > > In other words, there were conflicts not just in your code, but within > the libraries themselves? This was a problem. It's fixed now. > > Otherwise, it sounds like they were doing exactly what they were designed > to do. How else would you have solved the problem? > Matt: I can't remember a good example of why I stopped using it off hand. The next time I run into the problem I will give you an example of the problem. I know one way to get around some problems was to use machine_func() calls which everyone was using to get around some problems. I noticed on the list I was among the majority of users NOT using namespaces why don't you ask the other users maybe that would help you. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21512 Date: 2008 May 23 15:26 From: "Euler German" <eulerg at gmail.com> Subject: Re: Houston: euphoria programmer needed > On 23 May 2008 at 1:05, CChris wrote (maybe snipped): > posted by: CChris <christian.cuvier at a?riculture.?ouv.fr> > > Euler German wrote: > > > > > On 22 May 2008 at 14:57, irv mullins wrote (maybe snipped): > > > > > Lucius L. Hilley III wrote: > > > > > > > > Does the computer have internet? > > > > Could it be done by remote control? > > > > <a href="http://www.unkmar.com/">http://www.unkmar.com/</a> > > > > > > > Yes, and no. > > > Remember, these are people who are having trouble copying an exe > > > to the C: drive and getting it to run. Asking them to set up > > > remote desktop - well, I don't want to even think about it. > > > > > Maybe using something like UltraVNC Single Click could help. Nothing > > can be easiest than open a remote access clicking in a single > > executable. I do it all the time. > > > > Best, > > Euler > > > > Confirmed. > They only need an instruction on how to fetch and communicate their > server name, and not forget to set a password. Indeed, they have > nothing else to do beyond that point. Oh yes, launch and shut down the > vnc server... > > CChris > Nope. UltraVNC SC doesn't work like a regular VNC. It's server doesn't stay resident -- it's a subset of the regular server thus much smaller. It terminates itself if connection drops by itself, or by any side's will. It's action is limited by caller's privileges. They don't even need to say their actual dynamic IP. OK, they do have to do a thing: ask for it. ;) It's as simple as a click. Try it! You'll like it. Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com -= B E G I N =- X-EUFORUM: 21513 Date: 2008 May 23 16:03 From: Matt Lewis <matthewwalkerlewis at gma?l.co?> Subject: Re: Debug, debug, debug... and 4.0 Mike777 wrote: > > I've said it on IRC, so I thought I'd raise it here. If the debug system > could be enhanced within the roadmap of 4.0, that would be a real > enhancement to the language. I've mentioned a few things: I think that ideally, we'd provide a debugging api so that we could build debuggers outside of the interpreter itself. Matt -= B E G I N =- X-EUFORUM: 21514 Date: 2008 May 23 17:55 From: Mike777 <anon4321 at g?ail?com> Subject: Re: Debug, debug, debug... and 4.0 Matt Lewis wrote: > > Mike777 wrote: > > > > I've said it on IRC, so I thought I'd raise it here. If the debug system > > could be enhanced within the roadmap of 4.0, that would be a real > > enhancement to the language. I've mentioned a few things: > > I think that ideally, we'd provide a debugging api so that we could build > debuggers outside of the interpreter itself. Sure. But is that 4.0? If not, and I suspect it is not, can changes to the trace window be made within the 4.0 roadmap? Mike -= B E G I N =- X-EUFORUM: 21515 Date: 2008 May 23 21:49 From: don cole <doncole at pac?ell.n?t> Subject: Strange ListView Behavior When I setLVItemText(ListView89,2,2,"***") into an empty ListView. Nothing happens. However if I for x=1 to getLVCount(ListView89) do junk&=addLVItem(ListView89,0,"") end for First then it works ok. Don Cole -= B E G I N =- X-EUFORUM: 21516 Date: 2008 May 23 22:18 From: Jerry Story <story.jerry at gmail.c??> Subject: Euphoria roadmap Just a reminder. After you all get Euphoria 4.0 happening, what you really need to get Euphoria rocking and rolling is euphoria_xxx.deb followed by xeu_xxx.deb followed by eu_apps_xxx.deb. -= B E G I N =- X-EUFORUM: 21517 Date: 2008 May 23 22:21 From: Jerry Story <story.jerry at g?a?l.com> Subject: Re: Euphoria roadmap Jerry Story wrote: > > Just a reminder. After you all get Euphoria 4.0 happening, what you really need > to get Euphoria rocking and rolling is euphoria_xxx.deb followed by xeu_xxx.deb > followed by eu_apps_xxx.deb. typo: wxeu_xxx.app -= B E G I N =- X-EUFORUM: 21518 Date: 2008 May 23 22:21 From: Derek Parnell <ddparnell at bigpon?.com> Subject: Re: Euphoria roadmap Jerry Story wrote: > > Just a reminder. After you all get Euphoria 4.0 happening, what you really need > to get Euphoria rocking and rolling is euphoria_xxx.deb followed by xeu_xxx.deb > followed by eu_apps_xxx.deb. What are they? -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21519 Date: 2008 May 23 22:22 From: Jeremy Cowgar <jeremy at co?gar?com> Subject: Re: Euphoria roadmap Jerry Story wrote: > > Just a reminder. After you all get Euphoria 4.0 happening, what you really need > to get Euphoria rocking and rolling is euphoria_xxx.deb followed by xeu_xxx.deb > followed by eu_apps_xxx.deb. xeu? BTW... once 4.0 is out, we will begin to create packages for many distributions including: GenToo, FreeBSD, Fedora, ArchLinux, Ubuntu, Mandrake and Debian. I am sure I forgot a few from our list, but that's what I remember off the top of my head. In addition to this, we want to submit to the computer language shootout as well as encourage everyone here to start actively talking about Euphoria, blog about it, mention it to your co-workers, friends, etc... What apps would you pose should go into distributions? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21520 Date: 2008 May 23 23:05 From: Jerry Story <story.jerry at g??il.com> Subject: Re: Euphoria roadmap Derek Parnell wrote: > > Jerry Story wrote: > > > > Just a reminder. After you all get Euphoria 4.0 happening, what you really need > > to get Euphoria rocking and rolling is euphoria_xxx.deb followed by xeu_xxx.deb > > followed by eu_apps_xxx.deb. > > What are they? euphoria_xxx.deb is an imaginary future file for Euphoria in .deb format for installation on GNU/Linux. The xxx part is stuff you need to make a proper .deb name. It will include platform and version and such like. wxeu_xxx.deb is the same deal for wxEuphoria. eu_apps.deb is the same deal for other stuff based on Euphoria. Some day we will be able to install Euphoria and wxEuphoria and other Euphoria stuff on GNU/Linux using Synaptic Package Manager or Update Manager and it will be easy. Right now when people download dmak (Diet Monger Ass Kicker), they sometimes have a problem getting it to work on GNU/Linux because they need to install libwxeu.so. The standard nowadays is for installing things to be easy. Just click 'Install" and it is installed. This is a problem not just for dmak but also for all programs based on wxEuphoria or on any library that requires special installation. This will continue to be a problem until it is solved by putting things in .deb files or somesuch kind of files. After Euphoria and wxEuphoria and other stuff are put into .deb files and then I suppose in some GNU/Linx distros, then Euphoria will become part of the normal world. It will be "with it". -= B E G I N =- X-EUFORUM: 21521 Date: 2008 May 23 23:29 From: Jerry Story <story.jerry at gmail?c?m> Subject: Re: Euphoria roadmap Jeremy Cowgar wrote: > What apps would you pose should go into distributions? nut-nutrition is in Synaptic Package Manager. It installs perfectly. I figure dmak (Diet Monger Ass Kicker) probably should also be in Synaptic Package Manager, considering that (apart from problems of installation) it is a better program (in my opinion). I'm sure there are a bunch more apps among the Linux and General portions of "user contributions" that probably should go into distributions. -= B E G I N =- X-EUFORUM: 21522 Date: 2008 May 24 0:11 From: Derek Parnell <ddparnell at big?o?d.com> Subject: Re: Strange ListView Behavior don cole wrote: > > When I > > setLVItemText(ListView89,2,2,"***") > > into an empty ListView. Nothing happens. Let me get this straight ... you are trying to change the text of a non-existant item and you're surprised that it doesn't do anything. > However if I > > for x=1 to getLVCount(ListView89) do > junk&=addLVItem(ListView89,0,"") > end for > > First > > then it works ok. Then you add some stuff and now changing items works ... Yep, that is weird. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21523 Date: 2008 May 24 7:27 From: Dan Moyer <danielmoyer at p?odi?y.net> Subject: [OT] WinXP, "open with" menu: how to ADD to it??? If I right click on a Euphoria program, & select "open with", I see: EXW WordPad exwc Ed NotePad I don't know what the "exwc" is, but I'd like to ADD Judith's Editor, & I can't figure out HOW. I know it will be similar to "Ed", so the Exw.exe can run first & then run the app, but I'm not sure how I got Ed to be there nor how to add Editor. Any help?? Dan -= B E G I N =- X-EUFORUM: 21524 Date: 2008 May 24 7:44 From: CChris <christian.cuvier at agricu?tur?.gouv.fr> Subject: Re: Strange ListView Behavior don cole wrote: > > When I > > setLVItemText(ListView89,2,2,"***") > > into an empty ListView. Nothing happens. > > However if I > > for x=1 to getLVCount(ListView89) do > junk&=addLVItem(ListView89,0,"") > end for > > First > > then it works ok. > > Don Cole I'd expect that. setLVItem() sets an item's properties. The item must exist prior. If you add it first, then it exists and can be set. I jnow, some routine sets, like defineUserProperties() and friends, weren't designed like this. But I think this behaviour should remain the exception. add() adds and sets somehow, set() only sets. The release of win32lib 0.70.4a will be delayed a little due to the current development activity for Eu v4.0. I'm now targetting June 15 or something around that date. CChris -= B E G I N =- X-EUFORUM: 21525 Date: 2008 May 24 8:54 From: Dan Moyer <danielmoyer at pro?i?y.net> Subject: Re: [OT] WinXP, "open with" menu: how to ADD to it??? Dan Moyer wrote: > > If I right click on a Euphoria program, & select "open with", I see: > EXW > WordPad > exwc > Ed > NotePad > > I don't know what the "exwc" is, but I'd like to ADD Judith's Editor, > & I can't figure out HOW. I know it will be similar to "Ed", so the Exw.exe > can run first & then run the app, but I'm not sure how I got Ed to be there > nor how to add Editor. Any help?? > > Dan Well, never mind, I guess; I decided it would be better to try to put it under "Edit With", but when I couldn't GET any "Edit With" to have multiple options, just made an outright menu choice of "Judith's Editor", and made that work. Dan -= B E G I N =- X-EUFORUM: 21526 Date: 2008 May 24 12:05 From: irv mullins <irvm at ellijay.??m> Subject: Re: Do you currently use namespaces? Yes, all the time. But that's because I use a language where namespaces are implemented correctly, I think. Sorry if this is a bit long, but I don't know any way to show what I mean without examples. Examples: ...File foo... sub one return "foo one" ;; sub two return "foo two" ;; var three = 3.1 var four = [4,"foo Four"] ...File bar... sub one return "bar one" ;; sub two return "bar two" ;; var three = 3.2 var four = [4,"bar Four"] Using the included files: ...Main file (first method)... use foo use bar println(foo.one) # must use prefix, otherwise 'undeclared symbol' err println(foo.two) println(bar.three) println(bar.four) ...Results... foo one foo two 3.2 [4, 'bar Four'] ...(second method)... use foo (*) # import all as default use bar println(one) # no namespace needed, uses foo println(foo.two) # uses foo println(bar.three) # overrides default, uses bar println(four) ...(third method)... use foo (one) # only import function 'one' from foo use bar (two,three,four) # import these funks & vars from bar println(one) println(two) println(foo.two) println(bar.three) println(four) ...results... foo one bar two foo two 3.2 [4, 'bar Four'] ...(fourth method)... use foo as a use bar as b println(a.one) # must use correct prefix for all println(b.one) println(a.two) println(b.three) println(b.four) # println(two) # undeclared symbol err - can't accidentally get access ...(final example)... use foo as a use irv.testing.bar as b # includes the file bar which is located in # my testing directory, ignoring the local bar file. -= B E G I N =- X-EUFORUM: 21527 Date: 2008 May 24 12:23 From: irv mullins <irvm at e??ijay.com> Subject: Re: Do you currently use namespaces? Bernie: The question as posed is similar to "Have you stopped beating your wife?" Perhaps what should have been asked is: "If namespaces worked properly, would you be using them?" But that is still not 100%. Some people would say no, because the type of programs they write can be written without resorting to namespaces, for whatever reason. Perhaps they write short utility programs where everything can easily be put in one file. Perhaps they are incredibly organized and can manage huge monolithic files without a problem. Some people would say no because they don't realize how useful namespaces can be, they're used to muddling along with euphoria as it is. Neither of those "noes" should be taken as a rational reason to avoid implementing real namespacing. That would only hurt those of us who do not fall into one of the above categories. So, perhaps if it were asked again, the answers should be less terse. 1. No, I don't see the need, and I don't think anyone else should either. 2. No, I don't see the need, wouldn't use 'em, but it's OK if others do. 3. Yes, I would use them if they worked. 4. Yes, I use them even though they are incomplete and awkward sometimes. 5. Yes, they work exactly the way I like them to work.Don't change a thing. Maybe a couple more? -= B E G I N =- X-EUFORUM: 21528 Date: 2008 May 24 12:31 From: irv mullins <irvm at ellijay.c?m> Subject: Re: Houston: euphoria programmer needed Euler German wrote: > It's as simple as a click. Try it! You'll like it. For you it's simple. It's taken a couple of days and several e-mails to get across the idea that "drop this file in your C: directory" doesn't mean "create a new directory and move a lot of stuff around..." Sort of like the irate call I got a few years ago: client was fuming "Your program BROKE! Come fix it!" After a lot of conversation, I found out it had worked up until she "cleaned up a lot of junk I never use" (her words). Like what? "Oh, customer.dat, invoices.dat, stuff like that I never look at" -= B E G I N =- X-EUFORUM: 21529 Date: 2008 May 24 12:31 From: Jeremy Cowgar <jeremy at cowgar.?om> Subject: Re: Do you currently use namespaces? > > The question as posed is similar to "Have you stopped beating your wife?" > The intent of the question was not to determine it's usefulness, correctness, or people's opinion of it. It was to determine if we change the way namespaces work how many people would it affect? So, the original question was stated correctly for it's purpose. Irv, I enjoyed your post on namespaces. It is helpful. On the dev list we have exchanged over 200 messages within a very short time frame (3 days?). Discussions were just the same thing we discussed here on EUforum a few weeks ago, however, it went more into what would break, what would not break, how to implement, etc... -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21530 Date: 2008 May 24 16:00 From: don cole <doncole at pac?ell?net> Subject: Re: Strange ListView Behavior Derek Parnell wrote: > > don cole wrote: > > > > When I > > > > setLVItemText(ListView89,2,2,"***") > > > > into an empty ListView. Nothing happens. > > > Let me get this straight ... you are trying to change the text of a non-existant > item and you're surprised that it doesn't do anything. > > > > However if I > > > > for x=1 to getLVCount(ListView89) do > > junk&=addLVItem(ListView89,0,"") > > end for > > > > First > > > > then it works ok. > > Then you add some stuff and now changing items works ... > > Yep, that is weird. > > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell Of course I start out with, global constant ListView89 = createEx( ListView, {"ListView89"," "," "," "," "," "," "," "}, Window1, 4, 4, 776, 148, w32or_all({LVS_REPORT,LVS_SHOWSELALWAYS}), 0 ) Don Cole -= B E G I N =- X-EUFORUM: 21531 Date: 2008 May 24 16:09 From: don cole <doncole at pacbel?.?et> Subject: Re: Strange ListView Behavior CChris wrote: > > don cole wrote: > > > > When I > > > > setLVItemText(ListView89,2,2,"***") > > > > into an empty ListView. Nothing happens. > > > > However if I > > > > for x=1 to getLVCount(ListView89) do > > junk&=addLVItem(ListView89,0,"") > > end for > > > > First > > > > then it works ok. > > > > Don Cole > > I'd expect that. > setLVItem() sets an item's properties. The item must exist prior. > If you add it first, then it exists and can be set. > I jnow, some routine sets, like defineUserProperties() and friends, weren't > designed like this. But I think this behaviour should remain the exception. > add() adds and sets somehow, set() only sets. > > The release of win32lib 0.70.4a will be delayed a little due to the current > development activity for Eu v4.0. I'm now targetting June 15 or something around > that date. > > CChris Thanks CChris, I'll just keep doing it the same way. Not really a problem but weird. Don Cole -= B E G I N =- X-EUFORUM: 21532 Date: 2008 May 24 17:09 From: ken mortenson <kenneth_john at yaho?.com> Subject: Any PB & ADO gurus? You were so helpful for me before (thx Jason) I was hoping someone might get me unstuck again so I can get to the fun part of writing code. A little background. I bought PowerBASIC years ago because I wanted a good compiler. But I find PB to be both ugly and incomplete. While I've always liked the core C language, I find it gets dirty quickly. Euphoria is very clean and well named. It is euphoric writing code with such a flexible data type and it isn't cluttered with a lot of junk. Anyway, to my issue; Here's the PB (double ugly IMHO) code... FUNCTION dbOpen ALIAS "dbOpen" (sPath AS ASCIIZ) EXPORT AS LONG DIM v1 AS VARIANT ON ERROR GOTO ErrorTrap LET m_db = NEW DISPATCH IN "ADODB.Connection.2.7" LET m_rs = NEW DISPATCH IN "ADODB.Recordset.2.7" MSGBOX "CommandTimeout start" 'debug code v1 = 120 OBJECT LET m_db.CommandTimeout = v1 MSGBOX "CommandTimeout done" 'debug code v1 = 3 '%ado_Use_Client OBJECT LET m_db.CursorLocation = v1 v1 = "Provider=Microsoft.Jet.OLEDB.4.0; " _ & "Data Source=" & sPath & "; " _ & "User ID=ADMIN; " _ & "Password=;" OBJECT LET m_db.ConnectionString = v1 OBJECT CALL m_db.Open dbOpen = 1 'success EXIT FUNCTION ErrorTrap: dbOpen = 0 'failure LET m_db = NOTHING END FUNCTION ----------------------------------------------------- When I originally wrote this the param sPath was AS STRING, but Euphoria's allocate_string produces the PB type ASCIIZ so I changed that. This code works fine called from PB, but when called from Euphoria it fails on the line... OBJECT LET m_db.CommandTimeout = v1 I added the two messageboxes to bracket the problem. Called from Euphoria it never gets to the second messagebox. I'm baffled since disregarding the ugly syntax the line is pretty straight forward. Any ideas? Alternately, does anyone have another way of using ADO recordset from Euphoria? It would be nice if I could access any SQL db with just a new connection string as I can with this code. Why not use an EDB (anticipating your question) db? A number of reasons, basically because I know how to do safe multiuser calls to a SQL db, but don't see how that would work with an EDB. I'd be interested in that question as well. Hey, I'm interested in lots of things... ;-) -= B E G I N =- X-EUFORUM: 21533 Date: 2008 May 24 17:10 From: Shawn Pringle <shawn.pringle at gmail.??m> Subject: Re: Do you currently use namespaces? [irv mullins' question] I cannot see the how beating my wife is analogous to using namespaces. My answer is 4: Yes, I use them even though they are incomplete and awkward sometimes. I wouldn't use the words awkward so much as they could be improved as has been discussed and I gather they have already been improved for the new Euphoria. Number 4 is the best fit to my opinion. Shawn Pringle B.Sc. -= B E G I N =- X-EUFORUM: 21534 Date: 2008 May 24 17:44 From: ken mortenson <kenneth_john at yaho?.co?> Subject: Re: Houston: euphoria programmer needed irv mullins wrote: > Sort of like the irate call I got a few years ago: client was fuming "Your program > BROKE! Come fix it!" > > After a lot of conversation, I found out it had worked up until she "cleaned > up a lot of junk I never use" (her words). > Like what? "Oh, customer.dat, invoices.dat, stuff like that I never look at" Good story. We spend a lot of time protecting user's from themselves. It's sort of the job description. Otherwise, why spend a week writing code for something we could do manually in 15 minutes? It does get frustrating when the client (with nothing but the best of intentions I'm sure) blames you for something they did. Part of the game. Where is that anykey, any way? -= B E G I N =- X-EUFORUM: 21535 Date: 2008 May 24 18:40 From: Shawn Pringle <shawn.pringle at g?ail.?om> Subject: Re: Houston: euphoria programmer needed ken mortenson wrote: > > Good story. We spend a lot of time protecting user's from themselves. It's > sort of the job description. Otherwise, why spend a week writing code for > something we could do manually in 15 minutes? This is so true. There are hidden places though a user wouldn't normally go to that you can use for dat files. You can put in "Application Data". It's location is found by using the App_Data key in the registry somewhere and is inside the user's "home" directory. It is a good idea to keep the data files hidden this way. I suppose this is why we have hidden directories in WINDOWS. Shawn Pringle -= B E G I N =- X-EUFORUM: 21536 Date: 2008 May 24 19:56 From: irv mullins <irvm at ellija?.c?m> Subject: Re: Houston: euphoria programmer needed Shawn Pringle wrote: > This is so true. There are hidden places though a user wouldn't normally go > to that you can use for dat files. You can put in "Application Data". It's > location is found by using the App_Data key in the registry somewhere and is > inside the user's "home" directory. It is a good idea to keep the data files > hidden this way. I suppose this is why we have hidden directories in WINDOWS. I don't recall DOS having a registry. -= B E G I N =- X-EUFORUM: 21537 Date: 2008 May 24 20:13 From: Shawn Pringle <shawn.pringle at gm?il.?om> Subject: Re: Houston: euphoria programmer needed irv mullins wrote: > > Shawn Pringle wrote: > > > hidden this way. I suppose this is why we have hidden directories in WINDOWS. > > I don't recall DOS having a registry. Alright, I made an assumption. Looks like there are users that use only DOS. Shawn Pringle -= B E G I N =- X-EUFORUM: 21538 Date: 2008 May 24 20:23 From: irv mullins <irvm at e?lijay.c?m> Subject: Re: Houston: euphoria programmer needed Shawn Pringle wrote: > Alright, I made an assumption. Looks like there are users that use only DOS. That was not recent - I've been programming probably longer than you've been alive :) Unfortunately, users haven't grown smarter. Dumber, if anything, now that they have gotten into the habit of just clicking OK on everything they see. -= B E G I N =- X-EUFORUM: 21539 Date: 2008 May 24 20:35 From: David Stevenson <ff16 at m?s.net> Subject: Re: [OT] WinXP, "open with" menu: how to ADD to it??? Dan Moyer wrote: > > Dan Moyer wrote: > > > > If I right click on a Euphoria program, & select "open with", I see: > > EXW > > WordPad > > exwc > > Ed > > NotePad > > > > I don't know what the "exwc" is, but I'd like to ADD Judith's Editor, > > & I can't figure out HOW. I know it will be similar to "Ed", so the Exw.exe > > can run first & then run the app, but I'm not sure how I got Ed to be there > > nor how to add Editor. Any help?? > > > > Dan > > Well, never mind, I guess; I decided it would be better to try to put it > under "Edit With", but when I couldn't GET any "Edit With" to have multiple > options, just made an outright menu choice of "Judith's Editor", and made > that work. > > Dan Open a folder and click on tools tab. Click on folder options. Click on file types tab. Find EXW (or whichever extension you wish to add a right click item to). Click Advanced button. Click New. For action put in "JudyEdit" For application put in a string similar to <eucode> C:\EUPHORIA\BIN\ED.BAT "%1" <eucode> Not in a very intuitive place, is it? -= B E G I N =- X-EUFORUM: 21540 Date: 2008 May 24 20:39 From: Michael J. Sabal <m_sabal at yah?o.?om> Subject: Re: Any PB & ADO gurus? ken mortenson wrote: > > Alternately, does anyone have another way of using ADO recordset > from Euphoria? It would be nice if I could access any SQL db with > just a new connection string as I can with this code. > > Why not use an EDB (anticipating your question) db? A number of reasons, > basically because I know how to do safe multiuser calls to a SQL db, > but don't see how that would work with an EDB. I'd be interested in > that question as well. Hey, I'm interested in lots of things... ;-) Why not use ODBC? -= B E G I N =- X-EUFORUM: 21541 Date: 2008 May 24 20:41 From: irv mullins <irvm at el??jay.com> Subject: eu 4.0 I downloaded yesterday's release. Good news is it runs EuGTK programs. Bad news it it takes 8+ seconds to start up. Eu 3.1 takes 1 second or less. Profile_time doesn't work in Linux, so where or how should I start looking for the problem? -= B E G I N =- X-EUFORUM: 21542 Date: 2008 May 24 20:46 From: Bernie Ryan <xotron at blue?ro?.com> Subject: Re: Any PB & ADO gurus? ken mortenson wrote: > > You were so helpful for me before (thx Jason) I was hoping someone might > get me unstuck again so I can get to the fun part of writing code. > > A little background. I bought PowerBASIC years ago because I wanted a > good compiler. But I find PB to be both ugly and incomplete. > > While I've always liked the core C language, I find it gets dirty quickly. > > Euphoria is very clean and well named. It is euphoric writing code > with such a flexible data type and it isn't cluttered with a lot of junk. > > Anyway, to my issue; Here's the PB (double ugly IMHO) code... > > FUNCTION dbOpen ALIAS "dbOpen" (sPath AS ASCIIZ) EXPORT AS LONG > DIM v1 AS VARIANT > ON ERROR GOTO ErrorTrap > > LET m_db = NEW DISPATCH IN "ADODB.Connection.2.7" > LET m_rs = NEW DISPATCH IN "ADODB.Recordset.2.7" > > MSGBOX "CommandTimeout start" 'debug code > v1 = 120 > OBJECT LET m_db.CommandTimeout = v1 > MSGBOX "CommandTimeout done" 'debug code > > v1 = 3 '%ado_Use_Client > OBJECT LET m_db.CursorLocation = v1 > v1 = "Provider=Microsoft.Jet.OLEDB.4.0; " _ > & "Data Source=" & sPath & "; " _ > & "User ID=ADMIN; " _ > & "Password=;" > OBJECT LET m_db.ConnectionString = v1 > OBJECT CALL m_db.Open > dbOpen = 1 'success > EXIT FUNCTION > > ErrorTrap: > dbOpen = 0 'failure > LET m_db = NOTHING > END FUNCTION > ----------------------------------------------------- > When I originally wrote this the param sPath was AS STRING, but Euphoria's > allocate_string produces the PB type ASCIIZ so I changed that. > > This code works fine called from PB, but when called from Euphoria it > fails on the line... OBJECT LET m_db.CommandTimeout = v1 > > I added the two messageboxes to bracket the problem. Called from > Euphoria it never gets to the second messagebox. > > I'm baffled since disregarding the ugly syntax the line is pretty > straight forward. Any ideas? > > Alternately, does anyone have another way of using ADO recordset > from Euphoria? It would be nice if I could access any SQL db with > just a new connection string as I can with this code. > > Why not use an EDB (anticipating your question) db? A number of reasons, > basically because I know how to do safe multiuser calls to a SQL db, > but don't see how that would work with an EDB. I'd be interested in > that question as well. Hey, I'm interested in lots of things... ;-) ken: Did you look in the archive there are SQL and ODBC database programs here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=ODBC+Database+Connectivity Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21543 Date: 2008 May 24 21:12 From: Matt Lewis <matthewwalkerlewis at gmail.c??> Subject: Re: eu 4.0 irv mullins wrote: > > > I downloaded yesterday's release. > Good news is it runs EuGTK programs. > Bad news it it takes 8+ seconds to start up. > Eu 3.1 takes 1 second or less. > > Profile_time doesn't work in Linux, so where > or how should I start looking for the problem? Did someone post a binary? I've run wxEuphoria apps with 4.0, and it doesn't seem to take any longer. Matt -= B E G I N =- X-EUFORUM: 21544 Date: 2008 May 24 21:25 From: Jeremy Cowgar <jeremy at cowg??.com> Subject: Re: eu 4.0 Matt Lewis wrote: > > irv mullins wrote: > > > > > > I downloaded yesterday's release. > > Good news is it runs EuGTK programs. > > Bad news it it takes 8+ seconds to start up. > > Eu 3.1 takes 1 second or less. > > > > Profile_time doesn't work in Linux, so where > > or how should I start looking for the problem? > > Did someone post a binary? I've run wxEuphoria apps with 4.0, and it > doesn't seem to take any longer. > In IRC, I gave rywilly a link to a built version because we are jointly working on a wiki program. But I didn't make any public link. I'm sure others could have downloaded it, but it's pre-pre-alpha. However, that being said, I ran a simple bench mark of the sieve8k.exw script that comes with 3.1 and 4.0. To show nothing has been altered, I ran the 3.1 version. Here are the results for 4.0 and 3.1 as downloaded from RDS: $ time /opt/euphoria-3.1/bin/exu /opt/euphoria-3.1/demo/bench/sieve8k.exw 10000 Prime Sieve Benchmark Count: 1028 time: 4.82 real 0m4.825s user 0m4.816s sys 0m0.010s $ time /opt/euphoria-4.0/bin/exu /opt/euphoria-3.1/demo/bench/sieve8k.exw 10000 Prime Sieve Benchmark Count: 1028 time: 2.75 real 0m2.750s user 0m2.746s sys 0m0.003s Notice that 4.0 is more than 2 seconds faster. Now, this is including start up/parsing/run/cleanup time as the unix time command starts the timer, then spawns the program it's timing, then only stops the timer one the spawned program has been terminated and returned control to it. Why is it taking 8 seconds? That seems very odd. Can you tell us where you got the binary or if it is compiled from sources? If compiled from sources, what revision of svn? Thanks. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21545 Date: 2008 May 24 21:28 From: don cole <doncole at ?acbell.ne?> Subject: Re: Any PB & ADO gurus? ken mortenson wrote: > > You were so helpful for me before (thx Jason) I was hoping someone might > get me unstuck again so I can get to the fun part of writing code. > > A little background. I bought PowerBASIC years ago because I wanted a > good compiler. But I find PB to be both ugly and incomplete. > > While I've always liked the core C language, I find it gets dirty quickly. > > Euphoria is very clean and well named. It is euphoric writing code > with such a flexible data type and it isn't cluttered with a lot of junk. > > Anyway, to my issue; Here's the PB (double ugly IMHO) code... > > FUNCTION dbOpen ALIAS "dbOpen" (sPath AS ASCIIZ) EXPORT AS LONG > DIM v1 AS VARIANT > ON ERROR GOTO ErrorTrap > > LET m_db = NEW DISPATCH IN "ADODB.Connection.2.7" > LET m_rs = NEW DISPATCH IN "ADODB.Recordset.2.7" > > MSGBOX "CommandTimeout start" 'debug code > v1 = 120 > OBJECT LET m_db.CommandTimeout = v1 > MSGBOX "CommandTimeout done" 'debug code > > v1 = 3 '%ado_Use_Client > OBJECT LET m_db.CursorLocation = v1 > v1 = "Provider=Microsoft.Jet.OLEDB.4.0; " _ > & "Data Source=" & sPath & "; " _ > & "User ID=ADMIN; " _ > & "Password=;" > OBJECT LET m_db.ConnectionString = v1 > OBJECT CALL m_db.Open > dbOpen = 1 'success > EXIT FUNCTION > > ErrorTrap: > dbOpen = 0 'failure > LET m_db = NOTHING > END FUNCTION > ----------------------------------------------------- > When I originally wrote this the param sPath was AS STRING, but Euphoria's > allocate_string produces the PB type ASCIIZ so I changed that. > > This code works fine called from PB, but when called from Euphoria it > fails on the line... OBJECT LET m_db.CommandTimeout = v1 > > I added the two messageboxes to bracket the problem. Called from > Euphoria it never gets to the second messagebox. > > I'm baffled since disregarding the ugly syntax the line is pretty > straight forward. Any ideas? > > Alternately, does anyone have another way of using ADO recordset > from Euphoria? It would be nice if I could access any SQL db with > just a new connection string as I can with this code. > > Why not use an EDB (anticipating your question) db? A number of reasons, > basically because I know how to do safe multiuser calls to a SQL db, > but don't see how that would work with an EDB. I'd be interested in > that question as well. Hey, I'm interested in lots of things... ;-) Hello Ken, I am not familiar with PB but did kinow Liberty Basic. I found the best way was to forget all about Liberty Basic and start all over with Euphoria. It's was much easier and faster that way. This is just my 2 cents worth. Don Cole -= B E G I N =- X-EUFORUM: 21546 Date: 2008 May 24 21:35 From: Jeremy Cowgar <jeremy at cowg?r.c?m> Subject: Re: eu 4.0 To further test simply startup speed I made this bash script: #!/bin/sh for i in `seq 1 10000`; do /opt/euphoria-3.1/bin/exu hello.e done Each version of course calls the correct version. hello.e is: <eucode> integer a a = 1 </eucode> $ time ./test-3.1.sh real 0m11.550s user 0m4.153s sys 0m7.193s $ time ./test-4.0.sh real 0m11.288s user 0m3.786s sys 0m6.476s So the above loads/parses/executes/terminates exu 10,000 times. 4.0 is a tad faster, not much, but a tad. Something must be terribly wrong with the 8 second startup time for 4.0 and 3.1 being less than a second. Is this repeatable? Is there a test script we can run to try and debug the problem you are experiencing? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21547 Date: 2008 May 24 22:05 From: Bernie Ryan <xotron at blue?rog.c?m> Subject: Re: eu 4.0 Jeremy Cowgar wrote: > > To further test simply startup speed I made this bash script: > > #!/bin/sh > > for i in `seq 1 10000`; > do > /opt/euphoria-3.1/bin/exu hello.e > done > > Each version of course calls the correct version. > > hello.e is: > > <eucode> > integer a > a = 1 > </eucode> > > $ time ./test-3.1.sh > > real 0m11.550s > user 0m4.153s > sys 0m7.193s > > $ time ./test-4.0.sh > > real 0m11.288s > user 0m3.786s > sys 0m6.476s > > So the above loads/parses/executes/terminates exu 10,000 times. 4.0 is a tad > faster, not much, but a tad. > > Something must be terribly wrong with the 8 second startup time for 4.0 and > 3.1 being less than a second. Is this repeatable? Is there a test script we > can run to try and debug the problem you are experiencing? > > -- Jeremy: When Rob came out with version 2.5 the user's had a similar problem with EXW. http://www.openeuphoria.org/cgi-bin/esearch.exu?thread=1&fromMonth=B&fromYear=9&toMonth=1&toYear=A&keywords=%22v2.5+Opens+exw+files+wayyyy+too+slow%22 Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21548 Date: 2008 May 24 22:55 From: Matt Lewis <matthewwalkerlewis at gm?il.com> Subject: Re: eu 4.0 Bernie Ryan wrote: > > When Rob came out with version 2.5 the user's had a similar problem with > EXW. That's true, but it was due to the switch to a translated front end from hand coded C. Most of that was fixed. There's much less difference between 3.1 and 4.0. Matt -= B E G I N =- X-EUFORUM: 21549 Date: 2008 May 25 0:48 From: irv mullins <irvm at ellij?y?com> Subject: Re: eu 4.0 Jeremy Cowgar wrote: > > Why is it taking 8 seconds? That seems very odd. Can you tell us where you got > the binary or if it is compiled from sources? If compiled from sources, what > revision of svn? > > Thanks. > > -- > Jeremy Cowgar I got it from this weird guy's website. Maybe you've heard of him :) http://jeremy.cowgar.com/files/eu40.tar.gz 23-May-2008 17:20 3.1M -= B E G I N =- X-EUFORUM: 21550 Date: 2008 May 25 1:09 From: Jeremy Cowgar <jeremy at ?owgar.co?> Subject: Re: eu 4.0 irv mullins wrote: > > > I got it from this weird guy's website. Maybe you've heard of him :) > > <a href="http://jeremy.cowgar.com/files/eu40.tar.gz">http://jeremy.cowgar.com/files/eu40.tar.gz</a> 23-May-2008 17:20 3.1M You downloaded from him? Wow, now we all know your crazy! :-) Anyway, that's the same binary (well, w/in a few revisions of) from the tests that I showed here. Can you give us an example that's messing up on you? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21551 Date: 2008 May 25 3:09 From: ken mortenson <kenneth_john at yah??.com> Subject: Re: Any PB & ADO gurus? Michael J. Sabal wrote: >Why not use ODBC? Bernie Ryan wrote: >Did you look in the archive... don cole wrote: >I found the best way [is to] start all over with Euphoria. Thanks for the responses guys. I haven't used ODBC in over ten years, in VB6 I pulled info from ODBC and just did direct ADO. If I remember it was because of the performance hit using ODBC. Bernie, in the time honored tradition of programmers everywhere, I was trying to be lazy and here you give me homework to do ;-) Don, I've been looking for over thirty years for the 'ONE TRUE LANGUAGE' a bit like Don Quixote. I'm a true believer because I see glimpses of it and know I in theory could get what I want. Euphoria is so close, but it continues in some traditions that I am dead set against. Don ya push my button and I feel a rant coming on... I hesitate to commit to Euphoria partly because I would never deliver a product I couldn't be confident in. This DLL I wrote works and I've used it, but for reasons I don't understand, it blows up when called from Euphoria. Not that it's Euphoria's fault, frankly I'm amazed I was able to use an ADO object from PowerBASIC at all. I wasn't expecting it to work, but it did and has been rock solid in several other projects I've done. PowerBASIC is out, because although it does some things I need, it's ugly (which makes it difficult to read) and doesn't do all that I need. Another thing (again not the fault of Euphoria) is I wrote a windows program right after my skipper submission using win32lib. When I updated to a newer version of win32lib my program didn't work anymore. So I won't use win32lib because I don't trust it to not break my program in the future. I've had this problem with updated controls for VB6 as well. I don't buy those controls anymore either. Now I just write my own (where I can.) People have ideas all over the map. This discussion of namespaces caught my interest because it's a good example of solving the wrong problem. Name collisions don't happen with the right scoping rules. OOP is overhyped, but being able to create instances of a class completely eliminates this problem in a way that makes enterprise level development very managable. I maintained over a million lines of VB6 code (by myself during some of it's ten year life) which I couldn't have done without the project's file level scoping rules and the IDE allowing me to immediately drill down to the definition of any routine or variable in two clicks. Having to search for the declarations with no idea of what file it's in ridiculously slows down productivity. You demonstrate a problem in a program I've never seen before written in VB6 and I can track it down in the code in just a few seconds (it may take longer to actually fix the problem, but finding it is usually trivial.) I can't live without that anymore. I'm old and cranky. ... and that's the end of my rant. ken. Now I've got to do the homework Bernie gave me.... sheesh... -= B E G I N =- X-EUFORUM: 21552 Date: 2008 May 25 4:37 From: Mike777 <anon4321 at gma?l.c?m> Subject: Proprietariness or levels of it, anyway This may be a hornet's nest type issue, or it may be benign, but does anybody have a favorite mechanism for making one's code proprietary? Other than a commercial solution. Thanks Mike -= B E G I N =- X-EUFORUM: 21553 Date: 2008 May 25 4:56 From: Kenneth Rhodes <ken_rhodes30436 at yahoo.?o?> Subject: Re: Proprietariness or levels of it, anyway Mike777 wrote: > > This may be a hornet's nest type issue, or it may be benign, but does anybody > have a favorite mechanism for making one's code proprietary? Other than a commercial > solution. > > Thanks > > Mike Study MicroSoft-- then you can learn not only how to make anyone's code proprietary. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21554 Date: 2008 May 25 4:57 From: Dan Moyer <danielmoyer at pr?dig?.net> Subject: Re: [OT] WinXP, "open with" menu: how to ADD to it??? David Stevenson wrote: > > Dan Moyer wrote: > > > > Dan Moyer wrote: > > > > > > If I right click on a Euphoria program, & select "open with", I see: > > > EXW > > > WordPad > > > exwc > > > Ed > > > NotePad > > > > > > I don't know what the "exwc" is, but I'd like to ADD Judith's Editor, > > > & I can't figure out HOW. I know it will be similar to "Ed", so the Exw.exe > > > can run first & then run the app, but I'm not sure how I got Ed to be there > > > nor how to add Editor. Any help?? > > > > > > Dan > > > > Well, never mind, I guess; I decided it would be better to try to put it > > under "Edit With", but when I couldn't GET any "Edit With" to have multiple > > options, just made an outright menu choice of "Judith's Editor", and made > > that work. > > > > Dan > > Open a folder and click on tools tab. > Click on folder options. > Click on file types tab. > Find EXW (or whichever extension you wish to add a right click item to). > Click Advanced button. > Click New. > For action put in "JudyEdit" > For application put in a string similar to > <eucode> > C:\EUPHORIA\BIN\ED.BAT "%1" > <eucode> > > Not in a very intuitive place, is it? No, it's not, but that's approx. what I did do, although instead of making a .bat file, on the application line I think I put something like C:\EUPHORIA\BIN\EXW.EXE followed by the path to Judith's Editor, followed by the "%1", and I may have put one or both of those path/names also in quotes, too. But it did work, and it's handy, and maybe your outline will help someone else also to do something similar. Thanks, Dan -= B E G I N =- X-EUFORUM: 21555 Date: 2008 May 25 5:09 From: Rob H. <robert.hrosc at gm?il?com> Subject: Newbie question. Difficulty understanding a few things. Hello. I've been reading "A beginner's guide to euphoria". This question pertains to demo program 43 in that tutorial... I don't quite understand a few things. I would appreciate if somebody could tell me what's going on in this code... <eucode> for element = 1 to length(seek_positions) do status = seek(file_id,seek_positions[element][1]-1) if status = 0 then puts(file_id,seek_positions[element][2]) end if </eucode> In the second line. I don't understand what the [1]-1 is doing... can somebody please explain? Also, what's the [2] in the 4th line doing...? Then Further down in the code... <eucode> while compare(input_line,-1) != 0 do puts(1,input_line) input_line = gets(file_id) end while </eucode> Why are they comparing input_line to -1?? I'm sorry. I'm a newbie, and there isn't enough documentation available about Euphoria to satisfy all of my questions... Thanks for the help! -= B E G I N =- X-EUFORUM: 21556 Date: 2008 May 25 5:22 From: Mike777 <anon4321 at gmail?c?m> Subject: Re: Newbie question. Difficulty understanding a few things. Rob H. wrote: > > > Hello. I've been reading "A beginner's guide to euphoria". > This question pertains to demo program 43 in that tutorial... I don't quite > understand a few things. I would appreciate if somebody could tell me what's > going on in this code... > > <eucode> > for element = 1 to length(seek_positions) do > status = seek(file_id,seek_positions[element][1]-1) > if status = 0 then > puts(file_id,seek_positions[element][2]) > end if > </eucode> > In the second line. I don't understand what the [1]-1 is doing... can somebody > please explain? Both this question and the one below require you to understand how sequences work. Think of them as what other languages typically describe as an "array". But it is more like "an array on steroids" as the language interfaces with sequences in ways that other languages do not interface with arrays. And the fact that the language interfaces with sequences provides a lot of power. In the specific line of code above, you are calling a function (seek) which takes two arguments. The second argument is a number. That number is determined by going to the seek_positions sequence and then looking at what would be referenced in another language as an array, with something like "seek_positions(element,1)" and once that number is retrieved, subtract one from that. > Also, what's the [2] in the 4th line doing...? Same as above. > > Then > > Further down in the code... > > <eucode> > while compare(input_line,-1) != 0 do > puts(1,input_line) > input_line = gets(file_id) > end while > </eucode> > > Why are they comparing input_line to -1?? Do you have the documentation? If you look up the "compare" library routine you will see that it is comparing the value if "input_line" to "-1". > I'm sorry. I'm a newbie, and there isn't enough documentation available about > Euphoria to satisfy all of my questions... Oh, it is there. You just have to get used to using it. Use this in a google search and select the first link: "sequences are it" euphoria That should get you going. Welcome and good luck. Mike > > > Thanks for the help! -= B E G I N =- X-EUFORUM: 21557 Date: 2008 May 25 5:30 From: Mike777 <anon4321 at g?ail.?om> Subject: Re: Newbie question. Difficulty understanding a few things. Rob H. wrote: > Further down in the code... > > <eucode> > while compare(input_line,-1) != 0 do > puts(1,input_line) > input_line = gets(file_id) > end while > </eucode> > > Why are they comparing input_line to -1?? I'm not sure my response answered the specific question you were asking, which is "why". That code it traversing through the information/data in the file which is identified by the "file_id". It starts by assuming the value of input_line is something other than -1. If that is a valid assumption, then it executes the next two lines. The first of those next two lines outputs what is in input_line to the console (the console's identifier is "1"). The second line then gets another bit of information from the "file_id" file. Or, at least it tries. If it fails, it will put -1 (as a number) into input_line. Finally, it will then re-execute the while line and do everything over again if input_line is something other than -1. So the answer to your question is that the gets function will fail when the end of file is reached and when it fails it puts -1 into the input_line variable and therefore that line is testing input_line to see when its value is -1 and when it is it stops executing this loop. Mike -= B E G I N =- X-EUFORUM: 21558 Date: 2008 May 25 7:03 From: Rob H. <robert.hrosc at gm?il?com> Subject: Re: Newbie question. Difficulty understanding a few things. I understand what seek is doing. However. The seek_positions[element] determines where seek is currently "looking" because it's incrementing with the for element loop. So why is the [1] necessary?? Not sure if I'm explaining myself correctly... In the Reference Manual, seek only takes one argument... I'm wondering what the [1] and -1 specifically do. -= B E G I N =- X-EUFORUM: 21559 Date: 2008 May 25 7:09 From: don cole <doncole at pa?bell.n?t> Subject: Re: Any PB & ADO gurus? ken mortenson wrote: > > Michael J. Sabal wrote: > >Why not use ODBC? > > Bernie Ryan wrote: > >Did you look in the archive... > > don cole wrote: > >I found the best way [is to] start all over with Euphoria. > > Thanks for the responses guys. I haven't used ODBC in over ten years, in > VB6 I pulled info from ODBC and just did direct ADO. If I remember it was > because of the performance hit using ODBC. Bernie, in the time honored > tradition of programmers everywhere, I was trying to be lazy and here you > give me homework to do ;-) > > Don, I've been looking for over thirty years for the 'ONE TRUE LANGUAGE' a > bit like Don Quixote. I'm a true believer because I see glimpses of it > and know I in theory could get what I want. Euphoria is so close, but it > continues in some traditions that I am dead set against. > > Don ya push my button and I feel a rant coming on... > > I hesitate to commit to Euphoria partly because I would never deliver a > product I couldn't be confident in. This DLL I wrote works and I've used > it, but for reasons I don't understand, it blows up when called from > Euphoria. Not that it's Euphoria's fault, frankly I'm amazed I was able > to use an ADO object from PowerBASIC at all. I wasn't expecting it to work, > but it did and has been rock solid in several other projects I've done. > > PowerBASIC is out, because although it does some things I need, it's ugly > (which makes it difficult to read) and doesn't do all that I need. > > Another thing (again not the fault of Euphoria) is I wrote a windows program > right after my skipper submission using win32lib. When I updated to a newer > version of win32lib my program didn't work anymore. So I won't use win32lib > because I don't trust it to not break my program in the future. This could easly be fixed with include win32lib_ver3.2.exw include win32lib_ver4.exw etc... I've had > this problem with updated controls for VB6 as well. I don't buy those > controls anymore either. Now I just write my own (where I can.) > > People have ideas all over the map. This discussion of namespaces caught my > interest because it's a good example of solving the wrong problem. Name > collisions don't happen with the right scoping rules. OOP is overhyped, > but being able to create instances of a class completely eliminates this > problem in a way that makes enterprise level development very managable. > > I maintained over a million lines of VB6 code (by myself during some of > it's ten year life) which I couldn't have done without the project's file > level scoping rules and the IDE allowing me to immediately drill down to > the definition of any routine or variable in two clicks. Having to search > for the declarations with no idea of what file it's in ridiculously slows > down productivity. You demonstrate a problem in a program I've never seen > before written in VB6 and I can track it down in the code in just a few > seconds (it may take longer to actually fix the problem, but finding it is > usually trivial.) I can't live without that anymore. I'm old and cranky. > > ... and that's the end of my rant. > > ken. > > Now I've got to do the homework Bernie gave me.... sheesh... Don Cole -= B E G I N =- X-EUFORUM: 21560 Date: 2008 May 25 7:33 From: Dan Moyer <danielmoyer at prodi?y?net> Subject: Re: Newbie question. Difficulty understanding a few things. Rob H. wrote: > > > I understand what seek is doing. However. The seek_positions[element] determines > where seek is currently "looking" because it's incrementing with the for element > loop. > So why is the [1] necessary?? Not sure if I'm explaining myself correctly... > In the Reference Manual, seek only takes one argument... I'm wondering what > the [1] and -1 specifically do. Rob, the variable "seek_positions" is in effect an ARRAY, as it was created earlier in the demo to contain TWO items per "element", namely, the POSITION of a found vowel in the demo paragraph, and the actual VOWEL itself, so that the vowels, which had been REMOVED from the demo paragraph, could later be RE-INSERTED. So, the counter "element" is looking at each instance of a found vowel, where the FIRST item of each instance is the POSITION, and the SECOND item of each instance is the VOWEL. So, as the counter "element" is incremented, the code first finds WHERE in the demo the vowel has been removed from, namely seek_positions[element][1], and then uses that info to re-insert the actual vowel, which is stored at the SECOND place in each instance of discovered vowel, namely seek_positions[element][2]. Do you understand now why the [1] is being used? The actual sequence "seek_positions" would look like this for the first 5 "elements": {{3,101},{6,101},{7,97},{8,117},{12,111}} Notice the GROUPS of numbers; each group one of the "elements" counter; the FIRST number in each of those groups is the POSITION of a found vowel, and the SECOND number is the ascii representation of the vowel that was found at that postition. So the "elements" counter finds the GROUP, and the [1] or [2] finds the POSITION or VOWEL, respectivly, for each "element". With respect to the -1, unfortunatly, I can't explain why the code looks, apparently, at the place BEFORE each particular instance, which is what the -1 seems to do, because even though it works, and does NOT work if the -1 is removed, I don't understand why. :( Dan Moyer -= B E G I N =- X-EUFORUM: 21561 Date: 2008 May 25 7:44 From: Dan Moyer <danielmoyer at pro?igy.n?t> Subject: Re: Newbie question. Difficulty understanding a few things. Rob H. wrote: > > > I understand what seek is doing. However. The determines > where seek is currently "looking" because it's incrementing with the for element > loop. > So why is the [1] necessary?? Not sure if I'm explaining myself correctly... > In the Reference Manual, seek only takes one argument... I'm wondering what > the [1] and -1 specifically do. Rob, I could have been more succinct: there IS only one argument being passed, it's what ever is found at the FIRST place in seek_positions[element], minus 1. The counter "element" is looking each item in a sequence variable which has TWO items per element. Dan -= B E G I N =- X-EUFORUM: 21562 Date: 2008 May 25 8:09 From: don cole <doncole at p?c?ell.net> Subject: Re: Newbie question. Difficulty understanding a few things. Rob H. wrote: > > > I understand what seek is doing. However. The seek_positions[element] determines > where seek is currently "looking" because it's incrementing with the for element > loop. > So why is the [1] necessary?? Not sure if I'm explaining myself correctly... > In the Reference Manual, seek only takes one argument... I'm wondering what > the [1] and -1 specifically do. <eucode> seek_positions = {} for element = 1 to length(string) do if find(string[element],vowels) then seek_positions = append(seek_positions,{element, string[element]}) string[element] = ' ' end if end for </eucode> Here we are building a 2 element sequence called seek_positions. the first element being the element number. the second element being a string (' ') in the code seek_positions[1][1]=1 seek_positions[1][2]=' ' seek_postition[2][1]=2 seek_positions[2][2]=' ' etc... so seek_positions[2][1]-1=1 seek_positions[5][1]-3=2 Don Cole -= B E G I N =- X-EUFORUM: 21563 Date: 2008 May 25 8:19 From: Dan Moyer <danielmoyer at pro?ig?.net> Subject: Re: Newbie question. Difficulty understanding a few things. don cole wrote: > > Rob H. wrote: > > > > > > I understand what seek is doing. However. The seek_positions[element] determines > > where seek is currently "looking" because it's incrementing with the for element > > loop. > > So why is the [1] necessary?? Not sure if I'm explaining myself correctly... > > In the Reference Manual, seek only takes one argument... I'm wondering what > > the [1] and -1 specifically do. > <eucode> > seek_positions = {} > for element = 1 to length(string) do > if find(string[element],vowels) then > seek_positions = append(seek_positions,{element, string[element]}) > string[element] = ' ' > end if > end for > </eucode> > > Here we are building a 2 element sequence called seek_positions. > > the first element being the element number. > > the second element being a string (' ') > > in the code > seek_positions[1][1]=1 > seek_positions[1][2]=' ' > > seek_postition[2][1]=2 > seek_positions[2][2]=' ' > > etc... > > so seek_positions[2][1]-1=1 > seek_positions[5][1]-3=2 > > Don Cole Hi Don, That's not exactly right, I think. Yes, seek_positions is a two element array, but the empty space ' ' is not being added to seek_positions, but rather is REPLACING a character in string: string[element] = ' ' seek_positions has an item added each time a vowel is found, and that item consists of the position counter ("element") and the vowel itself. Dan -= B E G I N =- X-EUFORUM: 21564 Date: 2008 May 25 8:30 From: gshingles <gshingles at g?ail.?om> Subject: Re: Proprietariness or levels of it, anyway Mike777 wrote: > > This may be a hornet's nest type issue, or it may be benign, but does anybody > have a favorite mechanism for making one's code proprietary? Other than a commercial > solution. I don't think it's a bad thing (this issue). I think just about everyone would want to benefit financially from their efforts for at least some of what they do, even if they are involved with other free software projects. After all, the more they can support themselves financially the more free time they may have to benefit other efforts. That said, and even though I don't personally try to sell software, if I want it to remain closed (perhaps for example in a commercial environment where you are not specifically paid to write software) is only to release the compiled translated to C program. Even if you do release code, a carefully worded and placed license agreement could help if you are in a position of being related to lawyers, or being able to afford their services. :) If you want to prevent copying of binaries then that's another story I suppose. The fact that you could download and install a Microsoft operating system or major product in less than an hour shows that no level of sophisticated copy protection will be foolproof. Like my father always used to say "locks are to keep honest people out". I think the license is the most important, assuming you can catch who is infringing on your proprietary rights, because at least then you have an unabiguous leg to stand on. Gary -= B E G I N =- X-EUFORUM: 21565 Date: 2008 May 25 9:00 From: Dan Moyer <danielmoyer at prodi??.net> Subject: Re: Newbie question. Difficulty understanding a few things. Rob H. wrote: > > > I understand what seek is doing. However. The seek_positions[element] determines > where seek is currently "looking" because it's incrementing with the for element > loop. > So why is the [1] necessary?? Not sure if I'm explaining myself correctly... > In the Reference Manual, seek only takes one argument... I'm wondering what > the [1] and -1 specifically do. Rob, I think I finally understand what the -1 is there for. From the manual for seek: "The initial file position is 0 for files opened for read, write or update". So, since the first position in the file is a ZERO REFERENCE, every instance of position in the file must be one less than the "element" counter, which starts at ONE, not ZERO. Sheesh, took me long enough! Dan -= B E G I N =- X-EUFORUM: 21566 Date: 2008 May 25 9:11 From: Mike777 <anon4321 at gm?il?com> Subject: Re: Newbie question. Difficulty understanding a few things. Rob H. wrote: > > > I understand what seek is doing. However. The seek_positions[element] determines > where seek is currently "looking" because it's incrementing with the for element > loop. > So why is the [1] necessary?? Not sure if I'm explaining myself correctly... > In the Reference Manual, seek only takes one argument... I'm wondering what > the [1] and -1 specifically do. Me thinks that you didn't read my entire message closely. Go back to the part where I talked about the construct you are looking for clarification about being the equivalent to an array which would be represented by: "seek_positions(element,1)" You really need to read up on sequences and how they are shown. For example: seek_positions[element][1] is the Euphoria way of representing something which is probably more familiar to you as: seek_positions(element,1) Sequences are essentially very flexible arrays where each individual element can be either a number or another (embedded) sequence. This can get very complicated, very quickly. It is also amazingly powerful. But if you think of them as nothing more than arrays, you will begin to understand them. Let's go the other direction. Say you have a 5 by 5 array, so you have 25 elements (and let's make it a 1-based array rather than a zero-based array, for convenience) The first element would be array(1,1) and the last would be array(5,5). They would be shown as: array[1][1] and array[5][5] in Euphoria. So, the [1] that you are asking about is nothing more than the array index for the second element of a two-element index of the seek_positions variable (which in Euphoria is a sequence but in other languages would be called an array). As far as what the -1 does, that says "subtract 1" from the result you determined by looking at the specific element within the seek_positions sequence found at the index of {element,1). It might be helpful if you say what computer language you have the most experience with. That way, people here can make reference to that language when explaining Euphoria's methods. If this isn't clear, come back at us again. Mike -= B E G I N =- X-EUFORUM: 21567 Date: 2008 May 25 9:14 From: Mike777 <anon4321 at gmai?.?om> Subject: Re: Proprietariness or levels of it, anyway gshingles wrote: > > Mike777 wrote: > > > > This may be a hornet's nest type issue, or it may be benign, but does anybody > > have a favorite mechanism for making one's code proprietary? Other than a commercial > > solution. > > > If you want to prevent copying of binaries then that's another story I suppose. That is the story I'm trying to write. > The fact that you could download and install a Microsoft operating system or > major product in less than an hour shows that no level of sophisticated copy > protection will be foolproof. Like my father always used to say "locks are > to keep honest people out". Right. Which is why I am interested in what people have as a favorite mechanism, because I know that it is useless to try and write the perfect concept into code, as there isn't anything of the sort. I definitely think that, for the most part, the folks are honest who will buy what I might sell. It is their employees that I'm most interested in ensuring don't do something their bosses would dislike. Just a little protection is required, not a 24-hour German Shepherd who hasn't been fed for a week. Mike -= B E G I N =- X-EUFORUM: 21568 Date: 2008 May 25 9:58 From: don cole <doncole at ?acbell?net> Subject: Re: Newbie question. Difficulty understanding a few things. Dan Moyer wrote: > > don cole wrote: > > > > Rob H. wrote: > > > > > > > > > I understand what seek is doing. However. The seek_positions[element] determines > > > where seek is currently "looking" because it's incrementing with the for element > > > loop. > > > So why is the [1] necessary?? Not sure if I'm explaining myself correctly... > > > In the Reference Manual, seek only takes one argument... I'm wondering what > > > the [1] and -1 specifically do. > > <eucode> > > seek_positions = {} > > for element = 1 to length(string) do > > if find(string[element],vowels) then > > seek_positions = append(seek_positions,{element, string[element]}) > > string[element] = ' ' > > end if > > end for > > </eucode> > > > > Here we are building a 2 element sequence called seek_positions. > > > > the first element being the element number. > > > > the second element being a string (' ') > > > > in the code > > seek_positions[1][1]=1 > > seek_positions[1][2]=' ' > > > > seek_postition[2][1]=2 > > seek_positions[2][2]=' ' > > > > etc... > > > > so seek_positions[2][1]-1=1 > > seek_positions[5][1]-3=2 > > > > Don Cole > > Hi Don, > > That's not exactly right, I think. > > Yes, seek_positions is a two element array, but the empty space ' ' is > not being added to seek_positions, but rather is REPLACING a character in > string: string[element] = ' ' > > seek_positions has an item added each time a vowel is found, and that item > consists of the position counter ("element") and the vowel itself. > > Dan yeah! your right I missed that if find there. Don Cole -= B E G I N =- X-EUFORUM: 21569 Date: 2008 May 25 14:28 From: c.k.lester <euphoric at ?kl?ster.com> Subject: Re: Newbie question. Difficulty understanding a few things. Mike777 wrote: > Rob H. wrote: > > So why is the [1] necessary?? > You really need to read up on sequences and how they are shown. This page might help: http://www.usingeuphoria.com/books/jubilation/?variables -= B E G I N =- X-EUFORUM: 21570 Date: 2008 May 25 14:38 From: c.k.lester <euphoric at ?klester.com> Subject: Re: Proprietariness or levels of it, anyway Mike777 wrote: > gshingles wrote: > > If you want to prevent copying of binaries then that's another story I suppose. > That is the story I'm trying to write. Key each executable to the hard drive serial number. That way the executable will only work on PCs with that particular serial number. You can do it one of two ways: build a custom executable for each customer after you get the serial number of the drive to which it will be installed, or use an ini file (or registry or whatever) that uses a format like this: ----License File------------------------------------------ -- Do not tamper with this file or your license will be -- -- broken and you will have to purchase another copy. -- ---------------------------------------------------------- >84753984573094 #849HW98FH9WFAKJSH08 The number after the bracket is the licensed PC serial number. The number after the pound sign is a checksum of the contents of the license file. Without the license file, the program doesn't work. If the person tries to tamper with the license file, the checksum will not match and the program won't work. It has worked for me for 15 years. -= B E G I N =- X-EUFORUM: 21571 Date: 2008 May 25 14:41 From: Jeremy Cowgar <jeremy at cowgar?co?> Subject: Re: Proprietariness or levels of it, anyway c.k.lester wrote: > > >84753984573094 > > #849HW98FH9WFAKJSH08 > > The number after the bracket is the licensed PC serial number. The number > after the pound sign is a checksum of the contents of the license file. > Without the license file, the program doesn't work. If the person tries > to tamper with the license file, the checksum will not match and the > program won't work. > > It has worked for me for 15 years. What about Linux? I am sure the hd serial number must be somewhere, but does that mean when I do an upgrade I can to call you and relicense my software? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21572 Date: 2008 May 25 15:10 From: Jerry Story <story.jerry at gmail.c??> Subject: Debian Package Maker - Add Scripts - sudo ldconfig In Debian Package Maker, under Add Scripts, it needs sudo ldconfig. How do you get it to handle the password? -= B E G I N =- X-EUFORUM: 21573 Date: 2008 May 25 15:58 From: Bernie Ryan <xotron at b?uefro?.com> Subject: Re: Debian Package Maker - Add Scripts - sudo ldconfig Jerry Story wrote: > > In Debian Package Maker, under Add Scripts, it needs sudo ldconfig. How do you > get it to handle the password? Jerry: If you put 'sudo ldconfig' in the script won't running the script automatically prompt for a password when it runs sudo ? Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21574 Date: 2008 May 25 16:36 From: Jerry Story <story.jerry at g?ail.c?m> Subject: Re: Debian Package Maker - Add Scripts - sudo ldconfig Bernie Ryan wrote: > > Jerry Story wrote: > > > > In Debian Package Maker, under Add Scripts, it needs sudo ldconfig. How do you > > get it to handle the password? > > Jerry: > > If you put 'sudo ldconfig' in the script won't running the script > > automatically prompt for a password when it runs sudo ? I had some kind of idea that it was supposed to do everything by itself and not require a response. Because that's the way .deb files usually behave. -= B E G I N =- X-EUFORUM: 21575 Date: 2008 May 25 16:57 From: c.k.lester <euphoric at c?lester.co?> Subject: Re: Proprietariness or levels of it, anyway Jeremy Cowgar wrote: > c.k.lester wrote: > > It has worked for me for 15 years. > What about Linux? We don't make stuff that works in Linux, but the same ideas apply. > I am sure the hd serial number must be somewhere, but does > that mean when I do an upgrade I can to call you and relicense my software? Not only that, but you have to transfer that license... so, if you are getting an upgrade, you uninstall first. Then we can put the license on the new PC. If your hard drive dies... well... that's on a case-by-case basis. :/ -= B E G I N =- X-EUFORUM: 21576 Date: 2008 May 25 17:16 From: Bernie Ryan <xotron at blu?fr?g.com> Subject: Re: Proprietariness or levels of it, anyway Mike777 wrote: > > This may be a hornet's nest type issue, or it may be benign, but does anybody > have a favorite mechanism for making one's code proprietary? Other than a commercial > solution. > > Thanks > Mike: You can always put your code in a DLL or a SO library and ship the application that accesses the dll in a bound exe. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21577 Date: 2008 May 25 18:09 From: yuku <yuku at i?i?ek.com> Subject: Fwd: New to Euphoria Somehow I am still subscribed to the almost died mailing list below. Anyone wants to answer this guy? ↓ Subject: [programming_euphoria] New to Euphoria Date: Sat, 24 May 2008 22:42:54 -0000 From: chatnick_au <chatnick_au at yahoo.com> Reply-To: programming_euphoria at yahoogroups.com To: programming_euphoria at yahoogroups.com Hello group, I am glad to see a group devoted to Euphoria up and running. I am planing a particular task and was attracted to Euphoria for a couple of reasons. First its an interpreted language.. a novice like me ought to have an easier time debugging the code. Second the idea of sequences appeals to me, makes the dynamic arrays and pointer arithmetic so obsolete. I just want to reassure you, I shall be screaming out for help and guidance. Till that time, Ignorantly Yours -= B E G I N =- X-EUFORUM: 21578 Date: 2008 May 25 18:24 From: ken mortenson <kenneth_john at y?hoo.co?> Subject: Re: Any PB & ADO gurus? don cole wrote: > > ken mortenson wrote: > > Another thing (again not the fault of Euphoria) is I wrote a windows program > > right after my skipper submission using win32lib. When I updated to a newer > > version of win32lib my program didn't work anymore. So I won't use win32lib > > because I don't trust it to not break my program in the future. > > This could easly be fixed with > > include win32lib_ver3.2.exw > > include win32lib_ver4.exw > > etc... Your making me shudder Don! That is a solution, but is it the right one? Remember, this is Don Quixote your talking to. Making something work is not enough. As a programmer I feel great responsibilities. Programmers seem to know, to a greater or lesser extent, that they have a responsibility to produce a product that satisfies the customer. Yes, they all know they have a responsibility to make things work. But they have another responsibility that usually doesn't get the attention it deserves. They have a responsibility to be humble. Your solution, in my opinion for what it's worth (IMOFWIW), deals with the first two but fails to address the third. Let me explain why if I may. I strongly believe in the concept of the humble programmer. I often talk about ugly code and the two are related. Ugly code isn't just funky syntax. It isn't just avoiding spaghetti code. Ugly code is fragile. Everything breaks, but solid code breaks in ways that are predictable and managable. Your solution certainly might be managable but increases the workload of any (you can't always assume this to be yourself) that follow you. Your solution is a sledgehammer which is fine, but for me it's not the right one. I hope I haven't offended and I know I haven't explained myself well. BTW, my attraction to Euphoria is partly because I see it embodies much of the wisdom I feel my experience has given me. I also see a lost opportunity cost. There is a reason VB is third in popularity. There is a reason it's not number one. There is a reason Euphoria is 47th. Euphoria, could go in either direction. With the right changes, I see that it could go to number one and stay there with no challengers. The wrong changes will leave it languishing below the predominate languages. I see a lot of people advocating the wrong changes. Nothing gives you more raw power than machine language (best written with a macro assember of some kind.) But it's not popular. Why? No, it's not because ML is hard. It's really not any harder than Euphoria. It's because it's difficult to be expressive in ML. Euphoria's strength is that it is expressive. Algorithms are easier to write than in other languages. But it has some of the shortcomings of ML too. This is best expresses by the INCLUDE keyword. Include makes your program one long linear list (ignoring loops and branches for the moment) which is really all it ever is to your machine. People are not machines. Machines do some things better than people and people do some things better than machines. We need to play to eaches strength. People naturally conceptualize in a modular way rather than linear. We divide and conquer. This is our strength. ...and that's a lot of hot air. Don, you do push my buttons! That's probably a good thing. My best response will be by example. So I need to get busy on my project which I hope will show you some of what I've talked about here. I'm not doing the fun stuff yet because of some of the show stoppers I working on, but once I'm past that I should have code to upload within a short time after. Again, thanks for your help. Don't let my bloviating fool you into thinking I don't greatly appreciate your responding because I certainly do. -= B E G I N =- X-EUFORUM: 21579 Date: 2008 May 25 18:58 From: ken mortenson <kenneth_john at y??oo.com> Subject: Re: Any PB & ADO gurus? I have a habit of writing "your" when it should be "you're". Please forgive. -= B E G I N =- X-EUFORUM: 21580 Date: 2008 May 25 19:25 From: CChris <christian.cuvier at agriculture.?ouv.?r> Subject: Re: Fwd: New to Euphoria I got that email too. If I get a query, I may be bale to reply, but so far I don't see what I can tell him. CChris -= B E G I N =- X-EUFORUM: 21581 Date: 2008 May 25 19:25 From: Rob H. <robert.hrosc at gmail.?om> Subject: Re: Newbie question. Difficulty understanding a few things. Thank you everybody for the help. I do understand every demo program in the tutorial thus far. I refuse to move onto other demo programs until I can fully understand what is happening in the code. This will make for some healthy reading later. I'm not familiar with anything except c++. It's a very limited familiarity too. Logic, in general I understand, it's just the syntax that throws me for a loop and how given data is manipulated or referenced by use of said syntax. I'll definitely be posting back... hopefully not too often ;)! Thanks again for the detailed answers. -= B E G I N =- X-EUFORUM: 21582 Date: 2008 May 25 19:34 From: Rob H. <robert.hrosc at gmail.co?> Subject: More tutorials. I guess the number of tutorials on this language is limited. I have a few already. Does anybody know of any other tutorials that I can read?? I already have abgte 1 & 2, guiphoria, and jubilation... Anymore out there?? Perhaps a good tutorial to go along with the 4.0 release would be a good project idea? I can really see this language is going to take-off. Thank You. -= B E G I N =- X-EUFORUM: 21583 Date: 2008 May 25 20:43 From: c.k.lester <euphoric at ?klest?r.com> Subject: Re: More tutorials. Rob H. wrote: > > I can really see this language is going to take-off. I had to chuckle at this line. :D Euphoria is 15 years old. I guess it's about time. ;) -= B E G I N =- X-EUFORUM: 21584 Date: 2008 May 25 20:51 From: Alexander Toresson <alexander.toresson at gmai?.?om> Subject: Re: Debian Package Maker - Add Scripts - sudo ldconfig Jerry Story wrote: > > Bernie Ryan wrote: > > > > Jerry Story wrote: > > > > > > In Debian Package Maker, under Add Scripts, it needs sudo ldconfig. How do you > > > get it to handle the password? > > > > Jerry: > > > > If you put 'sudo ldconfig' in the script won't running the script > > > > automatically prompt for a password when it runs sudo ? > > I had some kind of idea that it was supposed to do everything by itself and > not require a response. Because that's the way .deb files usually behave. The scripts in a debian package run as root when you install the package. No need for sudo. Regards, Alexander Toresson -= B E G I N =- X-EUFORUM: 21585 Date: 2008 May 25 22:02 From: Derek Parnell <ddparnell at bigp?nd.?om> Subject: Re: More tutorials. c.k.lester wrote: > > Rob H. wrote: > > > > I can really see this language is going to take-off. > > I had to chuckle at this line. :D > > Euphoria is 15 years old. I guess it's about time. ;) The v4.0 will have an impact for sure. It starts to "modernise" the language and it should broaden its appeal. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21586 Date: 2008 May 25 22:54 From: Rob H. <robert.hrosc at gmail.?o?> Subject: Re: More tutorials. Speaking of version 4. What is the release date expected to be? I hope there is a good tutorial for it, not just example programs. -= B E G I N =- X-EUFORUM: 21587 Date: 2008 May 25 23:15 From: Jeremy Cowgar <jeremy at c?w?ar.com> Subject: Re: More tutorials. Rob H. wrote: > > Speaking of version 4. What is the release date expected to be? > We are still working on a few language construct additions, mainly namespaces. Any estimation would be premature. I would say not within a month and within 3 months. The first alpha could be out within a week. > I hope there is a good tutorial for it, not just example programs. Thus far the documentation has been expanded for the new language keywords and standard library but no tutorials have been added. Was the language manual not sufficient? I would be interested in your opinion as you are going through the process of learning it for the first time. In addition, what would you find to be the ideal tutorial? What would it do? I was thinking at first starting from scratch and building an application of a little value, but even at that there are so many paths an application could take... Text console? Web based? GUI? Command line utility? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21588 Date: 2008 May 25 23:33 From: gshingles <gshingles at ?mail.co?> Subject: Re: Proprietariness or levels of it, anyway Mike777 wrote: > > Right. Which is why I am interested in what people have as a favorite mechanism, > because I know that it is useless to try and write the perfect concept into > code, as there isn't anything of the sort. > > I definitely think that, for the most part, the folks are honest who will buy > what I might sell. It is their employees that I'm most interested in ensuring > don't do something their bosses would dislike. Just a little protection is > required, not a 24-hour German Shepherd who hasn't been fed for a week. One method I have used in the past (with spreadsheets actually :) is to place the critical data on a server in a 'hidden' share. This prevents casual copying and taking away of data, since the uninformed user won't know about the extra step involved, but still won't prevent someone who knows what they are doing getting the data. Another avenue might be to use PGP encryption to verify license files. That's still vulnerable to direct binary hacking but probaly hard to defeat without resorting to that (especially if the binary md5sum is checked as well). For example (and I'm not a crypto expert) if your license is signed by bob's private key (they author) and the binary is signed by the same key then the license is valid? Even better I suppose would be to sign the license with alice's (the user) public key and only run if the executable is signed (somehow, in Euphoria) with the same key? I don't know, just thinking at my keyboard :) Gary -= B E G I N =- X-EUFORUM: 21589 Date: 2008 May 26 0:01 From: ken mortenson <kenneth_john at ?ahoo.co?> Subject: Re: Do you currently use namespaces? Never. Matt Lewis wrote: >How else would you have solved the problem? 1) An instance of a class does not have this problem. 2) DLL's may have functions with the same name which is resolved in the function call declaration by assigning an alias. Euphoria is not inherently modular because it uses the INCLUDE paradigm. Other languages use a project file paradigm. Most functions and variables should not be public and their scope should be limited to the file they are declared in. Explicitly public functions and variables should have descriptive names which are less likely to conflict (but since even then they could, using classes would still be the solution.) -= B E G I N =- X-EUFORUM: 21590 Date: 2008 May 26 0:19 From: Jeremy Cowgar <jeremy at ?owgar?com> Subject: Re: Do you currently use namespaces? ken mortenson wrote: > > Never. > > Matt Lewis wrote: > >How else would you have solved the problem? > > 1) An instance of a class does not have this problem. > > 2) DLL's may have functions with the same name which is resolved in > the function call declaration by assigning an alias. > > Euphoria is not inherently modular because it uses the INCLUDE paradigm. > Other languages use a project file paradigm. I'm coming in late on this discussion, but how does include make it not modular? For instance here is some of my code: <eucode> include user.e as user include note.e as note sequence notes user:user current current = user:get(1) notes = note:get_all_for(current) </eucode> user.e is included in many different command line utilities/gui apps. It can be used independent of any other. That's modular and using include? > > Most functions and variables should not be public and their scope should > be limited to the file they are declared in. > Yes, that's just good practice and that's what I do above. > Explicitly public functions and variables should have descriptive names > which are less likely to conflict (but since even then they could, using > classes would still be the solution.) Yes, again, that's just good practice. I do not see how what you said is making Euphoria not modular? Can you expand a bit? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21591 Date: 2008 May 26 0:31 From: gshingles <gshingles at gma?l?com> Subject: User Friendly Euphoria [was Re: More tutorials.] Jeremy Cowgar wrote: > > Was the language manual not sufficient? I would be interested in your opinion > as you are going through the process of learning it for the first time. In addition, > what would you find to be the ideal tutorial? What would it do? I was thinking > at first starting from scratch and building an application of a little value, > but even at that there are so many paths an application could take... Text console? > Web based? GUI? Command line utility? I found section the entire section 2 very useful in learning what Euphoria was about in a few hours, but it is hard to be objective about it because I already knew C, C++, and Perl. So I can only speak from the perspective of someone coming from other languages... as an example I had to crash learn Python (having looking at it previously and thought WTF??) in order to get into Blender. For that the minimum documentation I found useful was the language definition and library references. I still have to refer to them every few days or so. I think maybe the biggest barrier to getting into Euphoria is the lack of a standard GUI with online context-sensitive help. Judith's IDE is fantastic and I probably wouldn't have got in to Windows programming at all without it, but of course it is Windows specific. Given that (at a guess) 95% of casual users interested in trying out Euphoria will be on Windows I would suggest including a bound version of that IDE and distributing win32lib and sample GUI programs with the official install (given respective author's approvals of course), but I do also appreciate your stated concerns about maintenance of the code base for the official distribution. That is where some sort of package manager would be invaluable (and is the "industry standard" way of doing things now) whereby the individual authors could have more autonomy in maintaining their own code and have the package management inform the user about updates. That said, I'd say go ahead with version 4 and put something like that on the roadmap for v5 or v6 because a package manager would take quite a lot of reorganisation but shouldn't break anything in the language itself. Sorry, just realised this wasn't about tutorials at all... I tend not to use them to learn with, I tend to look at them when something I am already doing has gone wrong and I can see a particular tutorial deals with something I am doing. Gary -= B E G I N =- X-EUFORUM: 21592 Date: 2008 May 26 0:50 From: ken mortenson <kenneth_john at y?hoo.co?> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: >how does include make it not modular? >I do not see how what you said is making Euphoria not modular? >Can you expand a bit? Absolutely, Keep in mind that a programmer can write code in a modular language that isn't modular and another could write good modules in a language that isn't supportive of that. Good modules should have certain features. Decoupling is an important principle as well as the principle of information hiding. They don't expose their internal structure but do expose an interface. What happens when you include a file? Everything becomes exposed! This, needless to say, does not promote information hiding! Let me give you a real example. I make it a matter of pride that if you get a function from me it is complete, works and you will have no problem adding it to your code. I was writing a utility and needed a function that a guy I worked with had written. He insisted I use his function. Being my nominal boss at the time it was difficult to refuse. Anyway, I added his code to my tiny little utility and there was a problem. It had ties that were dependant on other parts of his project. So I had to include those (couldn't amputate because that was the nature of his code.) This continued until finally my tiny little utility was the size of his major project. At that point I got my boss involved and let him share some of my frustration (I'm generous that way.) In the end, I wrote what I needed without the help of his function. The guy was a really smart guy, but didn't really understand the concept or why it was important. I find that very few programmers I've worked with really do. This was not an isolated incident. -= B E G I N =- X-EUFORUM: 21593 Date: 2008 May 26 0:57 From: Jeremy Cowgar <jeremy at c?w?ar.com> Subject: Re: Do you currently use namespaces? ken mortenson wrote: > > Jeremy Cowgar wrote: > >how does include make it not modular? > >I do not see how what you said is making Euphoria not modular? > >Can you expand a bit? > > Absolutely, > > Keep in mind that a programmer can write code in a modular language that > isn't modular and another could write good modules in a language that isn't > supportive of that. > > Good modules should have certain features. > > Decoupling is an important principle as well as the principle of > information hiding. They don't expose their internal structure but > do expose an interface. > > What happens when you include a file? Everything becomes exposed! > This, needless to say, does not promote information hiding! > That's not true at all. <eucode> -- greeter.e constant greeting = "Hello" procedure say_greeting() puts(1, greeting) end procedure procedure say_who(sequence who) puts(1, who) end procedure global procedure greet(sequence who) say_greeting() puts(1, ", ") say_who(who) puts(1, "!\n") end procedure -- myprog.ex include greeter.e greet("John Doe") puts(greeting) say_who("Jim") say_greeting() </eucode> The above code is just an example showing hello.e:4 greeting has not been declared puts(greeting) -- parse error, greeting is undefined. say_who and say_greeting are also invalid. The are not global. > Let me give you a real example. I make it a matter of pride that if you > get a function from me it is complete, works and you will have no problem > adding it to your code. I was writing a utility and needed a function > that a guy I worked with had written. He insisted I use his function. > Being my nominal boss at the time it was difficult to refuse. Anyway, I > added his code to my tiny little utility and there was a problem. It had > ties that were dependant on other parts of his project. So I had to include > those (couldn't amputate because that was the nature of his code.) This > continued until finally my tiny little utility was the size of his major > project. At that point I got my boss involved and let him share some of > my frustration (I'm generous that way.) In the end, I wrote what I needed > without the help of his function. The guy was a really smart guy, but didn't > really understand the concept or why it was important. I find that very > few programmers I've worked with really do. This was not an isolated > incident. Hm, that happens anywhere, even in languages that you would consider modular. That has nothing to do with include or with Euphoria. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21594 Date: 2008 May 26 1:05 From: Derek Parnell <ddparnell at big?ond.?om> Subject: Re: Do you currently use namespaces? ken mortenson wrote: > > Jeremy Cowgar wrote: > >how does include make it not modular? > >I do not see how what you said is making Euphoria not modular? > >Can you expand a bit? > ... Good modules should have certain features. > > Decoupling is an important principle as well as the principle of > information hiding. They don't expose their internal structure but > do expose an interface. > > What happens when you include a file? Everything becomes exposed! > This, needless to say, does not promote information hiding! Ummm ... actually this happens *not* to be the case... The ONLY things that are exposed are the symbols explicitly marked as 'global' within the file being included. For example ... If I have a file, exam.e, that contains the following lines ... <eucode> procedure foo() end procedure global procedure bar() end procedure </eucode> And another file that includes this ... <eucode> include exem.e foo() -- Fails because it can't be seen bar() -- Succeeds because 'exam.e' declared it global. </eucode> -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21595 Date: 2008 May 26 1:23 From: ken mortenson <kenneth_john at yahoo?co?> Subject: Re: Do you currently use namespaces? Derek Parnell wrote: > > ken mortenson wrote: > > What happens when you include a file? Everything becomes exposed! > > This, needless to say, does not promote information hiding! > > Ummm ... actually this happens *not* to be the case... The ONLY things that > are exposed are the symbols explicitly marked as 'global' within the file being > included. For example ... I'm sorry guys. I wasn't being clear. fileA.e includes fileB.e; fileB.e includes fileC.e Everything global in fileC is now exposed to fileA. This continues for every include. The end result is one big file, not a group of modules. This may be a problem. It is a problem when names collide. -= B E G I N =- X-EUFORUM: 21596 Date: 2008 May 26 1:27 From: Jeremy Cowgar <jeremy at c?wgar.co?> Subject: Re: Do you currently use namespaces? ken mortenson wrote: > > > I'm sorry guys. I wasn't being clear. > > fileA.e includes fileB.e; fileB.e includes fileC.e > > Everything global in fileC is now exposed to fileA. > > This continues for every include. The end result is one big file, not a > group of modules. > > This may be a problem. It is a problem when names collide. > Ok. That is not a problem anymore when you use namespaces. In addition, we may have other changes in 4.0 that solve your issue totally, even w/o namespaces. i.e. global propagation of globals not being the case. But the later is just under very, very, very initial discussion. Once we have an idea of the impact, some possible solutions, we will undoubtedly bring it up on EUforum for discussion. However, your given example above is still invalid if you use namespaces as currently defined in 4.0, and for the most part 3.1 as well. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21597 Date: 2008 May 26 1:31 From: c.k.lester <euphoric at ck?ester.com> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > ken mortenson wrote: > > I'm sorry guys. I wasn't being clear. > > fileA.e includes fileB.e; fileB.e includes fileC.e > > Everything global in fileC is now exposed to fileA. > > Ok. That is not a problem anymore when you use namespaces. > However, your given example above is still invalid if you use namespaces as > currently defined in 4.0, and for the most part 3.1 as well. How do you avoid fileC.e's globals not being exposed to fileA.e? Is it automatic? Just curious... -= B E G I N =- X-EUFORUM: 21598 Date: 2008 May 26 1:39 From: ken mortenson <kenneth_john at ?ahoo.?om> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > ken mortenson wrote: > > Keep in mind that a programmer can write code in a modular language that > > isn't modular and another could write good modules in a language that isn't > > supportive of that. > > > > Good modules should have certain features. > > > > Decoupling is an important principle as well as the principle of > > information hiding. They don't expose their internal structure but > > do expose an interface. > > [SNIP... story about decoupling] > Hm, that happens anywhere, even in languages that you would consider modular. You are right. However, some features encourage modular programming and some feature work against it. > That has nothing to do with include or with Euphoria. Well, it does. What is a module? It's a black box that does something. Include is a back door to that black box. Can you write modular programs using include? Of course you can. Does include encourage you to think in a modular way? No, I'll give you another example. Sequence is one type of coupling. Remember that a module should be decoupled. Each module is separate and distinct and has it's own (chiselled in stone) interface. Order doesn't matter in calling modules. Order does matter using include. -= B E G I N =- X-EUFORUM: 21599 Date: 2008 May 26 1:52 From: Kat <KAT12 at co?sahs.?et> Subject: Re: Do you currently use namespaces? ken mortenson wrote: <snip> > Remember that a module should be > decoupled. Each module is separate and distinct and has it's own > (chiselled in stone) interface. Order doesn't matter in calling modules. > > Order does matter using include. Order is everything in Eu, even calling it a bug that routine_id() once worked out of order. I asked for an export keyword to make an interface in namespace, and i asked for restricting "global" to at least files it included (which wouldn't have solved your example, but gotta start somewhere). My suggestions were shot down right away, and haven't been discussed. Some of this stuff was asked for 5 to 8 years ago, Ken, and it isn't here yet. Kat -= B E G I N =- X-EUFORUM: 21600 Date: 2008 May 26 1:53 From: Jeremy Cowgar <jeremy at cowg?r?com> Subject: Re: Do you currently use namespaces? ken mortenson wrote: > > Sequence is one type of coupling. Remember that a module should be > decoupled. Each module is separate and distinct and has it's own > (chiselled in stone) interface. Order doesn't matter in calling modules. > > Order does matter using include. In what way? Given my example of the user and note module. One is not depending on another, order could care less. I've never had to order any of my includes. I am unsure of any situation you would have to, can you give me an example? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21601 Date: 2008 May 26 2:09 From: Kat <KAT12 at co?sa?s.net> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > > ken mortenson wrote: > > > > Sequence is one type of coupling. Remember that a module should be > > decoupled. Each module is separate and distinct and has it's own > > (chiselled in stone) interface. Order doesn't matter in calling modules. > > > > Order does matter using include. > > In what way? Given my example of the user and note module. One is not depending > on another, order could care less. I've never had to order any of my includes. > I am unsure of any situation you would have to, can you give me an example? CK gave an example a few days ago in which he could solve the include order only thru massive use of routine_id(). Kat -= B E G I N =- X-EUFORUM: 21602 Date: 2008 May 26 2:09 From: Mike777 <anon4321 at ?mail.c?m> Subject: Re: Do you currently use namespaces? ken mortenson wrote: > > Jeremy Cowgar wrote: > >how does include make it not modular? > >I do not see how what you said is making Euphoria not modular? > >Can you expand a bit? > > Absolutely, > > Keep in mind that a programmer can write code in a modular language that > isn't modular and another could write good modules in a language that isn't > supportive of that. > > Good modules should have certain features. > > Decoupling is an important principle as well as the principle of > information hiding. They don't expose their internal structure but > do expose an interface. > > What happens when you include a file? Everything becomes exposed! > This, needless to say, does not promote information hiding! > > Let me give you a real example. I make it a matter of pride that if you > get a function from me it is complete, works and you will have no problem > adding it to your code. I was writing a utility and needed a function > that a guy I worked with had written. He insisted I use his function. > Being my nominal boss at the time it was difficult to refuse. Anyway, I > added his code to my tiny little utility and there was a problem. It had > ties that were dependant on other parts of his project. So I had to include > those (couldn't amputate because that was the nature of his code.) This > continued until finally my tiny little utility was the size of his major > project. At that point I got my boss involved and let him share some of > my frustration (I'm generous that way.) In the end, I wrote what I needed > without the help of his function. The guy was a really smart guy, but didn't > really understand the concept or why it was important. I find that very > few programmers I've worked with really do. This was not an isolated > incident. From my admittedly inexperienced vantage point, you are describing something which would be expected to reside in a dll, as self contained and fully functional to the extent ever intended. Includes, on the other hand, are intended to be not only included, but extended, if need be. In my view, there is a world of difference and, yes, I understand that things which might be better placed within dlls are instead left within includes for no good reason other than it is easier to do so. Much easier because it allows that completeness you champion to be given short shrift. I mean, why worry about completeness if the code is exposed for anybody to improve as they see fit? But people rarely can predict what portions of their workproduct requires extending. So to put virtually anything into a dll loses flexibility. I'm not sure what this means other than to say that I'm not sure I agree with your definition of complete. Mike -= B E G I N =- X-EUFORUM: 21603 Date: 2008 May 26 2:13 From: ken mortenson <kenneth_john at yahoo.??m> Subject: Re: Do you currently use namespaces? Kat, These topics have been written about for 30 years. It surprizes me that we are always reinventing the wheel. What surprises me more is how resistant people are to understanding decoupling, information hiding, and true modules. Supermen make bad programmers. I'll keep pounding my head against the wall. Eventually I'll make a dent. ;-) ken. -= B E G I N =- X-EUFORUM: 21604 Date: 2008 May 26 2:32 From: ken mortenson <kenneth_john at ya?oo.?om> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > ken mortenson wrote: > > Order does matter using include. > > In what way? Given my example of the user and note module. One is not depending > on another, order could care less. I've never had to order any of my includes. > I am unsure of any situation you would have to, can you give me an example? Am I up to the challenge? It seems strange to me that you've never had issues with ordering when that's the first thing that became a difficulty for me when learning Euphoria. I was constantly having to move functions and includes to earlier places in my code because of dependancies. The fact that routine ID's are employed is another example. If you accept that, can you accept that ordering is a kind of coupling that means it is less than modular? Smarter people than me have written books on the subject. The fact that you write good modules does not make Euphoria a modular language. Euphoria is more modular than some languages, but it is not naturally modular or make modular code the norm. I'm not quite sure how to explain that purple is purple? I've tried to explain this to really smart guys before and they didn't seem to get it either. Someone better than I will have to do it, probably. BTW, even Delphi has this problem so you are not the only one to be confused by the concept. -= B E G I N =- X-EUFORUM: 21605 Date: 2008 May 26 2:43 From: ken mortenson <kenneth_john at y?hoo.c?m> Subject: Re: Do you currently use namespaces? Mike777 wrote: > From my admittedly inexperienced vantage point, you are describing something > which would be expected to reside in a dll, as self contained and fully functional > to the extent ever intended. > > Includes, on the other hand, are intended to be not only included, but extended, > if need be. Good comments Mike, well deserving of a reply. Modular programming really has nothing to do with DLL's per se. The concept applies whether it's your code or someone elses, whether you are calling into a DLL or a module you wrote. Modules can be loose or tight. You may have a bunch of loosely related functions you wrote on a day and made a module out of them, or you could be defining a very precise API to solve a very specific problem. Someone should probably post a good reading list on the subject. My library, isn't what it was or I'd do it. -= B E G I N =- X-EUFORUM: 21606 Date: 2008 May 26 2:46 From: Jeremy Cowgar <jeremy at c?wgar.co?> Subject: Re: Do you currently use namespaces? ken mortenson wrote: > > Am I up to the challenge? If you write code like this you have problems: FileA.e <eucode> global function do_a() .... global function hello_a() ... </eucode> FileB.e <eucode> global function do_b() ... global function hello_b() ... </eucode> FileC.e <eucode> do_a() hello_b() </eucode> MyProg.ex <eucode> include FileA.e include FileB.e include FileC.e --- this has to be included last because it ------------------- it depends on FileA and FileB ------------------- ------------------- This is *horrible* coding. </eucode> In the above program, FileC.e should be rewritten as: FileC.e <eucode> include FileA.e include FileB.e do_a() hello_b() </eucode> MyProg.ex <eucode> include FileC.e include FileA.e include FileB.e ---- Notice... Order has zero affect on anything. ---- ---- This is proper coding. </eucode> -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21607 Date: 2008 May 26 2:48 From: ken mortenson <kenneth_john at yahoo.?o?> Subject: Re: Do you currently use namespaces? I hope everyone realizes that I'm not bashing Euphoria when I say it has features that make it less than ideal for modular programming. I love what Euphoria is and have a vision of what it could become. I've been looking for a language that gives me the pure joy I sometimes experience when coding and Euphoria is one of the few that has such potential. Sadly, I've seen potential fail too often in my half century. -= B E G I N =- X-EUFORUM: 21608 Date: 2008 May 26 2:54 From: Jeremy Cowgar <jeremy at ?ow?ar.com> Subject: Re: Do you currently use namespaces? ken mortenson wrote: > > I hope everyone realizes that I'm not bashing Euphoria when I say > it has features that make it less than ideal for modular programming. > No way. In order to make a programming language more useful you have to point out it's weak spots. If you fail to find, talk about or suggest different methods on it's weak spots, you might as well give up and trash what ever you are working on. > I love what Euphoria is and have a vision of what it could become. Me too! You may be very interested in some of the discussion that will be coming up on the exact topic you are addressing on the dev list. On the dev list we are going to try to define the problem and come up with a few solutions, then present the information we have found to EUforum. From your work here on EUforum already, I think you would be a great help there in the initial stages... Again, to everyone, the dev list is not for the elite, it's for anyone to join... we are driven by the community but sometimes, in cases like this, we don't even understand the problem fully so we try to talk about it and figure out the problem before trying to post a message here solving a problem we do not know about :-) > > I've been looking for a language that gives me the pure joy I sometimes > experience when coding and Euphoria is one of the few that has such > potential. > > Sadly, I've seen potential fail too often in my half century. > Good times are ahead for Euphoria. We are nearing completion on many fronts and an alpha is not far away. After that, beta's and final 4.0 release. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21609 Date: 2008 May 26 3:15 From: ken mortenson <kenneth_john at y?hoo.?om> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > [SNIP include example] > ---- This is proper coding. Ah, Jeremy, this is a grand statement. Especially when demonstrating the 'include everything' school of programming. I see this same problem in Microsoft programmers which is why they have a zillion constants for the definition of true and false (all with very precise names) in their code. Including fileA and fileB twice is only a little bit of nails on the chalkboard for me, but I can get past that because the language allows it. Ordering is just one aspect regarding the issue of modularity. Programmers are very good puzzle solvers. I'm sure that no matter what issue I bring up you'd be able to come up with an example of a solution. I respect you for that. None of that makes Euphoria a modular language. -= B E G I N =- X-EUFORUM: 21610 Date: 2008 May 26 3:16 From: Derek Parnell <ddparnell at bi?pon?.com> Subject: Re: Do you currently use namespaces? ken mortenson wrote: By the way, ken, and please don't take this the wrong way because I'm guilty of this, but your posts are starting to look a little condescending. I'm putting this effect down to the limitations of this particular communication medium, however it might be an idea to de-emphasize the language that seems to suggest that you know the "right thing" and no one else gets it. > Jeremy Cowgar wrote: > > ken mortenson wrote: > > > Order does matter using include. > > > > In what way? With Euphoria, order does matter. This has nothing intrinsicly to do with include files though. For better or worse, Euphoria has the deliberate restriction that one can only directly refer to symbols that are lexically declared (and exposed) earlier than their reference. So yes, order does matter. > Given my example of the user and note module. One is not depending > > on another, order could care less. I've never had to order any of my includes. > > I am unsure of any situation you would have to, can you give me an example? I can Jeremy. When writing the win32lib, I often had to reorder symbol declarations when a new bit of code needed to refer to something further on down (either in an included file or in the same file). This became so frustrating that I started (ab)using the routine_id() method just so I didn't have to reorganize the source code yet again. This has nothing to do with modular programming though. It is just a feature of Euphoria's design philosophy. > If you accept that, can you accept that ordering is a kind of coupling > that means it is less than modular? Smarter people than me have written > books on the subject. Yes, dependancies on the physical layout of code is a sort of coupling. However Euphoria, being a procedural language rather than a functional language, we will always be beholden to some aspects of the way code is organised. For example, we expect that the next statment to be executed will be the one after the current one (in most cases). > BTW, even Delphi has this problem so you are not the only one to be > confused by the concept. I am not confused by the concept of modules or modularity. There are many types of module systems, each with strengthes and weaknesses. Euphoria has a system of modules. The module is embodied in a single file. The module exposes its API via the 'global' keyword. It exposes this API to every line of code that follows the 'include' directive for the file, and conversely hides its API to code preceding the 'include' directive. That's about it for Euphoria. Can it be better? Sure it can! But define "better" first. You seem to be saying at least two things can be improved. Firstly that the forward referencing restriction be removed or amended. Secondly, that a module's API can have a mechanism that only exposes it (or selected parts of it) to the file that directly includes the module. Have I got that right? -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21611 Date: 2008 May 26 4:59 From: ken mortenson <kenneth_john at y??oo.com> Subject: Re: Do you currently use namespaces? Derek Parnell wrote: > ken mortenson wrote: > > By the way, ken, and please don't take this the wrong way because I'm guilty > of this, but your posts are starting to look a little condescending. I'm putting > this effect down to the limitations of this particular communication medium, > however it might be an idea to de-emphasize the language that seems to suggest > that you know the "right thing" and no one else gets it. Thank you Derek, I do appreciate it. But no it's me, I have no social grace. I'm an INTJ (google it) and many things that are self evident to me are not to others. The truth is I in no way look down on people (except for real evil bastidges!) and actually have a high regard and warm feeling toward almost everybody I communicate with (or I don't bother to) but it always seems to come across that way. It's an old problem for me and I don't really know what to do about it. An INTJ knows what they know, but are quick to acknowledge when shown to be wrong. Sometimes when I'm trying to be funny it comes across as condescencian(sp?). Being a 50 year old unemployed programming bum that just finalized his divorce this April... I could really use being part of a community of people that share my interests. I may have no social grace, but being human (contrary to that nasty rumor that's been going around) I do enjoy social contact with people. > I often had to reorder... > This has nothing to do with modular programming though. Respectfully, I wish I could provide you with a citation because this is a classic issue regarding modularity. > Euphoria, being a procedural language rather than a functional language Give me procedural or give me death! Don't even go to functional languages. That was funny, right? ;) > we will always be beholden to some aspects of the way code is organised. A truth, self evident. > I am not confused by the concept of modules or modularity. Please forgive me if I implied that. I'll take twelve lashes with a wet noodle. > There are many types > of module systems, each with strengthes and weaknesses. Euphoria has a system > of modules. The module is embodied in a single file. The module exposes its > API via the 'global' keyword. It exposes this API to every line of code that > follows the 'include' directive for the file, and conversely hides its API to > code preceding the 'include' directive. That's about it for Euphoria. One thing about experiencing different languages, especially if in a working environment, is that you start to get a feel for best and better. At least I see it that way. What makes me productive? What can I trust? ...about myself? ...my tools? If I got a contract today to produce a product, what language would I choose? I wish I could say Euphoria, but I can't. I can very clearly see what would have to change for me to say yes. I can also cleary see why I want to be able to say yes. Euphoria is the most expressive language I've ever seen (Rebol might complain, but this is my opinion.) You could argue the extent of how modular Euphoria is, but I don't see how a productive working programmer could not understand (and I do beg forgiveness if this sounds condesending) that it lags behind others in producing modular code. Probably will not change. My vision will probably require a clean sheet. I will say this. My vision would top the charts in no time at all because I see it filling a need that no other language is addressing. I'd pay a couple hundred dollars for such a tool and I wouldn't be alone. > Can it be better? Sure it can! But define "better" first. Actually, I've been working more intensely on that since discovering Euphoria a few years ago, but this has been a goal of mine since the mid 70's. I'm always out of sync with time. I was talking about massive online communities when the internet was just a gleam (in ALGORE'S EYE, right?) > You seem to be saying at least two things can be improved. Firstly that the > forward referencing restriction be removed or amended. I do think that routine ID's have better uses than forward refs. Not having to worry about which function comes first physically in the code encourages productivity as well as making modular code easier to implement. I don't believe I can be argued out of this position (but I will always accept the possibility. Part of the INTJ nature.) Optimizing for compiler speed at the expense of programmer productivity is a huge mistake in my, oh so humble but unable to convey my humility, opinion. Hey, that really was funny. Admit it. Now. Or be destroy by my invasion fleet! > Secondly, that a module's > API can have a mechanism that only exposes it (or selected parts of it) to the > file that directly includes the module. Have I got that right? Yes, and maybe no. I can't emphasize enough how overhyped OOP is. But one thing they have right is instances of classes. I've programmed C years ago, and the language has some features I really like, but I can't stand C++, or it's evil stepchild C#, My experience is with VB classes. While VB is certainly not fully OOP (I see this as a good thing!) it does have a few best in class features (the basic language is not one of them.) Absolutely, Best. In. Class. Even though the debugger could be improved, it is B.I.C. because it never gets in the way of coding and provides what I need. Intellisense (B.I.C.) even M$ couldn't get that right outside of VB. Drill down (B.I.C.) Two clicks and I've found the declaration, no search required. One file per class allows me to organize my code well. There is much more, but the last thing I should mention is direct compile. Yes, VB has a runtime that I rather it didn't. My ideal language would create a static compile that I could just hand to the user. That's enough for now. I got wackier ideas, but I think I need to be a bit reserved. Plus me fingers is gett'n tired. I think I'll just post then proofread. Good idea, right? -= B E G I N =- X-EUFORUM: 21612 Date: 2008 May 26 6:35 From: Kat <KAT12 at coosahs?n?t> Subject: Ken, seen ooeu? Have you looked at Matt's OOEU? Now there's a language i'd pay twice for what i paid for Euphoria. If it had no bug list and ran at Eu's speed. Kat -= B E G I N =- X-EUFORUM: 21613 Date: 2008 May 26 7:49 From: ken mortenson <kenneth_john at ya?oo.?om> Subject: Re: Ken, seen ooeu? Kat wrote: > Have you looked at Matt's OOEU? Now there's a language i'd pay twice for what > i paid for Euphoria. If it had no bug list and ran at Eu's speed. Not really. I was aware that somebody had put together something OOP for Euphoria. For two reasons I didn't look into it at the time. One, I like to stick with 'official' versions of things, OOP seems to be something that should be foundational to a language rather than something added on. Second because I really, really, really and truly, am tired of the OOP hype. I like to take what's good and discard the rest. I think classes are good but inheritance is mostly stupid. In the real world there are much better (and more maintainable) ways to write code. I'm sure somebody could come up with wonderful examples of inheritance that make me look foolish. I'm willing to take that chance. Is it worth looking into in your opinion? Twice zero is infinity right? I is just a p/a, math is hard! -= B E G I N =- X-EUFORUM: 21614 Date: 2008 May 26 8:00 From: ZNorQ <znorq at ?olha?g.com> Subject: Deleting folders with files Heya, How can I delete a folder containing files? Kenneth/ZNorQ -= B E G I N =- X-EUFORUM: 21615 Date: 2008 May 26 9:19 From: CChris <christian.cuvier at agricul?ure.gou?.fr> Subject: Re: Do you currently use namespaces? Derek Parnell wrote: > > ken mortenson wrote: > > > > Jeremy Cowgar wrote: > > >how does include make it not modular? > > >I do not see how what you said is making Euphoria not modular? > > >Can you expand a bit? > > > > ... Good modules should have certain features. > > > > Decoupling is an important principle as well as the principle of > > information hiding. They don't expose their internal structure but > > do expose an interface. > > > > What happens when you include a file? Everything becomes exposed! > > This, needless to say, does not promote information hiding! > > Ummm ... actually this happens *not* to be the case... The ONLY things that > are exposed are the symbols explicitly marked as 'global' within the file being > included. For example ... > > If I have a file, exam.e, that contains the following lines ... > <eucode> > procedure foo() > end procedure > > global procedure bar() > end procedure > </eucode> > > And another file that includes this ... > > <eucode> > include exem.e > foo() -- Fails because it can't be seen > bar() -- Succeeds because 'exam.e' declared it global. > </eucode> > > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell This means that multiple files have to exchange information through interface identifiers, since an identifier that is visible in several files is promoted to interface symbol. This makes it unsafe to break a large body of code into smaller, more maintainable files, because all exchanges are not supposed to involve "public" data or routines. And because making public these symbols may interfere with any application that uses the library. There ae workarounds as always, but they are neither practical nor 100% safe. CChris -= B E G I N =- X-EUFORUM: 21616 Date: 2008 May 26 9:25 From: CChris <christian.cuvier at agri?ulture.gouv.f?> Subject: Re: Do you currently use namespaces? Kat wrote: > > Jeremy Cowgar wrote: > > > > ken mortenson wrote: > > > > > > Sequence is one type of coupling. Remember that a module should be > > > decoupled. Each module is separate and distinct and has it's own > > > (chiselled in stone) interface. Order doesn't matter in calling modules. > > > > > > Order does matter using include. > > > > In what way? Given my example of the user and note module. One is not depending > > on another, order could care less. I've never had to order any of my includes. > > I am unsure of any situation you would have to, can you give me an example? > > CK gave an example a few days ago in which he could solve the include order > only thru massive use of routine_id(). > > Kat Open win32lib.ew and go through the code. Inclusion ordeer and placement in the file are crucial, and sometimes a headache to figure out. CChris -= B E G I N =- X-EUFORUM: 21617 Date: 2008 May 26 11:03 From: Derek Parnell <ddparnell at bigpon?.co?> Subject: Re: Deleting folders with files ZNorQ wrote: > > Heya, > > How can I delete a folder containing files? Because you used the word 'folder' I assume you are using Windows and not Linux. The command to use in Win2000, XP, and Vista is ... rmdir /S /Q dirname e.g. rmdir /S /Q c:\temp\workarea To use this from within a Euphoria program you need to use the system statement... e.g. system ("rmdir /S /Q c:\\temp\\workarea", 2) The '2' is in the second parameter so it doesn't clear the screen or change the graphics mode on the console. In the *nix world, the command is ... rm -rf dirname e.g. system ("rm -rf /temp/workarea", 2) -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21618 Date: 2008 May 26 11:18 From: Derek Parnell <ddparnell at big?ond.c?m> Subject: Re: Do you currently use namespaces? CChris wrote: > This means that multiple files have to exchange > information through interface identifiers, since > an identifier that is visible in several files > is promoted to interface symbol. This makes it > unsafe to break a large body of code into > smaller, more maintainable files, because all > exchanges are not supposed to involve "public" > data or routines. And because making public these > symbols may interfere with any application that > uses the library. By "public" I assume you mean "able to be directly referred to by code that is outside the declaring file". However, it has to be done that way if you want to directly refer to an entity by name - the name must be visible for your code to 'see' it. If you prefer indirect references, you can get away with not knowing the entity's real name but at a performance overhead or via an alias symbol. An alias is not a solution because its still a visible name. Also, the "public" access to data and not routines is the major problem with module coupling. With routines, one publishes the API and (try to) keep the API unchanged. Meaning you should be able to move the routine to a new module and not break the code using it. I assume that when you say "interfere with any application" you are referring to naming conflicts. This, as you well know, is what is being addressed in v4.0. Of course, one further way to restrict naming conflicts is to reduce the visibility of symbols. 'global' makes it seen by all including levels, even if they don't need to see it. One suggestion being kicked around is to allow 'global' items to only be seen by the file directly including it. Discussion continues on this front. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21619 Date: 2008 May 26 11:18 From: ZNorQ <znorq at holhaug.?o?> Subject: Re: Deleting folders with files Derek Parnell wrote: > > ZNorQ wrote: > > > > Heya, > > > > How can I delete a folder containing files? > > Because you used the word 'folder' I assume you are using Windows and not Linux. Correct, sorry for being abit vague. > > The command to use in Win2000, XP, and Vista is ... > > rmdir /S /Q dirname > > e.g. > rmdir /S /Q c:\temp\workarea > > To use this from within a Euphoria program you need to use the system statement... > > e.g. > > system ("rmdir /S /Q c:\\temp\\workarea", 2) > > The '2' is in the second parameter so it doesn't clear the screen or change > the graphics mode on the console. > > > In the *nix world, the command is ... > > rm -rf dirname > > e.g. > system ("rm -rf /temp/workarea", 2) > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell I know about the rmdir/rd in windows, I was kind of hoping that there where own set of functions in the Euphoria language that could handle this - or atleast in Win32Lib. The rmdir/rd will have to do. Thanks for the help, Derek. Kenneth/ZNorQ -= B E G I N =- X-EUFORUM: 21620 Date: 2008 May 26 11:30 From: Derek Parnell <ddparnell at b?gpo?d.com> Subject: Re: Deleting folders with files ZNorQ wrote: > I was kind of hoping that there where own set of functions > in the Euphoria language that could handle this [Watch this space ...] -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21621 Date: 2008 May 26 11:41 From: ken mortenson <kenneth_john at yahoo.co?> Subject: Re: Do you currently use namespaces? CChris wrote: > This means that multiple files have to exchange information through interface > identifiers, since an identifier that is visible in several files is promoted > to interface symbol. This makes it unsafe to break a large body of code into > smaller, more maintainable files, because all exchanges are not supposed to > involve "public" data or routines. And because making public these symbols may > interfere with any application that uses the library. > > There ae workarounds as always, but they are neither practical nor 100% safe. > > CChris When I see a VB programmer using lots of globals it's a sign of their inexperience to me. Inexperience can also mean someone who goes from job to job for years and is never actually around to maintain any of the code they wrote. The fact that Euphoria depends so heavily on globals is just another indicator to me that it is not inherently modular. I believe you are exactly right here Chris. Again, I must emphasize that modularity is something the programmer does, not the language. -= B E G I N =- X-EUFORUM: 21622 Date: 2008 May 26 12:01 From: Matt Lewis <matthewwalkerlewis at ?mail?com> Subject: Re: Do you currently use namespaces? ken mortenson wrote: > > Jeremy Cowgar wrote: > > [SNIP include example] > > ---- This is proper coding. > > Ah, Jeremy, this is a grand statement. Especially when demonstrating the > 'include everything' school of programming. I see this same problem in > Microsoft programmers which is why they have a zillion constants for the > definition of true and false (all with very precise names) in their code. > > Including fileA and fileB twice is only a little bit of nails on the > chalkboard for me, but I can get past that because the language allows it. It's not a matter of including it twice. His point was that your code should include what it needs. Your statement is actually the antithesis of modular programming, IMHO. Each module should explicitly declare its dependencies. Euphoria has never required this, though it will at least generate a warning in 4.0. Matt -= B E G I N =- X-EUFORUM: 21623 Date: 2008 May 26 12:09 From: Jeremy Cowgar <jeremy at co?ga?.com> Subject: Re: Do you currently use namespaces? CChris wrote: > > > Open win32lib.ew and go through the code. Inclusion ordeer and placement in > the file are crucial, and sometimes a headache to figure out. > I thought the reference was in regards to include statements about order. It certainly does matter in source and I don't really think that's a bad thing. Sometimes it would be nice to have forward references as well as backwards with-in a file, but for the most part, I think most issues are easily resolved. Quite a few languages have this "limitation". Modular and non-modular languages alike, that's why I thought the reference was in regards to include statements. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21624 Date: 2008 May 26 12:13 From: Jeremy Cowgar <jeremy at c?wgar.com> Subject: Re: Do you currently use namespaces? Matt Lewis wrote: > > ken mortenson wrote: > > > > Jeremy Cowgar wrote: > > > [SNIP include example] > > > ---- This is proper coding. > > > > Ah, Jeremy, this is a grand statement. Especially when demonstrating the > > 'include everything' school of programming. I see this same problem in > > Microsoft programmers which is why they have a zillion constants for the > > definition of true and false (all with very precise names) in their code. > > > > Including fileA and fileB twice is only a little bit of nails on the > > chalkboard for me, but I can get past that because the language allows it. > > It's not a matter of including it twice. His point was that your code should > include what it needs. Your statement is actually the antithesis of modular > programming, IMHO. Each module should explicitly declare its dependencies. > Euphoria has never required this, though it will at least generate a > warning in 4.0. > In addition, if you use namespaces, you can forget the fact 100% that anything is global throughout the entire program. For instance: FileA.e. FileB.e, FileC.e, FileD.e, ...., FileAA.e, ...., FileZZZZZZZ.e <eucode> global function hello() </eucode> MyProg.ex <eucode> include FileA.e as a include FileB.e as b ... include FileZZZZZZZ.e as zzzzzzz a:hello() b:hello() aaa:hello() zzzzzzzzzz:hello() </eucode> In side of the namespace, the *only* functions/procedures/variables are those within the file defining the namespace. It does not matter if there are 1,000 hello() functions. In side your declared namespace there is only 1. That's the same as a module: -- Fake Language FileA.fake module FileA export sub hello() { ... } sub goodbye() { ... } -- Fake Language FileB.fake module FileB export sub hello() { ... } sub goodbye() { ... } -- Fake Language MyProg.fake use FileA use FileB FileA.hello() FileB.hello() -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21625 Date: 2008 May 26 12:15 From: Jeremy Cowgar <jeremy at cowgar.co?> Subject: Re: Deleting folders with files ZNorQ wrote: > > > I know about the rmdir/rd in windows, I was kind of hoping that there where > own set of functions in the Euphoria language that could handle this - or atleast > in Win32Lib. > > The rmdir/rd will have to do. Thanks for the help, Derek. > Unfortunately that will not always work. That only works on Windows XP/Vista. On Win 95/98/ME you will need to use deltree, which is not available then on Windows XP/Vista. I am thinking maybe we need basic file system manipulation commands in 4.0 standard library such as: delete, copy, move, exists, etc... -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21626 Date: 2008 May 26 12:15 From: ken mortenson <kenneth_john at yahoo.co?> Subject: Re: Do you currently use namespaces? Matt Lewis wrote: > ken mortenson wrote: > > Including fileA and fileB twice is only a little bit of nails on the > > chalkboard for me, but I can get past that because the language allows it. > > It's not a matter of including it twice. His point was that your code should > include what it needs. Your statement is actually the antithesis of modular > programming, IMHO. Each module should explicitly declare its dependencies. > Euphoria has never required this, though it will at least generate a > warning in 4.0. I was being a bit too flip here. I think I was getting a bit punchy from responding to everybody. I really didn't expect it to be so controversial when I say that includes don't encourage modular programming. To me this is self evident. Apparently not to others. I did see his point. -= B E G I N =- X-EUFORUM: 21627 Date: 2008 May 26 12:39 From: ken mortenson <kenneth_john at yaho?.?om> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > In addition, if you use namespaces, you can forget the fact 100% that anything > is global throughout the entire program. For instance: > include FileA.e as a > include FileB.e as b > a:hello() > b:hello() I see the point you make regarding the similarity in the following. However, what happens if FileA.e above includes FileC.e and FileB.e includes FileD.e which both have hello(). Does your main file have to know to declare a namespace for the includes withing files A & B? This violates the principle of information hiding. > In side of the namespace, the *only* functions/procedures/variables are those > within the file defining the namespace. It does not matter if there are 1,000 > hello() functions. In side your declared namespace there is only 1. That's the > same as a module: > -- Fake Language MyProg.fake > use FileA > use FileB > > FileA.hello() > FileB.hello() -= B E G I N =- X-EUFORUM: 21628 Date: 2008 May 26 12:51 From: Jeremy Cowgar <jeremy at ?owg?r.com> Subject: Re: Do you currently use namespaces? -- filea.e <eucode> global procedure hello() puts(1, "filea: hello\n") end procedure </eucode> -- fileb.e <eucode> include filea.e as a global procedure hello() puts(1, "fileb: hello\n") end procedure </eucode> -- myprog.ex <eucode> include fileb.e as b b:hello() -- prints "fileb: hello" </eucode> myprog.ex cannot access a:hello() in any way. It would have to directly include filea.e to access filea.e's hello() -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21629 Date: 2008 May 26 12:52 From: Jeremy Cowgar <jeremy at ?owgar.?om> Subject: Re: Do you currently use namespaces? ken mortenson wrote: > > I was being a bit too flip here. I think I was getting a bit punchy from > responding to everybody. I really didn't expect it to be so controversial > when I say that includes don't encourage modular programming. > > To me this is self evident. Apparently not to others. I did see his point. > We are adding new features to Euphoria and I am just trying to understand where you think it is lacking so that it can be improved. I have been doing that through examples relying on your feedback. I am unsure of how else to figure this out. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21630 Date: 2008 May 26 12:52 From: ken mortenson <kenneth_john at yahoo.??m> Subject: Re: Do you currently use namespaces? ken mortenson wrote: > > Jeremy Cowgar wrote: > > In addition, if you use namespaces, you can forget the fact 100% that anything > > is global throughout the entire program. For instance: > > > include FileA.e as a > > include FileB.e as b > > a:hello() > > b:hello() > > I see the point you make regarding the similarity in the following. However, > > what happens if FileA.e above includes FileC.e and FileB.e includes FileD.e > which both have hello(). Does your main file have to know to declare a > namespace for the includes withing files A & B? This violates the > principle of information hiding. I am getting punchy. See if you can figure out what I actually meant to say, because what I said makes no sense. Or does it? I need sleep. -= B E G I N =- X-EUFORUM: 21631 Date: 2008 May 26 13:15 From: ken mortenson <kenneth_john at ?ahoo.?om> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > -- filea.e > global procedure hello() > -- fileb.e > include filea.e as a > global procedure hello() > -- myprog.ex > include fileb.e as b > b:hello() -- prints "fileb: hello" > > myprog.ex cannot access a:hello() in any way. It would have to directly include > filea.e to access filea.e's hello() Amazing, you figured out what I was trying to say even when I couldn't!!! Let me look at this... You say myprog.ex can't access a:hello() in any way. Got that. But again, a include c, b include d. If I understand correctly, then myprog.ex could call c:hello() or d:hello() even though they are not declared in myprog? If so, this is not a good module. However, I get the impression this is still an issue under discussion. I'd like to see how the result encourages modular thinking. -= B E G I N =- X-EUFORUM: 21632 Date: 2008 May 26 13:24 From: Jeremy Cowgar <jeremy at co??ar.com> Subject: Re: Do you currently use namespaces? ken mortenson wrote: > > Jeremy Cowgar wrote: > > > -- filea.e > > global procedure hello() > > > -- fileb.e > > include filea.e as a > > global procedure hello() > > > -- myprog.ex > > include fileb.e as b > > b:hello() -- prints "fileb: hello" > > > > myprog.ex cannot access a:hello() in any way. It would have to directly include > > filea.e to access filea.e's hello() > > Amazing, you figured out what I was trying to say even when I couldn't!!! > > Let me look at this... > > You say myprog.ex can't access a:hello() in any way. Got that. But again, > a include c, b include d. If I understand correctly, then myprog.ex could > call c:hello() or d:hello() even though they are not declared in myprog? > No, that's incorrect. if myprog.ex never includes directly c, or d then myprog could not call c:hello() nor d:hello(). > If so, this is not a good module. However, I get the impression this is > still an issue under discussion. I'd like to see how the result encourages > modular thinking. Yes, but we need to fully understand the problems, if just perceived. Please keep this thread going. I know it's getting a bit long, but it's good discussion. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21633 Date: 2008 May 26 13:25 From: ken mortenson <kenneth_john at yahoo?co?> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > We are adding new features to Euphoria and I am just trying to understand where > you think it is lacking so that it can be improved. I have been doing that through > examples relying on your feedback. I am unsure of how else to figure this out. That's a good reminder. I can often be found drifting into the weeds when it's a good time to focus. There are practical matters to consider that perhaps trump any philosophy discussions. I do tend to get caught up in the abstract when it's time for the specific. I hope I can be a positive influence to your endeavor. I am wishing you and everyone taking part much success. -= B E G I N =- X-EUFORUM: 21634 Date: 2008 May 26 13:27 From: Jeremy Cowgar <jeremy at cowgar.c??> Subject: Re: Do you currently use namespaces? ken mortenson wrote: > > > You say myprog.ex can't access a:hello() in any way. Got that. But again, > a include c, b include d. If I understand correctly, then myprog.ex could > call c:hello() or d:hello() even though they are not declared in myprog? > > If so, this is not a good module. However, I get the impression this is > still an issue under discussion. I'd like to see how the result encourages > modular thinking. Wait.. I think I misunderstood in my previous reply. Are you saying that if include c defines a function for export and myprog.ex includes c directly that it *shoulnd't* be able to access it? That that is bad modular programming? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21635 Date: 2008 May 26 13:55 From: Matt Lewis <matthewwalkerlewis at gmail.??m> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > > Matt Lewis wrote: > > > > It's not a matter of including it twice. His point was that your code should > > include what it needs. Your statement is actually the antithesis of modular > > programming, IMHO. Each module should explicitly declare its dependencies. > > Euphoria has never required this, though it will at least generate a > > warning in 4.0. > > > > In addition, if you use namespaces, you can forget the fact 100% that anything > is global throughout the entire program. For instance: Almost. Sort of. You can still get in trouble [theoretically] with multi-file libraries. If, say win32lib (not picking on it, just that's it's the most popular multi-file library out there) had naming conflicts within other files that were part of the library (w32foo.ew and w32bar.ew), you would have to include those and add a namespace in addition to including win32lib. I doubt anyone has ever encountered this exact problem, but someone on the internet was wrong again. :) Matt -= B E G I N =- X-EUFORUM: 21636 Date: 2008 May 26 13:58 From: ken mortenson <kenneth_john at y?ho?.com> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > ken mortenson wrote: > > > > You say myprog.ex can't access a:hello() in any way. Got that. But again, > > a include c, b include d. If I understand correctly, then myprog.ex could > > call c:hello() or d:hello() even though they are not declared in myprog? > > > > If so, this is not a good module. However, I get the impression this is > > still an issue under discussion. I'd like to see how the result encourages > > modular thinking. > > Wait.. I think I misunderstood in my previous reply. Are you saying that if > include c defines a function for export and myprog.ex includes c directly that > it *shoulnd't* be able to access it? That that is bad modular programming? No. My scenario only had fileA include fileC, etc. Which is if I now understand correctly means that myprog can not call c:hello() If myprog directly included fileC then I would expect it to be able to call c:hello() as easily as a:hello() and b:hello() Regarding modularity, I guess this could be considered a practical solution. My intuition tells me there is more to this issue however. I'll have to give it some more thought. -= B E G I N =- X-EUFORUM: 21637 Date: 2008 May 26 13:59 From: Jeremy Cowgar <jeremy at cowgar?co?> Subject: Re: Do you currently use namespaces? Matt Lewis wrote: > I doubt anyone has ever encountered this exact problem, but > someone on the internet was wrong again. :) > Again? LOL! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21638 Date: 2008 May 26 14:04 From: Matt Lewis <matthewwalkerlewis at gmail.??m> Subject: Re: Do you currently use namespaces? ken mortenson wrote: > > Jeremy Cowgar wrote: > > In addition, if you use namespaces, you can forget the fact 100% that anything > > is global throughout the entire program. For instance: > > > include FileA.e as a > > include FileB.e as b > > a:hello() > > b:hello() > > I see the point you make regarding the similarity in the following. However, > > what happens if FileA.e above includes FileC.e and FileB.e includes FileD.e > which both have hello(). Does your main file have to know to declare a > namespace for the includes withing files A & B? This violates the > principle of information hiding. The namespace that you use for a and b is also used to deconflict down through all of the includes of a and b, so a:hello() could refer to something in FileC.e. You are correct in that our ability to hide information needs some additional power. The local/global that we currently have isn't fine enough. Matt -= B E G I N =- X-EUFORUM: 21639 Date: 2008 May 26 14:09 From: Matt Lewis <matthewwalkerlewis at gma?l.c?m> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > > ken mortenson wrote: > > > > Jeremy Cowgar wrote: > > > > > -- filea.e > > > global procedure hello() > > > > > -- fileb.e > > > include filea.e as a > > > global procedure hello() > > > > > -- myprog.ex > > > include fileb.e as b > > > b:hello() -- prints "fileb: hello" > > > > > > myprog.ex cannot access a:hello() in any way. It would have to directly include > > > filea.e to access filea.e's hello() > > > > Amazing, you figured out what I was trying to say even when I couldn't!!! > > > > Let me look at this... > > > > You say myprog.ex can't access a:hello() in any way. Got that. But > > again, a include c, b include d. If I understand correctly, then > > myprog.ex could call c:hello() or d:hello() even though they are not > > declared in myprog? > > > > No, that's incorrect. if myprog.ex never includes directly c, or d then myprog > could not call c:hello() nor d:hello(). To clarify, the reason for this is that a:hello() is masked by b:hello(). If there were no b:hello(), then b:hello() would really refer to the hello() in filea.e. Matt -= B E G I N =- X-EUFORUM: 21640 Date: 2008 May 26 14:24 From: ken mortenson <kenneth_john at ya?o?.com> Subject: Re: Do you currently use namespaces? Matt Lewis wrote: > > In addition, if you use namespaces, you can forget the fact 100% that anything > > is global throughout the entire program. For instance: > > Almost. Sort of. You can still get in trouble [theoretically] with > multi-file libraries. If, say win32lib (not picking on it, just that's > it's the most popular multi-file library out there) had naming conflicts > within other files that were part of the library (w32foo.ew and w32bar.ew), > you would have to include those and add a namespace in addition to including > win32lib. I doubt anyone has ever encountered this exact problem, but > someone on the internet was wrong again. :) It's rather pleasant to have my intuition confirmed so quickly. With regard to usage. Are we looking at the use of namespaces being sort of all or nothing? I'm not saying it would be a requirement, but once you start leaning on namespaces to solve collisions, you would tend to have every include be given a name? Will there be instances where you didn't give an include a namespace and find that later you must? Like adding a new lib to your project? This may not be a top level include, requiring a hunt through who knows how many files (depending on project size.) While the usage may be consistant, you might have an issue with consistant usage? I suspect I'm not being clear. -= B E G I N =- X-EUFORUM: 21641 Date: 2008 May 26 14:35 From: Marco Achury <achury at c?ntv.n?t> Subject: Re: Fwd: New to Euphoria Who is the owner of that list? May be can put an autoresponder there to sent new people to Euforum. Or as you are suscript you can send a message to the list. +-+-+-+-+-+-+-+ Marco A. Achury Caracas, Venezuela -= B E G I N =- X-EUFORUM: 21642 Date: 2008 May 26 14:40 From: Jeremy Cowgar <jeremy at cowgar.?om> Subject: Re: Fwd: New to Euphoria Marco Achury wrote: > > Who is the owner of that list? > May be can put an autoresponder there to sent new people to Euforum. > > Or as you are suscript you can send a message to the list. > I've contacted the owner. The list is defunct, the owner is no longer using Euphoria, the list is vastly spam. He is looking into terminating it. I do not think we need a pointer or anything here because hardly anyone knew about it. People search for Euphoria will be going to rapideuphoria.com -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21643 Date: 2008 May 26 14:43 From: ken mortenson <kenneth_john at ?a?oo.com> Subject: Re: Do you currently use namespaces? Matt Lewis wrote: > To clarify, the reason for this is that a:hello() is masked by b:hello(). If > there were no b:hello(), then b:hello() would really refer to the hello() > in filea.e. > > Matt I'm not following, but others probably do. -= B E G I N =- X-EUFORUM: 21644 Date: 2008 May 26 14:52 From: ken mortenson <kenneth_john at ya?oo?com> Subject: Re: Do you currently use namespaces? Matt Lewis wrote: > You are correct in that our ability to hide information needs some additional > power. The local/global that we currently have isn't fine enough. It's just my gut, but this paradigm may not be resolvable regardless of the fineness. I believe there is a fundamental flaw in the concept of trying to fix the issues inherent with using includes as the application gets more complex. I know that classes resolves the issue. The problem of course is implementing classes when you are on track to use includes. I need to be more specific of course, but I need to think for awhile. -= B E G I N =- X-EUFORUM: 21645 Date: 2008 May 26 14:55 From: Marco Achury <achury at ca??v.net> Subject: Re: Deleting folders with files I proposed a library for file manipulation about one month ago and had not good answer. Some people said is useless and non popular. Is very important that as dir() the function works the same on any platform. +-+-+-+-+-+-+-+ Marco A. Achury Caracas, Venezuela -= B E G I N =- X-EUFORUM: 21646 Date: 2008 May 26 15:01 From: CChris <christian.cuvier at ag?icul?ure.gouv.fr> Subject: Re: Do you currently use namespaces? Derek Parnell wrote: > > CChris wrote: > > > This means that multiple files have to exchange > > information through interface identifiers, since > > an identifier that is visible in several files > > is promoted to interface symbol. This makes it > > unsafe to break a large body of code into > > smaller, more maintainable files, because all > > exchanges are not supposed to involve "public" > > data or routines. And because making public these > > symbols may interfere with any application that > > uses the library. > > By "public" I assume you mean "able to be directly referred to by code that > is outside the declaring file". Not exactly. By "public", I meant: available _everywhere_ outside the defining file, including an application including the lib. The issue is that they currently need to be as much public as that. > However, it has to be done that way if you want > to directly refer to an entity by name - the name must be visible for your code > to 'see' it. If you prefer indirect references, you can get away with not knowing > the entity's real name but at a performance overhead or via an alias symbol. > An alias is not a solution because its still a visible name. > You can inded replace a global routine by a global routine_id of a local routine, or a global variable by a global setter/getter. There is still a promiscuous symbol, and an extra performance penalty. > Also, the "public" access to data and not routines is the major problem with > module coupling. With routines, one publishes the API and (try to) keep the > API unchanged. Meaning you should be able to move the routine to a new module > and not break the code using it. > > I assume that when you say "interfere with any application" you are referring > to naming conflicts. This, as you well know, is what is being addressed in v4.0. There are several kinds of naming conflicts. If an application file, ie a file not supposed to be freely included anywhere, defines a symbol that exists in the lib the application as a whole includes, then the name should be changed in the applcation file. So these conflicts should never happen. The problem is the conflict between an application level identifier and an internal symbol from the library. The lib is assumed to be a black box, so it shouldn't matter whether it is split across several files. Also, these undocumented symbols may appear, change name or disappear at will, since they are not in the documented API of the lib. These conflicts haven't been discussed so far. Conflicts between several co-included libraries are a potential issue only, as far as I am aware of. It's the projected design of the new stdlib which is going to make them actual. They need to be addressed, but this is currently shadowing actual problems with potential problems. CChris > > Of course, one further way to restrict naming conflicts is to reduce the visibility > of symbols. 'global' makes it seen by all including levels, even if they don't > need to see it. One suggestion being kicked around is to allow 'global' items > to only be seen by the file directly including it. Discussion continues on this > front. > > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21647 Date: 2008 May 26 15:09 From: CChris <christian.cuvier at ag?iculture?gouv.fr> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > > CChris wrote: > > > > > > Open win32lib.ew and go through the code. Inclusion ordeer and placement in > > the file are crucial, and sometimes a headache to figure out. > > > > I thought the reference was in regards to include statements about order. It > certainly does matter in source and I don't really think that's a bad thing. > Sometimes it would be nice to have forward references as well as backwards with-in > a file, but for the most part, I think most issues are easily resolved. > > Quite a few languages have this "limitation". Modular and non-modular languages > alike, that's why I thought the reference was in regards to include statements. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Both forward referencing and include placement and order. If you want to break a set of functionality in a logical order, one should be able to do that. Currently, the conjunction of syntax rules about the positions of dclaring and using a symbol make that very difficult at best. CChris -= B E G I N =- X-EUFORUM: 21648 Date: 2008 May 26 15:11 From: CChris <christian.cuvier at ag??culture.gouv.fr> Subject: Re: Deleting folders with files Jeremy Cowgar wrote: > > ZNorQ wrote: > > > > > > I know about the rmdir/rd in windows, I was kind of hoping that there where > > own set of functions in the Euphoria language that could handle this - or atleast > > in Win32Lib. > > > > The rmdir/rd will have to do. Thanks for the help, Derek. > > > > Unfortunately that will not always work. That only works on Windows XP/Vista. > On Win 95/98/ME you will need to use deltree, which is not available then on > Windows XP/Vista. > > I am thinking maybe we need basic file system manipulation commands in 4.0 standard > library such as: > > delete, copy, move, exists, etc... > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I think Aku submitted such a lib to the Archive. CChris -= B E G I N =- X-EUFORUM: 21649 Date: 2008 May 26 16:17 From: c.k.lester <euphoric at ?kl?ster.com> Subject: Re: Do you currently use namespaces? In BBCMF, I've got a long list of includes. The includes at the bottom depend on includes at the top. Is there a better/preferred way? Here's an analogy: -- bbcmf.e include a.e include b.e include c.e include d.e -- relies on a, b include f.e -- relies on c, d include g.e -- relies on d, f -- index.esp -- the main program include bbcmf.e -= B E G I N =- X-EUFORUM: 21650 Date: 2008 May 26 16:22 From: Matt Lewis <matthewwalkerlewis at gma?l.c?m> Subject: Re: Do you currently use namespaces? c.k.lester wrote: > > In BBCMF, I've got a long list of includes. The includes at the bottom > depend on includes at the top. Is there a better/preferred way? Here's > an analogy: > > -- bbcmf.e > include a.e > include b.e > include c.e > include d.e -- relies on a, b > include f.e -- relies on c, d > include g.e -- relies on d, f > > -- index.esp -- the main program > include bbcmf.e d,f and g should make certain to include any file they need. Then, even if your main file doesn't use one of the dependencies, you'll still have working code. Matt -= B E G I N =- X-EUFORUM: 21651 Date: 2008 May 26 16:30 From: Matt Lewis <matthewwalkerlewis at gmail.??m> Subject: Re: Do you currently use namespaces? ken mortenson wrote: > > With regard to usage. Are we looking at the use of namespaces being > sort of all or nothing? I'm not saying it would be a requirement, but once > you start leaning on namespaces to solve collisions, you would tend to > have every include be given a name? It's not a requirement, though some people already code this way. Namespaces are the way in which you can resolve a collision. There's also going to be the ability to specify a default namespace for your library, which users could use. > Will there be instances where you didn't give an include a namespace and > find that later you must? Like adding a new lib to your project? This may > not be a top level include, requiring a hunt through who knows how many > files (depending on project size.) Yes. If you didn't specify a namespace, it's very possible that a later addition to your application could conflict with some other symbol that didn't need any qualifier previously. > While the usage may be consistant, you might have an issue with consistant > usage? I suspect I'm not being clear. Yeah, I'm not even trying to parse that one. :) > It's just my gut, but this paradigm may not be resolvable regardless of > the fineness. I believe there is a fundamental flaw in the concept of > trying to fix the issues inherent with using includes as the application > gets more complex. I know that classes resolves the issue. The problem > of course is implementing classes when you are on track to use includes. > > I need to be more specific of course, but I need to think for awhile. Classes only resolve the issue until you have multiple classes with the same name. I disagree with the main assertion, however. I believe that at this point it is totally possible to resolve any conflict with the tools that we have. By this, I mean that it should be possible to combine any [working!] third party code into a single application without having to modify any of the third party code. The information hiding is actually not *required* for this, though it could make the job easier by reducing the amount of symbols available to any particular scope. Matt -= B E G I N =- X-EUFORUM: 21652 Date: 2008 May 26 17:14 From: c.k.lester <euphoric at c?les?er.com> Subject: Re: Do you currently use namespaces? Matt Lewis wrote: > c.k.lester wrote: > > -- bbcmf.e > > include a.e > > include b.e > > include c.e > > include d.e -- relies on a, b > > include f.e -- relies on c, d > > include g.e -- relies on d, f > > > > -- index.esp -- the main program > > include bbcmf.e > > d,f and g should make certain to include any file they need. Then, even if > your main file doesn't use one of the dependencies, you'll still have > working code. That seems to violate DRY... Or doesn't it? But, I can see the case for including dependencies. How much more memory does this require, or does the interpreter see that I've included something earlier and it can just use that copy? -= B E G I N =- X-EUFORUM: 21653 Date: 2008 May 26 17:19 From: ken mortenson <kenneth_john at yahoo?com> Subject: Re: Do you currently use namespaces? Matt Lewis wrote: > Classes only resolve the issue until you have multiple classes with the > same name. Perhaps in theory, but I've never actually seen a real world example (not that it couldn't happen.) Any class would normally have many properties and methods which would have no collision issues. For the class name itself, most classes are those the programmer defines so those aren't a problem. So 3rd party libraries are the only issue. What about them? If in the form of two DLL's with the same name, you just put them into two different folders. So that leaves a third party source library. Again, you could simply have the library in a separate folder. So I just don't see any possible problem with class name collisions. Devil's advocate, how could I intentionally create a class name conflict? Of course, in VB, class names and file names are the same and there is one class per file. That may not be the case if the classes are implemented in some different way. > I disagree with the main assertion, however. Time will answer that question as it invariably does. > I believe that > at this point it is totally possible to resolve any conflict with the > tools that we have. By this, I mean that it should be possible to combine > any [working!] third party code into a single application without having to > modify any of the third party code. I completely agree with this as a goal. > The information hiding is actually not *required* for this, though it could > make the job easier by reducing the amount of symbols available to any > particular scope. > > Matt Just as a principle, all symbols should have scope as limited as possible. -= B E G I N =- X-EUFORUM: 21654 Date: 2008 May 26 17:22 From: c.k.lester <euphoric at ckles?er?com> Subject: Re: Do you currently use namespaces? Matt Lewis wrote: > d,f and g should make certain to include any file they need. Then, even if > your main file doesn't use one of the dependencies, you'll still have > working code. I can see the rationale here; I guess I just hate the idea of doing this: -- a.e shared_code() -- b.e include a.e -- c.e include a.e ... -- z.e include a.e -- myapp.exw include b.e include c.e when I could be doing this: -- a.e shared_code() -- myapp.exw include a.e -- here included ONCE, for everybody to use include b.e -- depends on a.e include c.e -- depends on a.e ... include z.e -- depends on a.e But, really, if you're going to depend on a lib, I guess you really should include it explicitly. :/ -= B E G I N =- X-EUFORUM: 21655 Date: 2008 May 26 17:26 From: Kat <KAT12 at coosahs.n??> Subject: Re: Deleting folders with files CChris wrote: > > Jeremy Cowgar wrote: > > > > ZNorQ wrote: > > > > > > > > > I know about the rmdir/rd in windows, I was kind of hoping that there where > > > own set of functions in the Euphoria language that could handle this - or atleast > > > in Win32Lib. > > > > > > The rmdir/rd will have to do. Thanks for the help, Derek. > > > > > > > Unfortunately that will not always work. That only works on Windows XP/Vista. > > On Win 95/98/ME you will need to use deltree, which is not available then on > > Windows XP/Vista. > > > > I am thinking maybe we need basic file system manipulation commands in 4.0 standard > > library such as: > > > > delete, copy, move, exists, etc... > > > > -- > > Jeremy Cowgar > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > I think Aku submitted such a lib to the Archive. So did Jeffrey Fielding and Brian Broker (win32fil.e). Kat -= B E G I N =- X-EUFORUM: 21656 Date: 2008 May 26 17:44 From: Matt Lewis <matthewwalkerlewis at ?mai?.com> Subject: Re: Do you currently use namespaces? ken mortenson wrote: > > Matt Lewis wrote: > > > Classes only resolve the issue until you have multiple classes with the > > same name. > > Perhaps in theory, but I've never actually seen a real world example (not > that it couldn't happen.) Any class would normally have many properties > and methods which would have no collision issues. I see them all the time in, for instance, Java. Different libraries often have similar class names. One common one that comes to mind is 'Query.' > For the class name > itself, most classes are those the programmer defines so those aren't a > problem. Only if you always roll your own. I think most people use at least some third party code, even if it's only from the standard library. You have no control over how those things are named. > So 3rd party libraries are the only issue. What about them? > If in the form of two DLL's with the same name, you just put them into > two different folders. So that leaves a third party source library. Again, > you could simply have the library in a separate folder. This is one way to disambiguate. I assume you're thinking of something like Java or perl, where file structure has meaning within the code. > So I just don't see any possible problem with class name collisions. > Devil's advocate, how could I intentionally create a class name conflict? > Of course, in VB, class names and file names are the same and there is one > class per file. That may not be the case if the classes are implemented > in some different way. It could still be a problem. What if you're using two different libraries, each of which define a class with the same name? For example, what if you have one library for using a database, and another for doing xslt stuff. It's pretty easy to imagine that both might have a Query class, for instance. The bottom line is that you need some sort of container which is in the control of the end user (at least, if you want *any* combination of 3rd party code to be usable together). You can use file structure. Euphoria doesn't use this. It uses namespaces. > > The information hiding is actually not *required* for this, though it could > > make the job easier by reducing the amount of symbols available to any > > particular scope. > > Just as a principle, all symbols should have scope as limited as possible. Yes, I think we all agree on this. Matt -= B E G I N =- X-EUFORUM: 21657 Date: 2008 May 26 17:49 From: Matt Lewis <matthewwalkerlewis at g??il.com> Subject: Re: Do you currently use namespaces? c.k.lester wrote: > > Matt Lewis wrote: > > > > d,f and g should make certain to include any file they need. Then, even if > > your main file doesn't use one of the dependencies, you'll still have > > working code. > > That seems to violate DRY... Or doesn't it? I would argue that it doesn't, or that it's at least a reasonable exception. Since both files need depend upon the code, it's just being more explicit about things. > But, I can see the case for including dependencies. How much more memory > does this require, or does the interpreter see that I've included something > earlier and it can just use that copy? The additional memory is trivial (basically, euphoria remembers who included whom, so it's an extra integer in a sequence). The file is only read once. But this information is used later to determine symbol resolution. Suppose that someone were using bbcmf and some other library. Now suppose that this other library exposed a global symbol that had the same name as something in one of your files (let's say filed.e). Under 3.1, if the other library were included before bbcmf, you'd get an error when that symbol was used in bbcmf, because there would be two globals with that name. Under 4.0, the parser will see that while there are two symbols, bbcmf actually included filed.e, but not the other library, so it obviously meant to use the symbol in filed.e. Matt -= B E G I N =- X-EUFORUM: 21658 Date: 2008 May 26 17:54 From: Matt Lewis <matthewwalkerlewis at gmai?.?om> Subject: Re: Do you currently use namespaces? c.k.lester wrote: > > Matt Lewis wrote: > > d,f and g should make certain to include any file they need. Then, even if > > your main file doesn't use one of the dependencies, you'll still have > > working code. > > I can see the rationale here; I guess I just hate the idea of doing this: <snip> > But, really, if you're going to depend on a lib, I guess you really should > include it explicitly. :/ Yes. It has several benefits. Some are to you, the original coder: * It makes it easier to see what the dependencies really are. * It helps resolve some of the 'order of include' issues you've run into. Some are for your downstream users: * If they want to use one of your modules apart from your library, it's easy to see the dependencies, and ensure they are correct. See the history of win32lib's memory management code for an example. * It prevents conflicts that could only be resolved by having an end user edit 3rd party code. BTW, in 4.0, not including the files (directly or indirectly) will result in a warning. Matt -= B E G I N =- X-EUFORUM: 21659 Date: 2008 May 26 18:28 From: ken mortenson <kenneth_john at ya?o?.com> Subject: Re: Do you currently use namespaces? Matt Lewis wrote: > Different libraries often have [some duplicate] class names. Sure. I've never found that to be a problem because of the way VB implements classes. Never. > The bottom line is that you need some sort of container which is in the > control of the end user (at least, if you want *any* combination of 3rd > party code to be usable together). You can use file structure. Euphoria > doesn't use this. But it could. It's just a question of implementation. The great advantage of using file structure is it's a natural way to organize code (not to be dismissed lightly.) -= B E G I N =- X-EUFORUM: 21660 Date: 2008 May 26 19:03 From: CChris <christian.cuvier at ag?icu?ture.gouv.fr> Subject: Re: Do you currently use namespaces? Matt Lewis wrote: > > c.k.lester wrote: > > > > Matt Lewis wrote: > > > > > > d,f and g should make certain to include any file they need. Then, even if > > > your main file doesn't use one of the dependencies, you'll still have > > > working code. > > > > That seems to violate DRY... Or doesn't it? > > I would argue that it doesn't, or that it's at least a reasonable exception. > > Since both files need depend upon the code, it's just being more explicit > about things. > This is completely against modular programming. If fileB.e depends on any file that provide something, but is meant to be included by them, you'll have fileA1.e and fileA2.e which will include fileB.e. Fine. But now, what to code in fileB.e? include fileA1.e -- but fileA2.e might do as well or include fileA2.e -- then what about the possibiity for fileA1.e? True, you may use the new ifdef statement to choose which one. But this misses the core point. The core point is that you need to know the name of a file to include it. But you don't know the name of all the third party files that might benefit from including fileB.e, since what is needed is only some properties of the including file. This goes against reusability of fileB.e. CChris > > But, I can see the case for including dependencies. How much more memory > > does this require, or does the interpreter see that I've included something > > earlier and it can just use that copy? > > The additional memory is trivial (basically, euphoria remembers who included > whom, so it's an extra integer in a sequence). The file is only read once. > But this information is used later to determine symbol resolution. > > Suppose that someone were using bbcmf and some other library. Now suppose > that this other library exposed a global symbol that had the same name as > something in one of your files (let's say filed.e). Under 3.1, if the > other library were included before bbcmf, you'd get an error when that > symbol was used in bbcmf, because there would be two globals with that name. > > Under 4.0, the parser will see that while there are two symbols, bbcmf actually > included filed.e, but not the other library, so it obviously meant to use > the symbol in filed.e. > > Matt -= B E G I N =- X-EUFORUM: 21661 Date: 2008 May 26 19:51 From: Matt Lewis <matthewwalkerlewis at gm?il.c?m> Subject: Re: Do you currently use namespaces? CChris wrote: > > Matt Lewis wrote: > > > > Since both files need depend upon the code, it's just being more explicit > > about things. > > > > This is completely against modular programming. Wrong. > If fileB.e depends on any file that provide something, but is meant to be > included by them, you'll have fileA1.e and fileA2.e which will include > fileB.e. Fine. Your pattern is broken. This would be equivalent to win32lib (old days) relying on the application to define the handler sequences, like onClick. Instead, we have a procedure in win32lib, setHandler, that the program calls to set the variables. Most languages (OK, that's an unproven assertion, but I can think of at least C/C++, java, perl and python) wouldn't even let you get away with this. > But now, what to code in fileB.e? > > include fileA1.e -- but fileA2.e might do as well > or > include fileA2.e -- then what about the possibiity for fileA1.e? > > True, you may use the new ifdef statement to choose which one. But this > misses the core point. > > The core point is that you need to know the name of a file to include it. > But you don't know the name of all the third party files that might benefit > from including fileB.e, since what is needed is only some properties of > the including file. This goes against reusability of fileB.e. Again, your pattern is broken. You should expose an API for those that use your library to supply whatever initialization stuff you need. You also get the free bonus that you don't require that more symbols be global. Matt -= B E G I N =- X-EUFORUM: 21662 Date: 2008 May 26 20:00 From: CChris <christian.cuvier at a?riculture?gouv.fr> Subject: Re: Do you currently use namespaces? Matt Lewis wrote: > > CChris wrote: > > > > Matt Lewis wrote: > > > > > > Since both files need depend upon the code, it's just being more explicit > > > about things. > > > > > > > This is completely against modular programming. > > Wrong. > > > If fileB.e depends on any file that provide something, but is meant to be > > included by them, you'll have fileA1.e and fileA2.e which will include > > fileB.e. Fine. > > Your pattern is broken. This would be equivalent to win32lib (old days) > relying on the application to define the handler sequences, like onClick. > Instead, we have a procedure in win32lib, setHandler, that the program > calls to set the variables. > > Most languages (OK, that's an unproven assertion, but I can think of at > least C/C++, java, perl and python) wouldn't even let you get away with > this. > > > But now, what to code in fileB.e? > > > > include fileA1.e -- but fileA2.e might do as well > > or > > include fileA2.e -- then what about the possibiity for fileA1.e? > > > > True, you may use the new ifdef statement to choose which one. But this > > misses the core point. > > > > The core point is that you need to know the name of a file to include it. > > But you don't know the name of all the third party files that might benefit > > from including fileB.e, since what is needed is only some properties of > > the including file. This goes against reusability of fileB.e. > > Again, your pattern is broken. You should expose an API for those that use > your library to supply whatever initialization stuff you need. You also > get the free bonus that you don't require that more symbols be global. > > Matt The construct is perfectly valid in 3.1, and would serve a definite purpose, ie implementing plugin file schemes. Perhaps removing this ability will not actually break code. But I see no benefit to offset the loss. CChris -= B E G I N =- X-EUFORUM: 21663 Date: 2008 May 26 20:00 From: moderator <moderator at OpenEuphoria.org> Subject: EUforum Monthly Reminder EUforum Monthly Reminder (sent automatically) EUforum was created for discussing the Euphoria Programming Language and closely-related topics. The Euphoria main Web page is: http://www.RapidEuphoria.com To find out about EUforum commands, or to search the archives of this list go here: http://www.RapidEuphoria.com/listserv.htm To access this list via the Web interface go here: http://www.OpenEuphoria.org/EUforum To access this list via RSS: http://www.OpenEuphoria.org/EUforum/messages.xml (brief summary) http://www.OpenEuphoria.org/EUforum/messages_full.xml (full feed) If you are a qualified user, this might be a good time to vote in the Euphoria Micro-Economy. You can vote here: http://www.RapidEuphoria.com/ecoform.htm -= B E G I N =- X-EUFORUM: 21664 Date: 2008 May 26 20:27 From: Matt Lewis <matthewwalkerlewis at gmai?.?om> Subject: Re: Do you currently use namespaces? CChris wrote: > > Matt Lewis wrote: > > > > CChris wrote: > > > > > > The core point is that you need to know the name of a file to include it. > > > But you don't know the name of all the third party files that might benefit > > > from including fileB.e, since what is needed is only some properties of > > > the including file. This goes against reusability of fileB.e. > > > > Again, your pattern is broken. You should expose an API for those that use > > your library to supply whatever initialization stuff you need. You also > > get the free bonus that you don't require that more symbols be global. > > The construct is perfectly valid in 3.1, and would serve a definite > purpose, ie implementing plugin file schemes. Perhaps removing this > ability will not actually break code. But I see no benefit to offset > the loss. There is no loss. You can still implement this. It's still a bad idea, and that's why the warning is there. So in reality, there is no loss, and only benefit. Consider the case when some other library that your user uses happens to have some global that has the same name as one that you require the user to implement? Now your library will break if it isn't included first, or if the user modifies your code. I'll say it again. Using this pattern makes it so that your code will play nice with other code. If you're just writing the final application, then you can be assured that your poorly structured code will not mess up anyone else. After all, you can always edit your code. If you're going to release your code for others to use, however, you're creating potential problems if you continue to use this pattern. You don't need to do that for plugins. In fact, this would seem to limit the number of plugins you could use, since you rely on calling discrete things. It would be like hardcoding Window in win32lib as an atom, and having users create their window and store it in that variable. But what if I want two windows in my app? Or, if you still coded it with sequences, and had users append their stuff to some global that you used, you're now doing the opposite of modular coding, since you've coupled the library and the application so closely. Matt -= B E G I N =- X-EUFORUM: 21665 Date: 2008 May 26 23:35 From: Derek Parnell <ddparnell at bigpond.??m> Subject: Re: Do you currently use namespaces? The D programming language has the addition concept of a package. I believe that Java has too. A package is essentially a named collection of modules. Anyhow, the thing is you can declare a symbol has being exposed only to its module, or only to its package, or to everything. Maybe this can be used in Euphoria too somehow. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21666 Date: 2008 May 26 23:54 From: Jeremy Cowgar <jeremy at cow?ar?com> Subject: Re: Do you currently use namespaces? Derek Parnell wrote: > > The D programming language has the addition concept of a package. I believe > that Java has too. A package is essentially a named collection of modules. Anyhow, > the thing is you can declare a symbol has being exposed only to its module, > or only to its package, or to everything. > > Maybe this can be used in Euphoria too somehow. > Derek, We currently have the ability for a file to declare it's namespace, what do you think about building from it: <eucode> -- pack_a.e namespace pack friend integer abc -- pack_b.e namespace pack include pack_a.e ? abc </eucode> I have no idea if friend is a good word or not, but it's not global and not local. It says you can share this item with other files in the same namespace. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21667 Date: 2008 May 27 0:11 From: gshingles <gshingles at gmail??om> Subject: Re: Do you currently use namespaces? Matt Lewis wrote: > > This is one way to disambiguate. I assume you're thinking of something like > Java or perl, where file structure has meaning within the code. ;-) > It could still be a problem. What if you're using two different libraries, > each of which define a class with the same name? For example, what if you > have one library for using a database, and another for doing xslt stuff. > It's pretty easy to imagine that both might have a Query class, for instance. > > The bottom line is that you need some sort of container which is in the > control of the end user (at least, if you want *any* combination of 3rd > party code to be usable together). You can use file structure. Euphoria > doesn't use this. It uses namespaces. I think that's where Euphoria leaves the beaten track a bit. Java and Perl are good examples for your example above with having names like (for example) MySQL::Query() or com.xxyyzz.xslt.Query(). No problem, except for the extra typing involved, which personally I don't mind and each language provides means to import those function names directly into your main namespace if you know you'll rely heavily on them. Even Python (from my all of two months experience with it) seems to 'namespace' through levels of, shall we say, containment: os.path.join(...), string.join(...) where they both behave differently. The aim with Euphoria seems to be to bring everything up to the level of the main program with the least amount of namespacing required, but to have the facility available in case of conflicts. This is fine by me, but I think this is an opportunity to bring some level of modularity to the language that is currently a bit 'loose', and I don't think it would break too much to implement something at this stage (but that is obviously the target of your discussions on the dev list which I haven't caught up on). I saw mention of a default namespace being created by the coder of the include. Well why not make the default namespace the name of the file, without .e[??] at the end? Even better, why not work out its path relative to the EUINC folder it is in and make that the default namespace? Even even better (all IMHO of course) provide a function that returns the name (or numeric id) of that default namespace? From the one minute of thought I just gave to that scenario you'd have the start of a basic roll-your-own OO system, without inheritance and all that guff, since you could store instantiated data mapped to that namespace and pass around an instance id to your 'class' methods (ie global routines in the include) designed to use it. I don't see how that would break anything since you could still use the include..as mechanism, and any library taking advantage of the OOness would be coded specifically to use that system (and be appropriately documented so). Euphoria's type checking would even make it possible to do both, like Perl, a procedural and an OO interface, it can even just be used as a default namespace mechanism. I'm happy to provide a comprehensive example of what I mean by all that if it is seen as a good idea or needs clarification. If it's not a good idea, I'd like to know why? :) Gary -= B E G I N =- X-EUFORUM: 21668 Date: 2008 May 27 0:11 From: Derek Parnell <ddparnell at bigpond.c?m> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > We currently have the ability for a file to declare it's namespace, what do > you think about building from it: > > I have no idea if friend is a good word or not, but it's not global and not > local. It says you can share this item with other files in the same namespace. To recap, in v3 a namespace is a local symbol. That is, the namespace name itself is only visible in the file that declares it, and that name lives in the file's scope so namespace name in a file must be unique. This means that ... include foo.e as foo include bar.e as foo would fail. Jeremy, if I read you correctly, you are suggesting that in v4 we expand the namespace concept to become more like a package, such that all files with the same namespace name form a logical collection of modules, and that we should then be able to nominate which symbols in a file can be seen at the 'package'/'namespace' level but not outside that level. Ths would be a different scope from both private (to the module/file) and global. Have I got your thinking correct? -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21669 Date: 2008 May 27 0:15 From: Jeremy Cowgar <jeremy at ?owga?.com> Subject: Re: Do you currently use namespaces? Derek Parnell wrote: > > Jeremy, > if I read you correctly, you are suggesting that in v4 we expand the namespace > concept to become more like a package, such that all files with the same namespace > name form a logical collection of modules, and that we should then be able to > nominate which symbols in a file can be seen at the 'package'/'namespace' level > but not outside that level. Ths would be a different scope from both private > (to the module/file) and global. > > Have I got your thinking correct? > Yes, however, as said on dev-list, it really is just one of many existing suggestions already and I do not yet fully understand the problem, let alone the perfect solution. So I am simply tossing out a slightly (I do understand the problem a bit) uneducated thought for comment to promote pro/con and other suggestion ideas. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21670 Date: 2008 May 27 0:21 From: Lucius L. Hilley III <euphoria at ?nkmar.?om> Subject: Re: Deleting folders with files Kat wrote: > > CChris wrote: > > > > Jeremy Cowgar wrote: > > > > > > ZNorQ wrote: > > > > > > > > > > > > I know about the rmdir/rd in windows, I was kind of hoping that there where > > > > own set of functions in the Euphoria language that could handle this - or > atleast</font></i> > > > > in Win32Lib. > > > > > > > > The rmdir/rd will have to do. Thanks for the help, Derek. > > > > > > > > > > Unfortunately that will not always work. That only works on Windows XP/Vista. > > > On Win 95/98/ME you will need to use deltree, which is not available then on > > > Windows XP/Vista. > > > > > > I am thinking maybe we need basic file system manipulation commands in 4.0 standard > > > library such as: > > > > > > delete, copy, move, exists, etc... > > > > > > -- > > > Jeremy Cowgar > > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > > > I think Aku submitted such a lib to the Archive. > > So did Jeffrey Fielding and Brian Broker (win32fil.e). > > Kat And Chris Bensler wrote one a few years back? Lucius L. Hilley III - Unkmar -= B E G I N =- X-EUFORUM: 21671 Date: 2008 May 27 0:24 From: Matt Lewis <matthewwalkerlewis at ?mail.c?m> Subject: Re: Do you currently use namespaces? Derek Parnell wrote: > > The D programming language has the addition concept of a package. I > believe that Java has too. A package is essentially a named collection of > modules. Anyhow, the thing is you can declare a symbol has being exposed > only to its module, or only to its package, or to everything. > > Maybe this can be used in Euphoria too somehow. CChris has a pretty detailed proposal on how to do this. In java, anything in the same package does not need an import, but there is still the issue of public/private/protected. Java relies heavily on using the filesystem for packages, and is how you end up with things that are fully qualified as org.rds.regex.search. Perl is somewhat similar. I think C++ is closer to what CChris proposed. My feelings about introducing something like this is that I don't think it's needed. It would be another concept similar, but different from namespaces. Perhaps if we'd started there...but we didn't. I think that the missing piece is one additional scope (named something like "export") that allows files that include a file to see symbols in that scope, but not any further. In other words: <eucode> -- app.ex include foo.e ? BAR -- BAR not defined here -- foo.e include bar.e ? BAR -- ok -- bar.e export constant BAR = 1 </eucode> And then we declare that export is the new global. All of the standard libraries should use this by default. For compatibility's sake, we probably shouldn't go back and change existing stuff. For a multi-file library like win32lib, files could still be logically organized, but it would be possible to keep internals from leaking out. One reason I prefer this approach over packaging (over CChris', at least, other packaging proposals might differ) is that individual files don't rely on some external resource to define the package. They simply define their own dependencies and expose an interface with two types of scope. Part of this comes from the fact that it's sometimes useful to take bits from a library like win32lib. I might not need or want everything, but I might want to use its memory management/structure modules. To me, this is a more modular approach than to define a static set of things as a package. Looking at a file, I can know all about it by reading it, and following its include statements, rather than referring to a parent file that defines its package. YMMV Matt -= B E G I N =- X-EUFORUM: 21672 Date: 2008 May 27 0:26 From: Mike <vulcan at win.?o.nz> Subject: Re: Do you currently use namespaces? Hi CK, I had a look at BBCMF to see if I could mebbe help or something. Where is the zip file? All I see are lots of indiviudal source files... Mike PS: I couldn't see any obvious email address to send this message directly to you.. c.k.lester wrote: > > In BBCMF, I've got a long list of includes. The includes at the bottom > depend on includes at the top. Is there a better/preferred way? Here's > an analogy: > > -- bbcmf.e > include a.e > include b.e > include c.e > include d.e -- relies on a, b > include f.e -- relies on c, d > include g.e -- relies on d, f > > -- index.esp -- the main program > include bbcmf.e -= B E G I N =- X-EUFORUM: 21673 Date: 2008 May 27 0:32 From: c.k.lester <euphoric at cklester.??m> Subject: Re: Do you currently use namespaces? Mike wrote: > > I had a look at BBCMF to see if I could mebbe help or something. Where is the > zip file? All I see are lots of indiviudal source files... Hey, Mike! Thanks for taking a look... or wanting to. :) The download page is here: http://bbcmf.com/?page=1&content=download_page The whole system is available via SVN. I stopped posting the ZIP files because things change so quickly. I'd be happy to zip them up, though, and email them to you (or make them otherwise available via my site). Let me know what you want to do. -= B E G I N =- X-EUFORUM: 21674 Date: 2008 May 27 0:48 From: c.k.lester <euphoric at ?klester?com> Subject: Re: Do you currently use namespaces? c.k.lester wrote: > Mike wrote: > > I had a look at BBCMF to see if I could mebbe help or something. Where is the > > zip file? All I see are lots of indiviudal source files... > Hey, Mike! Thanks for taking a look... or wanting to. :) Mike, here's how to set it all up: http://bbcmf.com/documentation/index.html#install -= B E G I N =- X-EUFORUM: 21675 Date: 2008 May 27 2:05 From: ken mortenson <kenneth_john at yahoo??om> Subject: Re: Ken, seen ooeu? Well, Just took a look at ooeu docs. Interesting. I never bought into the OOP hype. However, I do subscribe to the underlying principles and find dot notation useful (especially combined with intellisense.) My focus is building enterprise level software and classes make that a lot more managable. To me the most overhyped feature of OOP is inheritance. It complicates software (increasing maintenance) without any real benefit. Of course, I can see limited application where it can be useful. Thanks for pointing ooeu out to me. -= B E G I N =- X-EUFORUM: 21676 Date: 2008 May 27 4:46 From: Jason Gade <jaygade at yahoo?co?> Subject: Re: Do you currently use namespaces? I've been following this thread and I think some things are kinda... weird. I think I understand Ken's concerns, and I find some of CChris' styles much like goto-spaghetti-code. I think I also understand that massive libraries such as Win32lib have special requirements. Maybe I'm just short-sighted because I've only written programs with a few hundred lines of code instead of a few thousand. To me, a .e file has both state and interface. Much like an object. I include files that my program depends upon at the top of the program. Include files should never look at information in the main program. The main program should never rely upon the state or the interface of .e files that it does not explicitly include. If I was writing a library, which I have not done yet, I would try and make sure that each individual file was almost completely decoupled from any other file, except when building blocks. If two files needed to share some mutual state then I guess that I would write a third file to interface in between them. So maybe the only modules I'm really used to are in Java and C++ classes, and the way that C handles include files. Much like "goto", you can abuse the scope and include system of Euphoria. But you don't have to do so. Of course, you wouldn't know that from looking at the interpreter source code :-). -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21677 Date: 2008 May 27 6:25 From: ZNorQ <znorq at ho?ha?g.com> Subject: Re: Deleting folders with files Kat wrote: > > CChris wrote: > > > > Jeremy Cowgar wrote: > > > > > > ZNorQ wrote: > > > > > > > > > > > > I know about the rmdir/rd in windows, I was kind of hoping that there where > > > > own set of functions in the Euphoria language that could handle this - or > atleast</font></i> > > > > in Win32Lib. > > > > > > > > The rmdir/rd will have to do. Thanks for the help, Derek. > > > > > > > > > > Unfortunately that will not always work. That only works on Windows XP/Vista. > > > On Win 95/98/ME you will need to use deltree, which is not available then on > > > Windows XP/Vista. > > > > > > I am thinking maybe we need basic file system manipulation commands in 4.0 standard > > > library such as: > > > > > > delete, copy, move, exists, etc... > > > > > > -- > > > Jeremy Cowgar > > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > > > I think Aku submitted such a lib to the Archive. > > So did Jeffrey Fielding and Brian Broker (win32fil.e). > > Kat Found the win32fil.ew which seems to contain what I need. Good thing I didn't need to use those blasted dos cmds. Thanks folks! Kenneth/ZNorQ -= B E G I N =- X-EUFORUM: 21678 Date: 2008 May 27 6:33 From: ZNorQ <znorq at holha?g.c?m> Subject: Re: Deleting folders with files Marco Achury wrote: > > I proposed a library for file manipulation about > one month ago and had not good answer. Some > people said is useless and non popular. > > Is very important that as dir() the function works > the same on any platform. > > +-+-+-+-+-+-+-+ > Marco A. Achury > Caracas, Venezuela Pretty strange thing to say, but I guess the reason for saying so is that there are problably many of those libs already out there. I'd say that this should be an obvious inclusion in the core library of Euphoria (file.e?). Kenneth/ZNorQ -= B E G I N =- X-EUFORUM: 21679 Date: 2008 May 27 7:01 From: ken mortenson <kenneth_john at ?ah?o.com> Subject: Re: Do you currently use namespaces? Jason Gade wrote: Good observations Jason, this post provides a lot to chew on. > I've been following this thread and I think some things are kinda... weird. If I may, I think the weirdness come from the fact that it overlaps a lot of distinct issues. My feeling is that often we try to solve the wrong problem. We lose sight of the goal in the battle over nitty-gritty brain-twisters. Is name collision the big issue? Maybe not. Is getting namespaces to work the goal? Mayby not. Is the goal itself for some limited short term objective (to get a new version out) or is it something greater? > I think I understand Ken's concerns, and I find some of CChris' styles much > like goto-spaghetti-code. Sometimes I'm not sure I understand my own concerns. ;-) I do think that some concepts are not well shared because of peoples different experience and focus. To better understand my concerns, you have to understand that I have a clear and specific vision of what I want due to my years of work, but my experience may not be the same as others with different experience. I'm looking for a very specific tool that could be but isn't. Most people seem to just want to 'improve' this language by fixing some observed apparent issues. I'm very strongly in the school of thought that often less is more. To me, namespaces add complexity (not perhaps so much in usage as in other ways) without the sufficiently offsetting benefit. People will argue that namespaces provides a means of creating modular code. They might be right. The whole idea of includes and namespaces would, for me, preclude reaching the level of modularity I desire. > I think I also understand that massive libraries such as Win32lib have special > requirements. > > Maybe I'm just short-sighted because I've only written programs with a few hundred > lines of code instead of a few thousand. In the 1975, I thought ten thousand was a lot of lines of code (and a complete project.) Now that's just one of many hundreds of modules. > To me, a .e file has both state and interface. Much like an object. I include > files that my program depends upon at the top of the program. Include files > should never look at information in the main program. The main program should > never rely upon the state or the interface of .e files that it does not explicitly > include. I would say that is an example of modular thinking. Like I say, programmers write modules, languages don't. > If I was writing a library, which I have not done yet, I would try and make > sure that each individual file was almost completely decoupled from any other > file, except when building blocks. If two files needed to share some mutual > state then I guess that I would write a third file to interface in between them. > > So maybe the only modules I'm really used to are in Java and C++ classes, and > the way that C handles include files. > > Much like "goto", you can abuse the scope and include system of Euphoria. But > you don't have to do so. > > Of course, you wouldn't know that from looking at the interpreter source code :-). System software is a different animal from applications in my book. Think of machine language. If your high level language provides access to ML then you already have GOTO in your language even if it's not a specific keyword. My feeling however, is that a good HLL aught to be able to compile itself which to me is a test of it's expressiveness. Euphoria scores very highly in expressiveness. One of my comcerns is losing that expressiveness with unneeded features (and missing needed features.) Even having the addition of... namespace:function() over just function() is the addition of impurity in the language (admittedly a matter of taste) even though I am a big fan of dot notation... Instance.method() which some may consider to be similar. I do hate the blah.blah.blah.dosomething() version of dot notation. All I know is that with the right tools I can crank out a huge quantity of rock solid code and have great joy in the process producing something that in turn will please others. I want that!!! -= B E G I N =- X-EUFORUM: 21680 Date: 2008 May 27 9:32 From: CChris <christian.cuvier at agricultur?.g?uv.fr> Subject: Re: Do you currently use namespaces? Jeremy Cowgar wrote: > > Derek Parnell wrote: > > > > The D programming language has the addition concept of a package. I believe > > that Java has too. A package is essentially a named collection of modules. Anyhow, > > the thing is you can declare a symbol has being exposed only to its module, > > or only to its package, or to everything. > > > > Maybe this can be used in Euphoria too somehow. > > > > Derek, > > We currently have the ability for a file to declare it's namespace, what do > you think about building from it: > > > <eucode> > -- pack_a.e > namespace pack > > friend integer abc > > -- pack_b.e > namespace pack > > include pack_a.e > > ? abc > </eucode> > > I have no idea if friend is a good word or not, but it's not global and not > local. It says you can share this item with other files in the same namespace. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> "friend" is familiar for C++ coders; I had suggested "internal" in my package package; "protected" is used in other languages I think. I don't know which looks best, but one is needed. "private" has been suggested, but it collides with what we use to know as private variables. CChris -= B E G I N =- X-EUFORUM: 21681 Date: 2008 May 27 9:42 From: CChris <christian.cuvier at ?gricu?ture.gouv.fr> Subject: Re: Do you currently use namespaces? gshingles wrote: > > Matt Lewis wrote: > > > > This is one way to disambiguate. I assume you're thinking of something like > > Java or perl, where file structure has meaning within the code. > > ;-) > > > It could still be a problem. What if you're using two different libraries, > > each of which define a class with the same name? For example, what if you > > have one library for using a database, and another for doing xslt stuff. > > It's pretty easy to imagine that both might have a Query class, for instance. > > > > The bottom line is that you need some sort of container which is in the > > control of the end user (at least, if you want *any* combination of 3rd > > party code to be usable together). You can use file structure. Euphoria > > doesn't use this. It uses namespaces. > > I think that's where Euphoria leaves the beaten track a bit. Java and Perl > are good examples for your example above with having names like (for example) > MySQL::Query() or com.xxyyzz.xslt.Query(). No problem, except for the extra > typing involved, which personally I don't mind and each language provides means > to import those function names directly into your main namespace if you know > you'll rely heavily on them. > > Even Python (from my all of two months experience with it) seems to 'namespace' > through levels of, shall we say, containment: os.path.join(...), string.join(...) > where they both behave differently. > > The aim with Euphoria seems to be to bring everything up to the level of the > main program with the least amount of namespacing required, but to have the > facility available in case of conflicts. This is fine by me, but I think this > is an opportunity to bring some level of modularity to the language that is > currently a bit 'loose', and I don't think it would break too much to implement > something at this stage (but that is obviously the target of your discussions > on the dev list which I haven't caught up on). > > I saw mention of a default namespace being created by the coder of the include. > Well why not make the default namespace the name of the file, without .e[??] > at the end? Even better, why not work out its path relative to the EUINC folder > it is in and make that the default namespace? Even even better (all IMHO of > course) provide a function that returns the name (or numeric id) of that default > namespace? > For several reasons: * mylib_v1.e may become mylib_v2.e * file names may contain invalid characters for an Euphoria identifier, including, worst of all, spaces; * What is the name of fileA.e under Windows? Its short 8.3 name? its lowercased form? its uppercased form? * Having all of the above in mind, copy your library from one platform to another, and have fun. CChris > From the one minute of thought I just gave to that scenario you'd have the > start of a basic roll-your-own OO system, without inheritance and all that guff, > since you could store instantiated data mapped to that namespace and pass around > an instance id to your 'class' methods (ie global routines in the include) designed > to use it. > > I don't see how that would break anything since you could still use the include..as > mechanism, and any library taking advantage of the OOness would be coded specifically > to use that system (and be appropriately documented so). Euphoria's type checking > would even make it possible to do both, like Perl, a procedural and an OO interface, > it can even just be used as a default namespace mechanism. > > I'm happy to provide a comprehensive example of what I mean by all that if it > is seen as a good idea or needs clarification. If it's not a good idea, I'd > like to know why? :) > > Gary -= B E G I N =- X-EUFORUM: 21682 Date: 2008 May 27 9:57 From: Derek Parnell <ddparnell at bigpond.??m> Subject: Re: Do you currently use namespaces? CChris wrote: >> Well why not make the default namespace the name of the file, >> without .e[??] at the end? > For several reasons: > * mylib_v1.e may become mylib_v2.e > * file names may contain invalid characters for an Euphoria identifier, including, > worst of all, spaces; > * What is the name of fileA.e under Windows? Its short 8.3 name? its lowercased > form? its uppercased form? > * Having all of the above in mind, copy your library from one platform to another, > and have fun. OMG! These are problems that can never be solved in our lifetime. Let's all panic and run away now. ... or ... * Use the new v4.0 'namespace' directive to provide a default name for "mylib_v1.e" and thus also "mylib_v2.e" * Strip out illegal identifier characters * Convert to lowercase * As coded by the application author on the include statement * Huh??? What's the problem with different platforms and file names? Come on Chris, try to help solve the issues. Please, we need all the good ideas we can get, -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21683 Date: 2008 May 27 10:23 From: CChris <christian.cuvier at agriculture.gou?.fr> Subject: Re: Do you currently use namespaces? Derek Parnell wrote: > > CChris wrote: > > >> Well why not make the default namespace the name of the file, > >> without .e[??] at the end? > > > > For several reasons: > > * mylib_v1.e may become mylib_v2.e > > * file names may contain invalid characters for an Euphoria identifier, including, > > worst of all, spaces; > > * What is the name of fileA.e under Windows? Its short 8.3 name? its lowercased > > form? its uppercased form? > > * Having all of the above in mind, copy your library from one platform to another, > > and have fun. > > OMG! These are problems that can never be solved in our lifetime. Let's all > panic and run away now. > > ... or ... > > * Use the new v4.0 'namespace' directive to provide a default name for "mylib_v1.e" > and thus also "mylib_v2.e" > * Strip out illegal identifier characters > * Convert to lowercase > * As coded by the application author on the include statement > * Huh??? What's the problem with different platforms and file names? > > Come on Chris, try to help solve the issues. Please, we need all the good ideas > we can get, > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell That's why I don't think using a file name as default namespace is convenient, and was stating it. Actually, if we don't mind about existing code, using the new "internal" (or whatnot) qualifier in conjunction with an explicit default namespace for files that are part of the package is probably almost enough. With the addition of a "restrict" directive like in "restrict gets from foobar to foobar", it would be enough. Now we have to ponder whether we want to keep in check pre 4.0 code with rogue globals or not. That's why external exclude or include lists were designed for. Also, the proposal I had made had provisions for being able to still use "global" all around, and packaging directives like with package= would take care of translating "global" to exported or internal. If converting to the new rules is a light enough mental burden, then that component is not needed either. I actually would feel relieved if the global (no pun) mindset has become such that we only care for compatibiiity at a reasonable level. Good news. What we may need is a clear statement on how transition is managed and whether it ever will; this may be the tougher issue, but it wil impact what features or changes 4.0 can take. One thing though: can't logical packages be conntained in one another? There would be missing a way to specify that a package belongs to another. Perhaps <eucode> -- triangle.e namespace geometry,math </eucode> is enough, the issue then being to enforce some consistency between the multiple packages. Or we may not care anyway. CChris -= B E G I N =- X-EUFORUM: 21684 Date: 2008 May 27 10:57 From: CChris <christian.cuvier at agricultur?.?ouv.fr> Subject: Accented characters in identifiers Currently, if you use characters in the 128-255 range in identifiers, you will get incongruous error messages, like "Result of a function must be assigned" because you used a ó. This comes from the shrouding method Euphoria had been using long ago. Rob himself admitted supporting was becoming obsolte. Implementationwise, the move is simple: change the character class of all those chars from KEYWORD or BUILTIN to LETTER in the scanner. Nothing else (a couple if branches and constants will become dead code). Since characters that display as a letter in some code page may display differently on another, I think including the whole 128..255 range as valid characters is better than restricting it. If a char is valid somewhere, it must be valid anywhere, even if it displays funny. What do you think? CChris -= B E G I N =- X-EUFORUM: 21685 Date: 2008 May 27 11:23 From: gshingles <gshingles at gmai?.?om> Subject: Re: Do you currently use namespaces? CChris wrote: > > gshingles wrote: > > > > I saw mention of a default namespace being created by the coder of the include. > > Well why not make the default namespace the name of the file, without .e[??] > > at the end? Even better, why not work out its path relative to the EUINC folder > > it is in and make that the default namespace? Even even better (all IMHO of > > course) provide a function that returns the name (or numeric id) of that default > > namespace? > > > > For several reasons: > * mylib_v1.e may become mylib_v2.e I would expect containerised modules to be named sensibly, and probably not contain version information, so that you could say: <eucode> include database.e include database/mysql.e as mysql include net/http/useragent.e </eucode> ... and not have to particularly worry about what version you are including (I mean, that's what documentation is for). > * file names may contain invalid characters for an Euphoria identifier, including, > worst of all, spaces; Fair enough comment, though fairly easily ruled out with a bit of checking by the include system. eg crash with an error saying "you can't name it that". In Perl you name your module inside the file and woe betide you if the filename does not match. > * What is the name of fileA.e under Windows? Its short 8.3 name? its lowercased > form? its uppercased form? That's the best objection from your list, in my opinion. Systems like Perl grew up in strict filesystem environment so it wasn't an issue and I'm not sure how they deal with that in the Windows or DOS environment. > * Having all of the above in mind, copy your library from one platform to another, > and have fun. Yes, another flaw in the idea is the path separation, but that's why Perl uses '::' in place of '/' or '\' or ':'. Please note, I'm not suggesting making Euphoria into Perl, but I started using Perl at the end of version 4 and saw the evolution of its OO system into something that is really simple, yet very flexible. Another thing I hadn't thought of is how to call a method via an object, that may require a new notation, and might rule it out as a viable system anyway (since I was just thinking at the parsing level). Gary Gary -= B E G I N =- X-EUFORUM: 21686 Date: 2008 May 27 14:44 From: Jeremy Cowgar <jeremy at cowga?.c?m> Subject: Re: Accented characters in identifiers CChris wrote: > > > Currently, if you use characters in the 128-255 range in identifiers, you will > get incongruous error messages, like "Result of a function must be assigned" > because you used a ó. > > > What do you think? > Being a unicode (I should say any non-ascii) dummy, how would this affect people reading and using code with such characters? I do not want to discriminate at all, but will we create two divisions in the libraries and also code contributions to Euphoria core? For instance, I know English and a tiny, tiny bit of Spanish. I'm sure others know multiple languages but spoken languages just was something I've never been interested in. If a library has come out that does some very cool things but even it's function names use characters > 128 that I don't even know how to type of my keyboard, let alone what they mean, I cannot use it. Now, this is *obviously* bigger than I. I can understand if you are not a native English speaking person you're probably clenching your fists and steam is rising from your head but I am just trying to understand the impact. I mean no offense or to say that all programmers should speak English and forget their native tongue. I'm just trying to understand. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21687 Date: 2008 May 27 15:33 From: ken mortenson <kenneth_john at yaho?.co?> Subject: Re: Accented characters in identifiers Jeremy Cowgar wrote: > I do not want to discriminate at all... "Look! They are one people and there is one language for them all... Why now, there is NOTHING that they may have in mind that will be unattainable for them" You may recognize this quote from the story of Babel. The process of thinking IS discriminating (whatever your native language, call me a bigot.) Unicode is useful for data, not for code. Otherwise, why not have the languages keywords come in mutliple translations? It's because of the principle in that quote above. Do you want things to be attainable? Sometimes you have to limit yourself to make great results. It would be perfectly logical to say, "Let's do all our code in Unicode for one day we might want to bring out different language versions of our compiler." Except my keyboard expects me to write in English even iF other language keyboards are available. You can do a lot with 127 characters. It's not a valid assumption that you can do a lot more with 65,365 or so. I shudder to think of the finely crafted Euphoria language trying to become all things to all people. It will never achieve greatness if that's the road taken. Keep in mind I say that while also on a quest for the 'one true language.' Perhaps we should code in hebrew? ;-) -= B E G I N =- X-EUFORUM: 21688 Date: 2008 May 27 15:45 From: Salix <salix at fr?emai?.hu> Subject: Re: Accented characters in identifiers Jeremy Cowgar wrote: > > CChris wrote: > > > > What do you think? > > Being a unicode (I should say any non-ascii) dummy, how would this affect people > reading and using code with such characters? I think it would be great! I would definitely use the special characters. Whenever I write an open library I try anyway to choose function names that are obvious for the majority of the programmers. (See English speakers.) But whenever I write a code for my own (CGI, database, etc.) I prefer my own language/words/characters. Why not? Regards, Salix (hu-en-de) -= B E G I N =- X-EUFORUM: 21689 Date: 2008 May 27 16:22 From: Larry Miller <larrymiller at sas?tel.ne?> Subject: Re: Accented characters in identifiers I would have to agree with Jeremy and Ken in their posts. CChris had suggested that accented characters be permitted in identifiers. While this might be appealing to some, it may cause more trouble than it is worth. The trouble with code pages is that they are all different in how they interpret characters 128-255. Most of the Latin based code pages are close but the same can not be said of others, such as those for Cyrillic, Greek, etc. If a program used a character in this range it may display differently on a system with a different code page. Depending on the font and code page used they may not even be readable. I am sure the developers already know this but others may not. These problems could be minimized (but not eliminated) if Euphoria were to use some form of unicode, such as UTF8. Bu I don't think that the developers wish to travel that road. I think it best that identifiers be restricted to characters common to all code pages - ASCII. This may annoy some who's native language is not english but I think they will understand. Larry Miller -= B E G I N =- X-EUFORUM: 21690 Date: 2008 May 27 16:30 From: Kat <KAT12 at ?o?sahs.net> Subject: Re: Deleting folders with files ZNorQ wrote: > > Marco Achury wrote: > > > > I proposed a library for file manipulation about > > one month ago and had not good answer. Some > > people said is useless and non popular. > > > > Is very important that as dir() the function works > > the same on any platform. > > > > +-+-+-+-+-+-+-+ > > Marco A. Achury > > Caracas, Venezuela > > Pretty strange thing to say, but I guess the reason for saying so is that there > are problably many of those libs already out there. I'd say that this should > be an obvious inclusion in the core library of Euphoria (file.e?). Along with the functions that earlier OSs lack, such as access to files over 4gbytes, or 200,000 files per folder, etc. Kat -= B E G I N =- X-EUFORUM: 21691 Date: 2008 May 27 17:28 From: ken mortenson <kenneth_john at ?aho?.com> Subject: Re: New keyword added: continue Derek Parnell wrote: > > Jeremy Cowgar wrote: > I suppose a more detailed study could be done via the TIBOE > > language index, but here are my findings: > > > > python = continue > > c = continue > > vb = continue > > d = continue > > basic = continue > > pascal = continue > > php = continue > > perl = next > > javascript = continue > > tcl = continue > > But aren't we supposed to be learning from the mistakes of the past? > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell Next def: Immediately following in time, ORDER, importance, etc. Cont def: To go on after suspension or interruption. Cont def: To go on with or persist in. I think you can make a case for either word, but because next implies an iteration I would prefer it. The truth is, I don't have a dog in this hunt, because it doesn't really provide new capability. loop if true next code skipped here. end loop or loop if false code skipped here. end if end loop The results are the same. I also prefer type 4 letters to 8. NEXT is preferable to CONT for you wiseguys that say both can be 4. ;-) -= B E G I N =- X-EUFORUM: 21692 Date: 2008 May 27 17:49 From: ken mortenson <kenneth_john at ya?oo.c?m> Subject: Re: New keyword added: continue skip def: To jump lightly over. ...for those leaning whimsically (also 4 letters.) -= B E G I N =- X-EUFORUM: 21693 Date: 2008 May 27 18:13 From: Jason Gade <jaygade at yahoo?co?> Subject: Re: New keyword added: continue I don't usually like to save typing at the expense of clarity. C is pretty good at that, though... :-) -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21694 Date: 2008 May 27 18:23 From: Kat <KAT12 at coosahs.?e?> Subject: Re: New keyword added: continue ken mortenson wrote: > > skip def: To jump lightly over. > > ...for those leaning whimsically (also 4 letters.) goto def: to continue or next or resume or retry or restart or exit or entry at another location .. also 4 letters. Kat -= B E G I N =- X-EUFORUM: 21695 Date: 2008 May 27 18:30 From: c.k.lester <euphoric at ?klester.?om> Subject: Re: New keyword added: continue Kat wrote: > ken mortenson wrote: > > skip def: To jump lightly over. > > ...for those leaning whimsically (also 4 letters.) > goto def: to continue or next or resume or retry or restart or exit or entry > at another location How do you get next/continue or restart with goto (using only 4 letters?)? I don't see a way to iterate using just goto. You'd have to do all sorts of other stuff, methinks, to emulate these easier-to-use terms. -= B E G I N =- X-EUFORUM: 21696 Date: 2008 May 27 19:03 From: ken mortenson <kenneth_john at y?h?o.com> Subject: Re: Case Construct I've been thinking about branching syntax... if (expression) then some_code else other_code end if if (expr) case 1 some_code case 2 other_code else more_code end if if_any (expr) case 1, 25 some_code exit case > 10 other_code case < 5 code_in_addition_to_other_code else code_if_none_of_the_above end if THEN and CASE after the expression distinguishes the two. if_any allows fall through because sometimes that is useful. Muliple cases on a single line is also very useful; Would it be confusing to have a sequence represent the multiple cases? Probably a comma delimited list would be better. -= B E G I N =- X-EUFORUM: 21697 Date: 2008 May 27 20:06 From: ken mortenson <kenneth_john at yahoo??om> Subject: Re: New keyword added: continue Kat, Regarding GOTO, do not be drawn to the dark side. Are you seduced by it's power?!!! [insert Vader's heavy breathing here. I almost said Darth, I'm such a nerd!] This is another one of those humble programmer issues for me. Is the concept of structured programming a good thing? Even though sometimes it means fitting things to a structure rather than what may seem to be a more direct way of coding? One of the tenants of structured programming is that a block of code should have exactly one entrance and one exit (there is some confusion on this point that I will illustrate in a moment.) Why? Because it reduces the stress on the programmer. One entrance means, no guessing about where to start in the code. Once exit means you know where the code continues. Some may say, "but we're only talking about once we're inside the block of code!" You can make a case for that, but it's not a strong case. This also goes for exit [how many levels?] which is a semi-structured kind of goto. GOTO is actually two words of course and it's the TO part that is unstructured and causes the problems. Would you argue for GO (only 2 letters!) The confusion about one exit is that some programmers interpret this to mean that a structured block of code must exit the block only at the very last instruction. This is incorrect. In my code I ofter test for exceptions right at the beginning of the block and return right there. Sprinkling returns throughout your code doesn't violate the one exit rule either. Why? Because no matter how many returns you have you always return to the line following the original call. That is the one and only exit point. GOTO could, and does by those italian pasta lovers, get used to violate the only one exit rule because you can use it so that the code following the call is not executed. So I ask again, is structured programming a good thing? It's not a question that can be given a snap answer. I thought about it for years before reaching the conclusion that whatever it's faults, the answer is yes in ALL cases. Again, it's about humility. Supermen do not make good programmers (I often find myself cleaning up after them... so I have a strong perspective on this.) GOTO is powerful. It's the biggest ship in the galaxy. If you find you can't live without it's power, machine language is the place to be. It's loaded with goto's. I hope I've loosened your grip on goto a little without causing offense. (Yes, Derek I see my tone... If you could only see my heart. Not to imply that you don't and I'm not picking on anyone and, and, ...) I am but a simple and humble servant to whatever is true. -= B E G I N =- X-EUFORUM: 21698 Date: 2008 May 27 20:16 From: Kat <KAT12 at coos?hs.?et> Subject: Re: New keyword added: continue c.k.lester wrote: > > Kat wrote: > > ken mortenson wrote: > > > skip def: To jump lightly over. > > > ...for those leaning whimsically (also 4 letters.) > > goto def: to continue or next or resume or retry or restart or exit or entry > > at another location > > How do you get next/continue or restart with goto (using only 4 letters?)? I > don't see a way to iterate using just goto. You'd have to do all sorts of > other stuff, methinks, to emulate these easier-to-use terms. I have already given examples. Early mirc had no loop constructs, and for years had only if-then construct. All other loops, including case, were built with goto. I am NOT recommending this as good coding style in any language that has the appropriate loop devices..... set -u0 %loop 0 -- going to use "loop" :startofloop -- code -- note i can modify the loop var inc -u0 %loop if ( %loop != %y ) { goto startofloop } -- %loop is still valid here if i want to use it Bare-bones basic stuff. But getting good loops (if-then, while-do, repeat-until<cough>) in modern languages, and then adding 4 or more keywords to jump around *inside* a loop smells like nuts to me. <eucode> :restart for loop = 1 to 12 do :retry -- code if blah then goto restart end if if blorg then goto retry end if if not x then goto exit end if if CK then goto next end if if worstcase then goto cleanup&return end if -- code :next end for :exit </eucode> Not only is it crystal clear (flat panel, no cuts, colors, or occlusions) that it's going to change program flow, but the places it is going to are plainly and unambiguously labeled in the language of your choice, and it's pretty darned well self explainitory. I don't want to be programming along, then stop and wonder if the language will allow me to do something, and if so, which keyword do i want, and just where will it land? And then will it keep landing there if i later add some code to debug something else? Or what if i remove some debug code? etc etc etc. Kat -= B E G I N =- X-EUFORUM: 21699 Date: 2008 May 27 20:37 From: c.k.lester <euphoric at c?l?ster.com> Subject: Re: New keyword added: continue Kat wrote: > c.k.lester wrote: > > How do you get next/continue or restart with goto (using only 4 letters?)? I > > don't see a way to iterate using just goto. You'd have to do all sorts of > > other stuff, methinks, to emulate these easier-to-use terms. > > :restart > for loop = 1 to 12 do > :retry > -- code > if blah then goto restart end if > if blorg then goto retry end if > if not x then goto exit end if > if CK then goto next end if > if worstcase then goto cleanup&return end if > -- code > :next > end for > :exit Ah, I see how next/continue would work there, and retry. But restart- jumping OUT of a loop and then going back into it- looks like it might cause interpreter pains (memory leaks, etc.). And jumping out of the loop? Dunno. Maybe an interpreter modifier can speak to that. -= B E G I N =- X-EUFORUM: 21700 Date: 2008 May 27 20:56 From: ken mortenson <kenneth_john at yahoo.c??> Subject: Re: New keyword added: continue Kat wrote: > Bare-bones basic stuff. But getting good loops (if-then, while-do, repeat-until<cough>) > in modern languages, and then adding 4 or more keywords to jump around *inside* > a loop smells like nuts to me. A programmer after my own heart (soon you will achieve oneness...) I'm even weirder in my thinking (you guys already figured that one out didn't ya? But here's some confirmation...) All code written anywhere by anyone (quantum computing may make this statement untrue) have only three structures (sequence, branch, loop) I'd like to get rid of ALL the various flavors of loops (while, for, for each, etc.) and replace it with the pseudo code I've always used. Loop ... End Loop You do all your initialization before the loop. The loop creates Index which starts with a value of zero and increments once each iteration. The scope of Index is limited to the last declaration so for nested loops... Loop x = Index Loop y = Index array(x,y)=whatever. if (y>9) exit End Loop if (x>12) exit End Loop ...but I'm a dreamer. Am I not the only one? Note that all loops are infinite and require an explicit exit. Programmers with bad habits will be spanked enough to learn good habits in very short order. -= B E G I N =- X-EUFORUM: 21701 Date: 2008 May 27 21:00 From: Matt Lewis <matthewwalkerlewis at gma?l.?om> Subject: Re: New keyword added: continue c.k.lester wrote: > > Ah, I see how next/continue would work there, and retry. But restart- > jumping OUT of a loop and then going back into it- looks like it might > cause interpreter pains (memory leaks, etc.). And jumping out of the loop? > Dunno. Maybe an interpreter modifier can speak to that. You're probably afraid of 'exit', too. :P Seriously, exit is just a goto to the end of the loop. It doesn't do any clean up or anything. There isn't any needed. Matt -= B E G I N =- X-EUFORUM: 21702 Date: 2008 May 27 21:08 From: c.k.lester <euphoric at ckl?ster.?om> Subject: Re: New keyword added: continue ken mortenson wrote: > > Loop > x = Index > Loop > y = Index > array(x,y)=whatever. > if (y>9) exit > End Loop > if (x>12) exit > End Loop I'm... strangely... attracted to it. 8| -= B E G I N =- X-EUFORUM: 21703 Date: 2008 May 27 21:12 From: Jeremy Cowgar <jeremy at cowga?.c?m> Subject: Re: New keyword added: continue c.k.lester wrote: > > ken mortenson wrote: > > > > Loop > > x = Index > > Loop > > y = Index > > array(x,y)=whatever. > > if (y>9) exit > > End Loop > > if (x>12) exit > > End Loop > > I'm... strangely... attracted to it. 8| I was thinking we have: loop do until ... Why not loop do ... again or repeat However, I'd use a while loop or until loop for examples such as if (x>12) exit. Also you are assigning y = Index, x = Index, therefore, those are probably being incremented somewhere that you are not showing making the above loop probably more suited to a for loop? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21704 Date: 2008 May 27 21:14 From: c.k.lester <euphoric at ckl??ter.com> Subject: Re: New keyword added: continue Matt Lewis wrote: > c.k.lester wrote: > > Ah, I see how next/continue would work there, and retry. But restart- > > jumping OUT of a loop and then going back into it- looks like it might > > cause interpreter pains (memory leaks, etc.). And jumping out of the loop? > > Dunno. Maybe an interpreter modifier can speak to that. > You're probably afraid of 'exit', too. :P > Seriously, exit is just a goto to the end of the loop. It doesn't do any > clean up or anything. There isn't any needed. You'd know. I'm curious that there's no clean up necessary. It looks like there'd be a dangling variable. Eeeewwwwwww!!! :D (I admit I've never used exit. I'm not a sloppy enough coder. HAHAHAHA. Just kidding. I might've used it once. Well, I just checked bbcmf-system. Out of about 8.6KLOC, exit appears 0 times. So, I probably never have used it.) -= B E G I N =- X-EUFORUM: 21705 Date: 2008 May 27 21:16 From: Jeremy Cowgar <jeremy at c?wgar?com> Subject: Re: New keyword added: continue Jeremy Cowgar wrote: > > > Why not > > loop do > ... > again or repeat > I wanted to prefix but forgot... There are common things we do in loops and common ways of exiting a loop, thus we have for, while and until loops. If we get too many loops, we just overly complicate things. If we have too little loops, we overly complicate things as well. I do think the programming world has settled on the three main loops that satisfy the vast majority of looping needs and they are what we have, while, for and until. We probably do not need any more. For instance, I learned yesterday or today, that while 1 do ... end while is optimized as: begining: ... do something goto begining No exit checks or anything, so one could very well successfully argue we already have the loop proposed by ken: Loop End Loop -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21706 Date: 2008 May 27 21:18 From: ken mortenson <kenneth_john at y?hoo?com> Subject: Re: New keyword added: continue c.k.lester wrote: > > ken mortenson wrote: > > > > Loop > > x = Index > > Loop > > y = Index > > array(x,y)=whatever. > > if (y>9) exit > > End Loop > > if (x>12) exit > > End Loop > > I'm... strangely... attracted to it. 8| Medic! Medic! Get the tranquilizers, we've got another one! -= B E G I N =- X-EUFORUM: 21707 Date: 2008 May 27 21:21 From: jacques deschênes <desja at gl?bet?otter.net> Subject: Re: Accented characters in identifiers I agree with Salix on this. We could give the freedom of accented character to programmers but standard libraries and other codes distributed with euphoria should be restricted to english. I rebember reading a contribution from a euphoria user with identifiers although not accented were in a language I don't understand. I gave up because it is hard to read code where all identifiers are from an unknown language. But it not a problem as long as it not part of the distribution. English is a de facto common language on this planet. jacques Salix wrote: > > Jeremy Cowgar wrote: > > > > CChris wrote: > > > > > > What do you think? > > > > Being a unicode (I should say any non-ascii) dummy, how would this affect people > > reading and using code with such characters? > > I think it would be great! I would definitely use the special characters. > Whenever I write an open library I try anyway to choose function names > that are obvious for the majority of the programmers. (See English speakers.) > But whenever I write a code for my own (CGI, database, etc.) I prefer my > own language/words/characters. Why not? > > Regards, > > Salix > (hu-en-de) -= B E G I N =- X-EUFORUM: 21708 Date: 2008 May 27 21:42 From: Matt Lewis <matthewwalkerlewis at gmail.??m> Subject: Re: New keyword added: continue c.k.lester wrote: > > Matt Lewis wrote: > > c.k.lester wrote: > > > Ah, I see how next/continue would work there, and retry. But restart- > > > jumping OUT of a loop and then going back into it- looks like it might > > > cause interpreter pains (memory leaks, etc.). And jumping out of the loop? > > > Dunno. Maybe an interpreter modifier can speak to that. > > You're probably afraid of 'exit', too. :P > > Seriously, exit is just a goto to the end of the loop. It doesn't do any > > clean up or anything. There isn't any needed. > > You'd know. > > I'm curious that there's no clean up necessary. It looks like there'd be a > dangling variable. Eeeewwwwwww!!! :D Basically, each loop variable gets a slot in the symbol table. If it's not top level code, then it 'goes away' just like all the other private variables. > (I admit I've never used exit. I'm not a sloppy enough coder. HAHAHAHA. Just > kidding. I might've used it once. Well, I just checked bbcmf-system. Out of > about 8.6KLOC, exit appears 0 times. So, I probably never have used i >grep -c exit eusql.e 21 Maybe it's not in bbcmf, but you depend upon it. :) Matt -= B E G I N =- X-EUFORUM: 21709 Date: 2008 May 27 21:50 From: ken mortenson <kenneth_john at yahoo??om> Subject: Re: New keyword added: continue Jeremy Cowgar wrote: > I was thinking we have: > > loop do > > until ... > > Why not > > loop do > ... > again or repeat > > However, I'd use a while loop or until loop for examples such as if (x>12) > exit. The only difference between a do while or do until is where the test is made. In my construct there is no difference, you just put it where you want (or at multiple points if that's your style or need. do, again and repeat are all extraneous. In my view all structures would consistantly end with end (followed by the name of the structure: if, loop, procedure, etc.) Also you are assigning y = Index, x = Index, therefore, those are probably > being incremented somewhere that you are not showing making the above loop probably > more suited to a for loop? Exactly, they are incremented under the covers for each iteration of the loop starting at zero. This doesn't mean the programmer is limited in any way. A for loop simply has it's initialize as part of it's syntax. Initialize before the loop in all cases creates a simple habit. It may even teach those that initialize IN loops that, that is not a good idea. For loops also have an implicit increment by which I'm just suggesting is better being explicit. The real advantage is only one loop structure wich reduces stress on the humble programmer. Need a loop? Use Loop. -= B E G I N =- X-EUFORUM: 21710 Date: 2008 May 27 21:53 From: ken mortenson <kenneth_john at y?hoo.co?> Subject: Re: New keyword added: continue Jeremy Cowgar wrote: > while 1 do > ... > end while > > is optimized as: > > begining: > > ... do something > > goto begining > > No exit checks or anything, so one could very well successfully argue we already > have the loop proposed by ken: Yes, we've always had the loop. I'm just proposing we go all the way and just use the syntax... > Loop > > End Loop I guaranty the soon nobody would miss, while, for, for each, repeat until, do while, do until, rinse, lather, soap... oops! Got ahead of myself on those last few. -= B E G I N =- X-EUFORUM: 21711 Date: 2008 May 27 22:02 From: c.k.lester <euphoric at ckles?er.com> Subject: Re: New keyword added: continue Matt Lewis wrote: > c.k.lester wrote: > > (I admit I've never used exit. I'm not a sloppy enough coder. HAHAHAHA. Just > > kidding. I might've used it once. Well, I just checked bbcmf-system. Out of > > about 8.6KLOC, exit appears 0 times. So, I probably never have used i > >grep -c exit eusql.e > 21 > Maybe it's not in bbcmf, but you depend upon it. :) heheh... Yeah, I saw some in Tommy Carlier's kanarie, too, which is a significant part of BBCMF. So, I guess I've gotta cut off EuSQL and kanarie... LOL! RIGHT!!!11!!1!!111! -= B E G I N =- X-EUFORUM: 21712 Date: 2008 May 27 22:02 From: Jeremy Cowgar <jeremy at cow?ar.?om> Subject: Re: New keyword added: continue ken mortenson wrote: > > I guaranty the soon nobody would miss, while, for, for each, repeat until, > do while, do until, rinse, lather, soap... oops! Got ahead of myself on > those last few. > Ken, do you have any major open source apps out there that I can see the source for? Or any open source applications you have contributed a major patches/code to that I can see? I know a substantial amount of programmers, many of who can create code of such an utmost quality that it's down right amazing. Applications that have been in existence for > 15 years, still *easily* maintained today, well structured. These are people I trust. I also lead on applications in the 500KLOC range and I would not dare say get rid of for, while and until loops. That's just crazy. In fact, no one I have ever met or read about would make such a claim. It doesn't make sense. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21713 Date: 2008 May 27 22:12 From: Derek Parnell <ddparnell at bigpon?.?om> Subject: Re: New keyword added: continue Kat wrote: > <eucode> > :restart > for loop = 1 to 12 do > :retry > -- code > if blah then goto restart end if > if blorg then goto retry end if > if not x then goto exit end if > if CK then goto next end if > if worstcase then goto cleanup&return end if > -- code > :next > end for > :exit > </eucode> Hi Kat, just a few of quick questions ... ** How, as a maintainer of the code above, can I be sure that process flow only gets to the "restart:" label from either the statement immediately preceding it or the 'goto' inside the loop? In other words, how can I be sure that there is not another 'goto restart' elsewhere in the code? ** If I have to place another looping construct within the same scope as the one above, what should I call the labels? ** Under what circumstanes might I have to rename the labels? -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21714 Date: 2008 May 27 22:20 From: ken mortenson <kenneth_john at yahoo??om> Subject: Re: New keyword added: continue I wouldn't be adverse to an optional from/by Loop from 7 by -1.2 if (Index<-14.2) exit End Loop -= B E G I N =- X-EUFORUM: 21715 Date: 2008 May 27 22:28 From: gshingles <gshingles at gmai?.c?m> Subject: Re: New keyword added: continue ken mortenson wrote: > > I guaranty the soon nobody would miss, while, for, for each, repeat until, > do while, do until, rinse, lather, soap... oops! Got ahead of myself on > those last few. Maybe I'm just lazy, but I really miss foreach in Euphoria, especially since it has native sequences. I suspect sequence operations make it fairly redundant though. If all the work is being done by the interpreter then I would rather write something that looks like English, so I like having while and for. It's more natural to think (in my view) "count to 10 and for each number do something with it" (for..end for) than to think "LOOP,ADD,DO,TEST,END" (loop..loop end) or "while I haven't found it get the next one and have a look". (while) I'm actually really starting to admire Python. You say what you mean and don't have to dress everything up again to carry on with your code. I often sit there thinking "Is that it?" when I've iterated over an array in three lines of code and don't have to type '}' or 'end for' or count brackets etc :-) Anyway, whatever language Euphoria uses I'm sure we'll all get used to it. It's all the same as far as the CPU is concerned :) Gary -= B E G I N =- X-EUFORUM: 21716 Date: 2008 May 27 22:38 From: c.k.lester <euphoric at ckl?ster.com> Subject: Re: New keyword added: continue Derek Parnell wrote: > > just a few of quick questions ... Thus, goto is destroyed in one fell swoop. -= B E G I N =- X-EUFORUM: 21717 Date: 2008 May 27 22:58 From: Kat <KAT12 at coos?hs?net> Subject: Re: New keyword added: continue Derek Parnell wrote: > > Kat wrote: > > <eucode> > > :restart > > for loop = 1 to 12 do > > :retry > > -- code > > if blah then goto restart end if > > if blorg then goto retry end if > > if not x then goto exit end if > > if CK then goto next end if > > if worstcase then goto cleanup&return end if > > -- code > > :next > > end for > > :exit > > </eucode> > > Hi Kat, > just a few of quick questions ... > > ** How, as a maintainer of the code above, can I be sure that process flow only > gets to the "restart:" label from either the statement immediately preceding > it or the 'goto' inside the loop? In other words, how can I be sure that there > is not another 'goto restart' elsewhere in the code? You can't. You read the code to see if there is another "goto" that label. The same with "exit", "return", etc.. I have a fair amount of code that has "return" sprinkled around, and no one has ever complained about more than one place leaving the function. One way to restrict the "where from" is to localise all "goto" to procedure/function blocks, and not allow it in top level code. Exactly like in OOEU. > ** If I have to place another looping construct within the same scope as the > one above, what should I call the labels? Umm, how about "loop2" ? Or you mean the targets for more "goto" of the same umm, form? Pick a name. You have the freedom to restart the inner loop, the outer loop, the nested while loop in there which you added later, etc.. I tend to give my nested loop names some description, even if it's just "index1", so i could have a "goto restart_index1", which sorta reads easily, and i know just where it's going, and i can get there with the one "goto" keyword from any depth of nested loops. The target being present alerts me, as i am reading down the code, that i may be going back to that point from somewhere. > ** Under what circumstanes might I have to rename the labels? Never, i believe. If you add loops, or other code, you do not need to change anything, assuming your intent to goto the :target is the same. If you wish to add a target, choose another name. Like i said, i tend to use the loop name as part of the target, and/or/as well as the purpose, if i need any clairification, rather insuring unique target names. This way i can wrap or unwrap nested loops, and not have a problem, as well as skip blocks during debug. With goto scope restricted to proc/funct blocks, it makes some code even easier, such as "goto cleanup&return", which i know has the local scope of variables, is at the bottom of the block where code will fall thru to anyhow, and execute the "cleanup&return". With Eu the way it is now, i have hunks of code copy/pasted thruout which does the cleanup with local vars and returns, and those hunks are a nightmare to keep identical. Just as an aside, one other cure for that would be nested procedures, which could be called inside the nesting procedure, and the nested one have the scope of the nesting one's vars, i did this in Turbo Pascal a *lot*. I believe Matt scored 100 with the way he did goto in OOEU, and i reiterate my suggestion all of OOEU be merged into Eu v4. Kat -= B E G I N =- X-EUFORUM: 21718 Date: 2008 May 27 23:00 From: Kat <KAT12 at coos?hs.n?t> Subject: Re: New keyword added: continue c.k.lester wrote: > > Derek Parnell wrote: > > > > just a few of quick questions ... > > Thus, goto is destroyed in one fell swoop. I don't see why. Kat -= B E G I N =- X-EUFORUM: 21719 Date: 2008 May 27 23:21 From: c.k.lester <euphoric at cklester?co?> Subject: Re: New keyword added: continue Kat wrote: > c.k.lester wrote: > > Derek Parnell wrote: > > > just a few of quick questions ... > > Thus, goto is destroyed in one fell swoop. > I don't see why. Maintainability of code is of utmost importance. Using goto is dangerous! :) -= B E G I N =- X-EUFORUM: 21720 Date: 2008 May 27 23:25 From: ken mortenson <kenneth_john at yahoo.??m> Subject: Re: New keyword added: continue Jeremy Cowgar wrote: > I know a substantial amount of programmers, many of who can create code of such > an utmost quality that it's down right amazing. Applications that have been > in existence for > 15 years, still *easily* maintained today, well structured. > These are people I trust. I worked for a guy like that in NYC. -= B E G I N =- X-EUFORUM: 21721 Date: 2008 May 27 23:32 From: Kat <KAT12 at c?osahs?net> Subject: Re: New keyword added: continue c.k.lester wrote: > > Kat wrote: > > c.k.lester wrote: > > > Derek Parnell wrote: > > > > just a few of quick questions ... > > > Thus, goto is destroyed in one fell swoop. > > I don't see why. > > Maintainability of code is of utmost importance. Using goto is dangerous! :) Why are these two blocks so different that you call the 2nd one "dangerous" ? <eucode> for loop = 1 to x do -- code if x = blah then goto next end if -- code :next end for for loop = 1 to x do -- code if x = blah then next end if -- code end for </eucode> And ye who didn't know you were using code containing "exit", how were you "maintaining" that code? And how would you know how many places called "exit" to make the code flow change? Kat -= B E G I N =- X-EUFORUM: 21722 Date: 2008 May 27 23:40 From: ken mortenson <kenneth_john at y?hoo?com> Subject: Re: New keyword added: continue Jeremy Cowgar wrote: > Ken, do you have any major open source apps out there that I can see the source > for? Or any open source applications you have contributed a major patches/code > to that I can see? While I believe in open source I've worked for proprietory outfits. Most of my experimentation (not drugs! languages!) was prior to the last ten years (in which I worked for just two companies... I left the first company, worked a year for the second, then went back to the first.) My contract with a little mom and pop outfit in Seattle (well, Silverdale) called Squarerigger (they write fleet maintainance software and I hired with them at the beginning of a DOS to windows period.) even required me to shred any code I wrote for them after leaving the company. The second companies I worked at was for a young man and I made mistakes in handling the project. We had outlined a six month project which I was totally on track in the 1st four month to finish. He called his company NextPOS although it's something else now that he merged with a partner. You should be able to find both on the web. Then he decided he wanted the project broken up into a front end and a back end. I should have told him, no and stuck with no. I should have told him we need to get what I was working on done in the next few month so we could be making money to justify my salary, then work on a second version. But I didn't do that. He was the boss, young as he was, so I pulled out every 'back end' feature from the code that was almost completed and it was the last time I worked on it (it's now sitting on one of his backup servers somewhere) During the next 8 months he had me change the backend design twice. He'd told his vendors about the product from the first and they were calling everyday to find out it's status. Finally one weekend his chief tech. asked me for my machines password to do some network maintenance and when I came in monday I was locked out of my machine and the tech. didn't come in that day. So I told the Sales VP (the only senior guy besides me in the office that day) that I was taking the rest of the day off. I was still steaming the next day, so I called in and said I was taking another personal day (this was after a year of 60+ hour weeks.) When I came in the next day, my friend and owner wasn't in, but had his secretary/office manager let me know the bad news. Three days later I left California and was back to work for Squarerigger in Seattle. That first weekend there I worked overnights all weekend to fix their code for a very important demo on monday with some city that I don't recall. It wasn't enough time to fix everything (I could only insure that it didn't actually blow up.) They made the sale. I do have bits and pieces here and there in one language or another, but nothing I'd be proud to show off. I was hoping to do that with my next Euphoria project. What I've learned has been by listening, reading, thinking and experiences. I'm a self taught computer bum. Wrote my first HP2000F timeshared basic program in 30 minutes after buying the language manual from the local community college. Went to a trade school, but my buddy and I had to teach the instructors about PMA on the Prime 750. Spent hundreds of dollars on manuals I never used after leaving the school. Doesn't seem right. Bought a commodore 64 (with disk drive and tape!) for $1300. It was serial number 000000006xx in the year they sold 8 million (and the price dropped to under $200.) Gave it away, but would kind of like to have it now. I once thought FORTH could be the 'one true language' but that hallucination ended (but I still look at things like REBOL.) Wrote my first big project in NYC. dBase II multiuser (we had 13 286 machines on 2 servers... in 1982? very cutting edge.) 10,000 lines of code and I could visualize every line and every character... I actually edited the code remotely and blind for a customer in Ohio. No way I could do that today. I can hardly remember my name these days. Even flew to Ohio and did some custom reports for them. Nursemaided a report all night. When I got back to NYC my boss was mad about me giving things away for free. I was young. Rewrote that report in BASCOM and it went from 16 hours to 30 minutes! Bought my first copy of MASM back then, since I've bought Delphi, PowerBasic, DarkBasic. I was going to say I never had to buy C, then I remembered I bought a copy of Lattice C, which had a great upgrade policy right until the moment they went out of business. ;-) My favorite CPU was the 6502 with it's 13 addressing modes. I wrote an assembler for it in basic. Although my first CPU was an RCA 1802 that ran at a few hundred kilohertz. I've found I like features in many languages (ever ask yourself how would I do this in assember when writing dBase code?) I was also an air traffic controller and that's a story for another day. Boy, did you open a can of worms! All you really need to know is that I'm 49 but round that up to 50. I'm cranky. A rare INTJ. But code? I don't got no stink'n code. You guys better get Euphoria up to speed so I can ditch all these other language and just have fun. Later I'll tell you my vision for the 'ONE TRUE LANGUAGE' which Euphoria is a very significant part of. Then I'll show you code... Did you see my PowerBASIC example... Please don't make me code in PB. I'll be good. I promise. Please... BTW, while I was away for a year they bloated a work order module from about 10,000 lines to over 20,000 (adding accounting features that I had argued years earlier during the design phase should have been foundational to the product.) Worked that over to less than 10,000 lines of cleaner, more functional and easier to maintain code. Yes, I know that less is more. It's probably got all it's bloat back now that I'm not watching over it anymore. I -= B E G I N =- X-EUFORUM: 21723 Date: 2008 May 27 23:55 From: Derek Parnell <ddparnell at big?ond.?om> Subject: Re: New keyword added: continue Kat wrote: Thanks Kat. > Derek Parnell wrote: >> ... how can I be sure that there is not another 'goto restart' >> elsewhere in the code? > > You can't. You read the code to see if there is another "goto" that label. How likely would this requirement increase the cost of maintenance? > The same with "exit", "return", etc.. I have a fair amount > of code that has "return" sprinkled around, and no one has > ever complained about more than one place leaving > the function. I see this as a different issue. With 'goto' the question I raise deals with how ones arrives at the label and has nothing to do with the 'goto' statement itself, but with 'exit' and 'return', the process flow to arrive at that statement is clear and local. > One way to restrict the "where from" is to localise all "goto" > to procedure/function blocks, and not allow it in top level code. > Exactly like in OOEU. Does the number of statements in a routine affect this position? >> ** If I have to place another looping construct within the same >> scope as the one above, what should I call the labels? > > Umm, how about "loop2" ? Does the requirement that a 'goto' needs a (unique within the scope) label, reduce the amount of code that has to be read by maintainers? To me it seems that using the combination of 'label xyz' and 'goto xyz' contains a lot more redundant content than 'next' does. If such a loop containing labels, needs to be later nested inside another loop, what is the suggested naming convention, if any? e.g. We start with ... restart1: loop -- some code -- goto restart1 -- some more code --- restart2: loop -- some code --- goto restart2: -- some code -- goto restart1 -- some code end loop end loop But later this needs to be nested, such as ... restart3: loop -- some code --- restart1: loop -- some code -- goto restart1 -- some more code --- restart2: loop -- some code --- goto restart2: -- some code -- goto restart1 -- some code -- end loop end loop -- some code -- goto restart3 -- some code -- end loop Would it be better to keep the existing label names as above, or is it better to rename them to keep the implied nesting level obvious? >> ** Under what circumstanes might I have to rename the labels? > Never, i believe. See above. > Just as an aside, one other cure for that > would be nested procedures, which could be > called inside the nesting procedure, and the > nested one have the scope of the nesting one's > vars Yes, nested routines would be very very nice. I suspect that we will have this ability soon, but not for v4.0 -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21724 Date: 2008 May 28 0:08 From: Derek Parnell <ddparnell at bi?po?d.com> Subject: Re: New keyword added: continue Kat wrote: > > c.k.lester wrote: > > Maintainability of code is of utmost importance. Using goto is dangerous! :) > > Why are these two blocks so different that you call the 2nd one "dangerous" > ? Because in the first one we could get this ... <eucode> procedure foo() --- many lines of code --- goto next --- many lines of code --- goto next --- many lines of code --- for loop = 1 to x do -- code if x = blah then goto next end if -- code :next end for --- many lines of code --- goto next --- many lines of code --- end procedure </eucode> But I can't do that in the second example, and thus the cost of maintenance is lower in the second example. The cost is affected by the probability of bugs, the amount of code to read, and the amount of coding to repair/enhance existing code. > And how would you know how many places called "exit" to make the > code flow change? The problem is not the 'goto' statement (ie. change of control flow), the problem is with the label and how to arrive there. The extra maintenance cost that 'goto' introduces into a program must be offset by the performance benefit derived from using it, IMHO. Demonstrate that in a specific piece of Euphoria code and I'll support the use of 'goto' in that piece of code. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21725 Date: 2008 May 28 0:09 From: c.k.lester <euphoric at c??ester.com> Subject: Re: New keyword added: continue Kat wrote: > c.k.lester wrote: > > Maintainability of code is of utmost importance. Using goto is dangerous! :) > Why are these two blocks so different that you call the 2nd one "dangerous" > ? > for loop = 1 to x do > -- code > if x = blah then goto next end if > -- code > :next > end for > > for loop = 1 to x do > -- code > if x = blah then next end if > -- code > end for Because adding loops therein could be problematic. > And ye who didn't know you were using code containing "exit", > how were you "maintaining" that code? I'm not maintaining that code (they are in libraries I am including), so I don't care. :) -= B E G I N =- X-EUFORUM: 21726 Date: 2008 May 28 0:12 From: Kat <KAT12 at co?sahs.?et> Subject: Re: New keyword added: continue ken mortenson wrote: > <snip- a bunch of stuff, mentioned 6502 and flying> Several people here are avid 6502 people, and a few fly or have flown their own planes. And some of us are 50 yrs old or older. I still want to build a 6502 in ttl, i went so far as to do the pcb layouts over 10 years ago. Then the Dog Era began. Nevertheless, my ex-business ex-advisor who moved out of this state after considering what happened to me here (etc), is donating a gently used HP 1631D to the effort, which i pick up next month. I have a HP 1600A, but he says the 1631D, with external storage, is worth having. Still no ETA for a 6502 that executes internal instructions at any speed i can feed code into it, up to sub-ns speeds. Oh yea, and i did touch-n-go in a single engine (trike landing gear, high wing, 2 seater up front, i don't remember more about it), but didn't go for the pricey license. I did buy property with 1200ft of property line, but can't use it,, the neighbor's dogs got it in court, and they don't share. And without rounding, i am over 50. Kat -= B E G I N =- X-EUFORUM: 21727 Date: 2008 May 28 0:41 From: Matt Lewis <matthewwalkerlewis at gm?il.co?> Subject: Re: New keyword added: continue ken mortenson wrote: > > I wouldn't be adverse to an optional from/by > > Loop from 7 by -1.2 > if (Index<-14.2) exit > End Loop That's good to know. I think. Matt -= B E G I N =- X-EUFORUM: 21728 Date: 2008 May 28 0:44 From: Kat <KAT12 at coo?ahs.?et> Subject: Re: New keyword added: continue c.k.lester wrote: > > Kat wrote: > > c.k.lester wrote: > > > Maintainability of code is of utmost importance. Using goto is dangerous! :) > > Why are these two blocks so different that you call the 2nd one "dangerous" > > ? > > for loop = 1 to x do > > -- code > > if x = blah then goto next end if > > -- code > > :next > > end for > > > > for loop = 1 to x do > > -- code > > if x = blah then next end if > > -- code > > end for > > Because adding loops therein could be problematic. I do not see how. And frankly, the contrivance i post next i don't understand either.... <eucode> for loop1 = 1 to 12 do -- code goto next1 -- code for loop2 = 1 to 12 do -- code goto next2 -- code for loop3 = 1 to 12 do -- code goto next3 -- code for loop4 = 1 to 12 do -- code goto next4 -- code for loop5 = 1 to 12 do -- code goto next5 -- code for loop6 = 1 to 12 do -- code goto next6 -- code :next6 end for :next5 end for :next4 end for :next3 end for :next2 end for :next1 end for </eucode> No, i don't write like that, but i feel you wanted an extremely good example of stuff taken to bad extremes. But it does proove that you can word search in a text editor to find the target easily, and won't skip a "next" target, because the "goto" targets are plainly labeled above. > > And ye who didn't know you were using code containing "exit", > > how were you "maintaining" that code? > > I'm not maintaining that code (they are in libraries I am including), so > I don't care. :) Good, then you won't care if i use goto. :-)) Kat -= B E G I N =- X-EUFORUM: 21729 Date: 2008 May 28 0:46 From: ken mortenson <kenneth_john at yahoo??om> Subject: Re: New keyword added: continue Kat wrote: > And without rounding, i am over 50. Now I understand your loyalty to spaghetti. somewhere you've got a program running... :49 GOTO 49 ps: half italian and a quarter swede, so I like spaghetti too, just not in my code. I once had a boss in NYC that used to say he was 80% finished and hand me a plate of spaghetti it fix. He's also the guy that wrote self modifying code in BAL. That was quite the experience. -= B E G I N =- X-EUFORUM: 21730 Date: 2008 May 28 1:06 From: ken mortenson <kenneth_john at y?ho?.com> Subject: Re: New keyword added: continue Matt Lewis wrote: > > ken mortenson wrote: > > > > I wouldn't be adverse to an optional from/by > > > > Loop from 7 by -1.2 > > if (Index<-14.2) exit > > End Loop > > That's good to know. I think. So, what are you trying to tell me? I can take it. I'm a big boy. -= B E G I N =- X-EUFORUM: 21731 Date: 2008 May 28 1:09 From: Kat <KAT12 at ?oos?hs.net> Subject: Re: New keyword added: continue Derek Parnell wrote: > > Kat wrote: > > Thanks Kat. > > > Derek Parnell wrote: > >> ... how can I be sure that there is not another 'goto restart' > >> elsewhere in the code? > > > > You can't. You read the code to see if there is another "goto" that label. > > How likely would this requirement increase the cost of maintenance? In Textpad, drag the cursor over the label, and keypress for search. You could, i suppose, add a "came_from" var you interrogate in some way. > > The same with "exit", "return", etc.. I have a fair amount > > of code that has "return" sprinkled around, and no one has > > ever complained about more than one place leaving > > the function. > > I see this as a different issue. With 'goto' the question I raise deals with > how ones arrives at the label and has nothing to do with the 'goto' statement > itself, but with 'exit' and 'return', the process flow to arrive at that statement > is clear and local. It is as clear as goto, i think. If i have a function, and i can return from it in several points, how do you know which return got you back out of the function? > > One way to restrict the "where from" is to localise all "goto" > > to procedure/function blocks, and not allow it in top level code. > > Exactly like in OOEU. > > Does the number of statements in a routine affect this position? What? I don't see the connection between statement count and use of any keyword. > >> ** If I have to place another looping construct within the same > >> scope as the one above, what should I call the labels? > > > > Umm, how about "loop2" ? > > Does the requirement that a 'goto' needs a (unique within the scope) label, > reduce the amount of code that has to be read by maintainers? To me it seems > that using the combination of 'label xyz' and 'goto xyz' contains a lot more > redundant content than 'next' does. But you *know* where goto will goto, and across languages, you haveto remember where each language differs, as well as how each human language interprets each of those other keywords, such as "next", "continue", etc. > If such a loop containing labels, needs to be later nested inside another loop, > what is the suggested naming convention, if any? > > e.g. We start with ... > restart1: > loop > -- some code -- > goto restart1 > -- some more code --- > restart2: > loop > -- some code --- > goto restart2: > -- some code -- > goto restart1 > -- some code > end loop > end loop > > But later this needs to be nested, such as ... > > restart3: > loop > -- some code --- > restart1: > loop > -- some code -- > goto restart1 > -- some more code --- > restart2: > loop > -- some code --- > goto restart2: > -- some code -- > goto restart1 > -- some code -- > end loop > end loop > -- some code -- > goto restart3 > -- some code -- > end loop > > Would it be better to keep the existing label names as above, or is it better > to rename them to keep the implied nesting level obvious? Better to find a better way to code that. I would keep the labels more descriptive of what they do, and then not change them if you are wrapping or inserting new code that describes another function. > >> ** Under what circumstanes might I have to rename the labels? > > > Never, i believe. > > See above. Did. > > Just as an aside, one other cure for that > > would be nested procedures, which could be > > called inside the nesting procedure, and the > > nested one have the scope of the nesting one's > > vars > > Yes, nested routines would be very very nice. I suspect that we will have this > ability soon, but not for v4.0 Cool. Kat -= B E G I N =- X-EUFORUM: 21732 Date: 2008 May 28 1:26 From: Kat <KAT12 at co?s?hs.net> Subject: Re: New keyword added: continue Derek Parnell wrote: > > Kat wrote: > > > > c.k.lester wrote: > > > Maintainability of code is of utmost importance. Using goto is dangerous! :) > > > > Why are these two blocks so different that you call the 2nd one "dangerous" > > ? > > Because in the first one we could get this ... > > > <eucode> > procedure foo() > --- many lines of code --- > goto next > --- many lines of code --- > goto next > --- many lines of code --- > for loop = 1 to x do > -- code > if x = blah then goto next end if > -- code > :next > end for > --- many lines of code --- > goto next > --- many lines of code --- > end procedure > </eucode> > > But I can't do that in the second example, and thus the cost of maintenance > is lower in the second example. The cost is affected by the probability of bugs, > the amount of code to read, and the amount of coding to repair/enhance existing > code. I do not know why you'd do that code anyhow. You are jumping into a loop, you realise? You have unqualified statements to do a jump, so you have not shown me the entire code you wish me to approve or justify. Likewise, i could code up 100 procedures or functions, calling every one of them thru oddball routine_id() names, and cause everyone fits trying to trace them. And strangely, isn't that :next target where someone(?) wants to put an "entry" keyword? OUCH!! Do you want me to say you shouldn't code like that? Granted. Do you want me to say someone could code like that? Granted. Are you asking me if i think that is good code? No. Would i code like that? No. > > And how would you know how many places called "exit" to make the > > code flow change? > > The problem is not the 'goto' statement (ie. change of control flow), the problem > is with the label and how to arrive there. > > The extra maintenance cost that 'goto' introduces into a program must be offset > by the performance benefit derived from using it, IMHO. Demonstrate that in > a specific piece of Euphoria code and I'll support the use of 'goto' in that > piece of code. I cannot write up every possible piece of code that could possibly contain a "goto" for your support. I have no example of "goto" in Eu, because "goto" is not supported in Eu. I also code in mirc, but usually i use goto there for making up loops that mirc lacks, but Eu has. I tried using ooeu several times for more advanced projects, but there is a *HUGE* speed hit with ooeu which i cannot absorb. Perhaps this thread should be called "lets keep kat too busy answering the same questions over and over to spam any more". The discussion of goto has been going on for years on this list, and i am still in favor of goto being added to Eu. Kat -= B E G I N =- X-EUFORUM: 21733 Date: 2008 May 28 1:30 From: ken mortenson <kenneth_john at yah?o?com> Subject: Re: New keyword added: continue Kat wrote: > for loop1 = 1 to 12 do > -- code > goto next1 > -- code > for loop2 = 1 to 12 do > -- code > goto next2 > -- code > for loop3 = 1 to 12 do > -- code > goto next3 > -- code > for loop4 = 1 to 12 do > -- code > goto next4 > -- code > for loop5 = 1 to 12 do > -- code > goto next5 > -- code > for loop6 = 1 to 12 do > -- code > goto next6 > -- code > :next6 > end for > :next5 > end for > :next4 > end for > :next3 > end for > :next2 > end for > :next1 > end for Is equivalent to... > for loop1 = 1 to 12 do > -- code > goto next1 > :next1 > end for Is this what you meant the code to do? -= B E G I N =- X-EUFORUM: 21734 Date: 2008 May 28 1:33 From: Kat <KAT12 at c?osahs.net> Subject: Re: New keyword added: continue ken mortenson wrote: > > Kat wrote: > > > And without rounding, i am over 50. > > Now I understand your loyalty to spaghetti. I am not in favor of spagetti code. This is getting irritating to the point of dropping Eu entirely. > somewhere you've got a program running... > > :49 > GOTO 49 No, i don't. > ps: half italian and a quarter swede, so I like spaghetti too, just not > in my code. I once had a boss in NYC that used to say he was 80% finished > and hand me a plate of spaghetti it fix. He's also the guy that wrote > self modifying code in BAL. That was quite the experience. I do have some self-modifying 6502 assy code, written without aid of an assembler. I did it once, i ran out of memory on a C64, and rather than find more somewhere, i modify one byte of memory on pass one, and set it back on pass two. It's never broken. Kat -= B E G I N =- X-EUFORUM: 21735 Date: 2008 May 28 1:37 From: c.k.lester <euphoric at ?klester?com> Subject: Re: New keyword added: continue Kat wrote: > > This is getting irritating to the point of dropping Eu entirely. Bye, kat! -= B E G I N =- X-EUFORUM: 21736 Date: 2008 May 28 1:37 From: Kat <KAT12 at coos?hs?net> Subject: goto: it's conceded I just conceded to Derek that i cannot defend every possible use of "goto", and i cannot support to his standards the use of "goto". We agreed i will not be ultimately happy with Euphoria in all regards, perhaps i not use Euphoria any more, and i suggested to JBrown he not see what it takes to add "goto" to Euphoria v4. Is there any other groveling i need do? Kat -= B E G I N =- X-EUFORUM: 21737 Date: 2008 May 28 1:46 From: Jason Gade <jaygade at yahoo.?o?> Subject: Re: goto: it's conceded Kat wrote: > > > I just conceded to Derek that i cannot defend every possible use of "goto", > and i cannot support to his standards the use of "goto". We agreed i will not > be ultimately happy with Euphoria in all regards, perhaps i not use Euphoria > any more, and i suggested to JBrown he not see what it takes to add "goto" to > Euphoria v4. Is there any other groveling i need do? > > Kat A disagreement or an unpopular stance doesn't mean you have to grovel to anyone. Stick to your beliefs. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21738 Date: 2008 May 28 1:47 From: Jason Gade <jaygade at y?hoo?com> Subject: Re: New keyword added: continue c.k.lester wrote: > > Kat wrote: > > > > This is getting irritating to the point of dropping Eu entirely. > > Bye, kat! That's kinda messed up, man. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21739 Date: 2008 May 28 1:48 From: ken mortenson <kenneth_john at yahoo.??m> Subject: Re: New keyword added: continue Kat wrote: > > ken mortenson wrote: > > Now I understand your loyalty to spaghetti. > > I am not in favor of spagetti code. This is getting irritating to the point > of dropping Eu entirely. Please forgive me Kat. I thought I was being cute. Obviously I'm not quite as charming as I must imagine myself to be. -= B E G I N =- X-EUFORUM: 21740 Date: 2008 May 28 1:49 From: Derek Parnell <ddparnell at bigpond?com> Subject: Re: New keyword added: continue Kat wrote: >>> Why are these two blocks so different that >>> you call the 2nd one "dangerous" > I do not know why you'd do that code anyhow. That is not the point, Kat. I know that you and all the other responsible coders would not write such code. But if 'goto' exists then it it possible for SOMEONE to write such code. And because of that possibility, the code maintainer has to check EVERY BLOODY time what the actual control flow is just in case some dunderhead wrote something this bad. > Likewise, i could code up 100 procedures or functions, calling > every one of them thru oddball routine_id() names, and cause > everyone fits trying to trace them. That is true. That is why the usage of each routine_id() needs to be justified too. However, because of the forward referencing restriction in Euphoria, routine_id() must be used in some cases because there is no alternative (apart from code duplication). > And strangely, isn't that > :next target where someone(?) wants to put an "entry" keyword? OUCH!! Also true. I've gone off the 'entry' keyword now for that reason and others. > Do you want me to say you shouldn't code like that? > Granted. Do you want me to say someone could code like that? Granted. > Are you asking me if i think that is good code? No. > Would i code like that? No. However, that is not the point, Kat. This is not about you. It is about that "someone" who could code like this. > I cannot write up every possible piece of code that > could possibly contain a "goto" for your support. Then don't. No one is forcing you too. However, if anyone wants me, specifically, to support their code that happens to use a 'goto', then they need to convince me that there is no better way but to use 'goto'. > i am still in favor of goto being added to Eu. I have no issue with goto being added to Euphoria. I have issues with me having to support code (Euphoria or otherwise) that uses goto. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21741 Date: 2008 May 28 1:49 From: Matt Lewis <matthewwalkerlewis at gmail?c?m> Subject: Re: New keyword added: continue ken mortenson wrote: > > Matt Lewis wrote: > > > > ken mortenson wrote: > > > > > > I wouldn't be adverse to an optional from/by > > > > > > Loop from 7 by -1.2 > > > if (Index<-14.2) exit > > > End Loop > > > > That's good to know. I think. > > So, what are you trying to tell me? I can take it. I'm a big boy. Exactly. Matt -= B E G I N =- X-EUFORUM: 21742 Date: 2008 May 28 1:50 From: Derek Parnell <ddparnell at b?gp?nd.com> Subject: Re: goto: it's conceded > Is there any other groveling i need do? There never has been. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21743 Date: 2008 May 28 1:55 From: Kat <KAT12 at coo?ahs.?et> Subject: Re: New keyword added: continue ken mortenson wrote: > > Kat wrote: > > > for loop1 = 1 to 12 do > > -- code > > goto next1 > > -- code > > for loop2 = 1 to 12 do > > -- code > > goto next2 > > -- code > > for loop3 = 1 to 12 do > > -- code > > goto next3 > > -- code > > for loop4 = 1 to 12 do > > -- code > > goto next4 > > -- code > > for loop5 = 1 to 12 do > > -- code > > goto next5 > > -- code > > for loop6 = 1 to 12 do > > -- code > > goto next6 > > -- code > > :next6 > > end for > > :next5 > > end for > > :next4 > > end for > > :next3 > > end for > > :next2 > > end for > > :next1 > > end for > > Is equivalent to... > > > for loop1 = 1 to 12 do > > -- code > > goto next1 > > :next1 > > end for > > Is this what you meant the code to do? It has no meaning, it's a waste of bytes. It shows "goto next1" goes to ":next1" etc.. Forget it. Kat -= B E G I N =- X-EUFORUM: 21744 Date: 2008 May 28 2:25 From: ken mortenson <kenneth_john at ya?o?.com> Subject: Re: goto: it's conceded Jason Gade wrote: > > Kat wrote: > > > > I just conceded to Derek that i cannot defend every possible use of "goto", > > and i cannot support to his standards the use of "goto". We agreed i will not > > be ultimately happy with Euphoria in all regards, perhaps i not use Euphoria > > any more, and i suggested to JBrown he not see what it takes to add "goto" to > > Euphoria v4. Is there any other groveling i need do? > > > > Kat > > A disagreement or an unpopular stance doesn't mean you have to grovel to anyone. > Stick to your beliefs. I agree with Jason. Please forgive if I've been too harsh. I would like, if I may, to make a point about the term that you may find interesting if you don't mind. Spaghetti code is a term that seems to imply a tangled mess. You obviously take pride in not writing tangled messes and would be rightly indignant to have people unfairly suggest that. But realize that even if we all actually did write tangled messes, the computer wouldn't care. To it, the most tangled mess in the world is no different from the most orderly code ever written. That's not the problem. So for just that reason, the term spaghetti code misdirects from the real issue. The problem is that all programmers are human. One of the profound problems that you will see again and again when using GOTO's is that you can write a profuse amount of excellent quality code that takes many hours to create. Then, because of using GOTO's to labels it is much easier to overlook the fact that the code is never reached. Again and again you will see this. This doesn't mean that the same thing can't happen without GOTO'S because it certainly can. It's just a fact that it happens much more often when labels rather than structure is relied upon for program flow. Humans are more likely to make this mistake with labels. This isn't the only problem related to GOTO's but it is perhaps the easiest to perceive. -= B E G I N =- X-EUFORUM: 21745 Date: 2008 May 28 3:24 From: Kat <KAT12 at c?osahs.n?t> Subject: Re: goto: it's conceded ken mortenson wrote: > > Jason Gade wrote: > > > > Kat wrote: > > > > > > I just conceded to Derek that i cannot defend every possible use of "goto", > > > and i cannot support to his standards the use of "goto". We agreed i will not > > > be ultimately happy with Euphoria in all regards, perhaps i not use Euphoria > > > any more, and i suggested to JBrown he not see what it takes to add "goto" to > > > Euphoria v4. Is there any other groveling i need do? > > > > > > Kat > > > > A disagreement or an unpopular stance doesn't mean you have to grovel to anyone. > > Stick to your beliefs. > > I agree with Jason. I keep my beliefs. They just aren't wanted in Euphoria, #Euphoria, or Euforum. You will get a lot of new keywords and functions in Eu v4, some of which were thought up and considered for a few minutes before addition to the language. Goto isn't one of the new keywords. You will probably get strtok.e, and i appologise in advance for that, and any offence you take with eunet.e over any of my code that may still be in it. I had a lot of hope pinned on Euphoria. I am too old to start looking for a new language, i may just give up on all high level languages, the entire wintel platform, and goto AVRs and the olde 6502. And not release any code, so it cannot be called carp, and my ideas for the language not automatically shot down as a matter of course. Kat -= B E G I N =- X-EUFORUM: 21746 Date: 2008 May 28 6:24 From: ken mortenson <kenneth_john at ?ahoo.co?> Subject: Modularity Before beating me up on any particular point, please read the whole thing. Please forgive me for beating a dead horse but it nags me that there is such disagreement on this topic. Some have taken issue when I claim that INCLUDE is a less than modular methodology and therefore Euphoria is a less than modular language. I believe this to be self evident, but obviously I need to make the case in an understandable way. I don't know how well I can do that, but I'm going to take another shot at it. My definition of modularity is a bit like legos, parts that fit together. A module, hides it's internals and exposes an interface. I assume we agree. Suppose I have a library consisting of multiple files and I use this library by including a main library file in one of my projects files which may or may not be my main program file. This main library file includes other files which may include others and so on. Namespaces can be used to hide globals of included files if I understand the discussion I've read so far in the other threads. Library globals that are not hidden by namespaces are therefore part of the interface of the library. Therefore (for this particular scenario) all files of the library have to considered as one module. Files that have no visible globals are still considered to be part of the one module as they are part of the modules hidden internal structure. This is my first disconnect. While technically this is modularity, it is very course grained. My concept of modularity is much more fine grained than this. So already we have reached a point where Euphoria is less fine grain than my primary language VB6 where every file is a module (either a standard module, a class, or a form.) However, there is no reason why a third party library could not have several different files that may be include in your project as separate module which would be a finer grain of modularity. So what's my hangup? I suppose it's just that for the last decade I've been used to modules being physically separate files. But even these separate files may call each other and therefore technically are part of the internals of the module. It's not the way I usually think about it, but it is comparable. So actually, even these separate physical files could be thought of as less than modular if there is a level of coupling between files which is often the case. I'm coming around folks. Let's see if I can make it to the home stretch... Another sticking point. Modules as I'm used to are physical files that can be called but do not expose the interface of any file they call (not without an explicit public function but that still keeps the files it calls hidden.) Euphoria could do the same thing, but in practice I'm thinking since it's not limited to this behavior it doesn't (anything not restricted tends to be exploited.) I'd have to give Euphoria a half point off for this, but it's not really a big deal. So I guess my conclusion is that there really is no reason not to consider Euphoria a potentially fine grained modular language. I've got a thick skull so it may take a while for this concept to sink in. Thank you for playing. Collect your prizes at the door. -= B E G I N =- X-EUFORUM: 21747 Date: 2008 May 28 7:29 From: ken mortenson <kenneth_john at yah?o?com> Subject: Re: Modularity Modularity is not just a concept. There is a purpose to it. More than one actually. So how well does Euphoria concept of modularity fit with these purposes? I tie this concept into my vision of the my ideal development environment (humorously refered to as 'ONE TRUE LANGUAGE') The main purpose of modularity is to make programming a managable endeavor. Another equally important purpose is for the sharing of code. Within the development environment it should also facilitate the navigation within the code and it's conceptualization. Within the development environment the interface of a module should be able to be clearly delineated. All procedures, functions and variables of a module's interface should be available for inspection separate to those of other modules. At this point I'm not aware of the existance of such an environment (I don't believe Judith's IDE or any other I've seen includes these features.) My experience in the VB environment is that the combination of an object inspector, classes, dot notation and intellisense combine to form an environment where modularity is a key feature of development. I strongly believe these features are why VB is the environment of choice for millions of professional programmers. Euphoria as a language is in many ways far superior to the basic language, so it is in these strengths of VB that some focus is needed if Euphoria is ever to be widely used. More to come... -= B E G I N =- X-EUFORUM: 21748 Date: 2008 May 28 9:30 From: CChris <christian.cuvier at agriculture.?ouv.?r> Subject: Re: New keyword added: continue c.k.lester wrote: > > Matt Lewis wrote: > > c.k.lester wrote: > > > Ah, I see how next/continue would work there, and retry. But restart- > > > jumping OUT of a loop and then going back into it- looks like it might > > > cause interpreter pains (memory leaks, etc.). And jumping out of the loop? > > > Dunno. Maybe an interpreter modifier can speak to that. > > You're probably afraid of 'exit', too. :P > > Seriously, exit is just a goto to the end of the loop. It doesn't do any > > clean up or anything. There isn't any needed. > > You'd know. > > I'm curious that there's no clean up necessary. It looks like there'd be a > dangling variable. Eeeewwwwwww!!! :D > > (I admit I've never used exit. I'm not a sloppy enough coder. HAHAHAHA. Just > kidding. I might've used it once. Well, I just checked bbcmf-system. Out of > about 8.6KLOC, exit appears 0 times. So, I probably never have used it.) No cleanup is needed. When you say <eucode> for i=1 to n do -- ... end for </eucode> a variable named i, but with a unique index, is created for the duration of the routine it is in (top level code is in a procedure which returns in a special way). Since only the index of a variable is being used in actual execution, the only concern is that this particular i be used out of context. This is ensured by hiding it when the parser sees "end for". The parser doesn't goto or loop through code, it linearly ploughs through it. The i variable is a variable like any other, but with a special scope, so that the only references to it will appear inside the for loop it indexes. What may be an issue is jumping into a for loop from outside. The first code in a for loop initialises i, so strange things may happen if that code is skipped. And the logic needed for goto to understand that it must reinitialise the for loop index(es) involved before jumping in is probably costly. This can work in an interpreter with multple passes over the source, but not with the current parser, which is one pass only for speed. CChris -= B E G I N =- X-EUFORUM: 21749 Date: 2008 May 28 9:45 From: CChris <christian.cuvier at agric?ltur?.gouv.fr> Subject: Re: New keyword added: continue Kat wrote: > > Derek Parnell wrote: > > > > Kat wrote: > > > <eucode> > > > :restart > > > for loop = 1 to 12 do > > > :retry > > > -- code > > > if blah then goto restart end if > > > if blorg then goto retry end if > > > if not x then goto exit end if > > > if CK then goto next end if > > > if worstcase then goto cleanup&return end if > > > -- code > > > :next > > > end for > > > :exit > > > </eucode> > > > > Hi Kat, > > just a few of quick questions ... > > > > ** How, as a maintainer of the code above, can I be sure that process flow only > > gets to the "restart:" label from either the statement immediately preceding > > it or the 'goto' inside the loop? In other words, how can I be sure that there > > is not another 'goto restart' elsewhere in the code? > > You can't. You read the code to see if there is another "goto" that label. The > same with "exit", "return", etc.. I have a fair amount of code that has "return" > sprinkled around, and no one has ever complained about more than one place leaving > the function. One way to restrict the "where from" is to localise all "goto" > to procedure/function blocks, and not allow it in top level code. Exactly like > in OOEU. > > > ** If I have to place another looping construct within the same scope as the > > one above, what should I call the labels? > > Umm, how about "loop2" ? Or you mean the targets for more "goto" of the same > umm, form? Pick a name. You have the freedom to restart the inner loop, the > outer loop, the nested while loop in there which you added later, etc.. I tend > to give my nested loop names some description, even if it's just "index1", so > i could have a "goto restart_index1", which sorta reads easily, and i know just > where it's going, and i can get there with the one "goto" keyword from any depth > of nested loops. The target being present alerts me, as i am reading down the > code, that i may be going back to that point from somewhere. > > > ** Under what circumstanes might I have to rename the labels? > > Never, i believe. If you add loops, or other code, you do not need to change > anything, assuming your intent to goto the :target is the same. If you wish > to add a target, choose another name. Like i said, i tend to use the loop name > as part of the target, and/or/as well as the purpose, if i need any clairification, > rather insuring unique target names. This way i can wrap or unwrap nested loops, > and not have a problem, as well as skip blocks during debug. > > With goto scope restricted to proc/funct blocks, it makes some code even easier, > such as "goto cleanup&return", which i know has the local scope of variables, > is at the bottom of the block where code will fall thru to anyhow, and execute > the "cleanup&return". With Eu the way it is now, i have hunks of code copy/pasted > thruout which does the cleanup with local vars and returns, and those hunks > are a nightmare to keep identical. Just as an aside, one other cure for that > would be nested procedures, which could be called inside the nesting procedure, > and the nested one have the scope of the nesting one's vars, i did this in Turbo > Pascal a *lot*. > > I believe Matt scored 100 with the way he did goto in OOEU, and i reiterate > my suggestion all of OOEU be merged into Eu v4. > > Kat Which I'd support, with probably reservations about namespace handling. CChris -= B E G I N =- X-EUFORUM: 21750 Date: 2008 May 28 10:02 From: CChris <christian.cuvier at agriculture.g??v.fr> Subject: Re: New keyword added: continue Kat wrote: > > Derek Parnell wrote: > > > > Kat wrote: > > > > Thanks Kat. > > > > > Derek Parnell wrote: > > >> ... how can I be sure that there is not another 'goto restart' > > >> elsewhere in the code? > > > > > > You can't. You read the code to see if there is another "goto" that label. > > > > How likely would this requirement increase the cost of maintenance? > > In Textpad, drag the cursor over the label, and keypress for search. You could, > i suppose, add a "came_from" var you interrogate in some way. > > > > The same with "exit", "return", etc.. I have a fair amount > > > of code that has "return" sprinkled around, and no one has > > > ever complained about more than one place leaving > > > the function. > > > > I see this as a different issue. With 'goto' the question I raise deals with > > how ones arrives at the label and has nothing to do with the 'goto' statement > > itself, but with 'exit' and 'return', the process flow to arrive at that statement > > is clear and local. > > It is as clear as goto, i think. If i have a function, and i can return from > it in several points, how do you know which return got you back out of the function? > > > > One way to restrict the "where from" is to localise all "goto" > > > to procedure/function blocks, and not allow it in top level code. > > > Exactly like in OOEU. > > > > Does the number of statements in a routine affect this position? > > What? I don't see the connection between statement count and use of any keyword. > > > >> ** If I have to place another looping construct within the same > > >> scope as the one above, what should I call the labels? > > > > > > Umm, how about "loop2" ? > > > > Does the requirement that a 'goto' needs a (unique within the scope) label, > > reduce the amount of code that has to be read by maintainers? To me it seems > > that using the combination of 'label xyz' and 'goto xyz' contains a lot more > > redundant content than 'next' does. > > But you *know* where goto will goto, and across languages, you haveto remember > where each language differs, as well as how each human language interprets each > of those other keywords, such as "next", "continue", etc. > > > If such a loop containing labels, needs to be later nested inside another loop, > > what is the suggested naming convention, if any? > > > > e.g. We start with ... > > restart1: > > loop > > -- some code -- > > goto restart1 > > -- some more code --- > > restart2: > > loop > > -- some code --- > > goto restart2: > > -- some code -- > > goto restart1 > > -- some code > > end loop > > end loop > > > > But later this needs to be nested, such as ... > > > > restart3: > > loop > > -- some code --- > > restart1: > > loop > > -- some code -- > > goto restart1 > > -- some more code --- > > restart2: > > loop > > -- some code --- > > goto restart2: > > -- some code -- > > goto restart1 > > -- some code -- > > end loop > > end loop > > -- some code -- > > goto restart3 > > -- some code -- > > end loop > > > > Would it be better to keep the existing label names as above, or is it better > > to rename them to keep the implied nesting level obvious? > > Better to find a better way to code that. I would keep the labels more descriptive > of what they do, and then not change them if you are wrapping or inserting new > code that describes another function. > > > >> ** Under what circumstanes might I have to rename the labels? > > > > > Never, i believe. > > > > See above. > > Did. > > > > Just as an aside, one other cure for that > > > would be nested procedures, which could be > > > called inside the nesting procedure, and the > > > nested one have the scope of the nesting one's > > > vars > > > > Yes, nested routines would be very very nice. I suspect that we will have this > > ability soon, but not for v4.0 > > Cool. > > Kat It can be in 4.0 in a matter of days. The code works in interpreted mode in Æ. There may be issues with translated code, as I recently discovered, but the bulk of it could take like 3 days to port in, and a couple more for any residual bugs (I have always stated tat that code was experimental and not thoroughly tested). CChris -= B E G I N =- X-EUFORUM: 21751 Date: 2008 May 28 10:15 From: CChris <christian.cuvier at agric?ltur?.gouv.fr> Subject: Re: New keyword added: continue Derek Parnell wrote: > > Kat wrote: > >>> Why are these two blocks so different that > >>> you call the 2nd one "dangerous" > > > > I do not know why you'd do that code anyhow. > > That is not the point, Kat. I know that you and all the other responsible coders > would not write such code. But if 'goto' exists then it it possible for SOMEONE > to write such code. And because of that possibility, the code maintainer has > to check EVERY BLOODY time what the actual control flow is just in case some > dunderhead wrote something this bad. > Yeah, some coder did it wrong on the internet... Code which is hard to maintain won't be maintained and will quietly die, like many goto-less contribs in the Archive. Why should we care? > > Likewise, i could code up 100 procedures or functions, calling > > every one of them thru oddball routine_id() names, and cause > > everyone fits trying to trace them. > > That is true. That is why the usage of each routine_id() needs to be justified > too. However, because of the forward referencing restriction in Euphoria, routine_id() > must be used in some cases because there is no alternative (apart from code > duplication). > > > And strangely, isn't that > > :next target where someone(?) wants to put an "entry" keyword? OUCH!! > > Also true. I've gone off the 'entry' keyword now for that reason and others. > > > Do you want me to say you shouldn't code like that? > > Granted. Do you want me to say someone could code like that? Granted. > > Are you asking me if i think that is good code? No. > > Would i code like that? No. > > However, that is not the point, Kat. This is not about you. It is about that > "someone" who could code like this. > > > I cannot write up every possible piece of code that > > could possibly contain a "goto" for your support. > > Then don't. No one is forcing you too. However, if anyone wants me, specifically, > to support their code that happens to use a 'goto', then they need to convince > me that there is no better way but to use 'goto'. > > > i am still in favor of goto being added to Eu. > > I have no issue with goto being added to Euphoria. I have issues with me having > to support code (Euphoria or otherwise) that uses goto. > We may agree that the standard library, nor the interpreter, shoud not have goto (the C code in backend and translated code has them galore). If you supervise coders, you may ask them not to use it, since you are the boss. Any remaining concern? CChris > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21752 Date: 2008 May 28 11:37 From: Shawn Pringle <shawn.pringle at gmail.??m> Subject: Re: Accented characters in identifiers I see two sides to this debate: One, says we should use identifiers everyone can type: That is a subset of ASCII. I don't understand how ADA programmers cope with their character set. The other says okay, lets use English identifiers in libraries and core keywords but in the programmers' code let us allow them to use his native tongue. I would like to add that sometimes routines that were intended to be internal to a program sometimes get put into a .e file. Sometimes these .e files get uploaded to the archive by some altruism of the programmmer. This would become less likely if the programmer would also have to translate their routine names. I think if we decide to include accented characters we should use Unicode 16bit format. The interpreter could branch and do the IO in a Unicode manner if it finds the byte-order word at the beginning of the file. Alternatively, we could have a browser like usage of character sets where it sets the encoding at the beginnning of the file in a comment. <eucode> #!/usr/bin/exu -- encoding: utf-8 </eucode> I am not trying to be ironic or sarcastic here but I am just brainstorming what could be implemented. I say so because sometimes, I sense that I come across as sarcastic when I do not mean to. Shawn Pringle B.Sc. -= B E G I N =- X-EUFORUM: 21753 Date: 2008 May 28 11:56 From: Derek Parnell <ddparnell at bi?pond.co?> Subject: Re: New keyword added: continue CChris wrote: > Which I'd support, with probably reservations about namespace handling. What is it that you would support? Your response is not clear about what section of that very long post you're referring to. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21754 Date: 2008 May 28 11:57 From: Derek Parnell <ddparnell at bi?pon?.com> Subject: Re: New keyword added: continue CChris wrote: > It can be in 4.0 in a matter of days. What is the 'it' you talk about here? Whatever it is, don't add it to Eu until we all know what 'it' is that you are proposing to do. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21755 Date: 2008 May 28 11:59 From: Derek Parnell <ddparnell at ?igpond.c?m> Subject: Re: New keyword added: continue CChris wrote: > If you supervise coders, you may ask them not to use it, > since you are the boss. Any remaining concern? Are you talking to me, Chris? If so, what are you talking about? I really haven't got a clue what trying to say to me. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21756 Date: 2008 May 28 12:36 From: CChris <christian.cuvier at agriculture.go?v?fr> Subject: Re: New keyword added: continue Derek Parnell wrote: > > CChris wrote: > > > Which I'd support, with probably reservations about namespace handling. > > What is it that you would support? Your response is not clear about what section > of that very long post you're referring to. > The section preceding my comment, ie getting 80+% of OOEu into official Eu. CChris > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21757 Date: 2008 May 28 12:41 From: Jeremy Cowgar <jeremy at ?owgar.com> Subject: Re: New keyword added: continue CChris wrote: > > > The section preceding my comment, ie getting 80+% of OOEu into official Eu. > What specific functionality of OOeu? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21758 Date: 2008 May 28 12:57 From: CChris <christian.cuvier at a?ric?lture.gouv.fr> Subject: Re: New keyword added: continue Derek Parnell wrote: > > CChris wrote: > > > It can be in 4.0 in a matter of days. > > What is the 'it' you talk about here? > Support for nested routines. Like in <eucode> function umbrella() integer n1 sequence s2 procedure foo() --... end procedure -- umbrella code end function </eucode> A nested routine can be called only by * itself * the routine it is nested in (recursively) * any routine recursively nested in it * a sibling, ie another routine singly nested into the same parent * any routine recursively nested in a sibling Top level code is not considered to have any nested routine. The rules are needed in case of multiple nesting, so that no variable name clash occurs. Calling an indirect descendent (grandchild or more) is not forbidden, but probably to be frowned upon. Only vars defined by a routine or any of its ancestors are available to it. > Whatever it is, don't add it to Eu until we all know what 'it' is that you are > proposing to do. Of course :-) CChris > > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21759 Date: 2008 May 28 13:22 From: gshingles <gshingles at ?mail?com> Subject: Re: goto: it's conceded ken mortenson wrote: > --8<-- > This isn't the only problem related to GOTO's but it is perhaps the easiest > to perceive. One word (or maybe two): GOSUB ;-) Gary -= B E G I N =- X-EUFORUM: 21760 Date: 2008 May 28 13:23 From: CChris <christian.cuvier at ag?iculture.gouv.f?> Subject: Re: New keyword added: continue Derek Parnell wrote: > > CChris wrote: > > > If you supervise coders, you may ask them not to use it, > > since you are the boss. Any remaining concern? > > Are you talking to me, Chris? If so, what are you talking about? I really haven't > got a clue what trying to say to me. > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell You said: I'm concerned about having someday to maintain code that someone wrote badly using goto. Let's assume the oncern is not overplayed. Now how would that situation be happening? 1/ Because the Eu interpreter or the standard lib uses goto. We mat reasonably agree not to let this happen. After all, they are in the greater common denominator of Eu, which dosn't include goto. 2/ Because someone you supervise is giving you such code. Then you are free to set your coding rules, including not using goto. 3/ Because a supervisor hands you that job, and he accepted goto in code. But then you were aware that it ould happen, right? 4/ Otherwise, you have hardly any obligation to maintain any code you didn't write, so you can decide to not maintain if there's a goto. Is that clearer? So, you can always avoid maintaining the dreaded code, and your concerns will remain theory, even with goto in the language, not actual. CChris Notes: 1/ I'm not actively pushing for goto, as it may be of scarce usefulness with the new flow control statements in, and has serious pitfalls. However, I see that most of the reasons put forward against it are quite wrong. 2/ Can someone point me to actual publicly released spaghetti code? It's everyone's talk, but I have never seen any. Preferrably something less than 5 year old. -= B E G I N =- X-EUFORUM: 21761 Date: 2008 May 28 13:31 From: Jeremy Cowgar <jeremy at cow?ar.?om> Subject: Re: New keyword added: continue > > You said: I'm concerned about having someday to maintain code that someone wrote > badly using goto. > <snip> > Let's assume the concern is not overplayed. Now how would that situation be > happening? > > 1/ Because the Eu interpreter or the standard lib uses goto. We mat > reasonably agree not to let this happen. After all, they are in the greater > common denominator of Eu, which dosn't include goto. I've heard a few people say this and it does not make sense to me. I am not arguing for or against goto but here is my simple observation on the above statement. If goto is not good for the standard libraries than it's not good for the language. If it is good for the language than it's good for the standard library. I see no exceptions to this rule. Why would we add language functionality and then ban it from use? If we have the idea it should be banned, then it shouldn't be added! If we think it should be added then we cannot/should not ban it's use! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21762 Date: 2008 May 28 13:38 From: CChris <christian.cuvier at agriculture.gouv??r> Subject: Re: New keyword added: continue Jeremy Cowgar wrote: > > CChris wrote: > > > > > > The section preceding my comment, ie getting 80+% of OOEu into official Eu. > > > > What specific functionality of OOeu? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> - prototype based classes - dynamic variables (var_id(), read_variable(), ...) - dynamic code execution (eval() and friends) - supportfor optional : return_type in funvtion headers - and, why not?, goto CChris -= B E G I N =- X-EUFORUM: 21763 Date: 2008 May 28 13:39 From: Jason Gade <jaygade at yaho??com> Subject: Nested routines What is the utility of nested routines? What problems do they solve that can't be solved by refactoring and simplification? -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21764 Date: 2008 May 28 13:44 From: Jason Gade <jaygade at yahoo?c?m> Subject: Re: New keyword added: continue CChris wrote: > > Jeremy Cowgar wrote: > > > > CChris wrote: > > > > > > > > > The section preceding my comment, ie getting 80+% of OOEu into official Eu. > > > > > > > What specific functionality of OOeu? > > > > -- > > Jeremy Cowgar > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > - prototype based classes Wait -- OOEU has classes. I don't remember it having "prototype-based classes". From my readings, prototype-based OO is very different from class-based OO because in class-based OO classes and objects are different kinds of things and in prototype-based they aren't. > - dynamic variables (var_id(), read_variable(), ...) > - dynamic code execution (eval() and friends) > - supportfor optional : return_type in funvtion headers What is "optional : return_type in function headers"? That sounds like a move away from genericity to me. > - and, why not?, goto > > CChris -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21765 Date: 2008 May 28 13:46 From: Jeremy Cowgar <jeremy at c?wgar?com> Subject: Re: Nested routines Jason Gade wrote: > > What is the utility of nested routines? What problems do they solve that can't > be solved by refactoring and simplification? > Have you ever had to repeat a task over and over in a function that takes multiple local paramters and is only used within that one function? Why make a top-level function putting it at least into the file scope, deal with passing all the parameters to the function and getting the result when one could create a nested routine? Take a peek at: http://en.wikipedia.org/wiki/Nested_function for a little more info. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21766 Date: 2008 May 28 13:49 From: CChris <christian.cuvier at agricu?t?re.gouv.fr> Subject: Re: Nested routines Jason Gade wrote: > > What is the utility of nested routines? What problems do they solve that can't > be solved by refactoring and simplification? > > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. Sharing of private data and simple splitting of otherwise large routines. Instead of passing arguments (whih has a cost) between 3,4, 5 routines, use variables common to all the involved routines, and hide these symbols even from the rest of the file. This also makes code more maintainable, as the scope of more variables is being restricted in a visible way. Perforance call: call_func/call_proc have to check that a dynamic call o a nested routine is valid. Not much, and not often at all. It's not even a loss, as non nested routine calls are not affected (apart from a "if (symtab[s].u->parent != toplevel) test in backend. CChris -= B E G I N =- X-EUFORUM: 21767 Date: 2008 May 28 13:51 From: Jason Gade <jaygade at yahoo.??m> Subject: Re: Nested routines Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > What is the utility of nested routines? What problems do they solve that can't > > be solved by refactoring and simplification? > > > > Have you ever had to repeat a task over and over in a function that takes multiple > local paramters and is only used within that one function? Not that I can recall. I'd probably just make a separate function. > Why make a top-level > function putting it at least into the file scope, deal with passing all the > parameters to the function and getting the result when one could create a nested > routine? Again, I don't see the utility of nesting it vice putting it at the file scope. If your file is so large that putting the function in file scope would cause a name clash then maybe your file needs to be split up better. > > Take a peek at: <a href="http://en.wikipedia.org/wiki/Nested_function">http://en.wikipedia.org/wiki/Nested_function</a> for a little > more info. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Right, I know what they are even though I've never used them. I just don't see any use for them. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21768 Date: 2008 May 28 14:12 From: Jeremy Cowgar <jeremy at cowga??com> Subject: Re: Nested routines Jason Gade wrote: > > > Have you ever had to repeat a task over and over in a function that takes multiple > > local paramters and is only used within that one function? > > Not that I can recall. I'd probably just make a separate function. > Have you ever used a language that supports nested routines? I suspect that it's much like the for-in loop. Sure, you can program with out it, but once you use it, you'll miss it. One could ask, what can be done with a for-in loop that couldn't be done w/a simple for loop? The answer is easy... nothing! But why use a for loop if you have access to a for-in loop and your iterating a sequence? Nested routines is the same thing. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21769 Date: 2008 May 28 14:15 From: Matt Lewis <matthewwalkerlewis at gmail.co?> Subject: Re: New keyword added: continue Jason Gade wrote: > > CChris wrote: > > > > - supportfor optional : return_type in funvtion headers > > What is "optional : return_type in function headers"? That sounds like a move > away from genericity to me. You could overload class methods as long as they had different signatures. ooeu mangled names similar to C++. So you could have two different methods with the same name and same number of parameters. The return type helped the parser figure out which method to use based upon the return parameters from functions. It wasn't enforced in ooeu. <eucode> euclass complex( sequence c ) atom real, imaginary function add( atom a ) : complex ... end function function add( complex c ) ... end function function complex( atom r ) : complex return {r, 0} end function function complex( atom r, atom i ) : complex return {r, i} end function function complex( complex c ) : complex return c end function end euclass complex x, y x = complex( 0 ) y = complex( 5, 2 ) x = x.add( 3 ) x = x.add( y ) x = x.add( y.add( 2 ) ) </eucode> -= B E G I N =- X-EUFORUM: 21770 Date: 2008 May 28 14:21 From: Jason Gade <jaygade at ?ah?o.com> Subject: Re: New keyword added: continue Matt Lewis wrote: > > Jason Gade wrote: > > > > CChris wrote: > > > > > > - supportfor optional : return_type in funvtion headers > > > > What is "optional : return_type in function headers"? That sounds like a move > > away from genericity to me. > > You could overload class methods as long as they had different signatures. > > ooeu mangled names similar to C++. So you could have two different methods > with the same name and same number of parameters. The return type helped > the parser figure out which method to use based upon the return parameters > from functions. It wasn't enforced in ooeu. > <eucode> > euclass complex( sequence c ) > atom real, imaginary > > function add( atom a ) : complex > ... > end function > > function add( complex c ) > ... > end function > > function complex( atom r ) : complex > return {r, 0} > end function > > function complex( atom r, atom i ) : complex > return {r, i} > end function > > function complex( complex c ) : complex > return c > end function > end euclass > > complex x, y > x = complex( 0 ) > y = complex( 5, 2 ) > > x = x.add( 3 ) > x = x.add( y ) > x = x.add( y.add( 2 ) ) > </eucode> Yeah, I had to recheck the docs after CChris mentioned it. How does that affect non-method routines? -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21771 Date: 2008 May 28 14:52 From: ken mortenson <kenneth_john at y??oo.com> Subject: Re: goto: it's conceded gshingles wrote: > > ken mortenson wrote: > > --8<-- > > This isn't the only problem related to GOTO's but it is perhaps the easiest > > to perceive. > > One word (or maybe two): > > GOSUB Well, that's terse. Let me add a few more. Back in the day, I thought I could never live without ON X GOTO, as well as ON X GOSUB. I have matured quite a bit since then. The idea of using any of these four today is physically loathesome to me. Not to offend, but for a HLL to include these would make it a toy language not suitable for serious development. YMMV. -= B E G I N =- X-EUFORUM: 21772 Date: 2008 May 28 14:56 From: ken mortenson <kenneth_john at yaho??com> Subject: Re: Nested routines Jason Gade wrote: > > What is the utility of nested routines? What problems do they solve that can't > be solved by refactoring and simplification? You have hit the nail firmly on the head. It's a marketing ploy... "Look at the cool (and useless) stuff we have!" -= B E G I N =- X-EUFORUM: 21773 Date: 2008 May 28 14:58 From: Jeremy Cowgar <jeremy at cowgar.?o?> Subject: Re: Nested routines ken mortenson wrote: > > You have hit the nail firmly on the head. It's a marketing ploy... "Look at > the cool (and useless) stuff we have!" > How many lines of code have you written Ken? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21774 Date: 2008 May 28 15:04 From: Matt Lewis <matthewwalkerlewis at gm?il.?om> Subject: Re: New keyword added: continue Jason Gade wrote: > > Matt Lewis wrote: > > > > Jason Gade wrote: > > > > > > What is "optional : return_type in function headers"? That sounds like a move > > > away from genericity to me. > > > > You could overload class methods as long as they had different signatures. > > > > ooeu mangled names similar to C++. So you could have two different methods > > with the same name and same number of parameters. The return type helped > > the parser figure out which method to use based upon the return parameters > > from functions. It wasn't enforced in ooeu. > > > Yeah, I had to recheck the docs after CChris mentioned it. > > How does that affect non-method routines? It doesn't, except when they're used as parameters for method calls. Basically, the return type was stored in a slot in the symbol table for each function (defaulted to object, IIRC). It was therefore an additional couple of tokens to parse, and a little bit of additional information in the symbol table that the OO symbol resolution code used. Matt -= B E G I N =- X-EUFORUM: 21775 Date: 2008 May 28 15:05 From: ken mortenson <kenneth_john at y??oo.com> Subject: Re: Nested routines Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > What is the utility of nested routines? What problems do they solve that can't > > be solved by refactoring and simplification? > > > > Have you ever had to repeat a task over and over in a function that takes multiple > local paramters and is only used within that one function? All the time. > Why make a top-level function putting it at least into the file scope, Because it makes your current function cleaner and easier to maintain. > deal with passing all the parameters to the function Which is another advantage. Thinking of variable as semi-public within a function is a baaaaad idea. > and getting the result when one could create a nested routine? And another advantage. Those results are part of the unit test procedure. divide and conquer folks. It's the human thing to do. Short answer. It reduces the mental strain on the humble programmer. -= B E G I N =- X-EUFORUM: 21776 Date: 2008 May 28 15:07 From: Matt Lewis <matthewwalkerlewis at gma??.com> Subject: Re: goto: it's conceded ken mortenson wrote: > > Well, that's terse. Let me add a few more. Back in the day, I thought I > could never live without ON X GOTO, as well as ON X GOSUB. I have matured > quite a bit since then. The idea of using any of these four today is > physically loathesome to me. Not to offend, but for a HLL to include these > would make it a toy language not suitable for serious development. YMMV. Indeed MMV, though it goes by a different name, using routine_id and call_proc/call_func. See execute.e in the euphoria source directory for an example of how this can be reasonably used. Also, I'd point out that ON X GOTO is really similar (just a little less controlled) to a switch/select/case. Matt -= B E G I N =- X-EUFORUM: 21777 Date: 2008 May 28 15:12 From: ken mortenson <kenneth_john at yahoo?co?> Subject: Re: Nested routines Jeremy Cowgar wrote: > Have you ever used a language that supports nested routines? I suspect that > it's much like the for-in loop. Sure, you can program with out it, but once > you use it, you'll miss it. > > One could ask, what can be done with a for-in loop that couldn't be done w/a > simple for loop? The answer is easy... nothing! But why use a for loop if you > have access to a for-in loop and your iterating a sequence? Two questions. Same answer. Because less is more!!!!!!!!!!!!!! Imagine how effecient and less complicated your compiler becomes when you remove all the unneccessary bells and whistles and just leave the pure and clean, unadulterated core. Bells and whistles are for libraries (which are optional in a project) while the core should be a finely crafted tool. It's one of the main things that attracted me to the language in the first place. -= B E G I N =- X-EUFORUM: 21778 Date: 2008 May 28 15:17 From: Jeremy Cowgar <jeremy at ?owg?r.com> Subject: Re: Nested routines ken mortenson wrote: > > Two questions. Same answer. Because less is more!!!!!!!!!!!!!! > I agree! Less code I type the better. > Imagine how effecient and less complicated your compiler becomes when you > remove all the unneccessary bells and whistles and just leave the pure and > clean, unadulterated core. Bells and whistles are for libraries (which are > optional in a project) while the core should be a finely crafted tool. It's > one of the main things that attracted me to the language in the first place. Imagine how efficient and less complicated your code will be (which you have to maintain, not the compiler) if the compiler does it's job and provides the common constructs/functionality necessary for me to do my job (programming) easily! That's what I look for. If I wanted a bare minimum compiler I'd go with whitespace or something. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21779 Date: 2008 May 28 15:22 From: ken mortenson <kenneth_john at yahoo?c?m> Subject: Re: New keyword added: continue CChris wrote: > So, you can always avoid maintaining the dreaded code, and your concerns will > remain theory, even with goto in the language, not actual. With all due respect, this is incorrect. In the real world, supervisors are not baby sitters. They usually (almost always) do not have time for a full (or even partial) code review. Even if a supervisor assigns a senior programmer to review a junior programmers code, in a real shop where everybodies working on there own stuff, it just doesn't get done. Only when code review is part of an institutional and formal process does it get done, which is hardly ever the case. So if you agree (and you certainly have the right not to) that some feature makes maintainance a greater issue; if that feature is in the language you can be assured that some will abuse it. OTOH, whatever doesn't exist can not be abused. -= B E G I N =- X-EUFORUM: 21780 Date: 2008 May 28 15:24 From: ken mortenson <kenneth_john at y?hoo.co?> Subject: Re: New keyword added: continue Jeremy Cowgar wrote: > > > > You said: I'm concerned about having someday to maintain code that someone wrote > > badly using goto. > > > > <snip> > > > Let's assume the concern is not overplayed. Now how would that situation be > > happening? > > > > 1/ Because the Eu interpreter or the standard lib uses goto. We mat > > reasonably agree not to let this happen. After all, they are in the greater > > common denominator of Eu, which dosn't include goto. > > I've heard a few people say this and it does not make sense to me. I am not > arguing for or against goto but here is my simple observation on the above statement. > > If goto is not good for the standard libraries than it's not good for the language. > If it is good for the language than it's good for the standard library. I see > no exceptions to this rule. Why would we add language functionality and then > ban it from use? If we have the idea it should be banned, then it shouldn't > be added! If we think it should be added then we cannot/should not ban it's > use! That's just too logical Jeremy. What are you, some kind of fanatic? ;-) -= B E G I N =- X-EUFORUM: 21781 Date: 2008 May 28 15:25 From: CChris <christian.cuvier at agricult?re.gouv.?r> Subject: Re: New keyword added: continue Jason Gade wrote: > > Matt Lewis wrote: > > > > Jason Gade wrote: > > > > > > CChris wrote: > > > > > > > > - supportfor optional : return_type in funvtion headers > > > > > > What is "optional : return_type in function headers"? That sounds like a move > > > away from genericity to me. > > > > You could overload class methods as long as they had different signatures. > > > > ooeu mangled names similar to C++. So you could have two different methods > > with the same name and same number of parameters. The return type helped > > the parser figure out which method to use based upon the return parameters > > from functions. It wasn't enforced in ooeu. > > <eucode> > > euclass complex( sequence c ) > > atom real, imaginary > > > > function add( atom a ) : complex > > ... > > end function > > > > function add( complex c ) > > ... > > end function > > > > function complex( atom r ) : complex > > return {r, 0} > > end function > > > > function complex( atom r, atom i ) : complex > > return {r, i} > > end function > > > > function complex( complex c ) : complex > > return c > > end function > > end euclass > > > > complex x, y > > x = complex( 0 ) > > y = complex( 5, 2 ) > > > > x = x.add( 3 ) > > x = x.add( y ) > > x = x.add( y.add( 2 ) ) > > </eucode> > > Yeah, I had to recheck the docs after CChris mentioned it. > > How does that affect non-method routines? > > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. In self documentation, optimisation in returning vlues and again clearer code. That's why it would be optional for non OO routines. CChris -= B E G I N =- X-EUFORUM: 21782 Date: 2008 May 28 15:33 From: Matt Lewis <matthewwalkerlewis at gmail.c?m> Subject: Re: New keyword added: continue Jeremy Cowgar wrote: > > If goto is not good for the standard libraries than it's not good for the > language. If it is good for the language than it's good for the standard > library. I see no exceptions to this rule. Why would we add language > functionality and then ban it from use? If we have the idea it should be > banned, then it shouldn't be added! If we think it should be added then we > cannot/should not ban it's use! That's a good general principle, but not necessarily true for every case. One place where goto can be a lifesaver is in porting code from other languages that either have goto, or have other flow control structures that we don't. Goto emulation in these cases can lead to really messy code that's technically structured code, but the mess of nested ifs and flags can make a giant knot that could be cut with a well placed goto here and there. They can also be used in certain cases to great effect in optimizing (take a look at the back end of the interpreter :). I accept that some view this as insufficient reason for adding goto. I happen to disagree with them. Matt -= B E G I N =- X-EUFORUM: 21783 Date: 2008 May 28 15:35 From: CChris <christian.cuvier at agriculture.?ouv?fr> Subject: Re: New keyword added: continue ken mortenson wrote: > > Jeremy Cowgar wrote: > > > > > > > You said: I'm concerned about having someday to maintain code that someone wrote > > > badly using goto. > > > > > > > <snip> > > > > > Let's assume the concern is not overplayed. Now how would that situation be > > > happening? > > > > > > 1/ Because the Eu interpreter or the standard lib uses goto. We mat > > > reasonably agree not to let this happen. After all, they are in the greater > > > common denominator of Eu, which dosn't include goto. > > > > I've heard a few people say this and it does not make sense to me. I am not > > arguing for or against goto but here is my simple observation on the above statement. > > > > If goto is not good for the standard libraries than it's not good for the language. > > If it is good for the language than it's good for the standard library. I see > > no exceptions to this rule. Why would we add language functionality and then > > ban it from use? If we have the idea it should be banned, then it shouldn't > > be added! If we think it should be added then we cannot/should not ban it's > > use! > > That's just too logical Jeremy. What are you, some kind of fanatic? ;-) 1/ The standard library is made of very short routines, with perhaps the exception of sort.e. There would be hardly any point in using goto there anyway. 2/The interpreter is made of a few source files maintained by a few programmers. That selected group may decide anything that helps keep it cohesive. In both cases, there is no reason to apply the same strategy to general code. CChris -= B E G I N =- X-EUFORUM: 21784 Date: 2008 May 28 15:35 From: ken mortenson <kenneth_john at y?hoo.co?> Subject: Re: Nested routines Jeremy Cowgar wrote: > How many lines of code have you written Ken? You do the math. Between 500 to 1500 lines a day on average during one seven year period. Much less on average since I started programming in 1975, but still a considerable amount. I have professional experience in over a dozen languages, some working in engineering department at other times in software or service companies. This does not include dialecs of a single language (probably a dozen of basic alone.) I also have hobbiest experience in another dozen languages (I include Euphoria in this catagory.) I speak from real world experience. This doesn't make me right, just well informed. -= B E G I N =- X-EUFORUM: 21785 Date: 2008 May 28 15:40 From: ken mortenson <kenneth_john at ?ahoo.c?m> Subject: Re: goto: it's conceded Matt Lewis wrote: > Indeed MMV, though it goes by a different name, using routine_id and > call_proc/call_func. See execute.e in the euphoria source directory for > an example of how this can be reasonably used. Also, I'd point out that > ON X GOTO is really similar (just a little less controlled) to a > switch/select/case. I agree. Routine ID's can be used in a very similar way. Call by address from a table has many practical uses. Goto and Gosub however, will never be missed by me. Perhaps because I've maintained code where they have been abused. -= B E G I N =- X-EUFORUM: 21786 Date: 2008 May 28 15:47 From: Jason Gade <jaygade at yahoo?co?> Subject: Re: Nested routines Jeremy Cowgar wrote: > > ken mortenson wrote: > > > > Two questions. Same answer. Because less is more!!!!!!!!!!!!!! > > > > I agree! Less code I type the better. > > > Imagine how effecient and less complicated your compiler becomes when you > > remove all the unneccessary bells and whistles and just leave the pure and > > clean, unadulterated core. Bells and whistles are for libraries (which are > > optional in a project) while the core should be a finely crafted tool. It's > > one of the main things that attracted me to the language in the first place. > > Imagine how efficient and less complicated your code will be (which you have > to maintain, not the compiler) if the compiler does it's job and provides the > common constructs/functionality necessary for me to do my job (programming) > easily! That's what I look for. If I wanted a bare minimum compiler I'd go with > whitespace or something. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I prefer a bare minimum to a kitchen-sink approach. It seems like we've gone from discussing and adding functionality that has been requested and/or generally agreed upon by the community to just adding in any old thing. This beautiful, simple language is starting to suffer from some serious uglification IMV. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21787 Date: 2008 May 28 15:47 From: Jason Gade <jaygade at y?hoo.?om> Subject: Re: goto: it's conceded Gosub is just a named function/procedure call, only more primitive. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21788 Date: 2008 May 28 15:48 From: ken mortenson <kenneth_john at ya??o.com> Subject: Re: Nested routines Jeremy Cowgar wrote: > Imagine how efficient and less complicated your code will be (which you have > to maintain, not the compiler) if the compiler does it's job and provides the > common constructs/functionality necessary for me to do my job (programming) > easily! That's what I look for. If I wanted a bare minimum compiler I'd go with > whitespace or something. Having nested routines isn't a show stopper for me. I never use them, but tastes vary. My objection to this is weaker than for other ideas. My objection is more because of the sharing of vars. which may create the habit of doing the same thing at a higher scope. Practically though, it's not that big an issue to me. I raise my one itty, bitty vote nay, the yays may carry the day. One another note, bloated software happens because many people like the cool ideas and not enough people will stand against (call it apathy if you like) I feel the need to raise objections often just to be on the record. I generally don't regret my record. -= B E G I N =- X-EUFORUM: 21789 Date: 2008 May 28 15:50 From: Jeremy Cowgar <jeremy at cow?ar.co?> Subject: Re: New keyword added: continue Matt Lewis wrote: > > I accept that some view this as insufficient reason for adding goto. I > happen to disagree with them. > I think goto should be added, however, if goto exists and it makes sense to use it in a given situation, then it should be allowed in the standard library. Everyone is afraid of spaghetti code. We can create spaghetti code with or without goto. What stops us from doing so? Hopefully those contributing to Euphoria know how to program w/o spaghetti. Hopefully those peer reviewing commits will recognize spaghetti when it's committed. To say that goto could *possibly* create spaghetti *if* used improperly by a *novice* programmer therefore it should not be allowed in the standard library sounds a bit odd to me. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21790 Date: 2008 May 28 16:04 From: ken mortenson <kenneth_john at ya?oo.c?m> Subject: Re: New keyword added: continue Matt Lewis wrote: > > Goto emulation in these cases can lead to really messy code that's technically > structured code, but the mess of nested ifs and flags can make a giant knot > that could be cut with a well placed goto here and there. Matt, here's something to think about for a moment. If GOTO is so essential, how is it that MILLIONS of programmer, writing BILLIONS of lines of code over DECADES have been able to forgo using it? This is a serious thing to ponder. I admit the adustment to writing structured code is not an easy one, but the rewards (this is just one of many voices of experience) are more than you know. -= B E G I N =- X-EUFORUM: 21791 Date: 2008 May 28 16:06 From: ken mortenson <kenneth_john at yaho?.com> Subject: Re: goto: it's conceded Jason Gade wrote: > > Gosub is just a named function/procedure call Yoda, "This is why you fail..." -= B E G I N =- X-EUFORUM: 21792 Date: 2008 May 28 16:09 From: ken mortenson <kenneth_john at yahoo?c?m> Subject: Re: Nested routines Jason Gade wrote: > I prefer a bare minimum to a kitchen-sink approach. > > It seems like we've gone from discussing and adding functionality that has been > requested and/or generally agreed upon by the community to just adding in any > old thing. > > This beautiful, simple language is starting to suffer from some serious uglification > IMV. Version 5 may turn out to be a gutting of version 4. Einstein said, "keep everything as simple as possible, but no simpler" or something to that effect. Some people have a profound appreciation for this idea, but it's not unexpected that most don't. GACT - life itself is a simple as possible. GAC - too simple! -= B E G I N =- X-EUFORUM: 21793 Date: 2008 May 28 16:12 From: Jason Gade <jaygade at y?ho?.com> Subject: Re: goto: it's conceded ken mortenson wrote: > > Jason Gade wrote: > > > > Gosub is just a named function/procedure call > > Yoda, "This is why you fail..." Sorry, poor phrasing on my part. "A function or procedure call is just a named gosub." That's why they're called "subroutines" and they have "return" statements. Of course, subroutines existed before gosub. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21794 Date: 2008 May 28 16:45 From: Jeremy Cowgar <jeremy at ?owgar.c?m> Subject: Re: Nested routines ken mortenson wrote: > > Version 5 may turn out to be a gutting of version 4. > Ken, I will finish up my line of questioning with an observation that may be true or false, it may be implied or not. You speak to others as though the are immature and as though you have been enlightened by the programming gods. There are many very intelligent people here on EUforum who have vast amounts of professional programming experience who have studied language design who have programmed millions of lines of code and finally who are not dumb. The way you speak is condescending and irritating to many people. You have said such things as: "but the rewards (this is just one of many voices of experience) are more than you know." "With all due respect, this is incorrect." "Back in the day, I thought I could never live without ON X GOTO, as well as ON X GOSUB. I have matured quite a bit since then." "This isn't the only problem related to GOTO's but it is perhaps the easiest to perceive." "A programmer after my own heart (soon you will achieve oneness...)" "I am but a simple and humble servant to whatever is true." And those are just from your most recent posts. I didn't want to spend all day picking all of them out. So, I am not complaining, rebuking or upset, I am merely letting you know that your style of speaking is not helping your cause. In addition to this, please when making a statement provide information to back it up. I do not wish to go back and pick out more quotes, but statements such as "that's ugly", "it's bad practice", "..." says who? Can you give examples? Can you prove your point? An opinion is not worth much in today's world. Please provide real content. I will leave this subject now and continue on with improving Euphoria for the masses. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21795 Date: 2008 May 28 16:54 From: Jeremy Cowgar <jeremy at cowgar??om> Subject: Re: Nested routines Jason Gade wrote: > > > I prefer a bare minimum to a kitchen-sink approach. > > It seems like we've gone from discussing and adding functionality that has been > requested and/or generally agreed upon by the community to just adding in any > old thing. > Jason, I would like to point out that everything that has been added has been discussed, with the exception of the entry keyword, which was a carry over from a merge. At that, the entry keyword is being discussed currently because people are questioning it as they saw in the peer reviewing that is continuously going on during svn commits. Euphoria 4.0 has not yet hit an alpha stage and even during the alpha stage the keywords, constructs and API are free to change. The current discussion about nested routines, OO, etc... are just that, they are very, very pre-even thinking about adding, discussions to see what people think of those constructs. > This beautiful, simple language is starting to suffer from some serious > uglification IMV. > Can you be a little more precise on what additions to Euphoria in 4.0 you think are ugly so we can re-evaluate them? If they are currently being discussed, please let those out as discussions are already going on. If they have not yet been added, please leave those out as they are also being discussed already. I am speaking of what has been added or has been approved to be added? The list can be seen: http://sourceforge.net/mailarchive/message.php?msg_name=4831C95F.709%40cowgar.com To keep things in order and the discussions able to be followed, for each issue that you wish to discuss, can you start a new thread for? Thank you. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21796 Date: 2008 May 28 17:12 From: Jason Gade <jaygade at ya?oo.co?> Subject: Re: Nested routines Jeremy, I've already discussed some of the things that I don't like, and now new ones come up. While I consider myself one of the minimalists here, and as something of an amateur I certainly can't compete with others' professional education and experience, I'm not against every single feature that has been considered and added. Only a few of them. What's frustrating to me is that just when it seems like we've come to an agreement on one contentious issue we get, "oh, one more thing..." Maybe I'm just grousing/ranting. *shrug* I've obviously had as much luck arguing what I like/don't like with regards to additions as I did when trying to argue to have Euphoria added to the Shootout. So I should just STFU and code, but when I see yet another proposal it just sets my teeth on edge. I realize that sometimes there's a line between being an obstructionist for the cause of creating obstructions, and being an obstructionist when you see things taking a tack that is adding stuff to the language "just because". -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21797 Date: 2008 May 28 17:12 From: Jason Gade <jaygade at yaho?.?om> Subject: Re: Nested routines Jeremy Cowgar wrote: > > Jason Gade wrote: > The current discussion about nested routines, OO, etc... are just that, they > are very, very pre-even thinking about adding, discussions to see what people > think of those constructs. Sorry, if we're just discussing, then I'm just adding my 2c to the discussion then, and trying to explain where I'm coming from. Sometimes the discussions tend to turn into steamrollers though. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21798 Date: 2008 May 28 17:22 From: Jeremy Cowgar <jeremy at cowga?.c?m> Subject: Re: Nested routines Jason Gade wrote: > > What's frustrating to me is that just when it seems like we've come to an agreement > on one contentious issue we get, "oh, one more thing..." > I understand. That's one reason the email was created about organizing 4.0 which lists what will be added to it. It was just a view but I think it has common acceptance. Right now, however, it seems with the idea of 4.0 everyone has on their thinking caps and while their thinking caps are on, discussions might as well roll. 4.0 alpha is not too far away. Not as much as many people think has been added to 4.0, but 4.0 is going to be one nice new release. In 4.0 are many items that have been on SF.net or EUwiki in the request areas for a long time. > > So I should just STFU and code, but when I see yet another proposal it just > sets my teeth on edge. I realize that sometimes there's a line between being > an obstructionist for the cause of creating obstructions, and being an obstructionist > when you see things taking a tack that is adding stuff to the language "just > because". > This is a difficult time for us all. I'm getting tired of discussions as well as many others. We are all itching to have our hands at 4.0. 4.0 is reaching a state that it's worthy to be called 4.0. I am going to start renewed discussion on the Organizing 4.0 thread on the dev list and see what people think about finalizing the 4.0 roadmap. I do not wish to instantly shutoff peoples thinking caps though but 4.0 does need to come to some type of conclusion. There is an outstanding vote that needs to be made about namespaces/overriding, the idea of a select/switch statement that has not been discussed to much, other than that, I think 4.0 alpha is almost ready. Some more unit tests, a few known bugs and a bit better of a build system and I think we are ready. During the alpha stages changes can still happen but once we move to beta, the API/functionality will be locked *unless* a bug is found that *requires* an API change to fix. So, bear with us, we're getting close. This has been a long time for us all. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21799 Date: 2008 May 28 17:26 From: c.k.lester <euphoric at ckl?ster.co?> Subject: I Say Euphoria is Awesome... What Do You Say? Jason Gade wrote: > > So I should just STFU and code, but when I see yet another proposal it just > sets my teeth on edge. Jason, I know what you mean. I think we all need to understand that nobody is here to sabotage Euphoria. We all have our opinions as far as what Euphoria should be and do. None of us are enemies and we all fight for a common goal: to make Euphoria the best it can be. Remember that voicing one's own viewpoint is NOT putting another one down. It is simply presenting that viewpoint for discussion and analysis. And calling names never gets one anywhere. While jeremy finds ken's style of communication grating, I do not (yet!). In fact, I think ken has a lot to offer Euphoria. Likewise, jeremy has already proven that he is a very capable coder (and manager, even!*). Looks like they're going to bump heads, but hopefully they'll both understand that they're on the same team. ;) * Yes, you can put that as a reference on your resume. :P -= B E G I N =- X-EUFORUM: 21800 Date: 2008 May 28 17:30 From: c.k.lester <euphoric at cklest??.com> Subject: Re: Nested routines Jeremy Cowgar wrote: > > This is a difficult time for us all. I'm getting tired of discussions as well > as many others. We are all itching to have our hands at 4.0. 4.0 is reaching > a state that it's worthy to be called 4.0. ... > I do not wish to instantly shutoff peoples thinking caps... Jeremy, you've done an excellent job so far. A+++. Would hire again. :D It's great to see you, Matt, DerekP, CChris, and other gurus involved in improving the interpreter (I just wish Rob would speak up more, but I know he had family engagements recently). Keep it up, and let's get to 4.0 Release! -= B E G I N =- X-EUFORUM: 21801 Date: 2008 May 28 17:31 From: Jason Gade <jaygade at yaho?.com> Subject: Re: I Say Euphoria is Awesome... What Do You Say? Yes, I say it's awesome. Sorry for the rant. I actually made some progress last night on my Digital Mars C target, after leaving it sit dormant for months. I may be about halfway done or so. I've got the library and the executables to compile, next I need to fix the linking and then see whether it will run. Then I want to work on larger file support which I only have a small clue about. So I'm slowly getting into the swing of things. Heh, unfortunately it looks like most of the changes I'm making are in the C code... -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21802 Date: 2008 May 28 18:12 From: Matt Lewis <matthewwalkerlewis at gmail??om> Subject: Re: New keyword added: continue ken mortenson wrote: > > Matt Lewis wrote: > > > > Goto emulation in these cases can lead to really messy code that's technically > > structured code, but the mess of nested ifs and flags can make a giant knot > > that could be cut with a well placed goto here and there. > > Matt, here's something to think about for a moment. If GOTO is so essential, > how is it that MILLIONS of programmer, writing BILLIONS of lines of code > over DECADES have been able to forgo using it? This is a serious thing to > ponder. Yes, lot's of code has been written without using $language_feature. It does not follow that $language_feature is superfluous. > I admit the adjustment to writing structured code is not an easy one, but the > rewards (this is just one of many voices of experience) are more than you > know. This statement makes even less sense than the one before. Are you sure that you meant to respond to me? Matt -= B E G I N =- X-EUFORUM: 21803 Date: 2008 May 28 18:12 From: c.k.lester <euphoric at cklester.c?m> Subject: Re: I Say Euphoria is Awesome... What Do You Say? Jason Gade wrote: > > Yes, I say it's awesome. > > Sorry for the rant. No apologies necessary. I don't mind rants. :) -= B E G I N =- X-EUFORUM: 21804 Date: 2008 May 28 18:33 From: ken mortenson <kenneth_john at ya?oo.co?> Subject: Re: I Say Euphoria is Awesome... What Do You Say? c.k.lester wrote: > * Yes, you can put that as a reference on your resume. :P Thanks for the smile. I needed it. -= B E G I N =- X-EUFORUM: 21805 Date: 2008 May 28 18:53 From: ken mortenson <kenneth_john at yah??.com> Subject: Ken's abrasiveness Jeremy Cowgar wrote: > > ken mortenson wrote: > > > > Version 5 may turn out to be a gutting of version 4. To understand this comment you must understand it only applies in a world I wished I lived in. This is not the real world and I have no expectation it will happen. Euphoria was a glimmer of hope for me. Hope fades. One man wrote Euphoria. My expectation is that a committee seldom has as clear a vision. I'm sorry if this sounds so negative. If fact, I am a hopeful person (overly, it often turns out.) > Ken, > > You speak to others as though the are immature and as though you have been > enlightened by the programming gods. Actually, I'm only half god on my fathers side. ;-) Ok, maybe humor isn't an appropriate response. Everybody (I am included in the set of everybody) is more or less immature. Maturity is far off in the distance with regard to humanity. That's a declarative statement with no support offered. I do that. A lot. It's abrasive. I don't want to offend. Maturity on my part would suggest I hold my tongue more often (no matter if I am right or wrong.) Probably my enthusiasm for being part of a social group is a bit too much. Now the other side of the coin. Am I enlightened. I would hope so, aren't you? If the lightbulbs never went off we'd all still be stratching cave paintings (which would be sad for me since I really have no artistic ability whatsoever.) I state my opinions in a direct manner. I do not hold myself above others. Let me repeat that because it seems to get lost somehow... I. DO. NOT. HOLD. MY. SELF. ABOVE. OTHERS. Yes, I may give the impression. Let's say I do give that impression. The impression is not the reality. > There are many very intelligent people here on EUforum You believe I don't appreciate that??? Then I'm sorry. Because it is my appreciation which is at issue I can categorically assert this to be false. > who have vast amounts of professional programming experience who have > studied language design who have programmed millions of lines of code > and finally who are not dumb. Again. Why do you think I don't know this? I assume the answer is in my speech patterns. There is room for give and take on both our parts. > The way you speak is condescending and irritating to many people. I can only plead that it is not meant to be so. But I understand the perception. > You have said such things as: > > "but the rewards (this is just one of many voices of experience) are > more than you know." I stand by this statement. People that have not experienced GOTOLESS programming (and it may take years) lack the appreciation for the experience. I've never done drugs. I know some who have. When they tell me I lack appreciation for the experience I am forced to agree. If I tell you that you lack an experience which you do in fact lack. You can say I'm being derogatory (which is an immature response) or you can accept the observation as a simple observation. I've never been able to water ski. Should I feel I am less than people that can? Should you or anybody else? If anyone feels picked on when there is ABSOLUTELY NO INTENT to do so, then perhaps my response should be... BOO FREAKIN HOO. Because frankly there is a part of me that says, this isn't entirely my issue. > > "With all due respect, this is incorrect." You're right. I should have left the due respect part off, because obviously it was dismissed by those that read it. Do you appreciate that 'this is incorrect' is an opinion? Am I not entitled? > "Back in the day, I thought I could never live without ON X GOTO, as well as > ON X GOSUB. I have matured quite a bit since then." I would hope that after thirty years in a profession everybody could assert this last assertion. I certainly wouldn't hold it against you if you made the assertion about yourself. > "This isn't the only problem related to GOTO's but it is perhaps the easiest > to perceive." Some people imagine that GOTOs are not a problem because they use them and are comfortable with them. Not to pick on Kat, but my comment about equivalent code is an example of how easy it is to perceive the problem. Granted her focus was on labeling, but I can't help but notice that eleven out of twelve code groups could never be reached. Perhaps I'm an ass for pointing that out. This is what makes it easier to perceive than other equally damaging issues. > > "A programmer after my own heart (soon you will achieve oneness...)" This is humor that obviously fell flat. > "I am but a simple and humble servant to whatever is true." You have no idea (be offended if you like because I'm so wound up at this point that I no longer care) but I really do feel that striving for truth is a noble goal. I wish we all could hold such a goal dear. > So, I am not complaining, rebuking or upset, I am merely letting you know that > your style of speaking is not helping your cause. I'll take you at your word. In this case, I am certain that you are right. I hope you will wish me to overcome those aspects of my (lack of) communication skills that prompt your comments. > In addition to this, please > when making a statement provide information to back it up. I do not wish to > go back and pick out more quotes, but statements such as "that's ugly", "it's > bad practice", "..." says who? Can you give examples? Can you prove your point? > An opinion is not worth much in today's world. Please provide real content. A good observation. I do have a habit of stating unsubstantiated opinion. I do have support for what I say, but I am not so organized and my memory often fails me. For example you may note that I made a post which concedes that Euphoria can be coded in a finely granular modular way. My experience is that without a development environment that is supportive it, it fails as practical matter. This is an important issue for me, because I want a productivity tool and I'm tired of the limitations VB imposes on me. I'm going to take a break from posting. I have hopes that I expect will never be realized. If I had the skill, I would write the compiler I envision. Sadly, I know that I don't possess this skill at this time. Please, don't miss the fact that I have a high regard for the people on this forum. Is enlightenment so rare that none of us are allowed glimpses of it? I'm going to leave it at that. I'm not sure I've said what I need to say, but language is such an imperfect thing anyway. I only hate evil people. I've met evil. None of you fit into that category. Warm regards, ken. -= B E G I N =- X-EUFORUM: 21806 Date: 2008 May 28 20:01 From: Matt Lewis <matthewwalkerlewis at g?ail.c?m> Subject: Re: Ken's abrasiveness ken mortenson wrote: > > For example you may note that I made a post which concedes that Euphoria > can be coded in a finely granular modular way. My experience is that > without a development environment that is supportive it, it fails as > practical matter. This is an important issue for me, because I want a > productivity tool and I'm tired of the limitations VB imposes on me. I'd make a similar note about VB. It's certainly possible to code in a modular fashion, but most of the VB code I've encountered is far worse in this aspect than the euphoria code I've encountered. I'm sure some of the tension that some have noted is based on the fact that you only recently started participating in the community, which I tend to think of as a pretty tight knit group that's generally really good at welcoming newcomers, but not so much when what are probably questions about how euphoria works come across as criticism, both of the language and of the participants (regardless of the intent). In part, it's difficult to imagine someone having such strong opinions about how the language functions when he clearly has very little experience with it. Granted, having lots of outside experience can help those opinions, but your remarks still seemed to show a fair amount of ignorance with respect to euphoria. I'd challenge you to find a forum that does a better job at integrating new members, but it usually takes some work on the part of the new members, too. Matt -= B E G I N =- X-EUFORUM: 21807 Date: 2008 May 28 20:23 From: Kat <KAT12 at co?sahs.ne?> Subject: Re: Ken's abrasiveness Matt Lewis wrote: > > ken mortenson wrote: > > > > For example you may note that I made a post which concedes that Euphoria > > can be coded in a finely granular modular way. My experience is that > > without a development environment that is supportive it, it fails as > > practical matter. This is an important issue for me, because I want a > > productivity tool and I'm tired of the limitations VB imposes on me. > > I'd make a similar note about VB. It's certainly possible to code in a > modular fashion, but most of the VB code I've encountered is far worse in > this aspect than the euphoria code I've encountered. > > I'm sure some of the tension that some have noted is based on the fact that > you only recently started participating in the community, which I tend to > think of as a pretty tight knit group that's generally really good at > welcoming newcomers, but not so much when what are probably questions about > how euphoria works come across as criticism, both of the language and of > the participants (regardless of the intent). > > In part, it's difficult to imagine someone having such strong opinions about > how the language functions when he clearly has very little experience with > it. Granted, having lots of outside experience can help those opinions, > but your remarks still seemed to show a fair amount of ignorance with > respect to euphoria. I'd challenge you to find a forum that does a better > job at integrating new members, but it usually takes some work on the > part of the new members, too. Yea, you can't just stroll in here, spend 10 years coding in Euphoria, and ask for things to change! Don't expect you'll get nested routines like you asked for the first month you were here, or goto, or case/switch, or 64bit integers, or 8bit string types, or multiple inheritance in classes, or eval() / string execution, or "reverse" name resolution, or the latest OS's 64bit function calls, or a real debugger that can edit the variable's values, or anything else. If they ever do arrive, they'll be because someone else thought of them. And with only 10 years experience in using Eu, expect your code to be called carp, even if it's being used and was the only *working* code of it's type when you wrote it! And can't just say things you think are obvious, you *must* justify to the most excruciating details all facts anyone can think of to ask about, to back up your statements, over and over and over again, for years, and to do so will make you an irritant, troublemaker,, you won't be tenacious, you'll be stubborn. So welcome to Euphoria, Ken! Put on a manic clown face like CK's (not that he is a manic clown, i did not say that) so you'll be well liked, and be prepared to wait forever for requested features. Yes, Euphoria is better than most languages, but it still has holes in it. Just sit back and take what you are given, don't rock the boat. Kat -= B E G I N =- X-EUFORUM: 21808 Date: 2008 May 28 20:30 From: Bernie Ryan <xotron at bluefr?g.?om> Subject: forward reference When a user wants to create a forward reference in Euphoria; why can't the user give a description of a function/procedure at the top of their program. <eucode> function foo(sequence bar) end function </eucode> Then the scanner could create a dummy entry in the symbol table as a holding place and target for any forward reference. When this function name is encountered and there is code between the ')' and 'end' tokens then the symbol table entry could be modified into a real symbol table entry. This could be done without having to change to a multipass scanner. Could this be done ? Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21809 Date: 2008 May 28 20:35 From: c.k.lester <euphoric at ckle?ter.c?m> Subject: Re: Ken's abrasiveness Kat wrote: > > ...expect your code to be called carp That's fishy. > Put on a manic clown face like CK's (not that he > is a manic clown, i did not say that) so you'll be well liked... I don't know whether to be insulted or what. > Yes, Euphoria is better than most languages, > but it still has holes in it. Just sit back and take what you are given, don't > rock the boat. Yes, sit back and wait for version 8.0! It's going to knock your sock off!!! -= B E G I N =- X-EUFORUM: 21810 Date: 2008 May 28 20:39 From: Matt Lewis <matthewwalkerlewis at gmail.c??> Subject: Re: Ken's abrasiveness Kat, I respect you, and I rarely raise to answer rants like this, but here goes... Kat wrote: > > Yea, you can't just stroll in here, spend 10 years coding in Euphoria, and > ask for things to change! Don't expect you'll get nested routines like you > asked for the first month you were here, or goto, or case/switch, or 64bit > integers, or 8bit string types, or multiple inheritance in classes, or > eval() / string execution, or "reverse" name resolution, or the latest > OS's 64bit function calls, or a real debugger that can edit the variable's > values, or anything else. If they ever do arrive, they'll be because > someone else thought of them. It hasn't been that long since euphoria's been open source. There still aren't many people who understand how to change things, especially in the back end. Some of these things aren't trivial, maybe aren't even possible without a full rewrite. I think everyone could cite an example of where their favorite feature has been rejected by the community. > And with only 10 years experience in using Eu, expect your code to be > called carp, even if it's being used and was the only *working* code of > it's type when you wrote it! I think this is simply part of releasing anything, and communicating with people on the internet. I'm not a big penny arcade fan, but they got this one absolutely right: http://www.penny-arcade.com/comic/2004/03/19/ > And can't just say things you think are obvious, you *must* justify to the > most excruciating details all facts anyone can think of to ask about, to > back up your statements, over and over and over again, for years, and to > do so will make you an irritant, troublemaker, you won't be tenacious, > you'll be stubborn. Hey, we're programmers, which means we're a bunch of pedantic detail freaks with strong opinions about everything. It turns out that most of the folks around here disagree with you on that particular issue. > So welcome to Euphoria, Ken! Put on a manic clown face like CK's (not that > he is a manic clown, i did not say that) so you'll be well liked, and be > prepared to wait forever for requested features. Yes, Euphoria is better > than most languages, but it still has holes in it. Just sit back and take > what you are given, don't rock the boat. The problem is we can't even agree on which are holes, or how big they are. Matt -= B E G I N =- X-EUFORUM: 21811 Date: 2008 May 28 21:40 From: irv mullins <irvm at ellij?y?com> Subject: Re: eu 4.0 Jeremy Cowgar wrote: > > irv mullins wrote: > > > > > > I got it from this weird guy's website. Maybe you've heard of him :) > > > > <a href="http://jeremy.cowgar.com/files/eu40.tar.gz">http://jeremy.cowgar.com/files/eu40.tar.gz</a> > 23-May-2008 17:20 3.1M</font></i> > > You downloaded from him? Wow, now we all know your crazy! :-) > > Anyway, that's the same binary (well, w/in a few revisions of) from the tests > that I showed here. Can you give us an example that's messing up on you? > Yes, actually about 11,000 warnings were being generated. Something to do with the difference in the way includes are handled between 3.1 and 4.0. I've fixed those in my eugtk code. There are still some 'interesting' developments. More on those later. -= B E G I N =- X-EUFORUM: 21812 Date: 2008 May 28 21:43 From: Matt Lewis <matthewwalkerlewis at g?ai?.com> Subject: Re: eu 4.0 irv mullins wrote: > > Jeremy Cowgar wrote: > > > > Anyway, that's the same binary (well, w/in a few revisions of) from the tests > > that I showed here. Can you give us an example that's messing up on you? > > > Yes, actually about 11,000 warnings were being generated. Something > to do with the difference in the way includes are handled between 3.1 and 4.0. That would explain the slow down. The issue is that you were using something from a file that wasn't directly or indirectly included from the file using the symbols. Matt -= B E G I N =- X-EUFORUM: 21813 Date: 2008 May 28 21:52 From: Jeremy Cowgar <jeremy at c?wg?r.com> Subject: Re: eu 4.0 irv mullins wrote: > > Yes, actually about 11,000 warnings were being generated. Something > to do with the difference in the way includes are handled between 3.1 and 4.0. > > I've fixed those in my eugtk code. > Did that fix anything in regards to speed? > There are still some 'interesting' developments. More on those later. I hate to say this, but it's good you are doing this. It is giving us an opportunity to see what a large project is going to do with 4.0. Euphoria has a new wiki, it's not official yet, but I wonder if you would be so kind to add to a wiki page I've created: http://openeuphoria.org/wiki/euwiki.cgi?MigratingTo40 The reason it is not official yet is the parsing engine is a bit sensitive to correct syntax. You can goof it up if you try, which should not be so. Soon I will announce its official use, but while things are fresh in your mind, please document the changes there if you do not mind. That goes for everyone else as well. Thanks! -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21814 Date: 2008 May 28 21:54 From: don cole <doncole at pacb?ll.?et> Subject: Re: goto: it's conceded gshingles wrote: > > ken mortenson wrote: > > --8<-- > > This isn't the only problem related to GOTO's but it is perhaps the easiest > > to perceive. > > One word (or maybe two): > > GOSUB procedure GOSUB() > > ;-) > > Gary Don Cole -= B E G I N =- X-EUFORUM: 21815 Date: 2008 May 28 21:58 From: Jason Gade <jaygade at yaho?.com> Subject: Re: goto: it's conceded don cole wrote: > > gshingles wrote: > > > > ken mortenson wrote: > > > --8<-- > > > This isn't the only problem related to GOTO's but it is perhaps the easiest > > > to perceive. > > > > One word (or maybe two): > > > > GOSUB > > procedure GOSUB() > > > > ;-) > > > > Gary > > > Don Cole You are a bad, bad man, Don. :-) -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21816 Date: 2008 May 28 22:22 From: Kat <KAT12 at co?s?hs.net> Subject: Re: Ken's abrasiveness Matt Lewis wrote: > > > Kat, I respect you, and I rarely raise to answer rants like this, but here > goes... > > Kat wrote: > > > > Yea, you can't just stroll in here, spend 10 years coding in Euphoria, and > > ask for things to change! Don't expect you'll get nested routines like you > > asked for the first month you were here, or goto, or case/switch, or 64bit > > integers, or 8bit string types, or multiple inheritance in classes, or > > eval() / string execution, or "reverse" name resolution, or the latest > > OS's 64bit function calls, or a real debugger that can edit the variable's > > values, or anything else. If they ever do arrive, they'll be because > > someone else thought of them. > > It hasn't been that long since euphoria's been open source. There still > aren't many people who understand how to change things, especially in the > back end. Some of these things aren't trivial, maybe aren't even possible > without a full rewrite. I think everyone could cite an example of where > their favorite feature has been rejected by the community. I feel like *all* of my suggestions were rejected over the years. Even from the start, with string types, nesting procedures, and a debugger that can change the var's values. And of course, goto. And string execution. and sheesh, the brick wall i ran into with strings at all, right down to "why would you want to parse a string?, you don't want Euphoria for that!, go back to mirc and pascal!". Just comparing Eu to the most used capabilities of Mirc and Turbo Pascal would show features Eu could use to be more versatile! <snip> > Hey, we're programmers, which means we're a bunch of pedantic detail freaks > with strong opinions about everything. It turns out that most of the folks > around here disagree with you on that particular issue. Which particular issue?, because i see obstacles (humans) in front of *every* issue. Even me making eunet http functions threadsafe! I know someone will do it, and maybe they will even lift the code i did eubot with, just like i was going to do, but it's not acceptable for ME to do it, so i quit working on it. So i won't be releasing the next strtok.e either, let CK do it the "true euphorian" way. > > So welcome to Euphoria, Ken! Put on a manic clown face like CK's (not that > > he is a manic clown, i did not say that) so you'll be well liked, and be > > prepared to wait forever for requested features. Yes, Euphoria is better > > than most languages, but it still has holes in it. Just sit back and take > > what you are given, don't rock the boat. > > The problem is we can't even agree on which are holes, or how big they are. Oh come on! One look at the offshoots of Eu over the years should demo the huge holes Eu has, starting with OOEU, then Bach, way back to the stuff David Cuny did, all those preprocessors and parsers, etc.. RDS said they'd be happy if someone did a debugger in a gui way, so you did one, and it wasn't jumped on! IIRC, someone did a gui debugger in another programming language once too. It's extremely disappointing. Instead of "yes, you can do that in Eu", you get "i wonder if that can be done in Eu." Other languages are starting up with some form of unicode built in, but despite being asked for in Eu, it's a debate as to if it's worthwhile?? How arrogantly american to tell all the rest of the world to 7bit ascii-zise their languages or get lost! I figure this is my last rant, i am tired of wasting my breath and time. Kat -= B E G I N =- X-EUFORUM: 21817 Date: 2008 May 28 22:28 From: ChrisBurch3 <crylex at g?ai?.com> Subject: Re: eu 4.0 Euphoria has a wiki? Wow. Nice. Any chance of a forum? (Or arranging threads on the list by date last posted)? Chris -= B E G I N =- X-EUFORUM: 21818 Date: 2008 May 28 22:32 From: Mike <vulcan at wi?.?o.nz> Subject: Re: forward reference Bernie Ryan wrote: > > > When a user wants to create a forward reference in Euphoria; > > why can't the user give a description of a function/procedure > > at the top of their program. > > <eucode> > > function foo(sequence bar) end function > > </eucode> > > Then the scanner could create a dummy entry in the symbol table > > as a holding place and target for any forward reference. > > When this function name is encountered and there is code between the ')' > > and 'end' tokens then the symbol table entry could be modified into > > a real symbol table entry. > > This could be done without having to change to a multipass scanner. > > Could this be done ? > > Bernie Absolutely. It has already been implemented in CChris' AE interpreter using this syntax: <eucode> forward function foo(sequence bar) </eucode> However, although good, this is still not ideal because: 1) the user has to add this extra line whenever they think a new routine might be forward. 2) locals override globals so a routine (near the end of a file) that is promoted to "forward" this way could unknowingly override a global of the same name that is referenced earlier in the file. Whereas, normal routines will only override globals from their declaration position. 3) it doesn't solve the issue of references in mutually including files unless you're willing to manage literally truckloads of global forward declarations. In Orac, routine calls can be made anywhere inside a file and outside a file when, say, mutually including files exist. It can do this because Orac is a multi-pass system. Until Euphoria becomes the same, this problem of forward references will persist. Everyone knows it but hardly anyone talks about it. Forward references are one of the most important improvements that could be made to the language but it would require rewriting fundamental parts of the parser. Who can save us? regards, Mike -= B E G I N =- X-EUFORUM: 21819 Date: 2008 May 28 22:32 From: Jeremy Cowgar <jeremy at co?g?r.com> Subject: Re: eu 4.0 ChrisBurch3 wrote: > > Euphoria has a wiki? Wow. Nice. > > Any chance of a forum? (Or arranging threads on the list by date last posted)? > Sure: http://www.openeuphoria.org/EUforum/threads.html :-D -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21820 Date: 2008 May 28 23:06 From: gshingles <gshingles at gma?l.com> Subject: Re: goto: it's conceded ken mortenson wrote: > > > One word (or maybe two): > > > > GOSUB > > Well, that's terse. Let me add a few more. Back in the day, I thought I > could never live without ON X GOTO, as well as ON X GOSUB. I have matured > quite a bit since then. The idea of using any of these four today is > physically loathesome to me. Not to offend, but for a HLL to include these > would make it a toy language not suitable for serious development. YMMV. Yes, I wasn't being serious. Your excellent treatise on the evils of spaghetti code took me back to the days when I wrote a rather large drawing program in a version of BASIC on my CP/M computer (Microbee 256TC). No mouse. I encountered all of the problems you mentioned using GOTO, so I gradually started using GOSUB thinking that might alleviate some of those shortcomings since you didn't need to know which line to GOTO back to. That's when I first learned what a stack overflow was :-) Gary -= B E G I N =- X-EUFORUM: 21821 Date: 2008 May 29 0:12 From: ken mortenson <kenneth_john at yah?o?com> Subject: Those were the days my friend gshingles wrote: > I encountered all of the problems you mentioned using GOTO, so I gradually started using GOSUB > thinking that might alleviate some of those shortcomings since you didn't need to know which > line to GOTO back to. That's when I first learned what a stack overflow was :-) My little RCA 1802 computer with it's toggle switchs and hex keypad had so little memory that some of a program would be stored in video memory. You could actually watch the bits flip as the program was run. -= B E G I N =- X-EUFORUM: 21822 Date: 2008 May 29 0:37 From: ken mortenson <kenneth_john at yahoo??om> Subject: Re: Ken's abrasiveness Matt Lewis wrote: > your remarks still seemed to show a fair amount of ignorance I only hope that you will be kind enough to point out my ignorance when it is on display (rather than claiming me ignorant without evidence that I might then have the opportunity to refute.) I'm afraid I can't reciprocate, because that would be abrasive. So I won't mention the 3 points of ignorance you displayed in this post. -= B E G I N =- X-EUFORUM: 21823 Date: 2008 May 29 0:41 From: Derek Parnell <ddparnell at bi?pond.c?m> Subject: Re: forward reference Mike wrote: > Forward references are one of the most important improvements that could be > made to the language I'm pretty sure we will not see forward referencing in v4.0, but I would not discount it appearing soon after that. There is a lot of discussion to take place before forward referencing could happen and the timetable for v4.0 wouldn't allow it. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21824 Date: 2008 May 29 1:03 From: irv mullins <irvm at el?ijay?com> Subject: Re: Those were the days my friend ken mortenson wrote: > My little RCA 1802 computer with it's toggle switchs and hex keypad had so > little memory that some of a program would be stored in video memory. You > could actually watch the bits flip as the program was run. But it had enough that we used it to control our enlarger in the photolab for several years. Whole program was 0045 bytes (hex), and had to be typed in now and then. Had it memorized. The program is still on the web :) -= B E G I N =- X-EUFORUM: 21825 Date: 2008 May 29 1:07 From: Matt Lewis <matthewwalkerlewis at g?ail.?om> Subject: Re: Ken's abrasiveness ken mortenson wrote: > > Matt Lewis wrote: > > your remarks still seemed to show a fair amount of ignorance > > I only hope that you will be kind enough to point out my ignorance when > it is on display (rather than claiming me ignorant without evidence that > I might then have the opportunity to refute.) First, I'd like to commend you on that edit, where you left out the last part: "with respect to euphoria." Please note that I'm not trying to be pejorative when I say ignorance. Just pointing out that by your comments, my impression is that of someone not overly familiar with the language. I'd also say that this is the right place to get answers to any questions you might have. Looking at your recent posting history: >> rid_dbOpen has a value of 2, which seems a little odd to me unless >> part of some vector table, but I don't know the internals of Euphoria. >> Namespaces can be used to hide globals of included files if I understand the >> discussion I've read so far in the other threads. This next example is really identical to a for statement: <eucode> for Index = 7 to -14.2 by -1.2 -- ... end for </eucode> >> I wouldn't be adverse to an optional from/by >> Loop from 7 by -1.2 >> if (Index<-14.2) exit >> End Loop Most code I've encountered follow this rule: >> Most functions and variables should not be public and their scope should >> be limited to the file they are declared in. > I'm afraid I can't reciprocate, because that would be abrasive. So I won't > mention the 3 points of ignorance you displayed in this post. Guess I'll be left in bliss, then. :) Matt -= B E G I N =- X-EUFORUM: 21826 Date: 2008 May 29 1:12 From: Jerry Story <story.jerry at g?ail?com> Subject: [OT] it's vs its English lesson: Some people use "it's" when they mean "its". "it's" is a contraction for "it is". "its" is possessive. All these websites explain it's vs its: http://www.cgl.uwaterloo.ca/~csk/its.html http://www.stormloader.com/garyes/its/#top http://www.fred.net/kathy/its.html http://web.uvic.ca/wguide/Pages/UsIts.html http://grammar.ccc.commnet.edu/grammar/cgi-shl/quiz.pl/its_there_quiz.htm http://www.learnenglish.org.uk/games/punctuation-game/its/its.html http://www.gcse.com/english/its_confused.htm -= B E G I N =- X-EUFORUM: 21827 Date: 2008 May 29 1:12 Subject: Liquid Solder From: eltronic at juno.com http://www.amazon.com/Permatex-25906-Liquid-Solder-Tube/dp/B000HBM2ZI a tube from them would cost $1.88 + 6.56 shiping permatex makes it so any auto store may have it or can get it -= B E G I N =- X-EUFORUM: 21828 Date: 2008 May 29 1:17 From: Jeremy Cowgar <jeremy at cowg?r.com> Subject: Re: [OT] it's vs its Jerry Story wrote: > > English lesson: > Some people use "it's" when they mean "its". > "it's" is a contraction for "it is". > "its" is possessive. > I've been hounded on IRC about it too :-) I'll learn some day. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21829 Date: 2008 May 29 1:32 From: ken mortenson <kenneth_john at yaho??com> Subject: Re: Ken's abrasiveness Matt Lewis wrote: > Looking at your recent posting history: > > >> rid_dbOpen has a value of 2, which seems a little odd to me unless > >> part of some vector table, but I don't know the internals of Euphoria. Turns out the 2 was from a vector table only in the PowerBASIC DLL. Heck of a good intuition for someone so ignorant. > >> Namespaces can be used to hide globals of included files if I understand the > >> discussion I've read so far in the other threads. > > This next example is really identical to a for statement: > <eucode> > for Index = 7 to -14.2 by -1.2 > -- ... > end for > </eucode> > >> I wouldn't be adverse to an optional from/by > >> Loop from 7 by -1.2 > >> if (Index<-14.2) exit > >> End Loop I was discussing an alternate sytax. You are displaying your ignorance here by missing that point. You are also displaying an ignorance of my knowledge in that I uploaded a DOS Euphoria program over two years ago and have since written several WINDOWS Euphoria programs. If you think I'm ignorant of the Euphoria for loop syntax that is another point of your ignorance on display. Finally, it is cowardly of you to claim me ignorant in any respect without providing evidence as I've done in the passage above so that I am at a severe handicap to defend myself. You can believe anything you like about me. I believe that you are no gentleman and a coward. -= B E G I N =- X-EUFORUM: 21830 Date: 2008 May 29 1:38 From: ne1uno <eltronic at lycos.co?> Subject: Re: Liquid Solder hehe hit reply on the wrong msg. resume the Kat fight. your spam filters are still working and nobody buy that solder, I got dibs. but why is the email address not getting munged when it comes from topica? -= B E G I N =- X-EUFORUM: 21831 Date: 2008 May 29 1:56 From: Jeremy Cowgar <jeremy at ?owgar.?om> Subject: Re: Liquid Solder ne1uno wrote: > > hehe > hit reply on the wrong msg. > resume the Kat fight. > your spam filters are still working > and nobody buy that solder, I got dibs. > > but why is the email address not getting munged > when it comes from topica? Ha. I was wondering what's up. I thought spammer, then I clicked the "from" address to see if there were other messages, and it came up with all sorts from you. Rob will have to answer the questions about it not getting munged. Weird. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21832 Date: 2008 May 29 2:22 From: Matt Lewis <matthewwalkerlewis at gm?i?.com> Subject: Re: Ken's abrasiveness ken mortenson wrote: > > Matt Lewis wrote: > > > Looking at your recent posting history: > > > > >> rid_dbOpen has a value of 2, which seems a little odd to me unless > > >> part of some vector table, but I don't know the internals of Euphoria. > > Turns out the 2 was from a vector table only in the PowerBASIC DLL. Heck > of a good intuition for someone so ignorant. ??? Unless we're looking at different things, here was how you got a value for rid_dbOpen: <eucode> atom rid_dbOpen rid_dbOpen = define_c_func(dbSQL, "dbOpen", {C_POINTER}, C_LONG) </eucode> The 2 was returned by define_c_func, which has no knowledge of a vector table in the PowerBASIC DLL. Your intuition was coincidence. > > >> Namespaces can be used to hide globals of included files if I understand the > > >> discussion I've read so far in the other threads. > > > > This next example is really identical to a for statement: > > <eucode> > > for Index = 7 to -14.2 by -1.2 > > -- ... > > end for > > </eucode> > > >> I wouldn't be adverse to an optional from/by > > >> Loop from 7 by -1.2 > > >> if (Index<-14.2) exit > > >> End Loop > > I was discussing an alternate sytax. You are displaying your ignorance > here by missing that point. You are also displaying an ignorance of my > knowledge in that I uploaded a DOS Euphoria program over two years ago > and have since written several WINDOWS Euphoria programs. If you think > I'm ignorant of the Euphoria for loop syntax that is another point of > your ignorance on display. Well, then I guess this was another example of poor communication. You suggested something (that was the entire message, BTW) that was already present in the language. This also coming from the person arguing for parsimonious languages, I connected the dots that you weren't aware of the full for-loop syntax. One irony of your loop philosophy, is that originally, Euphoria didn't have for-loops, because a while loop could do anything a for loop could do. You're right, I didn't look through the submissions archive, just the EuForum archive. > Finally, it is cowardly of you to claim me ignorant in any respect without > providing evidence as I've done in the passage above so that I am at a > severe handicap to defend myself. Why is it cowardly? In the case above, with define_c_func, you proved your ignorance of how that feature of the language works. According to the docs, which I believe someone responded to your original post with a link: "A small integer, i1, known as a routine id, will be returned." This isn't a sin or a faux pas or anything--just a fact. According to wordnet.princeton.edu/perl/webwn, ignorance is defined as: "the lack of knowledge or education" You're certainly not the most lacking in knowledge about the language who participates on this forum, though you make a lot of [admittedly] very assertive claims, both about what euphoria is and isn't, and about general programming. You'll note I didn't say anything about you being ignorant about programming in general. It's interesting [to me] that you construed all of this as a personal attack, especially after making such a big deal about your lack of social graces. To wit: > You can believe anything you like about me. > > I believe that you are no gentleman and a coward. And you are welcome to believe whatever you like. I'm done feeding the trolls. Matt -= B E G I N =- X-EUFORUM: 21833 Date: 2008 May 29 3:04 From: ken mortenson <kenneth_john at ya?oo?com> Subject: Matt's Maturity Matt Lewis wrote: > > Unless we're looking at different things, here was how you got a value for > rid_dbOpen: > <eucode> > atom rid_dbOpen > rid_dbOpen = define_c_func(dbSQL, "dbOpen", {C_POINTER}, C_LONG) > </eucode> > > The 2 was returned by define_c_func, which has no knowledge of a vector > table in the PowerBASIC DLL. Your intuition was coincidence. dbSQL is a PowerBasic DLL. "dbOpen" is the second function defined therein. Are you ignorant of how define_c_func works? My intuition was spot on. Thank you for reinforcing that point. > Well, then I guess this was another example of poor communication. You > suggested something (that was the entire message, BTW) that was already > present in the language. This also coming from the person arguing for > parsimonious languages, I connected the dots that you weren't aware of > the full for-loop syntax. This is reasonable. You should be more careful in your assumptions. > One irony of your loop philosophy, is that originally, Euphoria didn't have > for-loops, because a while loop could do anything a for loop could do. > > You're right, I didn't look through the submissions archive, just the > EuForum archive. > > > Finally, it is cowardly of you to claim me ignorant in any respect without > > providing evidence as I've done in the passage above so that I am at a > > severe handicap to defend myself. > > Why is it cowardly? Because in your original post you made the accusation without support. Only in subsequent post did you provide evidence, but not so I could defend myself but so you could prove how right you were. As I am demonstrating here I am able to defend myself when provided with specific allegations rather than indefensible slurs. To accuse without giving the accused the means of defending themselves is a cowardly act. A mature person knows that. > In the case above, with define_c_func, you proved your > ignorance of how that feature of the language works. As I've already shown above, you are still continuing to show your ignorance about the source of the number while my intution has proved to be entirely correct. This next part is beautiful... > According to the docs, > which I believe someone responded to your original post with a link: > > "A small integer, i1, known as a routine id, will be returned." You read, but without understanding. What is the source of this small integer? Magic? No, it's seems it's from the vector table of the DLL. > It's interesting [to me] that you construed all of this as a personal > attack, especially after making such a big deal about your lack of social > graces. To wit: It was a personal attack. Make no mistake. Calling me a troll is also a personal attack. I've had the decency of explaining to you why it was a cowardly attack. If you were a gentleman you would apologize for doing so (rather than continuing with the troll comments and digging yourself in deeper by continuing to try to prove what I have repeated demonstrated to be wrong.) > > You can believe anything you like about me. > > > > I believe that you are no gentleman and a coward. > > And you are welcome to believe whatever you like. I'm done feeding the > trolls. The ball is now in your court. Your actions define who you are. Notice I'm not calling you names. Calling you a coward is a specific response to your actions and you can prove me wrong with an apology. -= B E G I N =- X-EUFORUM: 21834 Date: 2008 May 29 3:17 From: Jeremy Cowgar <jeremy at c?wgar.co?> Subject: Re: Matt's Maturity Ken, Do you think that the way you speak that you have admitted to has had anything to do with this? The mature thing would have been to admit that you were guilty as well instead of challenging a dual in the streets. The citations that Matt gave I thought as well. Communication face to face is difficult enough let alone over a medium such as this. I know there is no hope what-so-ever for this thread. You should email Matt and settle this off the forums. EUforum has been taxed enough. Please. If you choose to continue on this thread, you may do so, but this will be my last communication about it. You can have the last word in regards to me if you wish. Thank You. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21835 Date: 2008 May 29 3:19 From: Derek Parnell <ddparnell at bigpond.c?m> Subject: Re: Matt's Maturity ken mortenson wrote: > > Matt Lewis wrote: > > > > Unless we're looking at different things, here was how you got a value for > > rid_dbOpen: > > <eucode> > > atom rid_dbOpen > > rid_dbOpen = define_c_func(dbSQL, "dbOpen", {C_POINTER}, C_LONG) > > </eucode> > > > > The 2 was returned by define_c_func, which has no knowledge of a vector > > table in the PowerBASIC DLL. Your intuition was coincidence. > > dbSQL is a PowerBasic DLL. "dbOpen" is the second function defined > therein. Are you ignorant of how define_c_func works? > > My intuition was spot on. Thank you for reinforcing that point. Ken, you are wrong. Matt you are right. Here is the relevent source code from Euphoria .. c_routine[c_routine_next].address = proc_address; c_routine[c_routine_next].name = routine_ptr; c_routine[c_routine_next].arg_size = SEQ_PTR(arg_size); c_routine[c_routine_next].return_size = t; c_routine[c_routine_next].convention = convention; return c_routine_next++; The value returned by define_c_func() is an index into a vector (array) that is dynamically built within the executing EUPHORIA program. The value returned has no linkage to the position in which the 'function' is located inside the DLL. > Your actions define who you are. Exactly ... ken either go away or apologize. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21836 Date: 2008 May 29 3:34 From: ken mortenson <kenneth_john at ya?oo.c?m> Subject: Re: Matt's Maturity Jeremy Cowgar wrote: > Ken, > > Do you think that the way you speak that you have admitted to has had anything > to do with this? Jeremy, I'm absolutely sure that my personality type is difficult for some to relate to. This is why, when Derek first brought up the point I provided resources to help any that cared to look into to it, with some understanding. Understand Jeremy, I spent my entire young life wondering what was wrong with me and why I perceive things the way I do. When I learned about personality temperments I realized for the first time that I wasn't defective. My perceptions are useful in the fabric of society. Fortunately for all concerned, mine is the lowest percentwise of the sixteen types that all people fall into. What a relief, eh? > The mature thing would have been to admit that you were guilty > as well instead of challenging a dual in the streets. When publically attacked I will not skulk off into the dark. I realize it is discomforting to many, but a public attack deserves a public apology. I'm willing to apologize for any specific action of mine that needs such. > The citations that Matt > gave I thought as well. Communication face to face is difficult enough let alone > over a medium such as this. I agreed. There were false assumptions made. One of the worst may be that it's always the abrasive guys fault, because he's new and therefore an easier target. > I know there is no hope what-so-ever for this thread. Hey, I'm a hopeful person. Aren't you? What's so hard about making an apology. Men do it all the time. Young men need the experience. Last point. I do wish to apologize to you and any others that have been distressed by this public display. I expect to be treated with respect and hope that regardless of my apparent abrasiveness (notice I started that thread) you understand that I have respect for you. -= B E G I N =- X-EUFORUM: 21837 Date: 2008 May 29 3:40 From: Matt Lewis <matthewwalkerlewis at ??ail.com> Subject: Re: Matt's Maturity ken mortenson wrote: > > Matt Lewis wrote: > > > > Unless we're looking at different things, here was how you got a value for > > rid_dbOpen: > > <eucode> > > atom rid_dbOpen > > rid_dbOpen = define_c_func(dbSQL, "dbOpen", {C_POINTER}, C_LONG) > > </eucode> > > > > The 2 was returned by define_c_func, which has no knowledge of a vector > > table in the PowerBASIC DLL. Your intuition was coincidence. > > dbSQL is a PowerBasic DLL. "dbOpen" is the second function defined > therein. Are you ignorant of how define_c_func works? > > My intuition was spot on. Thank you for reinforcing that point. No, it turns out I'm not ignorant of how define_c_func works. I'll walk you through what you're seeing: ...from source/execute.h: struct arg_info { int (*address)(); // pointer to C function s1_ptr name; // name of routine (for diagnostics) s1_ptr arg_size; // s1_ptr of sequence of argument sizes object return_size; // atom or sequence for return value size int convention; // calling convention }; ...from source/be_machine.c: int c_routine_next = 0; /* index of next available element */ struct arg_info *c_routine = NULL; /* array of c_routine structs */ Here is a bit of the back-end implementation of define_c_func (just the start and the end): object DefineC(object x) /* define a C routine: x is {lib, name, arg_sizes, return_type or 0} alternatively, x is {"", address or {'+', address}, arg_sizes, return_type or 0} Return -1 on failure. */ { ... proc_address = (int (*)())GetProcAddress((void *)lib, routine_string); ... c_routine[c_routine_next].address = proc_address; ... return c_routine_next++; } You can look up the rest of the code yourself, but as you can see, euphoria uses GetProcAddress along with the name of the exported function. It stores a pointer to that structure in an array, and returns the index for that particular arg_info. > > > Finally, it is cowardly of you to claim me ignorant in any respect without > > > providing evidence as I've done in the passage above so that I am at a > > > severe handicap to defend myself. > > > > Why is it cowardly? > > Because in your original post you made the accusation without support. > Only in subsequent post did you provide evidence, but not so I could > defend myself but so you could prove how right you were. As I am > demonstrating here I am able to defend myself when provided with > specific allegations rather than indefensible slurs. > > To accuse without giving the accused the means of defending themselves > is a cowardly act. A mature person knows that. Sorry, I wasn't really accusing you of anything. It's true that I didn't provide references in the original. I reread my original post: http://www.openeuphoria.org/EUforum/m21806.html ...and I still think it was a pretty neutral statement of my observations. > > In the case above, with define_c_func, you proved your > > ignorance of how that feature of the language works. > > As I've already shown above, you are still continuing to show your > ignorance about the source of the number while my intution has proved > to be entirely correct. This next part is beautiful... > > > According to the docs, > > which I believe someone responded to your original post with a link: > > > > "A small integer, i1, known as a routine id, will be returned." > > You read, but without understanding. What is the source of this small > integer? Magic? No, it's seems it's from the vector table of the DLL. I don't follow this jump to the vector table in the dll, or what it is. Are you referring to the export by ordinal, perhaps? Even so, as I showed above, you were incorrect. > > It's interesting [to me] that you construed all of this as a personal > > attack, especially after making such a big deal about your lack of social > > graces. To wit: > > It was a personal attack. Make no mistake. Calling me a troll is also > a personal attack. I've had the decency of explaining to you why it > was a cowardly attack. If you were a gentleman you would apologize > for doing so (rather than continuing with the troll comments and digging > yourself in deeper by continuing to try to prove what I have repeated > demonstrated to be wrong.) I'll grant the troll comment. But as Keith David said in _Men at Work_, "He was provokin me!" I don't have a problem admitting it when I'm wrong. I even admitted once (and a half?) where I was wrong. But you continue to say false things about define_c_func, displaying your ignorance. Who is digging? > > > You can believe anything you like about me. > > > > > > I believe that you are no gentleman and a coward. > > > > And you are welcome to believe whatever you like. I'm done feeding the > > trolls. > > The ball is now in your court. Your actions define who you are. > Notice I'm not calling you names. Calling you a coward is a specific > response to your actions and you can prove me wrong with an apology. You're not calling me names in *this* post (though you still quoted the names you called me previously). I'll admit that you're not really a troll (though some of your posts about gotos, structured code, and other general programming philosophies seem at least borderline), just that you were correct when you claimed to be a poor communicator. I often have a similar problem. I've often thought a lot about a particular issue, and have developed a strong opinion. When the topic comes up, I'm not hesitant to let others know. It comes across as a knee jerk reaction and irritates people (esp my wife, who never fails to let me know!), because my opinions seem unfounded or poorly thought out--even though the opposite is true. Something I read every so often, that is a huge help for fora like this: http://www.catb.org/~esr/faqs/smart-questions.html You may have seen it before. Matt -= B E G I N =- X-EUFORUM: 21838 Date: 2008 May 29 3:52 From: ken mortenson <kenneth_john at yah??.com> Subject: Re: Matt's Maturity Derek Parnell wrote: > The value returned by define_c_func() is an index into a vector (array) that > is dynamically built within the executing EUPHORIA program. The value returned > has no linkage to the position in which the 'function' is located inside the > DLL. > > > Your actions define who you are. > > Exactly ... ken either go away or apologize. Derek, At some point there must be some relationship to the DLL. If your telling me there isn't we're living in fantasy land. Regardless of that, for you to provide this information shows that he didn't... yet made accusations anyway. Now your asking me to apologize for what? Being attacked publicly? Who am I to you? Nobody, so yes, you can tell me to go away because it seems no loss to you. I suspect I am not going to make a dent because you've already prejudged. You should be proud of yourself. Up until this last message I was impressed by your kindness in trying to adjust others viewpoints. Boy did I misjudge you. -= B E G I N =- X-EUFORUM: 21839 Date: 2008 May 29 4:14 From: ken mortenson <kenneth_john at ?ahoo.?om> Subject: Re: Matt's Maturity Thank you Matt, I appreciate your reply. I'm willing to put the whole thing behind us with no hard feelings. I admit, I can rub a lot of people the wrong way. Give me a chance and you might find I'm worth knowing. I only here on this forum because I believe that about you and every one else. There are no evil people here. Just us poor humans. I'm sorry too. -= B E G I N =- X-EUFORUM: 21840 Date: 2008 May 29 4:25 From: ken mortenson <kenneth_john at y?hoo.co?> Subject: Re: Matt's Maturity Derek, I just went back and looked, my original assertion which was that I thought the number must be coming from a Euphoria vector table. I think your vector array qualifies. So you can keep telling me about how wrong I am if it makes you feel better to do so. I hope I've settled this with Matt. You can gang up on me if you like. I'd prefer we drop it. Do you still want me to leave? Is that choice yours? -= B E G I N =- X-EUFORUM: 21841 Date: 2008 May 29 4:40 From: Derek Parnell <ddparnell at bigpon??com> Subject: Re: Matt's Maturity ken mortenson wrote: > I'd prefer we drop it. Do you still want me to leave? I have read this after writing to you privately. This is no longer a public conversation. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21842 Date: 2008 May 29 5:28 From: gshingles <gshingles at ?mail.c?m> Subject: Re: [OT] it's vs its Jerry Story wrote: > > English lesson: > Some people use "it's" when they mean "its". > "it's" is a contraction for "it is". > "its" is possessive. > > All these websites explain it's vs its: ... Yeah and some people spell 'colour' as 'color' too. I don't think we should get too pedantic about this stuff do you? I mean we'll never have a keyword that uses an apostrophe in it, and I personally don't want to have to think about spelling and grammar when I'm grappling with the abstract nature of getting a compiler to convert my written intentions into machine code. Good on ya though, that's one that annoys me too; when I stop to notice it that is :) Gary -= B E G I N =- X-EUFORUM: 21843 Date: 2008 May 29 7:55 From: CChris <christian.cuvier at agricul?ure.gouv.f?> Subject: Re: forward reference Bernie Ryan wrote: > > > When a user wants to create a forward reference in Euphoria; > > why can't the user give a description of a function/procedure > > at the top of their program. > > <eucode> > > function foo(sequence bar) end function > > </eucode> > > Then the scanner could create a dummy entry in the symbol table > > as a holding place and target for any forward reference. > > When this function name is encountered and there is code between the ')' > > and 'end' tokens then the symbol table entry could be modified into > > a real symbol table entry. > > This could be done without having to change to a multipass scanner. > > Could this be done ? > > Bernie > > My files in archive: > WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API > > Can be downloaded here: > <a href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a> It is done in Æ . Or in Orac (there is kind of a connection). CChris -= B E G I N =- X-EUFORUM: 21844 Date: 2008 May 29 8:18 From: CChris <christian.cuvier at agriculture?gouv.?r> Subject: Re: Ken's abrasiveness Kat wrote: > > Matt Lewis wrote: > > > > > > Kat, I respect you, and I rarely raise to answer rants like this, but here > > goes... > > > > Kat wrote: > > > > > > Yea, you can't just stroll in here, spend 10 years coding in Euphoria, and > > > ask for things to change! Don't expect you'll get nested routines like you > > > asked for the first month you were here, or goto, or case/switch, or 64bit > > > integers, or 8bit string types, or multiple inheritance in classes, or > > > eval() / string execution, or "reverse" name resolution, or the latest > > > OS's 64bit function calls, or a real debugger that can edit the variable's > > > values, or anything else. If they ever do arrive, they'll be because > > > someone else thought of them. > > > > It hasn't been that long since euphoria's been open source. There still > > aren't many people who understand how to change things, especially in the > > back end. Some of these things aren't trivial, maybe aren't even possible > > without a full rewrite. I think everyone could cite an example of where > > their favorite feature has been rejected by the community. > > I feel like *all* of my suggestions were rejected over the years. Even from > the start, with string types, nesting procedures, and a debugger that can change > the var's values. And of course, goto. And string execution. and sheesh, the > brick wall i ran into with strings at all, right down to "why would you want > to parse a string?, you don't want Euphoria for that!, go back to mirc and pascal!". > Just comparing Eu to the most used capabilities of Mirc and Turbo Pascal would > show features Eu could use to be more versatile! > > <snip> > > > Hey, we're programmers, which means we're a bunch of pedantic detail freaks > > with strong opinions about everything. It turns out that most of the folks > > around here disagree with you on that particular issue. > > Which particular issue?, because i see obstacles (humans) in front of *every* > issue. Even me making eunet http functions threadsafe! I know someone will do > it, and maybe they will even lift the code i did eubot with, just like i was > going to do, but it's not acceptable for ME to do it, so i quit working on it. > So i won't be releasing the next strtok.e either, let CK do it the "true euphorian" > way. > > > > So welcome to Euphoria, Ken! Put on a manic clown face like CK's (not that > > > he is a manic clown, i did not say that) so you'll be well liked, and be > > > prepared to wait forever for requested features. Yes, Euphoria is better > > > than most languages, but it still has holes in it. Just sit back and take > > > what you are given, don't rock the boat. > > > > The problem is we can't even agree on which are holes, or how big they are. > > Oh come on! One look at the offshoots of Eu over the years should demo the huge > holes Eu has, starting with OOEU, then Bach, way back to the stuff David Cuny > did, all those preprocessors and parsers, etc.. RDS said they'd be happy if > someone did a debugger in a gui way, so you did one, and it wasn't jumped on! > IIRC, someone did a gui debugger in another programming language once too. It's > extremely disappointing. Instead of "yes, you can do that in Eu", you get "i > wonder if that can be done in Eu." Other languages are starting up with some > form of unicode built in, but despite being asked for in Eu, it's a debate as > to if it's worthwhile?? How arrogantly american to tell all the rest of the > world to 7bit ascii-zise their languages or get lost! > > I figure this is my last rant, i am tired of wasting my breath and time. > > Kat While I have been here for 6 years only I think, watched quite a few rants and requests from you (and agreeing with I'd say 60% of them) being consistently rejected, and definitively shared this frustrating experience of banging head against a wall of inertia, minimalism and sometimes sheer ignorance, I can tell you that it is not hopeless. If I started Æ a few years ago, and left it to dust later, it was because I was appalled by the rejection of features that are (soon were) so conspicuously missing. I can tell you that, last automn, I was about to leave this forum for good, as I was not developing anything in Eu any longer. Then there has been the hasty release of win32lib 70.1, where I had put some work; I had to take care. And now that some prominent conservatives don't appear to be around anymore, we have this upheaval leading to 4.0 taking place, and parts of that wretched Æ code is now being merged (by me) into 4.0. So... while I certainly understand the irritation (a stronger term could be more appropriate, I bet), because I have felt it for so long, the fact is that drastic changes are taking place. Perhaps are we mutating from a dandy language to a certainly elegant, but far more practical, language. While there is opposition (but not as fierce as it once was) to goto, and while I'm afraid a native (wchar[] like) string type would be possible only with a massive rewrite of the interpreter, other areas are probably much mor open than they have ever been. I think an improved debugger or string execution are part of them. Whether those could make it in 4.0 alpha, 4.0 stable or 4.1 is a timetable issue. I dare to say practicality is starting to win over modern art in shaping Eu design. As far as I'm concerned, I keep on pushing. CChris -= B E G I N =- X-EUFORUM: 21845 Date: 2008 May 29 9:00 From: CChris <christian.cuvier at agricul?ure.g?uv.fr> Subject: Re: [OT] it's vs its gshingles wrote: > > Jerry Story wrote: > > > > English lesson: > > Some people use "it's" when they mean "its". > > "it's" is a contraction for "it is". > > "its" is possessive. > > > > All these websites explain it's vs its: > ... > > Yeah and some people spell 'colour' as 'color' too. I don't think we should > get too pedantic about this stuff do you? I mean we'll never have a keyword > that uses an apostrophe in it, and I personally don't want to have to think > about spelling and grammar when I'm grappling with the abstract nature of getting > a compiler to convert my written intentions into machine code. > > Good on ya though, that's one that annoys me too; when I stop to notice it that > is :) > > Gary I won't say "just my 0.02¢, but... I'm not pedantic about grammar, not being a specialist, writer or something. And I think I'm fluent enough in english, which is not my native language, to still understand everything even with some sloppy grammar. However, I think there are quite a few people with more limited knowledge of the language, and the sloppy grammar may make reading us significantly harder on them. At least, that's what I experience when reading/listening to a foreign language I don't master pretty well, so I assume other people do. If we are serious to opening up to the world, and AFAIK we are, it could be a good idea to straighten up these bolts, simply so as to allow other people to understand more easily or faster, and perhaps post in. Chiding someone whose english is not the native language for poor wording would be ridiculous and inappropriate. Thank goodness, it hasn't happened. Hey, I never said I wasn't making mistakes myself!! Even without the typos. I'm not a good typist, and have ranted against too verbose constructs quite a few times. CChris -= B E G I N =- X-EUFORUM: 21846 Date: 2008 May 29 10:01 From: marky1124 <mark_young at hot?ail.?om> Subject: eugrid radio buttons Hi, I'm just trying to use eugrid v1.3.4 for the first time. I've created a simple list of names with a radio button cell next to each. I'm seeing the behaviour that multiple radio buttons can be selected at the same time. I'd expect it to automatically highlight the most recently clicked radio button (I thought that was the distinction between radio buttons and check boxes). Can anyone confirm whether eugrid can be asked to maintain the radiobuttons in a single select mode, or do I have to catch the events and do it manually? If it is a manual job I'd be most grateful if anyone could send me an example. I've looked at the style.exw demo that comes with eugrid and that doesn't do single select mode on the radio buttons. Cheers, Mark -= B E G I N =- X-EUFORUM: 21847 Date: 2008 May 29 10:21 From: ChrisBurch2 <crylex at fr?e?k.co.uk> Subject: Re: eu 4.0 Jeremy Cowgar wrote: > > ChrisBurch3 wrote: > > > > Euphoria has a wiki? Wow. Nice. > > > > Any chance of a forum? (Or arranging threads on the list by date last posted)? > > > > Sure: <a href="http://www.openeuphoria.org/EUforum/threads.html">http://www.openeuphoria.org/EUforum/threads.html</a> > > :-D > No, it doesn't so that (yet). Check out the date of this thread on the threads page, check the date of the last post, and check its position in the list of threads. Ideally (IMHO) the thread with the most recent posting should be sorted to the bottom of the page - that would be really cool. Chris > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> -= B E G I N =- X-EUFORUM: 21848 Date: 2008 May 29 10:32 From: ChrisBurch2 <crylex at fre??k.co.uk> Subject: Re: [OT] it's vs its CChris wrote: > > gshingles wrote: > > > > Jerry Story wrote: > > > > > > English lesson: > > > Some people use "it's" when they mean "its". > > > "it's" is a contraction for "it is". > > > "its" is possessive. > > > > > > All these websites explain it's vs its: > > ... > > > > Yeah and some people spell 'colour' as 'color' too. I don't think we should > > get too pedantic about this stuff do you? I mean we'll never have a keyword > > that uses an apostrophe in it, and I personally don't want to have to think > > about spelling and grammar when I'm grappling with the abstract nature of getting > > a compiler to convert my written intentions into machine code. > > > > Good on ya though, that's one that annoys me too; when I stop to notice it that > > is :) > > > > Gary > > I won't say "just my 0.02¢, but... > > I'm not pedantic about grammar, not being a specialist, writer or something. > And I think I'm fluent enough in english, which is not my native language, to > still understand everything even with some sloppy grammar. > > However, I think there are quite a few people with more limited knowledge of > the language, and the sloppy grammar may make reading us significantly harder > on them. At least, that's what I experience when reading/listening to a foreign > language I don't master pretty well, so I assume other people do. > > If we are serious to opening up to the world, and AFAIK we are, it could be > a good idea to straighten up these bolts, simply so as to allow other people > to understand more easily or faster, and perhaps post in. Chiding someone whose > english is not the native language for poor wording would be ridiculous and > inappropriate. Thank goodness, it hasn't happened. > > Hey, I never said I wasn't making mistakes myself!! Even without the typos. > I'm not a good typist, and have ranted against too verbose constructs quite > a few times. > > CChris Hi Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn’t mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. http://dan.hersam.com/2005/01/27/reading-jumbled-letters/ So now I want a version of eu that isn't so pedantic about spelling too, ie fro i = 1 ot 10 do piftrn("%d",{i}) ned ofr and it would still work! After all the teachers at my kids school don't seem to care how the chidren spell nowadays - why should computers! And if I want to start a sentence this way, why not.? And I likes' to dot additional apostrophe's anywhere too. :-) Chris -= B E G I N =- X-EUFORUM: 21849 Date: 2008 May 29 11:02 From: Matt Lewis <matthewwalkerlewis at ?mail.co?> Subject: Re: Matt's Maturity ken mortenson wrote: > > Thank you Matt, > > I appreciate your reply. I'm willing to put the whole thing behind us with > no hard feelings. I agree. Matt -= B E G I N =- X-EUFORUM: 21850 Date: 2008 May 29 11:48 From: Shawn Pringle <shawn.pringle at gmail?co?> Subject: Re: [OT] it's vs its I don't know what ever prompted you to make that observation here. I noticed a few examples of people using the wrong 'there' in this forum and I didn't hear a peep out of you then. Shawn Pringle -= B E G I N =- X-EUFORUM: 21851 Date: 2008 May 29 12:01 From: Shawn Pringle <shawn.pringle at gm?il.co?> Subject: Flaming and Loathing in the EUforum I haven't seen a flame war like this in years. I have to agree that one should attack the arguments and one should point out the arguments for putting forth your idea. Just terminate the 'Matt's maturity' and 'Ken's abrasiveness' threads. Let's get back on topic to what EUforum is for. Based on Matt's and Ken's self description they would seem to be too --ah mature to let these threads continue for so long. I remember the last flame war I saw was in the comp.os.linux.dev newsgroup and I just was laughing my ass off how these evident adults were name calling each other and stuff. Before I saw flame wars in fido-net and BBSes. I didn't expect one coming from here. Shawn Pringle B.Sc. -= B E G I N =- X-EUFORUM: 21852 Date: 2008 May 29 13:33 From: Igor Kachan <kinz at pet?rlink.r?> Subject: Re: Accented characters in identifiers CChris wrote: > > > Currently, if you use characters in the 128-255 range in identifiers, you will > get incongruous error messages, like "Result of a function must be assigned" > because you used a ó. > > This comes from the shrouding method Euphoria had been using long ago. Rob himself > admitted supporting was becoming obsolte. > > Implementationwise, the move is simple: change the character class of all those > chars from KEYWORD or BUILTIN to LETTER in the scanner. Nothing else (a couple > if branches and constants will become dead code). > > Since characters that display as a letter in some code page may display differently > on another, I think including the whole 128..255 range as valid characters is > better than restricting it. If a char is valid somewhere, it must be valid anywhere, > even if it displays funny. > > What do you think? Hi Chris, It is very good idea, I think, but its implementation is not too simple. There is Bilingual Euphoria 2.5 in the Archive. It understands any characters in identifiers and English and Russian keywords and has the English or Russian error messages and can translate the program text from English to Russian and back, but there is still unknown bug on Linux platform (DOS32, WIN32 are very stable, I work on it all the time). http://www.rapideuphoria.com/ru_eu_11.zip Sorry, I do not have some spare time to implement these features in 3.2 now - my vegetable-garden takes all my summer time :-) So ask please Rob for that code just to see various details of that interpreter, if you want. That was strongly licensed 2.5 stuff, that was our co-work with Rob and he didn't want to open that code that time. Regards, Igor Kachan kinz at peterlink.ru -= B E G I N =- X-EUFORUM: 21853 Date: 2008 May 29 13:41 From: Jason Gade <jaygade at ?ahoo?com> Subject: Re: Ken's abrasiveness CChris wrote: > While I have been here for 6 years only I think, watched quite a few rants and > requests from you (and agreeing with I'd say 60% of them) being consistently > rejected, and definitively shared this frustrating experience of banging head > against a wall of inertia, minimalism and sometimes sheer ignorance, I can tell > you that it is not hopeless. > > If I started Æ a few years ago, and left it to dust later, it was because I > was appalled by the rejection of features that are (soon were) so conspicuously > missing. I can tell you that, last automn, I was about to leave this forum for > good, as I was not developing anything in Eu any longer. > > Then there has been the hasty release of win32lib 70.1, where I had put some > work; I had to take care. And now that some prominent conservatives don't appear > to be around anymore, we have this upheaval leading to 4.0 taking place, and > parts of that wretched Æ code is now being merged (by me) into 4.0. > > So... while I certainly understand the irritation (a stronger term could be > more appropriate, I bet), because I have felt it for so long, the fact is that > drastic changes are taking place. Perhaps are we mutating from a dandy language > to a certainly elegant, but far more practical, language. > > While there is opposition (but not as fierce as it once was) to goto, and while > I'm afraid a native (wchar[] like) string type would be possible only with a > massive rewrite of the interpreter, other areas are probably much mor open than > they have ever been. I think an improved debugger or string execution are part > of them. > > Whether those could make it in 4.0 alpha, 4.0 stable or 4.1 is a timetable issue. > I dare to say practicality is starting to win over modern art in shaping Eu > design. As far as I'm concerned, I keep on pushing. > > CChris And some of us will continuously fight against the inclusion of misfeatures, as we see them, and the pollution of the language, until we tire of arguing and leave this place too. Once Euphoria loses its beauty, looks like every other language out there, and there is no longer anything worthwhile to distinguish it from anything else. I know that I was close to that point yesterday, and I'm sure that I'll be pushed to that brink again and again with all of these proposals that come up. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21854 Date: 2008 May 29 13:52 From: Jeremy Cowgar <jeremy at cowga?.c?m> Subject: Re: eu 4.0 ChrisBurch2 wrote: > > > No, it doesn't so that (yet). Check out the date of this thread on the threads > page, check the date of the last post, and check its position in the list > of threads. Ideally (IMHO) the thread with the most recent posting should > be sorted to the bottom of the page - that would be really cool. > Ah, Ok. got ya. I do not think we will be replacing EUforum. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21855 Date: 2008 May 29 13:53 From: c.k.lester <euphoric at cklester??om> Subject: Re: Ken's abrasiveness Jason Gade wrote: > > And some of us will continuously fight against the inclusion of misfeatures, > as we see them, and the pollution of the language, until we tire of arguing > and leave this place too. Jason, I'm somewhat in the minimalist camp, with a caveat: if an added feature is not going to negatively impact the performance of the interpreter, I generally don't have a problem with its inclusion. For instance, I'm totally against GOTO being added to the language, but if it doesn't negatively affect the performance (read: speed) of the interpreter, then I'm not going to put up a big fight about it. I wonder, too, about bloating the interpreter... but with today's hardware, that's not really an issue. So, while I share your concerns for Euphoria, I don't think we're at a point where we are seeing its assimilation into the programmer collective. It's still unique and fast and useful. -= B E G I N =- X-EUFORUM: 21856 Date: 2008 May 29 14:12 From: Jason Gade <jaygade at yah?o?com> Subject: Re: Ken's abrasiveness c.k.lester wrote: > > Jason Gade wrote: > > > > And some of us will continuously fight against the inclusion of misfeatures, > > as we see them, and the pollution of the language, until we tire of arguing > > and leave this place too. > > Jason, I'm somewhat in the minimalist camp, with a caveat: if an added feature > is not going to negatively impact the performance of the interpreter, I > generally don't have a problem with its inclusion. For instance, I'm totally > against GOTO being added to the language, but if it doesn't negatively > affect the performance (read: speed) of the interpreter, then I'm not going > to put up a big fight about it. > > I wonder, too, about bloating the interpreter... but with today's hardware, > that's not really an issue. > > So, while I share your concerns for Euphoria, I don't think we're at a point > where we are seeing its assimilation into the programmer collective. It's > still unique and fast and useful. It's not like I'm against /every/ feature, I'm trying to make that clear. And I'm not so much in the "bloating the interpreter" camp or in the "slowing down the interpreter" camp because these days it just doesn't really matter that much. Clear code is far more important. Maybe it's just pie-in-the-sky idealism, but for me it has more to do with the overall look and feel of the language, which features /should/ be included because they fit the philosophy of the language and which are just the syntactic sugar flavor-of-the-week. I think there should be a compelling reason to add anything --feature or new built-in-- to the interpreter, and a broad consensus as well. Not just "because it's cool." Same rant, different day I guess. Heh, for true minimalism and performance I guess I can always just stick with C. But allow me to make a comparison -- in some ways, going from C (a beautiful language, IMO, missing some features) to C++ (not so beautiful, lots of little-used features) introduced a lot of power and expressiveness at the expense of a lot of clunkiness and ugliness. And some missing features remain missing, or at least non standard. I'd like to avoid that here. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21857 Date: 2008 May 29 14:12 From: CChris <christian.cuvier at agricult?re.go?v.fr> Subject: Re: Accented characters in identifiers Igor Kachan wrote: > > CChris wrote: > > > > > > Currently, if you use characters in the 128-255 range in identifiers, you will > > get incongruous error messages, like "Result of a function must be assigned" > > because you used a ó. > > > > This comes from the shrouding method Euphoria had been using long ago. Rob himself > > admitted supporting was becoming obsolte. > > > > Implementationwise, the move is simple: change the character class of all those > > chars from KEYWORD or BUILTIN to LETTER in the scanner. Nothing else (a couple > > if branches and constants will become dead code). > > > > Since characters that display as a letter in some code page may display differently > > on another, I think including the whole 128..255 range as valid characters is > > better than restricting it. If a char is valid somewhere, it must be valid anywhere, > > even if it displays funny. > > > > What do you think? > > Hi Chris, > > It is very good idea, I think, but its implementation is not > too simple. There is Bilingual Euphoria 2.5 in the Archive. > It understands any characters in identifiers and > English and Russian keywords and has the English or Russian > error messages and can translate the program text from English > to Russian and back, but there is still unknown bug on > Linux platform (DOS32, WIN32 are very stable, I work on it all > the time). > > <a href="http://www.rapideuphoria.com/ru_eu_11.zip">http://www.rapideuphoria.com/ru_eu_11.zip</a> > > Sorry, I do not have some spare time to implement these > features in 3.2 now - my vegetable-garden takes all my > summer time :-) > > So ask please Rob for that code just to see various details > of that interpreter, if you want. That was strongly licensed > 2.5 stuff, that was our co-work with Rob and he didn't want > to open that code that time. > > > Regards, > Igor Kachan > kinz at peterlink.ru You may be aware that Euphoria has been open source for one year now. I'm not sure using any licensed material with restrictions worse than GPL would be possible or desirable. I may be wrong there though. Could you elaborate on how the bug shows up on Linux? Inasmuch as this doesn't infringe on any NDA of course. CChris -= B E G I N =- X-EUFORUM: 21858 Date: 2008 May 29 14:17 From: Jason Gade <jaygade at ?ah?o.com> Subject: Roadmaps and wikis and links, oh my! Jeremy, can you add links in your signature to the wiki and the roadmap? I keep losing them and I access from several different computers. Or at least post them again? I know I should just bookmark them, but since you're taking a lead position and all. Plus I access from several different computers throughout the day. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21859 Date: 2008 May 29 14:25 From: Jeremy Cowgar <jeremy at cow??r.com> Subject: Changes to Euphoria Jason Gade wrote: > > > It's not like I'm against /every/ feature, I'm trying to make that clear. And > I'm not so much in the "bloating the interpreter" camp or in the "slowing down > the interpreter" camp because these days it just doesn't really matter that > much. Clear code is far more important. > I am in the do not slow down the interpreter camp and the clear code camp. I do not care too much if the executable grows a bit. > Maybe it's just pie-in-the-sky idealism, but for me it has more to do with the > overall look and feel of the language, which features /should/ be included because > they fit the philosophy of the language and which are just the syntactic sugar > flavor-of-the-week. > I am not against syntactic sugar as a lot of times the syntactic sugar is nice. Many people consider the for loop syntactic sugar: <eucode> for a = 1 to length(lines) do --body end for </eucode> That's simply sugar for: <eucode> integer a a = 1 while a < length(lines) do -- body a = a + 1 end while </eucode> What I am for is not to reduce 2 character here or there, but sugar above is great stuff. It means I (the programmer) have to work less to achieve the same goal. That's my end desire. Am I lazy? I guess one could say that, but if you have a ditch to dig will you choose a spoon, a shovel or back hoe? Now, I am also in the camp that says let's try to have one way of doing things. I say try because, you could use a for or while loop to accomplish the same thing, but each has their own benefit. They are not duplicating functionality. I have used languages that have added every little new buzz word out there and they are so complex it's no fun to program in. After all, I do like my programming job, why? I think it's fun. > I think there should be a compelling reason to add anything --feature or new > built-in-- to the interpreter, and a broad consensus as well. Not just "because > it's cool." > Again, can you please tell me what has been added to the interpreter "because it's cool" ? In your opinion, I am not asking for fact, simply your opinion. > Same rant, different day I guess. > Heh, for true minimalism and performance I guess I can always just stick with > C. > Hm, C has goto, right :-D (added for goto fans, sorry, could not resist) > But allow me to make a comparison -- in some ways, going from C (a beautiful > language, IMO, missing some features) to C++ (not so beautiful, lots of little-used > features) introduced a lot of power and expressiveness at the expense of a lot > of clunkiness and ugliness. And some missing features remain missing, or at > least non standard. I'd like to avoid that here. > Hm, I hardly think C to C++ is a valid comparison of Eu 3.1 to Eu 4.0. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21860 Date: 2008 May 29 14:35 From: Jason Gade <jaygade at ya?o?.com> Subject: Re: Changes to Euphoria Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > > > It's not like I'm against /every/ feature, I'm trying to make that clear. And > > I'm not so much in the "bloating the interpreter" camp or in the "slowing down > > the interpreter" camp because these days it just doesn't really matter that > > much. Clear code is far more important. > > > > I am in the do not slow down the interpreter camp and the clear code camp. I > do not care too much if the executable grows a bit. Which is why I like you :-) ! > > > Maybe it's just pie-in-the-sky idealism, but for me it has more to do with the > > overall look and feel of the language, which features /should/ be included because > > they fit the philosophy of the language and which are just the syntactic sugar > > flavor-of-the-week. > > > > I am not against syntactic sugar as a lot of times the syntactic sugar is nice. > Many people consider the for loop syntactic sugar: > > <eucode> > for a = 1 to length(lines) do > --body > end for > </eucode> > > That's simply sugar for: > > <eucode> > integer a > a = 1 > while a < length(lines) do > -- body > a = a + 1 > end while > </eucode> > > What I am for is not to reduce 2 character here or there, but sugar above is > great stuff. It means I (the programmer) have to work less to achieve the same > goal. That's my end desire. Am I lazy? I guess one could say that, but if you > have a ditch to dig will you choose a spoon, a shovel or back hoe? > > Now, I am also in the camp that says let's try to have one way of doing things. > I say try because, you could use a for or while loop to accomplish the same > thing, but each has their own benefit. They are not duplicating functionality. > I have used languages that have added every little new buzz word out there and > they are so complex it's no fun to program in. After all, I do like my programming > job, why? I think it's fun. Right, and the "one way" and the "sugar" or "tool in the toolbox" (to borrow another phrase) sometimes conflict. I understand that. Which is why I'm trying to make clear that I don't want to obstruct things just for the sake of being obstructionist. > > > I think there should be a compelling reason to add anything --feature or new > > built-in-- to the interpreter, and a broad consensus as well. Not just "because > > it's cool." > > > > Again, can you please tell me what has been added to the interpreter "because > it's cool" ? In your opinion, I am not asking for fact, simply your opinion. "retry" is the one that comes to mind mostly, for arguments that I've already given, and I've also already conceded on it. Other things which have only been proposed here, and like yesterday, I realize that it's just discussion at this point though sometimes, like yesterday, it still feels like being steam rolled, like some things will be included no matter what anybody thinks. nested routines felt like that yesterday, just other vague feelings. > > > Same rant, different day I guess. > > > Heh, for true minimalism and performance I guess I can always just stick with > > C. > > > > Hm, C has goto, right :-D (added for goto fans, sorry, could not resist) Yes, C has goto. Nothing wrong with that. I was once going to port Rogue from C to Euphoria (just because) and I reached a piece of code that does something like the proposed "entry" keyword. Since C doesn't have "entry", it used a goto. It took awhile for me to figure out how to do that properly in Euphoria and I eventually had to ask here in the list. Of course, someone gave me the obvious and elegant solution using an "if" statement. Pity I never finished that project... > > But allow me to make a comparison -- in some ways, going from C (a beautiful > > language, IMO, missing some features) to C++ (not so beautiful, lots of little-used > > features) introduced a lot of power and expressiveness at the expense of a lot > > of clunkiness and ugliness. And some missing features remain missing, or at > > least non standard. I'd like to avoid that here. > > > > Hm, I hardly think C to C++ is a valid comparison of Eu 3.1 to Eu 4.0. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Right, again to be more clear -- my rants are less about 4.0 specifically (even though it still seems like features are being piled on) but the future of the language in general, beyond 4.0. As I've said both here and in the developer's list, I'm pretty much on board with the 4.0 roadmap that you have spelled out. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21861 Date: 2008 May 29 14:36 From: Jeremy Cowgar <jeremy at cow?ar.c?m> Subject: Re: Roadmaps and wikis and links, oh my! Jason Gade wrote: > > Jeremy, can you add links in your signature to the wiki and the roadmap? I keep > losing them and I access from several different computers. Or at least post > them again? > > I know I should just bookmark them, but since you're taking a lead position > and all. Plus I access from several different computers throughout the day. > I can, however, I do not want to today. The reason is hopefully this weekend the new wiki will officially go live. I do not want to start directing people in masses to the new wiki as it has a few issues still but I do not wish to start directing in masses to the old wiki as well because it's going to change very soon. The best thing that is written about 4.0 thus far is the Organizing 4.0. Please see this page and it's notes: http://openeuphoria.org/wiki/euwiki.cgi?Roadmap40 Notice to everyone, this link may change in the near future (Friday or Saturday). -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21862 Date: 2008 May 29 14:41 From: Jason Gade <jaygade at yah?o.co?> Subject: Re: Roadmaps and wikis and links, oh my! Thanks, that's what I was looking for. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21863 Date: 2008 May 29 15:04 From: Kat <KAT12 at co?s?hs.net> Subject: Re: Ken's abrasiveness Jason Gade wrote: <snip> > I think there should be a compelling reason to add anything --feature or new > built-in-- to the interpreter, and a broad consensus as well. Not just "because > it's cool." Jason, CK is adding repeat_str() to Eu, and Eu doesn't have a string type. Kat -= B E G I N =- X-EUFORUM: 21864 Date: 2008 May 29 15:12 From: c.k.lester <euphoric at ckleste?.?om> Subject: Re: Ken's abrasiveness Kat wrote: > Jason Gade wrote: > > I think there should be a compelling reason to add anything --feature or new > > built-in-- to the interpreter, and a broad consensus as well. Not just "because > > it's cool." > Jason, CK is adding repeat_str() to Eu, and Eu doesn't have a string type. No I'm not. Kat, weren't you leaving? -= B E G I N =- X-EUFORUM: 21865 Date: 2008 May 29 15:16 From: Jeremy Cowgar <jeremy at cow??r.com> Subject: Re: Ken's abrasiveness Kat wrote: > > Jason Gade wrote: > > <snip> > > > I think there should be a compelling reason to add anything --feature or new > > built-in-- to the interpreter, and a broad consensus as well. Not just "because > > it's cool." > > Jason, CK is adding repeat_str() to Eu, and Eu doesn't have a string type. > Eu does not have a string type, but it certainly has strings. repeat_str() sounds like a nice function to have in the standard library: <eucode> ? repeat('A', 2) -- "AA" ? repeat("ABC", 2) -- {"ABC","ABC"} ? repeat_str("ABC", 2) -- "ABCABC" </eucode> -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21866 Date: 2008 May 29 15:19 From: c.k.lester <euphoric at cklest?r.c?m> Subject: Re: Ken's abrasiveness Jeremy Cowgar wrote: > Kat wrote: > > Jason, CK is adding repeat_str() to Eu, and Eu doesn't have a string type. > Eu does not have a string type, but it certainly has strings. repeat_str() sounds > like a nice function to have in the standard library: > > <eucode> > ? repeat('A', 2) -- "AA" > ? repeat("ABC", 2) -- {"ABC","ABC"} > ? repeat_str("ABC", 2) -- "ABCABC" > </eucode> I had simply asked about this functionality being currently available in 4.0 alpha alpha, then suggested it be added if not. Derek agree it was a potentially valuable addition. Where she got that I was adding it to Eu- phoria is beyond me. -= B E G I N =- X-EUFORUM: 21867 Date: 2008 May 29 15:27 From: Jason Gade <jaygade at y??oo.com> Subject: Re: Ken's abrasiveness c.k.lester wrote: > > Kat wrote: > > Jason Gade wrote: > > > I think there should be a compelling reason to add anything --feature or new > > > built-in-- to the interpreter, and a broad consensus as well. Not just "because > > > it's cool." > > Jason, CK is adding repeat_str() to Eu, and Eu doesn't have a string type. > > No I'm not. > I was browsing the svn repository and I couldn't find anything... Sequences do 99.9% the job of strings, and they do better than what passes for a string in C. I think their can be improvement, and it has certainly been mentioned with regards to unicode strings. It's just that I don't think we know how to do it "the right way". I certainly don't know how, even though I've thought about it from time to time. For me, Euphoria has two types -- atom and sequence, and of course object which encompasses them both (and is therefore not really separate). Integer is just a special case of atom it is included for performance reasons/special purposes. String as a special case of sequence would be okay, if needed. But again, it needs to be designed and integrated somehow. Now I'm just rambling. Sorry. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21868 Date: 2008 May 29 15:28 From: MBianchi <mebian at ?i?calinet.it> Subject: Re: Changes to Euphoria After reading all the threads regarding the changes in Eu 4.0, I'd like to add my 1/2 cent. Please, forgive me, I'm really new to Eu, even if I went back and forth from it for several times now, so my doubt is *for sure* a naive one, and my english too bad. I was first attracted to Eu for speed, and for the ability to use an interpreter *and* a real compiler, but the most important feature of the language soon became its 'devotion' to sequences. This made me (erroneously?) think that Eu could have its place in vector languages, like APL, J, K, Q etc. etc., with its own character and extentions toward procedural languages, but nevertheless in the array languages pool. Reading past threads I noticed that Rob himself had a deep experience with APL, so some sort of inheritance of good ideas from it could be a supposition even more reasonable. In all recent discussions I saw on Euforum, I did not see any proposal for better sequence ops, or some improvements on sequencing in itself though, but many, reasonable or not, I'm not in the position of expressing an honest opinion, about procedural structures. Just out of curiosity, am I totally wrong in thinking Eu in the vector language family, or are Eu sequences already at the best we can achieve (really, no flame intended at all), or ...? TIA, and Cheers. MBianchi -= B E G I N =- X-EUFORUM: 21869 Date: 2008 May 29 15:33 From: Jeremy Cowgar <jeremy at cowgar.?o?> Subject: Re: Changes to Euphoria MBianchi wrote: > > I was first attracted to Eu for speed, and for the ability to use an interpreter > *and* a real compiler, but the most important feature of the language soon became > its 'devotion' to sequences. > Me too! > This made me (erroneously?) think that Eu could have its place in vector languages, > like APL, J, K, Q etc. etc., with its own character and extentions toward procedural > languages, but nevertheless in the array languages pool. > I'm sorry. I've played with many, many languages but all of the ones you listed, I have not. Honestly, I do not know what a vector language is. > Reading past threads I noticed that Rob himself had a deep experience with APL, > so some sort of inheritance of good ideas from it could be a supposition even > more reasonable. > > In all recent discussions I saw on Euforum, I did not see any proposal for better > sequence ops, or some improvements on sequencing in itself though, but many, > reasonable or not, I'm not in the position of expressing an honest opinion, > about procedural structures. There is a new library called sequence.e which contains many functions that work on sequences. I am unsure if any of those would be what you are thinking, since I am not experienced in vector languages. > Just out of curiosity, am I totally wrong in thinking Eu in the vector language > family, or are Eu sequences already at the best we can achieve (really, no flame > intended at all), or ...? > Can someone else answer this who understands vector languages? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21870 Date: 2008 May 29 15:33 From: Kat <KAT12 at coosahs.??t> Subject: Re: Ken's abrasiveness c.k.lester wrote: > > Kat wrote: > > Jason Gade wrote: > > > I think there should be a compelling reason to add anything --feature or new > > > built-in-- to the interpreter, and a broad consensus as well. Not just "because > > > it's cool." > > Jason, CK is adding repeat_str() to Eu, and Eu doesn't have a string type. > > No I'm not. > > Kat, weren't you leaving? You want me out of anything you know, don't you, CK? Kat -= B E G I N =- X-EUFORUM: 21871 Date: 2008 May 29 15:35 From: Kat <KAT12 at c??sahs.net> Subject: Re: Ken's abrasiveness c.k.lester wrote: > > Jeremy Cowgar wrote: > > Kat wrote: > > > Jason, CK is adding repeat_str() to Eu, and Eu doesn't have a string type. > > Eu does not have a string type, but it certainly has strings. repeat_str() sounds > > like a nice function to have in the standard library: > > > > <eucode> > > ? repeat('A', 2) -- "AA" > > ? repeat("ABC", 2) -- {"ABC","ABC"} > > ? repeat_str("ABC", 2) -- "ABCABC" > > </eucode> > > I had simply asked about this functionality being currently available in > 4.0 alpha alpha, then suggested it be added if not. Derek agree it was a > potentially valuable addition. Where she got that I was adding it to Eu- > phoria is beyond me. [20:21] <euphoric> i put a func in strtok that does this: x = repeat_str("xyz",3) -- x = "xyzxyzxyz" Kat -= B E G I N =- X-EUFORUM: 21872 Date: 2008 May 29 15:41 From: c.k.lester <euphoric at ckle??er.com> Subject: Re: Ken's abrasiveness Kat wrote: > c.k.lester wrote: > > Kat, weren't you leaving? > You want me out of anything you know, don't you, CK? Well, you kinda promised. Seriously, while I respect your ability to code, I do get tired of hearing (reading) you whine about how terrible your life is, especially because of Euphoria. And now you are telling lies about me adding things to Euphoria. Did you really think I was adding repeat_str() to Euphoria? Because if you did not, I can't fathom why you'd say something like that. -= B E G I N =- X-EUFORUM: 21873 Date: 2008 May 29 15:45 From: Kat <KAT12 at coo?a?s.net> Subject: Re: Ken's abrasiveness c.k.lester wrote: > > Kat wrote: > > c.k.lester wrote: > > > Kat, weren't you leaving? > > You want me out of anything you know, don't you, CK? > > Well, you kinda promised. I said i probably would not be coding in Eu again. Show me where i promised anything. > Seriously, while I respect your ability to code, I do get tired of hearing > (reading) you whine about how terrible your life is, especially because of > Euphoria. And now you are telling lies about me adding things to Euphoria. > Did you really think I was adding repeat_str() to Euphoria? Because if you > did not, I can't fathom why you'd say something like that. Ok, lets escalate this: fork you, CK. Kat -= B E G I N =- X-EUFORUM: 21874 Date: 2008 May 29 15:45 From: c.k.lester <euphoric at c?lester?com> Subject: Re: Ken's abrasiveness Kat wrote: > c.k.lester wrote: > > Jeremy Cowgar wrote: > > > ? repeat_str("ABC", 2) -- "ABCABC" > > I had simply asked about this functionality being currently available in > > 4.0 alpha alpha, then suggested it be added if not. Derek agree it was a > > potentially valuable addition. Where she got that I was adding it to Eu- > > phoria is beyond me. > [20:21] <euphoric> i put a func in strtok that does this: x = repeat_str("xyz",3) > -- x = "xyzxyzxyz" Uh. strtok_v2-1.e != Euphoria It's not even a standard lib. You were reaching. But what was your point? -= B E G I N =- X-EUFORUM: 21875 Date: 2008 May 29 15:55 From: c.k.lester <euphoric at ?klester.com> Subject: Re: Ken's abrasiveness Kat wrote: > c.k.lester wrote: > > > Seriously, while I respect your ability to code, I do get tired of hearing > > (reading) you whine about how terrible your life is, especially because of > > Euphoria. And now you are telling lies about me adding things to Euphoria. > > Did you really think I was adding repeat_str() to Euphoria? Because if you > > did not, I can't fathom why you'd say something like that. > > Ok, lets escalate this: fork you, CK. Hey, now! Be nice. -= B E G I N =- X-EUFORUM: 21876 Date: 2008 May 29 16:12 From: Kat <KAT12 at co?sa?s.net> Subject: Re: Ken's abrasiveness c.k.lester wrote: > > Kat wrote: > > c.k.lester wrote: > > > Jeremy Cowgar wrote: > > > > ? repeat_str("ABC", 2) -- "ABCABC" > > > I had simply asked about this functionality being currently available in > > > 4.0 alpha alpha, then suggested it be added if not. Derek agree it was a > > > potentially valuable addition. Where she got that I was adding it to Eu- > > > phoria is beyond me. > > [20:21] <euphoric> i put a func in strtok that does this: x = repeat_str("xyz",3) > > -- x = "xyzxyzxyz" > > Uh. > > strtok_v2-1.e != Euphoria > > It's not even a standard lib. > > You were reaching. But what was your point? Does it really even matter what my point was? Eu doesn't have a string type, there is no string in Eu. They are sequences, where every 8bit character takes up 32bits. And you are adding a function that replaces 3 whole lines of code that do the same thing, a trivial thing, while important stuff doesn't get added. Kat -= B E G I N =- X-EUFORUM: 21877 Date: 2008 May 29 16:18 From: Igor Kachan <kinz at p?terlink.?u> Subject: Re: Accented characters in identifiers CChris wrote: > > Igor Kachan wrote: > > > > CChris wrote: > > > > > > [snip] > > > > > > What do you think? > > > > Hi Chris, > > > > It is very good idea, I think, but its implementation is not > > too simple. There is Bilingual Euphoria 2.5 in the Archive. > > It understands any characters in identifiers and > > English and Russian keywords and has the English or Russian > > error messages and can translate the program text from English > > to Russian and back, but there is still unknown bug on > > Linux platform (DOS32, WIN32 are very stable, I work on it all > > the time). > > > > http://www.rapideuphoria.com/ru_eu_11.zip > > > > Sorry, I do not have some spare time to implement these > > features in 3.2 now - my vegetable-garden takes all my > > summer time :-) > > > > So ask please Rob for that code just to see various details > > of that interpreter, if you want. That was strongly licensed > > 2.5 stuff, that was our co-work with Rob and he didn't want > > to open that code that time. > > > > > You may be aware that Euphoria has been open source for one year now. Yes, I do know that EU 3.0 is open source, but the 2.5 source code was a commercial product with strong license restrictions. After 3.0, I asked Rob to open the bilingual EU 2.5 too - I did not have the spare time to develop the bilingual EU 3.0 by myself, so why not to allow this work to someone who wants to work without reinventing of all that stuff? That time Rob prefered to wait me. But this waiting gets too long. > I'm not sure using any licensed material with restrictions worse > than GPL would be possible or desirable. I may be wrong there though. There are the official developers of the Open source EU now, why not to open just for them just that 2.5 bilingual interpreter? Rob? > Could you elaborate on how the bug shows up on Linux? Ok, I'll try to find that interpreter on my old reserved HDD and run it to make the screen-shots on Linux Mandrake 10.0. > Inasmuch as this doesn't infringe on any NDA of course. What is NDA? Sorry, I do not know this abbreviation. Regards, Igor Kachan kinz at peterlink.ru -= B E G I N =- X-EUFORUM: 21878 Date: 2008 May 29 16:18 From: Matt Lewis <matthewwalkerlewis at gm?i?.com> Subject: Re: Ken's abrasiveness Kat wrote: > > Ok, lets escalate this: fork you, CK. DK? Matt -= B E G I N =- X-EUFORUM: 21879 Date: 2008 May 29 16:23 From: Matt Lewis <matthewwalkerlewis at ?mail.c?m> Subject: Strings Kat wrote: > > Eu doesn't have a string type, there is no string in Eu. They are sequences, > where every 8bit character takes up 32bits. And you are adding a function that > replaces 3 whole lines of code that do the same thing, a trivial thing, while > important stuff doesn't get added. This is something that seems like it should be trivial, but isn't, given the design of euphoria. Adding a new primitive would require changes all over the place (hundreds of places, easily). We'd probably have to redo some of the test macros, and I suspect that we'd lose a lot of the current speed of euphoria. If someone can figure out an easy way to do this, I suspect it'd get into the language pretty quickly. Of course, that ignores the prospect of Unicode, which is a whole 'nother can of worms, and also something that will require some drastic recoding in the back end, though due to the way that sequences are implemented, probably none in the front end. Matt -= B E G I N =- X-EUFORUM: 21880 Date: 2008 May 29 16:24 From: c.k.lester <euphoric at ckle??er.com> Subject: Re: Ken's abrasiveness Kat wrote: > c.k.lester wrote: > > You were reaching. But what was your point? > Does it really even matter what my point was? Yes, because lying is not socially appropriate. Distorting facts is frowned upon (unless you're a politician). > Eu doesn't have a string type, there is no string in Eu. They are sequences, Okay, so let's call it repeat_seq() I guess. > where every 8bit character takes up 32bits. And you are adding a function that > replaces 3 whole lines of code that do the same thing, Well, using for...end for only replaces 3 lines of while...end while. So repeat_seq() is in good company. > a trivial thing, while important stuff doesn't get added. By "important stuff" you really mean, "stuff Kat wants." From what I can see, 4.0 is getting a few changes and bug fixes. It's called progress, and while it might not be at a pace you appreciate, it's still stepping forward. -= B E G I N =- X-EUFORUM: 21881 Date: 2008 May 29 16:24 From: marky1124 <mark_young at ho?mail.?om> Subject: IDE crash working with ListViews Hi Judith, I hope you are reading the forum and open to a request for a bug fix. I'm using IDE 1.0.3b which is bound against win32lib v0.70.4. I've been getting fairly regular crashes whilst working with ListViews, the crash displays the following error: Error code 472 getRect:GetWindowRect failed Win32Lib v0.70.4 15-Mar-2008Runtime error (Traceback unavailable) I've not figured out the exact sequence of events that lead to this crash, however I have found a reproducible sequence of events that leads to a similar crash. Here are the steps: 1) Open the IDE (i.e. New Project) 2) Using the Toolbar choose Selection -> Listview 3) Click inside Window1 to create ListView2 4) Right click on ListView2 -> List View Styles Explorer 5) Tick Single Select 6) Tick Single Click Activate 7) Click "Transfer to Properties" 8) Right click on ListView2 -> List View Styles Explorer NOTE: "Single Click Activate" is no longer ticked 9) Tick Single Click Activate 10) Click "Transfer to Properties" 11) Right click on ListView2 -> List View Styles Explorer NOTE: "Single Click Activate" is no longer ticked 12) Untick "Single Select" 13) Click "Transfer to Properties" 14) Right click -> List View Styles Explorer 15) Tick Single Click Activate 16) Click "Transfer to Properties" 17) The IDE now crashes with Error code 477 destroy:Menu failed Win32Lib v0.70.4 15-Mar-2008 So there's a bug here with remembering the "Single Click Activate" setting as well as the two types of crash. Please let me know if I can provide any further information. Cheers, Mark -= B E G I N =- X-EUFORUM: 21882 Date: 2008 May 29 16:27 From: ken mortenson <kenneth_john at yahoo.?o?> Subject: Re: Changes to Euphoria Thoughts inspired by Jason and Jeremy's discussion... Things in life are often a trade off... Programmers develop habits as well as use idioms of a particular language. Working with a small team of programmers on a huge project I can often tell which member of my team wrote a particular section of code by how it's written. If I got my way, my ability to do this would lessen which is a loss. So what am I looking to get to compensate for this loss? I'm looking for a cleaner code that is easier to read with understanding. The quicker you get comprehension the less you are stressed. Making the programmers job easier. Idioms shared make comprehension easier too. You can achieve much of this by the minimalist approach. Take GOTO's verses structured code as a first example. GOTO allows a programmer to express themselves very individually (making it easier for me to tell who wrote the code) while structured code isn't so individual. The structure tends to enforce a likely similar looking code. And it's generally quicker to comprehend (especially in a long block of code.) Structures have a beginning so you know you're in a structure. Even if the code scrolls of the end of the page, you already know the eventuality. With GOTO all you see at the beginning of a loop is a label. That label doesn't tell you, you are about to enter a loop. Your comprehension will require you to examine more code. You could also minimize by taken out the structure, just use GOTO's everywhere. It's largely a matter of taste, but I prefer using structured code. YMMV. I'd like to talk about loops. You may think I'm just in love with my idea (which I admit is partly true) but there are good reasons for my proposal. I don't believe any on this forum will have any trouble judging the merits or speaking their mind about it. Some may even oppose an idea not for the idea itself but because of who proposes it (which I think is a rather sad thing.) It's been noted that FOR loops are an addition to Euphoria which originally had just while loops. I've used FOR loops so much that I don't give it a thought usually about whether they should be included or not, but thinking minimally (don't include what you don't need) I realize there's a good reason for not having them. Let me start with the while loop and get back to the for. while (1) ... end while I would claim that quicker comprehension occurs with this construct... Loop ... End Loop Both are infinite loops. Yes, it's not much quicker to comprehend, we're not dolts after all, but after examining thousands of lines of code, by 3am I betcha that it becomes a bit more significant. I would also claim (without support, just my INTJ assertiveness again) that comprehension is better when Loop is used to describe Loop, rather than any other _____ is a loop. Call me crazy. Now, how about getting out of the loop? Some language provide a plethora of ways and are thinking of new ways all the time no doubt (programmers are such a creative bunch after all.) The fact that sometimes you need to get out of loops and the beginning, the end, the middle has led to repeat, until, etc. But for a minimalist the answer is right there, IF. You need something like EXIT to be used with the IF, but IF eliminates the need for any additional unneeded keywords because you can put the IF test anywhere in the loop; beginning, middle and end. Exit tells you immediately that you are leaving the loop you are currently in. Exit 12, on the other hand, is an offramp in New Jersey I think! What about FOR. What does FOR add to the game that LOOP doesn't give you already? FOR gives you an INDEX. What a great idea. But perhaps if a minimalist were trying to add an implicit INDEX he or she might have realized you don't need to add FOR at all! Loop ... End Loop There it is, did you see it? Looks like anticomprehesion time, doesn't it? Never fear, I'll get back to that in a moment. FOR gives you more than just INDEX. You can tell where to start, where to end and how much to increment by. For LOOP to have a start you'd have to do something like this... Loop from 5 End Loop Well why not? This also gives us something else... Loop ... End Loop ...under the covers can become... :Loop ... GOTO Loop And now quicker comprehension because the lack of from indicates no INDEX at all. It does however require the idiom Loop from 1, but I don't think that's such a big deal. Idioms foster comprehension too. Other languages use STEP where Euphoria uses BY... I really like BY. I don't know why, I just do. So we keep it... Loop from 10 by 5 As long a we understand the INDEX is implicit (with only Loop for loops that comprehension will come rathe quickly. We don't have any other type of loop to cause confusion.) But how about the end of the loop? With FOR I specify the end in the declaration. We minimalist don't need it. We already have IF (cond) Exit. Again I would restate that use of a single loop construct would make comprehension quicker and would be reinforced with each subsequent use. I stated my case for the two issues I've brought up before (somebody got a fire extinguisher handy???) Am I in love with my ideas. Sure, why not? Can I live with rejection. Yeah, I suppose. I'll just go into a corner and sulk for awhile.... ;-) The biggest problem is that taken up my proposal requires change. Change is not easy. No, better to say, change is hard. One of the really annoying things about me is that time often proves me right; by then the sun has cooled, the earth has left it's orbit and the guys I was fighting with (in the friendly fashion that programmers do) has left the company. But it's not about me. So please consider the merits regardless of the source. I would also argue that a minimalist approach makes for a better compiler or interpreter but we'd all agree on that, so where's the fun? -= B E G I N =- X-EUFORUM: 21883 Date: 2008 May 29 16:29 From: CChris <christian.cuvier at agri?ulture.gouv?fr> Subject: Re: Ken's abrasiveness Jeremy Cowgar wrote: > > Kat wrote: > > > > Jason Gade wrote: > > > > <snip> > > > > > I think there should be a compelling reason to add anything --feature or new > > > built-in-- to the interpreter, and a broad consensus as well. Not just "because > > > it's cool." > > > > Jason, CK is adding repeat_str() to Eu, and Eu doesn't have a string type. > > > > Eu does not have a string type, but it certainly has strings. repeat_str() sounds > like a nice function to have in the standard library: > > <eucode> > ? repeat('A', 2) -- "AA" > ? repeat("ABC", 2) -- {"ABC","ABC"} > ? repeat_str("ABC", 2) -- "ABCABC" > </eucode> > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> repeat_pattern() will be committed soon. Does the same. CChris -= B E G I N =- X-EUFORUM: 21884 Date: 2008 May 29 16:32 From: Kat <KAT12 at ?oosahs.ne?> Subject: Re: Ken's abrasiveness c.k.lester wrote: > > Kat wrote: > > c.k.lester wrote: > > > > > Seriously, while I respect your ability to code, I do get tired of hearing > > > (reading) you whine about how terrible your life is, especially because of > > > Euphoria. And now you are telling lies about me adding things to Euphoria. > > > Did you really think I was adding repeat_str() to Euphoria? Because if you > > > did not, I can't fathom why you'd say something like that. > > > > Ok, lets escalate this: fork you, CK. > > Hey, now! Be nice. You are the one who says a complaint about going to jail for 10 years because a neighbor's dog doesn't want me to get my snailmail on my own paid-for realestate is whining. You are the one who says being unemployed for 23 years is whining. You are the one who says being constantly let down by the lack of progress in Euphoria is whining. And you say you respect my coding, yet i stopped work on eunet and strtok because of it being called carp, and the person who called it carp was welcomed as a Eu developer, reinforcing his credentials and authority for disparaging my skills. Kat -= B E G I N =- X-EUFORUM: 21885 Date: 2008 May 29 16:37 From: CChris <christian.cuvier at agriculture.g?uv.?r> Subject: Re: Accented characters in identifiers Igor Kachan wrote: > > CChris wrote: > > > > Igor Kachan wrote: > > > > > > CChris wrote: > > > > > > > > [snip] > > > > > > > > What do you think? > > > > > > Hi Chris, > > > > > > It is very good idea, I think, but its implementation is not > > > too simple. There is Bilingual Euphoria 2.5 in the Archive. > > > It understands any characters in identifiers and > > > English and Russian keywords and has the English or Russian > > > error messages and can translate the program text from English > > > to Russian and back, but there is still unknown bug on > > > Linux platform (DOS32, WIN32 are very stable, I work on it all > > > the time). > > > > > > <a href="http://www.rapideuphoria.com/ru_eu_11.zip">http://www.rapideuphoria.com/ru_eu_11.zip</a> > > > > > > Sorry, I do not have some spare time to implement these > > > features in 3.2 now - my vegetable-garden takes all my > > > summer time :-) > > > > > > So ask please Rob for that code just to see various details > > > of that interpreter, if you want. That was strongly licensed > > > 2.5 stuff, that was our co-work with Rob and he didn't want > > > to open that code that time. > > > > > > > > You may be aware that Euphoria has been open source for one year now. > > Yes, I do know that EU 3.0 is open source, but the 2.5 source > code was a commercial product with strong license restrictions. > > After 3.0, I asked Rob to open the bilingual EU 2.5 too - I did not > have the spare time to develop the bilingual EU 3.0 by myself, so > why not to allow this work to someone who wants to work without > reinventing of all that stuff? > > That time Rob prefered to wait me. But this waiting gets too long. > > > I'm not sure using any licensed material with restrictions worse > > than GPL would be possible or desirable. I may be wrong there though. > > There are the official developers of the Open source EU now, > why not to open just for them just that 2.5 bilingual interpreter? > > Rob? > > > Could you elaborate on how the bug shows up on Linux? > > Ok, I'll try to find that interpreter on my old reserved > HDD and run it to make the screen-shots > on Linux Mandrake 10.0. > > > Inasmuch as this doesn't infringe on any NDA of course. > > What is NDA? Sorry, I do not know this abbreviation. > > Regards, > Igor Kachan > kinz at peterlink.ru Sorry: Non Disclosure Agreement. CChris -= B E G I N =- X-EUFORUM: 21886 Date: 2008 May 29 16:38 From: MBianchi <mebian at tisc?l?net.it> Subject: Re: Changes to Euphoria Jeremy, Thanks for answering, perhaps some link could be useful to clarify what I'm talking about: http://www.byte.com/art/9509/sec12/art2.htm (for an interesting lecture) http://www.vector.org.uk/archive/v231/legrand.htm (even more interesting lecture, to me) http://www.vector.org.uk/typography/pview.htm (Where they all are from) http://www.ed-thelen.org/comp-hist/APL-hist.html (most enlightning lecture, from my standpoint) http://www.jsoftware.com/ Please, don't be cheated by strange characters, or almost unreadable sources, or age of most articles contributions, that's not the real point, in my opinion. Looking at the concepts which were at the foundations of this class of languages, I cannot avoid to think to Eu sequences as still misunderstood children of the language.... (by myself, at least, for sure!) :-) Couldn't they be considered the most distinguishing feature of the language, and its 'secret weapon' to be as perfected and empowered as possible ? Cheers. MBianchi -= B E G I N =- X-EUFORUM: 21887 Date: 2008 May 29 16:51 From: c.k.lester <euphoric at ckleste??com> Subject: Re: Changes to Euphoria ken mortenson wrote: > > Loop > ... > End Loop This is a cool idea. All our loop constructs can be replaced by one simple Loop End Loop Loop [from x by y] -- default is from 1 by 1 and optional -- put code here to emulate "for" loop if Loop = 10 then exit end if -- code here for "while" loops End Loop (Can Loop have this dual purpose, to start a Loop AND be its counter?) So, instead of for i=1 to 20 do ...code end for we do Loop ...code if Loop = 20 then exit end if End Loop Instead of q = x while atom(q) do ...code q = x end while q = x Loop if atom(q) then exit end if ...code q = x End Loop Loop..End Loop is a teensie bit more verbose, but it minimalizes the strain on my brain... one loop construct instead of 2+. This was just a fun thought experiment. Please don't claim that I'm adding Loop to Euphoria. 8) -= B E G I N =- X-EUFORUM: 21888 Date: 2008 May 29 16:52 From: CChris <christian.cuvier at a?riculture.g?uv.fr> Subject: Re: Changes to Euphoria ken mortenson wrote: > > Thoughts inspired by Jason and Jeremy's discussion... > > Things in life are often a trade off... > > Programmers develop habits as well as use idioms of a particular language. > Working with a small team of programmers on a huge project I can often tell > which member of my team wrote a particular section of code by how it's > written. If I got my way, my ability to do this would lessen which is a loss. > > So what am I looking to get to compensate for this loss? > > I'm looking for a cleaner code that is easier to read with understanding. > The quicker you get comprehension the less you are stressed. Making the > programmers job easier. Idioms shared make comprehension easier too. > > You can achieve much of this by the minimalist approach. > > Take GOTO's verses structured code as a first example. GOTO allows a > programmer to express themselves very individually (making it easier for > me to tell who wrote the code) while structured code isn't so individual. > The structure tends to enforce a likely similar looking code. And it's > generally quicker to comprehend (especially in a long block of code.) > Structures have a beginning so you know you're in a structure. Even if the > code scrolls of the end of the page, you already know the eventuality. > > With GOTO all you see at the beginning of a loop is a label. That label > doesn't tell you, you are about to enter a loop. Your comprehension will > require you to examine more code. > > You could also minimize by taken out the structure, just use GOTO's > everywhere. It's largely a matter of taste, but I prefer using structured > code. YMMV. > > I'd like to talk about loops. You may think I'm just in love with my idea > (which I admit is partly true) but there are good reasons for my proposal. > I don't believe any on this forum will have any trouble judging the merits > or speaking their mind about it. Some may even oppose an idea not for the > idea itself but because of who proposes it (which I think is a rather sad > thing.) > > It's been noted that FOR loops are an addition to Euphoria which originally > had just while loops. I've used FOR loops so much that I don't give it a > thought usually about whether they should be included or not, but thinking > minimally (don't include what you don't need) I realize there's a good > reason for not having them. Let me start with the while loop and get back > to the for. > > while (1) > ... > end while > > I would claim that quicker comprehension occurs with this construct... > > Loop > ... > End Loop > > Both are infinite loops. Yes, it's not much quicker to comprehend, we're > not dolts after all, but after examining thousands of lines of code, by > 3am I betcha that it becomes a bit more significant. > > I would also claim (without support, just my INTJ assertiveness again) that > comprehension is better when Loop is used to describe Loop, rather than any > other _____ is a loop. Call me crazy. > > Now, how about getting out of the loop? Some language provide a plethora > of ways and are thinking of new ways all the time no doubt (programmers are > such a creative bunch after all.) The fact that sometimes you need to get > out of loops and the beginning, the end, the middle has led to repeat, until, > etc. But for a minimalist the answer is right there, IF. You need something > like EXIT to be used with the IF, but IF eliminates the need for any > additional unneeded keywords because you can put the IF test anywhere in the > loop; beginning, middle and end. Exit tells you immediately that you are > leaving the loop you are currently in. Exit 12, on the other hand, is an > offramp in New Jersey I think! > > What about FOR. What does FOR add to the game that LOOP doesn't give you > already? FOR gives you an INDEX. What a great idea. But perhaps > if a minimalist were trying to add an implicit INDEX he or she might have > realized you don't need to add FOR at all! > > Loop > ... > End Loop > > There it is, did you see it? Looks like anticomprehesion time, doesn't it? > Never fear, I'll get back to that in a moment. > > FOR gives you more than just INDEX. You can tell where to start, where to > end and how much to increment by. > > For LOOP to have a start you'd have to do something like this... > > Loop from 5 > > End Loop > > Well why not? This also gives us something else... > > Loop > ... > End Loop > > ...under the covers can become... > > :Loop > ... > GOTO Loop > > And now quicker comprehension because the lack of from indicates no INDEX > at all. It does however require the idiom Loop from 1, but I don't think > that's such a big deal. Idioms foster comprehension too. > > Other languages use STEP where Euphoria uses BY... I really like BY. I > don't know why, I just do. So we keep it... > > Loop from 10 by 5 > > As long a we understand the INDEX is implicit (with only Loop for loops that > comprehension will come rathe quickly. We don't have any other type of loop > to cause confusion.) > > But how about the end of the loop? With FOR I specify the end in the > declaration. We minimalist don't need it. We already have IF (cond) Exit. > > Again I would restate that use of a single loop construct would make > comprehension quicker and would be reinforced with each subsequent use. > > I stated my case for the two issues I've brought up before (somebody got > a fire extinguisher handy???) > > Am I in love with my ideas. Sure, why not? Can I live with rejection. > Yeah, I suppose. I'll just go into a corner and sulk for awhile.... ;-) > > The biggest problem is that taken up my proposal requires change. Change > is not easy. No, better to say, change is hard. One of the really annoying > things about me is that time often proves me right; by then the sun has > cooled, the earth has left it's orbit and the guys I was fighting with (in > the friendly fashion that programmers do) has left the company. > > But it's not about me. So please consider the merits regardless of the > source. > > I would also argue that a minimalist approach makes for a better compiler > or interpreter but we'd all agree on that, so where's the fun? Frankly, your approach reminds me of Fortran (any flavour). Its superiority in some specific areas of programming has survived programming concepts and hardware changes. Fortran compilers have been the first to introduce some advanced features like statistical reshuffling of code to optimise its speed, etc. Great and granted. So you'd get the do i=1,n,step ... end loop, the arithmetic 3 way if and a few other minimalist thingies. But if I found Fortran comfortable to program with, I'd use Fortran, nand I don't. I even downloaded OpenWatcom F77 compiler, just to try my hand. Good for stuff where speed is more importan than maintainability. But I'd say hardly better. CChris -= B E G I N =- X-EUFORUM: 21889 Date: 2008 May 29 17:01 From: Kat <KAT12 at coo?ah?.net> Subject: Re: Ken's abrasiveness Jeremy Cowgar wrote: > > Kat wrote: > > > > Jason Gade wrote: > > > > <snip> > > > > > I think there should be a compelling reason to add anything --feature or new > > > built-in-- to the interpreter, and a broad consensus as well. Not just "because > > > it's cool." > > > > Jason, CK is adding repeat_str() to Eu, and Eu doesn't have a string type. > > > > Eu does not have a string type, but it certainly has strings. <snip> Where is the definition of strings in Eu, a definition that isn't the exact same as sequences? Kat -= B E G I N =- X-EUFORUM: 21890 Date: 2008 May 29 17:02 From: Kat <KAT12 at coosahs.n??> Subject: Re: Ken's abrasiveness c.k.lester wrote: > > Kat wrote: > > c.k.lester wrote: > > > You were reaching. But what was your point? > > Does it really even matter what my point was? > > Yes, because lying is not socially appropriate. Distorting facts is frowned > upon (unless you're a politician). Yes, it is, so where did i promise to go away like you said? > > Eu doesn't have a string type, there is no string in Eu. They are sequences, > > Okay, so let's call it repeat_seq() I guess. > > > where every 8bit character takes up 32bits. And you are adding a function that > > replaces 3 whole lines of code that do the same thing, > > Well, using for...end for only replaces 3 lines of while...end while. So > repeat_seq() is in good company. > > > a trivial thing, while important stuff doesn't get added. > > By "important stuff" you really mean, "stuff Kat wants." No. I mean like unicode, case/switch, strings, a current thread of unicode and accented chars which is on the list, all the keywords that really mean "goto" unlabeled places, real debuggers, windoze/wx/etc gui debuggers like ooeu has, forward/backward referencing, etc etc. So unless you really have a fascination with my arse that you'd like to detail, would you get off it, CK? Why must you distort everything like that? Are you a politician? > From what I can see, 4.0 is getting a few changes and bug fixes. It's > called progress, and while it might not be at a pace you appreciate, > it's still stepping forward. It sure is a step forward. And I can't contribute because my code is carp. And if i goto jail for simply existing, it would have been my last chance to make any positive difference at all anywhere. And while you and others use strtok or eunet or eubot, my code in them is said to be carp and unuseable. Kat -= B E G I N =- X-EUFORUM: 21891 Date: 2008 May 29 17:54 From: Jeremy Cowgar <jeremy at cow?ar.co?> Subject: Re: Changes to Euphoria c.k.lester wrote: > > > This is a cool idea. All our loop constructs can be replaced by one simple And millions of lines of code broken. > > Loop [from x by y] -- default is from 1 by 1 and optional > -- put code here to emulate "for" loop > if Loop = 10 then exit end if > -- code here for "while" loops > End Loop > The above loop is simple but now go to something like for a = 1 to length(lines) do .... Now you are evaluating the length of lines over and over and over again. Granted, length is stored in the sequence but some other calculation. If that's what you want, you can do it via while 1 do end while If you have trouble typing that, you can use an editor that will expand loop to while 1 do.. Most decent editors do that. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21892 Date: 2008 May 29 17:56 From: Jeremy Cowgar <jeremy at co?gar.c?m> Subject: Re: Changes to Euphoria ken mortenson wrote: > > > You can achieve much of this by the minimalist approach. > I'm going to go out on a limb here and suggest that Euphoria is not a minimalist programming language. That should solve all of this debate? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21893 Date: 2008 May 29 18:00 From: Mike777 <anon4321 at ?mai?.com> Subject: Re: Changes to Euphoria ken mortenson wrote: > > while (1) > ... > end while > > I would claim that quicker comprehension occurs with this construct... > > Loop > ... > End Loop > > Both are infinite loops. Yes, it's not much quicker to comprehend, we're > not dolts after all, but after examining thousands of lines of code, by > 3am I betcha that it becomes a bit more significant. Incorrect. The lack, at the beginning, of the indicator as to finality means I must open up a stack in my brain as I see Loop. And I can't pull from that stack until perhaps much later. Bad idea. > Now, how about getting out of the loop? > But for a minimalist the answer is right there, IF. You need something > like EXIT to be used with the IF, but IF eliminates the need for any > additional unneeded keywords because you can put the IF test anywhere in the > loop; beginning, middle and end. Your beginning and my beginning are different. I want it at **THE** beginning. Not on the next line, indented or not. I want to comprehend as much of the logic that is being proposed, as quickly as possible, without having to span additional lines (sometimes pages and pages of lines) until I get to a test intended to allow for exit. Even if you *allow* such specification at the very beginning, it sounds like you would also *allow* it many lines later. All arguments that rail against GOTO rail against separating the exit test from the definition. I can do that now with a while(1) loop. I don't want to HAVE to do it for all loops. > Exit tells you immediately that you are > leaving the loop you are currently in. For my compiler (read: brain) to do anything "immediately" I must see the conditional test. If that doesn't appear until many lines of code later, I can't do it *immediately*. If this idea had merit, all loops would be while(1) loops, which we already have, and are avoided unless necessary by virtually everybody. > But it's not about me. So please consider the merits regardless of the > source. I see no merit, no matter the source. Mike -= B E G I N =- X-EUFORUM: 21894 Date: 2008 May 29 18:12 From: Judith Evans <camping at ccew?.?et> Subject: Re: IDE crash working with ListViews marky1124 wrote: > > Hi Judith, > > I hope you are reading the forum and open to a request for a bug fix. I'm using > IDE 1.0.3b which is bound against win32lib v0.70.4. I've been getting fairly > regular crashes whilst working with ListViews, the crash displays the following > error: > > Error code 472 > getRect:GetWindowRect failed > > Win32Lib v0.70.4 15-Mar-2008Runtime error (Traceback unavailable) > > > So there's a bug here with remembering the "Single Click Activate" setting as > well as the two types of crash. > > Please let me know if I can provide any further information. > > Cheers, > Mark Yes, there are windows in IDE that are crashing with getRect:GetWindowRect failed. What is happening is that I thought I was being clever to destroy and recreate windows. What I did is at the top of many window's createEx statements I added a statement "if 'name of window' = -1 then" followed by the createEx statments and end if. Later when the user closed the window I destroyed it and set the 'name of window' to -1. This has turned out to be not suce a bright idea and I am gradually changing IDE. What I have been doing is removing the if 'window name' = -1 statements and finding the associated destroy statement and removing it as well as the following 'window name' = -1 statement. I was hoping to have everything ready to release in May except there is an enhancement to Code Editor that does not play with the test version of Win32lib but does work fine with the Mar-15 version. Until that is worked out I can not release IDE unless I temporarily remove the new feature which I don't want to do. I don't know what change from the Mar 15 win32lib to the testing Win32lib may be affecting the feature. I didn't know about the bug remembering the "Single Click Activate" setting. I'll fix that as well; thanks. What I am leading up to is I have no idea when IDE will be next released. judith -= B E G I N =- X-EUFORUM: 21895 Date: 2008 May 29 18:50 From: Jason Gade <jaygade at yahoo.??m> Subject: Re: Changes to Euphoria Jeremy Cowgar wrote: > > ken mortenson wrote: > > > > > > You can achieve much of this by the minimalist approach. > > > > I'm going to go out on a limb here and suggest that Euphoria is not a minimalist > programming language. That should solve all of this debate? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Well, not as minimalist as C or as Ken's proposals, but... I'm good with while and for and (eventually) foreach. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21896 Date: 2008 May 29 19:04 From: Igor Kachan <kinz at peterli??.ru> Subject: Re: Accented characters in identifiers Igor Kachan wrote: > > CChris wrote: > > > > Igor Kachan wrote: > > > > > > CChris wrote: > > > > > > > > [snip] > > > > > > > > What do you think? > >[snip] > > > Could you elaborate on how the bug shows up on Linux? > > Ok, I'll try to find that interpreter on my old reserved > HDD and run it to make the screen-shots > on Linux Mandrake 10.0. There are buggy bilingual interpreter for Linux exu_r and ex.err files for two euphoria/demos/linux programs in this package: http://www.private.peterlink.ru/kinz/exu_r_25.zip Try please, if you want. sanity.ex works ok with exu_r - 100% passed. Regards, Igor Kachan kinz at peterlink.ru -= B E G I N =- X-EUFORUM: 21897 Date: 2008 May 29 19:12 From: ken mortenson <kenneth_john at ??hoo.com> Subject: Re: Changes to Euphoria CChris wrote: > Frankly, your approach reminds me of Fortran (any flavour). Wow. That's not a response I expected. Although defining 5=6 in Fortran did make for interesting debug sessions with friends. > Its superiority in some specific areas of programming has survived programming > concepts and hardware changes. Fortran compilers have been the first to introduce > some advanced features like statistical reshuffling of code to optimise its > speed, etc. > > Great and granted. > So you'd get the do i=1,n,step ... end loop, the arithmetic 3 way if and a few > other minimalist thingies. I believe you are confusing terse syntax with minimalism (you are free to disagree, my opinions and assertions are just vibrations in the wind.) > But if I found Fortran comfortable to program with, I'd use Fortran, nand I > don't. I even downloaded OpenWatcom F77 compiler, just to try my hand. Good > for stuff where speed is more importan than maintainability. But I'd say hardly > better. > > CChris Chris, with all due respect (this is not presymbolic language folks, when I say with respect it has profound meaning to me) I believe you've just set up a straw man argument. 1) Only fools would program in FORTRAN these days. 2) Ken's ideas are just repackaged FORTRAN. 3) Ken is a fool. Thanks for playing. Am I being unfair in my assessment? -= B E G I N =- X-EUFORUM: 21898 Date: 2008 May 29 19:15 From: Jeremy Cowgar <jeremy at ?owga?.com> Subject: Re: Changes to Euphoria ken mortenson wrote: > > 1) Only fools would program in FORTRAN these days. > 2) Ken's ideas are just repackaged FORTRAN. > 3) Ken is a fool. > > Thanks for playing. > > Am I being unfair in my assessment? Ken, We have had enough arguments on the forum for a while. Can we just discuss programming issues? There are people here trying to solve problems, trying to ask questions and get answers, i.e. what the forum is designed to do but their messages are lost in ones like this. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21899 Date: 2008 May 29 19:42 From: ken mortenson <kenneth_john at yahoo?c?m> Subject: Re: Changes to Euphoria Jeremy Cowgar wrote: > We have had enough arguments on the forum for a while. Can we just discuss programming > issues? There are people here trying to solve problems, trying to ask questions > and get answers, i.e. what the forum is designed to do but their messages are > lost in ones like this. I agree with your sentiment Jeremy. I'm not trying to start another fight. It just seems weird that my proposal would be likened to FORTRAN. This is a deep and profound misunderstanding of minimalist goals which are best embodied in that universally recognized stupid fool, Albert Einstein... ...as simple as possible, no simpler. My thoughts may not be welcome, yet still be of value. I've had bosses that only liked an idea if it was their idea. In one case, I'd have to take him to lunch, fill him with Hennesseys and by the end of lunch he was trying to convince me to do my idea because by then it was his idea. Life is weird and doesn't work the way you'd expect. If only we had the source code to humanity, perhaps we could fix it? I don't want to fight. I don't want my ideas labeled stupid when they are reasonable either. This proposal is a modest one. How well it does will be a great indicator of how welcome more profound ideas of mine will be accepted. I'm not going to lose any sleep if nobody likes it. But the ways it is or will be attacked is very revealing to me. I can face a thousand challenger to an idea, but only the one that is truly reasonable is going to have an impact. I'm not attacking the messenger but I'm not so sure others will have that same restraint. Judge for yourself of course. No, I do not want to fight. -= B E G I N =- X-EUFORUM: 21900 Date: 2008 May 29 20:00 From: George Walters <gwalters at ?c.?r.com> Subject: getenv I have set an environmental variable in XP to null. It exists but is empty. getenv returns a -1 which I would think should be {}. An empty sequence, however the function returns -1 which the doc says is undefined. It is not undefined but is a null sequence as I have set it up. Is this correct? I'm using EU 2.4 but I suspect it has not change in the current version. Syntax: x = getenv(s) Description: Return the value of an environment variable. If the variable is undefined, return -1. Comments: Because either a sequence or an atom (-1) might be returned, you should probably assign the result to a variable declared as object. -= B E G I N =- X-EUFORUM: 21901 Date: 2008 May 29 20:07 From: ken mortenson <kenneth_john at ?ahoo?com> Subject: Re: Changes to Euphoria Jeremy Cowgar wrote: > for a = 1 to length(lines) do .... > > Now you are evaluating the length of lines over and over and over again. Granted, > length is stored in the sequence but some other calculation. length(lines) is part of initialization. Only an inexperienced coder would put it inside the loop. To be explicit... LineLength=length(lines) Loop if (a>LineLength) Exit End Loop Yes, we have an explicit var instead of an implicit one. I don't have a problem with that. -= B E G I N =- X-EUFORUM: 21902 Date: 2008 May 29 20:12 From: ken mortenson <kenneth_john at ya?oo.c?m> Subject: Re: Changes to Euphoria ken mortenson wrote: my bad... > LineLength=length(lines) a=1 > Loop a+=1 > if (a>LineLength) Exit > End Loop > > Yes, we have an explicit var instead of an implicit one. I don't have a > problem with that. -= B E G I N =- X-EUFORUM: 21903 Date: 2008 May 29 20:14 From: Jeremy Cowgar <jeremy at ??wgar.com> Subject: Re: Changes to Euphoria ken mortenson wrote: > > are reasonable either. This proposal is a modest one. How well it does > will be a great indicator of how welcome more profound ideas of mine will > be accepted. Ken, I think the real debate is not how good or how bad your ideas are it is does it fit into the purpose of Euphoria. I stated previously and was waiting for a response ... "I'm going to go out on a limb here and suggest that Euphoria is not a minimalist programming language. That should solve all of this debate?" Euphoria is not a minimalist language but you are proposing that it be. The people here do not want a minimalist language. They like Euphoria syntax. Be it wrong or right in your eyes, that is Euphoria and that's why people are here using it, because they like that. I am not telling you to leave, even if I wanted to (which I do not), I have no authority to do that. But I can suggest that if so far what you have outlined is what you think the one true language is, you may be wasting your time here. I say that to save you time, not to be mean or cruel. Some of your suggestions about Euphoria may be right or wrong, but it would be like suggesting to Python that they adopt Ruby syntax. The fact they are python programmers is they like their syntax. I'm just trying to figure out the root problem here. That's all. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21904 Date: 2008 May 29 20:30 From: Jeremy Cowgar <jeremy at cowgar.c?m> Subject: Re: getenv George Walters wrote: > > I have set an environmental variable in XP to null. It exists but is empty. > getenv returns a -1 which I would think should be {}. An empty sequence, > however the function returns -1 which the doc says is undefined. It is not > undefined but is a null sequence as I have set it up. Is this correct? I'm > using EU 2.4 but I suspect it has not change in the current version. > I tried this on Linux: [jeremy at jdesk ~]$ exu test.e -1 [jeremy@jdesk ~]$ export HELLO=A [jeremy at jdesk ~]$ exu test.e {65} [jeremy@jdesk ~]$ export HELLO= [jeremy at jdesk ~]$ exu test.e {} I then tried on Windows Vista: C:\EUPHORIA> exwc test.e -1 C:\EUPHORIA> SET HELLO=A C:\EUPHORIA> exwc test.e {65} C:\EUPHORIA> SET HELLO= C:\EUPHORIA> exwc test.e -1 So, the problem is in 4.0 as well. I then went and made a C app: void main(void) { printf("%s\n", getenv("HELLO")); } And here is where the problem is: C:\EUPHORIA> .\test.exe NULL C:\EUPHORIA> SET HELLO=A C:\EUPHORIA> exwc test.e A C:\EUPHORIA> SET HELLO= C:\EUPHORIA> exwc test.e NULL So, the underlying C function call getenv() doesn't know. So, I am unsure of how Euphoria is going to be able to know. Anyone with thoughts? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21905 Date: 2008 May 29 20:49 From: ken mortenson <kenneth_john at y?hoo.com> Subject: Re: Changes to Euphoria Jeremy Cowgar wrote: > Euphoria is not a minimalist language but you are proposing that it be. The > people here do not want a minimalist language. They like Euphoria syntax. Be > it wrong or right in your eyes, that is Euphoria and that's why people are here > using it, because they like that. Jeremy, I think your a fair individual. You may be surprised to find that I'm not really a minimimist either. I do appreciate some of it's concepts. The truth is, I don't want to give up FOR loops either. I've been using them faithfully since before GWBasic. 6 years before actually. > I am not telling you to leave, even if I wanted to (which I do not), I have > no authority to do that. But I can suggest that if so far what you have outlined > is what you think the one true language is, you may be wasting your time here. > I say that to save you time, not to be mean or cruel. Well, that's about the kindest boot in the ass I've ever gotten. Don't worry, I don't lose sight of my goals. I'm not sure why I'm here, other than community. Yes, I'd like my vision of the IDE and compiler to be realized and I've fallen in love with sequences (which is a hard love, APL requires a new keyboard.) I have no delussions that Euphoria will somehow morph into my vision. Sometimes you have to expose your ideas to the world to see the response. I want to thank all those that have sent me letters of encouragement, it was... nice, surprising and touching. I would not betray names, that wouldn't be right. I have an out of style send of honor. I will probably test the waters a bit longer. It would only be fair that those with need have the opportunity of such new experiences. -= B E G I N =- X-EUFORUM: 21906 Date: 2008 May 29 20:53 From: Matt Lewis <matthewwalkerlewis at g?ail.?om> Subject: Re: Changes to Euphoria ken mortenson wrote: > > Chris, with all due respect (this is not presymbolic language folks, when I > say with respect it has profound meaning to me) I believe you've just set > up a straw man argument. > > 1) Only fools would program in FORTRAN these days. > 2) Ken's ideas are just repackaged FORTRAN. > 3) Ken is a fool. > > Thanks for playing. > > Am I being unfair in my assessment? I would have characterized his assessment a bit differently: 1) CChris doesn't like to code in FORTRAN 2) Ken's ideas somehow remind CChris of FORTRAN 3) CChris wouldn't like to program in a language that followed Ken's ideas Matt -= B E G I N =- X-EUFORUM: 21907 Date: 2008 May 29 20:57 From: Matt Lewis <matthewwalkerlewis at g?a?l.com> Subject: Re: getenv Jeremy Cowgar wrote: > > George Walters wrote: > > > > I have set an environmental variable in XP to null. It exists but is empty. > > getenv returns a -1 which I would think should be {}. An empty sequence, > > however the function returns -1 which the doc says is undefined. It is not > > undefined but is a null sequence as I have set it up. Is this correct? I'm > > using EU 2.4 but I suspect it has not change in the current version. > So, the underlying C function call getenv() doesn't know. So, I am unsure of > how Euphoria is going to be able to know. > > Anyone with thoughts? This is how I would expect it to work. I also tried this in cmd.exe: >SET FOO=BAR >SET FOO FOO=BAR >SET FOO= >SET FOO Environment variable FOO not defined George, I don't think you can really set something to be null, and expect to get an answer back. Matt -= B E G I N =- X-EUFORUM: 21908 Date: 2008 May 29 21:06 From: don cole <doncole at pacbell?ne?> Subject: Squawking To Everybody, While there are bound to be differences of opinion on how to proceed, I don't think we need all this name calling on this forum. You know who you are. If you want to get violent go play Grand Theft Auto ver.4, a recent high tec develepment. Don Cole -= B E G I N =- X-EUFORUM: 21909 Date: 2008 May 29 21:25 From: ken mortenson <kenneth_john at yahoo?c?m> Subject: Re: Changes to Euphoria Matt Lewis wrote: > > ken mortenson wrote: > > > > Chris, with all due respect (this is not presymbolic language folks, when I > > say with respect it has profound meaning to me) I believe you've just set > > up a straw man argument. > > > > 1) Only fools would program in FORTRAN these days. > > 2) Ken's ideas are just repackaged FORTRAN. > > 3) Ken is a fool. > > > > Thanks for playing. > > > > Am I being unfair in my assessment? > > I would have characterized his assessment a bit differently: > > 1) CChris doesn't like to code in FORTRAN > 2) Ken's ideas somehow remind CChris of FORTRAN > 3) CChris wouldn't like to program in a language that followed Ken's ideas > > Matt I stand corrected. Thanks Matt. -= B E G I N =- X-EUFORUM: 21910 Date: 2008 May 29 21:59 From: ChrisBurch2 <crylex at freeuk.co.??> Subject: Re: getenv George Walters wrote: > > > I have set an environmental variable in XP to null. It exists but is empty. > getenv returns a -1 which I would think should be {}. An empty sequence, > however the function returns -1 which the doc says is undefined. It is not > undefined but is a null sequence as I have set it up. Is this correct? I'm > using EU 2.4 but I suspect it has not change in the current version. > > Syntax: x = getenv(s) > > Description: Return the value of an environment variable. If the variable is > undefined, return -1. > > Comments: Because either a sequence or an atom (-1) might be returned, you > should probably assign the result to a variable declared as > object. Hi That is correct. If you set the variable to '' or ' ', then -1 is still returned as practically speaking trailing spaces are removed. Its easy to work around object x x = getenv("ENIRONMENT_VAR"IABLE") if x = -1 then x = {} end if Chris -= B E G I N =- X-EUFORUM: 21911 Date: 2008 May 29 22:21 From: Matt Lewis <matthewwalkerlewis at ??ail.com> Subject: Re: Squawking don cole wrote: > > To Everybody, > While there are bound to be differences of opinion on how to proceed, I don't > think we need all this name calling on this forum. You know who you are. There's some guy on slashdot whose sig always amuses me. It goes something like this: A young idea is a beautiful and a fragile thing. Attack people, not ideas. Matt -= B E G I N =- X-EUFORUM: 21912 Date: 2008 May 29 22:51 From: Derek Parnell <ddparnell at big?ond.com> Subject: Re: Ken's abrasiveness Jeremy Cowgar wrote: > Eu does not have a string type, but it certainly has strings. repeat_str() sounds > like a nice function to have in the standard library: > > <eucode> > ? repeat('A', 2) -- "AA" > ? repeat("ABC", 2) -- {"ABC","ABC"} > ? repeat_str("ABC", 2) -- "ABCABC" > </eucode> But the name is wrong. Consider ... ? repeat_str({"ABC","DEF"}, 2) -- {"ABC","DEF","ABC","DEF"} -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21913 Date: 2008 May 29 22:52 From: ken mortenson <kenneth_john at ?ahoo.com> Subject: Re: Squawking Matt Lewis wrote: > A young idea is a beautiful and a fragile thing. Attack people, not > ideas. Love it. May I steal it? -= B E G I N =- X-EUFORUM: 21914 Date: 2008 May 29 23:07 From: gshingles <gshingles at g?ail.com> Subject: Unicode [was Re: [OT] it's vs its] CChris wrote: > > Chiding someone whose > english is not the native language for poor wording would be ridiculous and > inappropriate. Thank goodness, it hasn't happened. I wouldn't expect that to happen among rational thinking programming types (if there is such a thing :-) If something is unclear then I would expect we would just ask for clarification. > Hey, I never said I wasn't making mistakes myself!! Even without the typos. > I'm not a good typist, and have ranted against too verbose constructs quite > a few times. I've been a native speaker of English my whole life and still get it wrong often. That's just the nature of English, but it does contain enough redundant information that a meaning can usually be derived at least (my guess) 95% of the time. No matter what someone writes :) (Which is a danger too, when that meaning wasn't meant to be there!) To bring it back to Euphoria, yes even EUForum being in English is ... a fact (I was going to say 'unfortunate', 'a problem' etc but it is just a fact as far as I'm concerned). That goes for the interpreter only accepting English keywords, etc. For EUForum, I don't think there's much we can do about that, at least not until machine translation reaches acceptable quality (maybe another 5 years?). For the interpreter itself, the only solution I can think of is to replace keywords dynamically in an editor depending on which language is selected by the end user. And by replace, I mean visually replace, not actually replace them in the file. So the keywords in the source file are all English, but when opened with "this" editor 'while' would be seen as '[insert language equivalent here]' (if it's not in a string literal, etc). That leaves the routine names of any public interface you make available for an include. A good example of a way around that (albeit for a relatively simple API) is Aku's INI File library. The main file is inifile.e which exports tulisIni(..) and ambilIni(..). If you want the English equivalent, you include inifile-en.e which wraps those two functions with English names. So maybe an editor (like Ken's magic IDE) is the way to go to offset some of these language issues, I realise this doesn't cover different character sets, or the need for unicode for non-western or Cyrillic languages though, that's an issue for us to decide whether to incorporate native Unicode into Euphoria (which I am not against). Gary -= B E G I N =- X-EUFORUM: 21915 Date: 2008 May 29 23:12 From: Derek Parnell <ddparnell at b??pond.com> Subject: Re: getenv George Walters wrote: > I have set an environmental variable in XP to null. It exists but is empty. How did you do that? I can't work out a way to set a ENVSYM to null in Windows. SET FOO= in Windows/DOS is the syntax to remove the symbol. It doesn't set it to null. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21916 Date: 2008 May 30 2:05 From: Jeremy Cowgar <jeremy at ?owgar?com> Subject: Re: Unicode [was Re: [OT] it's vs its] gshingles wrote: > > That leaves the routine names of any public interface you make available for > an include. A good example of a way around that (albeit for a relatively simple > API) is Aku's INI File library. The main file is inifile.e which exports tulisIni(..) > and ambilIni(..). If you want the English equivalent, you include inifile-en.e > which wraps those two functions with English names. > Euphoria 4.0 actually has language translation include in the standard library now as well as number/currency and date translation. english.lng ----------- hello Hello world World slang.lng --------- hello What's up world dudes myprog.ex <eucode> include locale.e as l l:lang("english") printf(1, "%s, %s!", {l:w("hello"), l:w("world")}) l:lang("slang") printf(1, "%s, %s!", {l:w("hello"), l:w("world")}) </eucode> Output: Hello, World! What's up, dude! Language files can have multi-line messages as well as contain codes that will go along with printf/sprintf. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21917 Date: 2008 May 30 4:36 From: Shawn Pringle <shawn.pringle at ?mail.c?m> Subject: Str-Kat Kat, A EUPHORIA string is a sequence that contains integer values that each represent a character value. EUPHORIA has a string type as much as C does. A string is not dealt seperately as a special type and it doesn't need to be. Unlike both BASIC and C though there are no special string ops that concatonate, determine the length, and copy. In EUPHORIA you manipulate strings and arrays the same way because they are the same. They are all sequences. And since sequence manipulation is strait forward so is string manipulation. I wouldn't want it to be any other way. Shawn Pringle -= B E G I N =- X-EUFORUM: 21918 Date: 2008 May 30 4:41 From: Dan Moyer <danielmoyer at p??digy.net> Subject: Re: Changes to Euphoria Jeremy Cowgar wrote: > > MBianchi wrote: > > > > I was first attracted to Eu for speed, and for the ability to use an interpreter > > *and* a real compiler, but the most important feature of the language soon became > > its 'devotion' to sequences. > > > > Me too! > > > This made me (erroneously?) think that Eu could have its place in vector languages, > > like APL, J, K, Q etc. etc., with its own character and extentions toward procedural > > languages, but nevertheless in the array languages pool. > > > > I'm sorry. I've played with many, many languages but all of the ones you listed, > I have not. Honestly, I do not know what a vector language is. > > > Reading past threads I noticed that Rob himself had a deep experience with APL, > > so some sort of inheritance of good ideas from it could be a supposition even > > more reasonable. > > > > In all recent discussions I saw on Euforum, I did not see any proposal for better > > sequence ops, or some improvements on sequencing in itself though, but many, > > reasonable or not, I'm not in the position of expressing an honest opinion, > > about procedural structures. > > There is a new library called sequence.e which contains many functions that > work on sequences. I am unsure if any of those would be what you are thinking, > since I am not experienced in vector languages. > > > Just out of curiosity, am I totally wrong in thinking Eu in the vector language > > family, or are Eu sequences already at the best we can achieve (really, no flame > > intended at all), or ...? > > > > Can someone else answer this who understands vector languages? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Haven't read this whole thread yet, but found this reference which also mentions Euphoria: http://c2.com/cgi/wiki?CollectionOrientedProgramming it's from: http://c2.com/cgi/wiki?ArrayOrientedLanguage Dan Moyer -= B E G I N =- X-EUFORUM: 21919 Date: 2008 May 30 4:54 From: Shawn Pringle <shawn.pringle at gma?l.c?m> Subject: Re: Strings Matt Lewis wrote: > > If someone can figure out an easy way to do this, I suspect it'd get into > the language pretty quickly. Of course, that ignores the prospect of > Unicode, which is a whole 'nother can of worms, and also something that > will require some drastic recoding in the back end, though due to the > way that sequences are implemented, probably none in the front end. > > Matt It seems you can do Unicode well enough already: sequence shawn shawn = { 's', 'h', #0430, 'w','n' } -- a is cyrillic a. You can use poke2 from words.e or poke2 from my own pokpeek2.e and use with a unicode C routine. All manipulation works like any another sequence Shawn Pringle -= B E G I N =- X-EUFORUM: 21920 Date: 2008 May 30 4:54 From: Kat <KAT12 at c?osahs.n?t> Subject: Re: Str-Kat Shawn Pringle wrote: > > Kat, > > A EUPHORIA string is a sequence that contains integer > values that each represent a character value. EUPHORIA > has a string type as much as C does. > > A string is not dealt seperately as a special type and > it doesn't need to be. > > Unlike both BASIC and C though there are no special > string ops that concatonate, determine the length, and > copy. In EUPHORIA you manipulate strings and arrays > the same way because they are the same. They are all > sequences. And since sequence manipulation is strait > forward so is string manipulation. I wouldn't want > it to be any other way. Really? Since when does EUPHORIA use only 8 bits for each CHAR in the SEQUENCE ? Since when can you load a 500mbyte STRING into EUPHORIA and not have the OS kill the application with "too much memory used" error (windoze allows each app to have only 2 gigabytes)? Kat, forgetting she wrote STRING-TOKENS lib in archives. -= B E G I N =- X-EUFORUM: 21921 Date: 2008 May 30 5:06 From: Shawn Pringle <shawn.pringle at ??ail.com> Subject: Re: Str-Kat Kat wrote: > > Shawn Pringle wrote: > > > > Kat, > > > > A EUPHORIA string is a sequence that contains integer > > values that each represent a character value. EUPHORIA > > has a string type as much as C does. > > > > A string is not dealt seperately as a special type and > > it doesn't need to be. > > > > Unlike both BASIC and C though there are no special > > string ops that concatonate, determine the length, and > > copy. In EUPHORIA you manipulate strings and arrays > > the same way because they are the same. They are all > > sequences. And since sequence manipulation is strait > > forward so is string manipulation. I wouldn't want > > it to be any other way. > > Really? Since when does EUPHORIA use only 8 bits for each CHAR in the SEQUENCE > ? Since when can you load a 500mbyte STRING into EUPHORIA and not have the OS > kill the application with "too much memory used" error (windoze allows each > app to have only 2 gigabytes)? > > Kat, > forgetting she wrote STRING-TOKENS lib in archives. I didn't say 8 bits for each character. Normally they are 7-bit but for those who are doing non-English they could be 18 bit. Frankly, I don't give a damn. Why would you want to load a 500 MB string into memory at once anyway? Shawn -= B E G I N =- X-EUFORUM: 21922 Date: 2008 May 30 5:16 From: Derek Parnell <ddparnell at b?gpond.co?> Subject: Re: Str-Kat Kat wrote: > > Shawn Pringle wrote: > > > > Kat, > > > > A EUPHORIA string is a sequence that contains integer > > values that each represent a character value. > Really? Ok, its not quite accurate. It should read more like ... "A EUPHORIA string is a sequence that ONLY contains POSTIVE integer values that each represent a character value." > Since when does EUPHORIA use only 8 bits for each CHAR > in the SEQUENCE? Since when is the definition of "string" :: An array of 8-bit unsigned integers? > Since when can you load a 500mbyte STRING into EUPHORIA and > not have the OS kill the application with "too much memory used" > error (windoze allows each app to have only 2 gigabytes)? It doesn't. I bet a Commodore 64 couldn't do that either. Since when do you absolutely, positively, must have all those 500 mega BYTES in RAM at the same time? Are you saying that your task can only be achieved if all those bytes are in RAM simultaneously? -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21923 Date: 2008 May 30 5:23 From: Kat <KAT12 at c?osahs.?et> Subject: Re: Str-Kat Shawn Pringle wrote: > > Kat wrote: > > > > Shawn Pringle wrote: > > > > > > Kat, > > > > > > A EUPHORIA string is a sequence that contains integer > > > values that each represent a character value. EUPHORIA > > > has a string type as much as C does. > > > > > > A string is not dealt seperately as a special type and > > > it doesn't need to be. > > > > > > Unlike both BASIC and C though there are no special > > > string ops that concatonate, determine the length, and > > > copy. In EUPHORIA you manipulate strings and arrays > > > the same way because they are the same. They are all > > > sequences. And since sequence manipulation is strait > > > forward so is string manipulation. I wouldn't want > > > it to be any other way. > > > > Really? Since when does EUPHORIA use only 8 bits for each CHAR in the SEQUENCE > > ? Since when can you load a 500mbyte STRING into EUPHORIA and not have the OS > > kill the application with "too much memory used" error (windoze allows each > > app to have only 2 gigabytes)? > > > > Kat, > > forgetting she wrote STRING-TOKENS lib in archives. > > I didn't say 8 bits for each character. Normally they are 7-bit but for > those who are doing non-English they could be 18 bit. Frankly, I don't > give a damn. There's the problem. Doesn't explain why you brought it up tho. > Why would you want to load a 500 MB string into memory at once anyway? You going to criticise the "why", instead of finding the "how"? Ok, try loading 250 megabytes and *using* it. The 250 will become a gigabyte, and almost any way you use it will copy it, making it 2 gigabytes, and the OS will kill it. Oh, for non-ascii chars in non-usa places, you could still have UTF-8 or UTF-16 strings and still save memory. Your example still used 32bits/char. Kat -= B E G I N =- X-EUFORUM: 21924 Date: 2008 May 30 5:30 From: Kat <KAT12 at co?sa?s.net> Subject: Re: Str Derek Parnell wrote: > > Kat wrote: > > > > Shawn Pringle wrote: > > > > > > Kat, > > > > > > A EUPHORIA string is a sequence that contains integer > > > values that each represent a character value. > > > > Really? > > Ok, its not quite accurate. It should read more like ... > > "A EUPHORIA string is a sequence that ONLY contains POSTIVE integer > values that each represent a character value." > > > Since when does EUPHORIA use only 8 bits for each CHAR > > in the SEQUENCE? > > Since when is the definition of "string" :: An array of 8-bit unsigned integers? It isn't, it could be UTF16 as well, using only 1/2 as much memory as Eu sequences. > > Since when can you load a 500mbyte STRING into EUPHORIA and > > not have the OS kill the application with "too much memory used" > > error (windoze allows each app to have only 2 gigabytes)? > > It doesn't. I bet a Commodore 64 couldn't do that either. Strangely, there is a IDE64 for the C64 that can handle 4gigabyte files on ATA drives. > Since when do you absolutely, positively, must have all those 500 mega BYTES > in RAM at the same time? Are you saying that your task can only be achieved > if all those bytes are in RAM simultaneously? Damn, i pick a number that guarantees windose killing the app, and that's all you can think of. Don't you have anything better to do, Derek, or you just trolling for me? Kat -= B E G I N =- X-EUFORUM: 21925 Date: 2008 May 30 6:00 From: Derek Parnell <ddparnell at bi?pond?com> Subject: Re: Str Kat wrote: > > Derek Parnell wrote: > > > > Kat wrote: > > > > > > Shawn Pringle wrote: > > > > > > > > Kat, > > > > > > > > A EUPHORIA string is a sequence that contains integer > > > > values that each represent a character value. > > > > > > > Really? > > > > Ok, its not quite accurate. It should read more like ... > > > > "A EUPHORIA string is a sequence that ONLY contains POSTIVE integer > > values that each represent a character value." > > > > > Since when does EUPHORIA use only 8 bits for each CHAR > > > in the SEQUENCE? > > > > Since when is the definition of "string" :: An array of 8-bit unsigned integers? > > It isn't, it could be UTF16 as well, using only 1/2 as much memory as Eu sequences. Except for some weird characters, you are right. However, Euphoria strings are encoded as UTF32 only. > > > Since when can you load a 500mbyte STRING into EUPHORIA and > > > not have the OS kill the application with "too much memory used" > > > error (windoze allows each app to have only 2 gigabytes)? > > > > It doesn't. I bet a Commodore 64 couldn't do that either. > > Strangely, there is a IDE64 for the C64 that can handle 4gigabyte files on ATA > drives. That would be a disk right and not RAM? I though the problem was storing huge amounts of bytes in RAM. > > Since when do you absolutely, positively, must have all those 500 mega BYTES > > in RAM at the same time? Are you saying that your task can only be achieved > > if all those bytes are in RAM simultaneously? > > Damn, i pick a number that guarantees windose killing the app, and that's all > you can think of. Hang on a minute ... did you tell us that you picked '500MB' because that's a number that will cause Windows to fail? No you did not. It seemed to me, and I think everyone else, that you have a need to actually have that 500MB in RAM. I know that you have applications that to an awful lot of text analysis etc on stuff from the internet, so I just thought that your concern was that you can't use Euphoria for those apps because of its forced UTF32 encoding. It seems to me that if we had UTF8 encoding that you'd then complain that it can't handle "strings" of more than 2GB! > Don't you have anything better to do, Derek, or you just trolling > for me? Kat, you know me better than that. I'm not shitting you or trying to upset you. I'm trying to get to the real issue AND try to help find ways to overcome it. If you can tell me about some of your real world tasks that Euphoria's strings prevent you from performing, I'd like to find solutions to those for you. So far, I'm not convinced you have a case but I can have my opinion changed with some evidence to the contrary. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21926 Date: 2008 May 30 6:35 From: Kat <KAT12 at coo?a?s.net> Subject: Re: Str Derek Parnell wrote: > > Kat wrote: > > > > Derek Parnell wrote: > > > > > > Kat wrote: > > > > > > > > Shawn Pringle wrote: > > > > > > > > > > Kat, > > > > > > > > > > A EUPHORIA string is a sequence that contains integer > > > > > values that each represent a character value. > > > > > > > > > > Really? > > > > > > Ok, its not quite accurate. It should read more like ... > > > > > > "A EUPHORIA string is a sequence that ONLY contains POSTIVE integer > > > values that each represent a character value." > > > > > > > Since when does EUPHORIA use only 8 bits for each CHAR > > > > in the SEQUENCE? > > > > > > Since when is the definition of "string" :: An array of 8-bit unsigned integers? > > > > It isn't, it could be UTF16 as well, using only 1/2 as much memory as Eu sequences. > > Except for some weird characters, you are right. However, Euphoria strings are > encoded as UTF32 only. > > > > > Since when can you load a 500mbyte STRING into EUPHORIA and > > > > not have the OS kill the application with "too much memory used" > > > > error (windoze allows each app to have only 2 gigabytes)? > > > > > > It doesn't. I bet a Commodore 64 couldn't do that either. > > > > Strangely, there is a IDE64 for the C64 that can handle 4gigabyte files on ATA > > drives. > > That would be a disk right and not RAM? I though the problem was storing huge > amounts of bytes in RAM. Didn't mean to confuse anyone, sorry. I just thought it interesting a 30 year old 8bit computer could seek() in bigger files than Eu can on winxp or vista, or etc.. > > > Since when do you absolutely, positively, must have all those 500 mega BYTES > > > in RAM at the same time? Are you saying that your task can only be achieved > > > if all those bytes are in RAM simultaneously? > > > > Damn, i pick a number that guarantees windose killing the app, and that's all > > you can think of. > > Hang on a minute ... did you tell us that you picked '500MB' because that's > a number that will cause Windows to fail? No you did not. Yes, i did. It was simple way to show Shawn Pringle how a file of 1/4 the limit of windows would cause a termination. *Using* a 250megabyte file in memory will do the same. > It seemed to me, > and I think everyone else, that you have a need to actually have that 500MB > in RAM. I know that you have applications that to an awful lot of text analysis > etc on stuff from the internet, so I just thought that your concern was that > you can't use Euphoria for those apps because of its forced UTF32 encoding. There's also the overhead of memory management by Eu and windose, involving swapping to disk, allocating and freeing, etc.. And again i point out it's not the 500meg loading that sneakily gets you, it's using the smaller amounts of data where the data is copied in the function call, doubling the app's memory needs. Somehow, the apps often get to be 4x whatever the working file's size. > It seems to me that if we had UTF8 encoding that you'd then complain that it > can't handle "strings" of more than 2GB! > > > Don't you have anything better to do, Derek, or you just trolling > > for me? > > Kat, you know me better than that. I'm not shitting you or trying to upset you. > I'm trying to get to the real issue AND try to help find ways to overcome it. > > If you can tell me about some of your real world tasks that Euphoria's strings > prevent you from performing, I'd like to find solutions to those for you. So > far, I'm not convinced you have a case but I can have my opinion changed with > some evidence to the contrary. I wasn't trying to prove anything, nor was i asking for help. I am so accustomed now to Eu not being able to handle large files, or doing so slowly, that my first impulse is to ask how i might get around the limits, not what i might be able to do. For instance, i recently broke up that 16gigabyte file into a few million smaller files, and in that process, i needed a huge_seek(), which i asked about, and i don't think qualified as sufficent proof of any need. I have some 250megabytes of tab-delimited files that should fit into memory, but won't. I'll haveto gets() each file, keep a running list of what i am looking for from each one, possibly writing that out to a file if it won't fit in memory (which i'll find out about about 3 days into the run <sigh>). Kat -= B E G I N =- X-EUFORUM: 21927 Date: 2008 May 30 9:22 From: CChris <christian.cuvier at agriculture.go?v?fr> Subject: Re: IDE crash working with ListViews Judith Evans wrote: > > marky1124 wrote: > > > > Hi Judith, > > > > I hope you are reading the forum and open to a request for a bug fix. I'm using > > IDE 1.0.3b which is bound against win32lib v0.70.4. I've been getting fairly > > regular crashes whilst working with ListViews, the crash displays the following > > error: > > > > Error code 472 > > getRect:GetWindowRect failed > > > > Win32Lib v0.70.4 15-Mar-2008Runtime error (Traceback unavailable) > > > > > > So there's a bug here with remembering the "Single Click Activate" setting as > > well as the two types of crash. > > > > Please let me know if I can provide any further information. > > > > Cheers, > > Mark > > Yes, there are windows in IDE that are crashing with getRect:GetWindowRect failed. > What is happening is that I thought I was being clever to destroy and recreate > windows. What I did is at the top of many window's createEx statements I added > a statement "if 'name of window' = -1 then" followed by the createEx statments > and end if. Later when the user closed the window I destroyed it and set the > 'name of window' to -1. This has turned out to be not suce a bright idea and > I am gradually changing IDE. What I have been doing is removing the if 'window > name' = -1 statements and finding the associated destroy statement and removing > it as well as the following 'window name' = -1 statement. > > I was hoping to have everything ready to release in May except there is an enhancement > to Code Editor that does not play with the test version of Win32lib but does > work fine with the Mar-15 version. Until that is worked out I can not release > IDE unless I temporarily remove the new feature which I don't want to do. I > don't know what change from the Mar 15 win32lib to the testing Win32lib may > be affecting the feature. > > I didn't know about the bug remembering the "Single Click Activate" setting. > I'll fix that as well; thanks. > > What I am leading up to is I have no idea when IDE will be next released. > > judith I expect to release 70.4a around june 15 or 20, after the current work on 4.0 pre alpha is done. This will give me a chance to look into this and Andy's FList issue. There seems to be an urgency to get the alpha out, so it is currently getting top priority after RL. Judith: Could you email the problem to cchris005 hat fastmail doubt fm ? My usual addr is choking full with the devlist activity, guess I'll have to change my SF address binding. CChris -= B E G I N =- X-EUFORUM: 21928 Date: 2008 May 30 9:27 From: CChris <christian.cuvier at agr?culture.gouv.f?> Subject: Re: Accented characters in identifiers Igor Kachan wrote: > > Igor Kachan wrote: > > > > CChris wrote: > > > > > > Igor Kachan wrote: > > > > > > > > CChris wrote: > > > > > > > > > > [snip] > > > > > > > > > > What do you think? > > > >[snip] > > > > > Could you elaborate on how the bug shows up on Linux? > > > > Ok, I'll try to find that interpreter on my old reserved > > HDD and run it to make the screen-shots > > on Linux Mandrake 10.0. > > There are buggy bilingual interpreter for > Linux exu_r and ex.err files for two euphoria/demos/linux > programs in this package: > > <a href="http://www.private.peterlink.ru/kinz/exu_r_25.zip">http://www.private.peterlink.ru/kinz/exu_r_25.zip</a> > > Try please, if you want. > > sanity.ex works ok with exu_r - 100% passed. > > Regards, > Igor Kachan > kinz at peterlink.ru Got those files, which are hardly informative indeed. I think any implementation of acccented chars (allowing any UTF-8 char in identifiers is trivial, they just may cause display concerns when the code page is not the original one) would be done with the new tools in 4.0, and there wil be many. Perhaps you, Rob and Jeremy might want to discuss this? CChris -= B E G I N =- X-EUFORUM: 21929 Date: 2008 May 30 9:40 From: CChris <christian.cuvier at agricu?ture.gouv.?r> Subject: Re: Changes to Euphoria ken mortenson wrote: > > CChris wrote: > > > Frankly, your approach reminds me of Fortran (any flavour). > > Wow. That's not a response I expected. Although defining 5=6 in Fortran > did make for interesting debug sessions with friends. > Interesting... > > Its superiority in some specific areas of programming has survived programming > > concepts and hardware changes. Fortran compilers have been the first to introduce > > some advanced features like statistical reshuffling of code to optimise its > > speed, etc. > > > > Great and granted. > > > So you'd get the do i=1,n,step ... end loop, the arithmetic 3 way if and a few > > other minimalist thingies. > > I believe you are confusing terse syntax with minimalism (you are free to > disagree, my opinions and assertions are just vibrations in the wind.) > How do you get minimalism in a language without terse syntax, and many lines to implement the simplest construct? Admittedly, a language may have terse syntax while not being minimalistic - I thin to APL. You'll admit the border area is quie blurred, unless you have precise definitions, which it would help to state explicitly. > > But if I found Fortran comfortable to program with, I'd use Fortran, nand I > > don't. I even downloaded OpenWatcom F77 compiler, just to try my hand. Good > > for stuff where speed is more importan than maintainability. But I'd say hardly > > better. > > > > CChris > > Chris, with all due respect (this is not presymbolic language folks, when I > say with respect it has profound meaning to me) I believe you've just set > up a straw man argument. > > 1) Only fools would program in FORTRAN these days. > 2) Ken's ideas are just repackaged FORTRAN. > 3) Ken is a fool. > > Thanks for playing. > > Am I being unfair in my assessment? Not unfair, but quite off the spot. My thoughts are more along this: 1/ Only speed freaks, or people who need the speed for specific applications, program in Fortran today, in spite of its being much harder to maintain. And they are by no means fools, since they are able to maintain that. 2/ Ken has been/is/was closr to this school of programming 3/ Ken's experience is different from mine, and from most Eu users' as well. Even though my programming experience is probably quite different from most Eu users' as well. CChris -= B E G I N =- X-EUFORUM: 21930 Date: 2008 May 30 10:02 From: CChris <christian.cuvier at agri??lture.gouv.fr> Subject: Re: Unicode [was Re: [OT] it's vs its] gshingles wrote: > > CChris wrote: > > > > Chiding someone whose > > english is not the native language for poor wording would be ridiculous and > > inappropriate. Thank goodness, it hasn't happened. > > I wouldn't expect that to happen among rational thinking programming types (if there is such a thing > :-) If something is unclear then I would expect > we would just ask for clarification. > > > Hey, I never said I wasn't making mistakes myself!! Even without the typos. > > I'm not a good typist, and have ranted against too verbose constructs quite > > a few times. > > I've been a native speaker of English my whole life and still get it wrong often. > That's just the nature of English, but it does contain enough redundant information > that a meaning can usually be derived at least (my guess) 95% of the time. No > matter what someone writes :) (Which is a danger too, when that meaning wasn't > meant to be there!) > > To bring it back to Euphoria, yes even EUForum being in English is ... a fact > (I was going to say 'unfortunate', 'a problem' etc but it is just a fact as > far as I'm concerned). That goes for the interpreter only accepting English > keywords, etc. > > For EUForum, I don't think there's much we can do about that, at least not until > machine translation reaches acceptable quality (maybe another 5 years?). > > For the interpreter itself, the only solution I can think of is to replace keywords > dynamically in an editor depending on which language is selected by the end > user. And by replace, I mean visually replace, not actually replace them in > the file. So the keywords in the source file are all English, but when opened > with "this" editor 'while' would be seen as '[insert language equivalent here]' > (if it's not in a string literal, etc). > I wasn't that ambitious. Anyone with a C compiler and clear instructions can build from source and edit keylist.e replacing any names as desired. With a small mod in the parser, the whole upper half of UTF-8 is available for isentifiers. I was thinking only to having é, ç or ü in variable or routine names. These are e acute, c with cedilla and u with umlaut; they may display in a strange way on some codepages. And we have to accept © or ¿ (copyright and reverse question mark), because they may mean some reasonable letter on a different code page. > That leaves the routine names of any public interface you make available for > an include. A good example of a way around that (albeit for a relatively simple > API) is Aku's INI File library. The main file is inifile.e which exports tulisIni(..) > and ambilIni(..). If you want the English equivalent, you include inifile-en.e > which wraps those two functions with English names. > > So maybe an editor (like Ken's magic IDE) is the way to go to offset some of > these language issues, I realise this doesn't cover different character sets, > or the need for unicode for non-western or Cyrillic languages though, that's > an issue for us to decide whether to incorporate native Unicode into Euphoria > (which I am not against). > This is a different topic. I'm not opposed to it either, and do not think performance would be affected. But this requires more thought and knowledge. CChris > Gary -= B E G I N =- X-EUFORUM: 21931 Date: 2008 May 30 10:02 From: George Walters <gwalters at sc?rr.?om> Subject: Re: getenv This is not an important issue for me. I just stumbled upon it and was curious. Derek I set the var to null using windows XP programs. start>settings > control panel > systems > advanced > environmental variables Windows allows you to have a name and an empty value for it which I wanted to use at the moment. -= B E G I N =- X-EUFORUM: 21932 Date: 2008 May 30 10:08 From: CChris <christian.cuvier at agric?lture.gouv.f?> Subject: Re: Str-Kat Shawn Pringle wrote: > > Kat, > > A EUPHORIA string is a sequence that contains integer > values that each represent a character value. EUPHORIA > has a string type as much as C does. > > A string is not dealt seperately as a special type and > it doesn't need to be. > > Unlike both BASIC and C though there are no special > string ops that concatonate, determine the length, and > copy. In EUPHORIA you manipulate strings and arrays > the same way because they are the same. They are all > sequences. And since sequence manipulation is strait > forward so is string manipulation. I wouldn't want > it to be any other way. > > Shawn Pringle Compare the memory overhead and performance hit that general sequences take when compared to raw arrays of bytes/words/dwords in memory, and you will want to have different operators and types. The flexibility of sequences is wonderful. However, sequences of bytes/dwords are a fairly common special case, and there is room for the processing speed and memory footprint to be much, much more optimised. CChris -= B E G I N =- X-EUFORUM: 21933 Date: 2008 May 30 10:41 From: Matt Lewis <matthewwalkerlewis at ?mail.c?m> Subject: Re: Strings Shawn Pringle wrote: > > Matt Lewis wrote: > > > > If someone can figure out an easy way to do this, I suspect it'd get into > > the language pretty quickly. Of course, that ignores the prospect of > > Unicode, which is a whole 'nother can of worms, and also something that > > will require some drastic recoding in the back end, though due to the > > way that sequences are implemented, probably none in the front end. > > > > Matt > It seems you can do Unicode well enough already: > > sequence shawn > shawn = { 's', 'h', #0430, 'w','n' } -- a is cyrillic a. Yes, wxEuphoria does this currently. > You can use poke2 from words.e or poke2 from my own pokpeek2.e > and use with a unicode C routine. All manipulation works > like any another sequence Or you can poke2 with the built-in in 4.0. But then you'll also have to wrap all of your I/O functions, too. That's where all the work will be. Matt -= B E G I N =- X-EUFORUM: 21934 Date: 2008 May 30 10:53 From: marky1124 <mark_young at hotmail.c?m> Subject: Re: IDE crash working with ListViews Thank you very much Judith for all the information and the fixed version of IDE_ListViewStyles.ew. It's certainly fixed the bug linked to remembering the "Single Click Activate" setting, and I've been unable to reproduce the crash, so that's looking very hopeful. That's amazingly quick work thank you very much. I do have a 2nd potential bug, although it may be a restriction, with the the ListView functionality. I'll start another thread to discuss. Cheers, Mark -= B E G I N =- X-EUFORUM: 21935 Date: 2008 May 30 11:28 From: marky1124 <mark_young at ?otmail.c?m> Subject: IDE 1.0.3b single column ListView Hi Judith, I want to create a ListView with a single column. My attempts to do so via the IDE keep being thwarted. I'm unsure whether this is a bug or a restriction. Here's how I've tried to do it: 1) Create a ListView control 2) Right click on it -> List View Styles Explorer 3) Click on "To Column Data" 4) Click on the default "ListView2" Title and change it to "Name" 5) Click Change 6) Click Ok 7) Click "Transfer To Properties" NOTE: The Caption now shows as "Name","" 8) If I press F5 to run the code there are two columns, it's not immediately obvious because of the horizontal scroll bar. 9) I can change the Caption to "Name" and get the result I want but if I revisit the List View Styles Explorer then the Caption is changed again to "Name","" I also wanted the single column to be the width of the ListView. I found that the ListView explorer appeared to let me set it by setting "Specific Width" and 196. However that setting didn't take until I also chose "Specific Width" in the "Override Column Width" group in the Visual List View Styles window. That may not be a bug, that might just be my misunderstanding of how to drive the IDE. Perhaps you could comment on whether I'm approaching things wrongly or whether perhaps the IDE could be improved to make this sort of thing more obvious. All the best, Cheers, Mark -= B E G I N =- X-EUFORUM: 21936 Date: 2008 May 30 11:38 From: Shawn Pringle <shawn.pringle at g?ail.c?m> Subject: Re: Str-Kat Derek Parnell wrote: > > Kat wrote: > > > > Shawn Pringle wrote: > > > > > > Kat, > > > > > > A EUPHORIA string is a sequence that contains integer > > > values that each represent a character value. > > > > Really? > > Ok, its not quite accurate. It should read more like ... > > "A EUPHORIA string is a sequence that ONLY contains POSTIVE integer > values that each represent a character value." > > > Since when does EUPHORIA use only 8 bits for each CHAR > > in the SEQUENCE? > > Since when is the definition of "string" :: An array of 8-bit unsigned integers? > I just do not accept the COBOL definition of a string. Eventually we all will be using Unicode in one form or another. Sure, utf-8 would fit in that definition but one could also use 16-bit unsigned integers because the Windows API either does that or returns chars using an unportable codepage. To, me there are only two types of strings I work with: 16-bit and 7-bit ASCII. Inspite of having over 65,000 characters to work with the ANSI Unicode commitee wasn't able to fit everything in that space. I have to blame their waste on things like special codes for Roman numerals(!) and other needless homoglyphs. So, they have scheme for encoding an 18-bit space in multiple 16-bit characters. Don't worry about EUPHORIA strings, the UNICODE commitee will eventually use four billion different code points anyway. Just wait a few years for them to catch up. ;) Shawn > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21937 Date: 2008 May 30 12:21 From: marky1124 <mark_young at hot?ai?.com> Subject: IDE 1.0.3b - four minor niggles Hi Judith, I'm sorry but I've got more IDE issues to discuss. My apologises for these all coming together. I think once I started telling you about one thing then I've remembered, or sometimes discovered, others. 1) If I create a Table object and then click on it, the PropertyList shows a greyed out row called "Table Specs" and "Press to Access". Is that right? If I save the project and then open it again a popup appears saying "After project file is loaded, you need to use TableSpecs to adjust the columns and rows for Table2". The "Table Specs" row is still greyed out, so I can't follow the instruction. 2) If I already have the IDE open and attempt to open a 2nd one, then a splash screen blinks up and closes. Presumably the IDE is closing because only one is allowed at a time, it would be nicer if it paused to popup a message box informing the user of this. 3) If I have a "List View Styles Explorer" window open it's possible to open a 2nd one from the main IDE. If you do this then you can't close both. Cancel on one works, the other won't close. I know this is a "Doctor Doctor it hurts when I do this" situation, but it happened to me by mistake and I was unable to get out of the situation without closing the whole IDE. 4) I've had problems with resizing the design area. Here's a way of demonstrating an issue with it: 1) Open the IDE 2) Now use Project -> Open to open a project with a screen that is wider than the original design window 3) Now use the right edge of the main IDE window to resize wider 4) Now try to use the right edge of the design window to resize wider. It won't let you. It will let you reduce the width but not increase it. 5) To get out of this situation use the bottom right corner of the main IDE window to resize wider and then it will automatically widen the design window. Thanks very much in advance for looking at these issues, Cheers, Mark -= B E G I N =- X-EUFORUM: 21938 Date: 2008 May 30 12:27 From: Jeremy Cowgar <jeremy at c?wgar.co?> Subject: Re: getenv ChrisBurch2 wrote: > > That is correct. If you set the variable to '' or ' ', then -1 is still returned > as practically speaking trailing spaces are removed. > > Its easy to work around > That's not true on Linux. Behavior is different. unset VARNAME -1 export VARNAME=A {A} export VARNAME= {} -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21939 Date: 2008 May 30 12:41 From: Jeremy Cowgar <jeremy at cowgar?c?m> Subject: Re: getenv George Walters wrote: > > This is not an important issue for me. I just stumbled upon it and was curious. > Derek I set the var to null using windows XP programs. > > start>settings > control panel > systems > advanced > environmental variables > > Windows allows you to have a name and an empty value for it which I wanted to > use at the moment. Fact is in Linux getenv() returns {} when an empty value is set as the Linux version of getenv() returns "" on an empty value. However, getenv() returns -1 in Windows on an empty value because the Windows version of getenv() returns NULL on an empty value. Therefore, I think we need to change the way getenv() in Euphoria works to be consistent. I think the Linux version should return -1 as well, thus, a cross-platform application will work in either environment, but will this break existing code? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21940 Date: 2008 May 30 12:56 From: irv mullins <irvm at ellija?.?om> Subject: Re: Str Whether Kat has, or needs to process, 500meg files is irrelevant. What matters here is that the simple, clean, and efficient Euphoria language is actually messy and wasteful when dealing with one of the most common forms of data that needs to be processed. Euphoria was designed that way from the start for the sake of simplicity. Somehow, most other languages were able to implement proper strings without becoming unbearably complex. The result? A little more work for the language developers, but one heck of a lot less work for the programmers who USE the language. Less work? Yes. There are plenty of languages which are smart enough to print out variables with whatever it was you put in them! Not {72,101,108,108,111,32,87,111,114,108,100,33} Besides all that, it seems strange for a language developed when computers were pretty limited in memory to have been intentionally wasteful of that memory. -= B E G I N =- X-EUFORUM: 21941 Date: 2008 May 30 13:01 From: Kenneth Rhodes <ken_rhodes30436 at yahoo.co?> Subject: Re: getenv Jeremy Cowgar wrote: > > George Walters wrote: > > > > This is not an important issue for me. I just stumbled upon it and was curious. > > Derek I set the var to null using windows XP programs. > > > > start>settings > control panel > systems > advanced > environmental variables > > > > Windows allows you to have a name and an empty value for it which I wanted to > > use at the moment. > > Fact is in Linux getenv() returns {} when an empty value is set as the Linux > version of getenv() returns "" on an empty value. However, getenv() returns > -1 in Windows on an empty value because the Windows version of getenv() returns > NULL on an empty value. > > Therefore, I think we need to change the way getenv() in Euphoria works to be > consistent. I think the Linux version should return -1 as well, thus, a cross-platform > application will work in either environment, but will this break existing code? > > -- > Jeremy Cowgar Your kidding, right? {} and " " are empty values. Muck arround with Windows to your hearts content, thats what its there for. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21942 Date: 2008 May 30 13:23 From: Judith Evans <camping at c?ewb?net> Subject: Re: IDE 1.0.3b single column ListView marky1124 wrote: > Perhaps you could comment on whether I'm approaching things wrongly or whether > perhaps the IDE could be improved to make this sort of thing more obvious. > > All the best, > Cheers, > Mark ListView Explorer has always been awkward to use. I do not have a lot of experience with ListView control. One reason the empty column 2 shows up in IDE Property Caption is simply because someone wanted a captioned column and an unnamed column. At the time I couldn't figure out how to accommodate that as well as only the first column caption. There may need to be an extra checkbox to indicate that. Further compounding ListView Explorer is that when I originally wrote this module Win32lib had not added a lot of the routines which make it easier to create the control. It has been on my todo list, and promptly neglected, to bring ListView createEx up to par. Let's see now; have I made all my excuses and "and buts"? Seriously I'd be happy to work with you on improving ListView Explorer and the resultant ListView generated control. I'll e-mail you, judith -= B E G I N =- X-EUFORUM: 21943 Date: 2008 May 30 13:29 From: Derek Parnell <ddparnell at bigpo?d.com> Subject: Re: getenv Jeremy Cowgar wrote: > > George Walters wrote: > > > > This is not an important issue for me. I just stumbled upon it and was curious. > > Derek I set the var to null using windows XP programs. > > > > start>settings > control panel > systems > advanced > environmental variables > > > > Windows allows you to have a name and an empty value for it which I wanted to > > use at the moment. Actually it doesn't appear to be that simple. When using the method above to set a null symbol, what happens is that Windows stores the list of symbols and values you want to have, and when it creates a process it copies all of those EXCEPT any 'empty' symbols to the new process. In short, Windows does not support the concept of symbol having a NULL value. And so the getenv() is correctly returning the fact that the symbol does not exist for your process. > Fact is in Linux getenv() returns {} when an empty value is set as the Linux > version of getenv() returns "" on an empty value. However, getenv() returns > -1 in Windows on an empty value because the Windows version of getenv() returns > NULL on an empty value. Yes, unix supports a NULL valued symbol, but Windows doesn't. > Therefore, I think we need to change the way getenv() in Euphoria works to be > consistent. I think the Linux version should return -1 as well, thus, a cross-platform > application will work in either environment, but will this break existing code? So is there any unix code that just tests for the existence of a symbol regardless of its value? -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21944 Date: 2008 May 30 13:36 From: Jason Gade <jaygade at y?hoo.co?> Subject: Re: Str Kat wrote: > Didn't mean to confuse anyone, sorry. I just thought it interesting a 30 year > old 8bit computer could seek() in bigger files than Eu can on winxp or vista, > or etc.. Well that *is* a different subject, but... Cant' Euphoria seek into 4G files? I thought I had proved that it could (by looking at the source, not by experiment)? > I wasn't trying to prove anything, nor was i asking for help. I am so accustomed > now to Eu not being able to handle large files, or doing so slowly, that my > first impulse is to ask how i might get around the limits, not what i might > be able to do. For instance, i recently broke up that 16gigabyte file into a > few million smaller files, and in that process, i needed a huge_seek(), which > i asked about, and i don't think qualified as sufficent proof of any need. I said I wanted to look into this (unless someone else jumps my claim on it) but I just haven't gotten around to it yet. Slothful, I know, and I'm working on something else first. Which I didn't actually work on last night... :-( -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21945 Date: 2008 May 30 13:54 From: Judith Evans <camping at c?ewb.ne?> Subject: Re: IDE 1.0.3b - four minor niggles marky1124 wrote: > > Hi Judith, > > I'm sorry but I've got more IDE issues to discuss. My apologises for these all > coming together. I think once I started telling you about one thing then I've > remembered, or sometimes discovered, others. I'ts not a problem - I want to know anything that is not intuitive or fails to work clearly. > > > 1) If I create a Table object and then click on it, the PropertyList shows a > greyed out row called "Table Specs" and "Press to Access". Is that right? You need to add a control to the Table Spec first. You can then either use the Properties "Press to Access" or right click in the Table control (not the control you just added.) The Table Specs cell was added to Properties because a user had a very complicated Table array and could find no place to right click to continue with table options. After that you will get a lot of options to build your array. I'll review IDE.htm docs to see where using Table Specs can be described better. I used to distribute some sample projects with IDE. Perhaps I should provide them again as a download option? > > If I save the project and then open it again a popup appears saying "After > project file is loaded, you need to use TableSpecs to adjust the columns and > rows for Table2". The "Table Specs" row is still greyed out, so I can't follow > the instruction. Project message is trying to tell you that you need to add a control to Table Specs and then choose table Specs from Properties or right click in the Table control. > > > 2) If I already have the IDE open and attempt to open a 2nd one, then a splash > screen blinks up and closes. Presumably the IDE is closing because only one > is allowed at a time, it would be nicer if it paused to popup a message box > informing the user of this. The default in IDE's configurations is one instance but you can change that. If you have not changed it then a message box might be nice. I'll check that out. > > > 3) If I have a "List View Styles Explorer" window open it's possible to open > a 2nd one from the main IDE. If you do this then you can't close both. Cancel > on one works, the other won't close. I know this is a "Doctor Doctor it hurts > when I do this" situation, but it happened to me by mistake and I was unable > to get out of the situation without closing the whole IDE. LOL! Sorry to laugh but the "Doctor Doctor" really tickled me. I'll fix this. > > > 4) I've had problems with resizing the design area. Here's a way of demonstrating > an issue with it: > > 1) Open the IDE > 2) Now use Project -> Open to open a project with a screen that is wider > than the original design window IDE resizes Design to fit the project window width and height, scroll bars will be added if the window is large. There are problems if the window is larger than SCREEN size. I have a request on my todo list to address this issue. > 3) Now use the right edge of the main IDE window to resize wider > 4) Now try to use the right edge of the design window to resize wider. It > won't let you. It will let you reduce the width but not increase it. > 5) To get out of this situation use the bottom right corner of the main IDE > window to resize wider and then it will automatically widen the design window. 4) and 5) The problem is there is a hidden window that you can't access. That's why I usually suggest that the window's Properties width and height cells be used instead of trying to expand via the mouse. Here again if you try to expand past SCREEN size there is a problem. It is always nice to get new IDE users because new topics and concerns are brought to the table which only help IDE get better and better. > > > Thanks very much in advance for looking at these issues, > Cheers, > Mark judith -= B E G I N =- X-EUFORUM: 21946 Date: 2008 May 30 14:03 From: Jason Gade <jaygade at yahoo?co?> Subject: Re: Str irv mullins wrote: > > > Whether Kat has, or needs to process, 500meg files is irrelevant. I pretty much agree with this statement, although see below. > What matters here is that the simple, clean, and efficient > Euphoria language is actually messy and wasteful when dealing > with one of the most common forms of data that needs to be processed. > > Euphoria was designed that way from the start for the sake of simplicity. > Somehow, most other languages were able to implement proper strings without > > becoming unbearably complex. The result? A little more work for the > language developers, but one heck of a lot less work for the programmers who > > USE the language. > > Less work? Yes. There are plenty of languages which are smart enough to > print out variables with whatever it was you put in them! > > Not {72,101,108,108,111,32,87,111,114,108,100,33} > > Besides all that, it seems strange for a language developed when computers > were pretty limited in memory to have been intentionally wasteful of that > memory. We don't work with 8-bit machines any more, so why do we need an 8-bit type? I like the orthogonality of the fact that a type in euphoria is either an atom or a sequence and that an atom can represent almost anything. Now, for performance reasons, and because most computers and OSes are still 32-bit, Euphoria has an integer type as well. It's just a subset of atoms, though. Now, for Kat and for others who work with humongous amounts of text data that must remain in the application's data space, I could see where having some kind of string type limited to 8 bits would be useful. However often that comes up. All that has been done so far, though, is discussion of what needs to be done to integrate Unicode into Euphoria. While Jeremy has done a good job of listing the issues involved, no one who has a vested interest has taken the lead on developing for it. Oh, and just as an aside -- in some languages, all values are represented by strings of characters, and only converted to machine numbers as needed for calculations. They're very flexible languages but not very performance-oriented. Javascript comes to mind, probably a couple of others too. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21947 Date: 2008 May 30 14:03 From: Peter Robinson <indorlaw at yahoo.??m.au> Subject: Constrained sequences I may have some time in a few weeks to look at the source, and I'm thinking about the proposal for sequences of types. I'm thinking it shouldn't be all that difficult. Correct me if I'm wrong. The following syntax would only declare a sequence. It doesn't declare any integers or atoms:- sequence of integer x sequence of sequence of atom x What it says is that I'm declaring a sequence, but when I make assignments to it in the future they must fit the constraint (“of integer” or “of sequence of atom”). Only the far right type is open – everything to the left of an “of” must be “sequence”. So, in the parsing phase, instead of adding a symbol to the table with an attribute like SEQ, it needs a pair attribute like {depth, type}, where depth is the level of the last “of” and “type” is the far-right type. So the attributes of the declarations above (using zero-based indexing) would be something like:- sequence of integer x -- { 1, INTEGER } sequence of sequence of atom y -- { 2, ATOM } Notice that both these pairs represent sequences. Any attribute with depth > 0 represents a sequence. Traditional types could be typed by the same system:- sequence x -- { 0, SEQ } atom y -- { 0, ATOM } So for starters, apart from adjusting the scanner and adding the keyword “of”, it would be necessary to slightly change the structure of symbol attributes, and obviously the functions that test those attributes. The constraints only play a significant role when an assignment occurs TO the constrained sequence. But this is a trigger point anyway. The interpreter has to check the type of assignments. The checking code just needs an extra branch to handle data flagged as a constrainted sequence. It has to check that the RHS matches the pattern of the constraint. When such an assignment occurs, I'm figuring that the types of the assigned values are already stored in a symbol table since the interpreter needs them for certain purposes. (e.g when you assign to an element of an element: x[2]{3] = 7, where x[2] must be a sequence with at least 3 elements; OR function_call( x[1] ), where x[1] must be an integer). So the interpreter already handles typing the elements of a sequence. Occurrences of elements of a constrained sequence in an expression would also have to be considered, but I suspect that they're just variations of the above. Once an assignment to a constrained sequence is validated, other operations on the sequence occur as normal. It occurred to me that the proposed atribute pair would also provide an opportunity to implement strings as a form of constrained sequence. It was a coincidence that Matt happened to raise a post about this recently. The new attrbitue pair would have no natural meaning for negative values of the depth variable. Sequences with no (or implied) depth specifictions could be represented by negative depth values. E.g:- ascii sequence x -- { -1, INTEGER } unicode sequence y -- { -2, INTEGER } By treating these quasi-types as constrained sequences, all the usual sequence treatments can apply without change unless we choose to override them. In relation to strings, we may well want to change the translation of operators like “=”. When the interpeter sees a sequence operation on “=”, it must look at the variable's constraint to check whether it is a string, and apply the natural operation. Other types that could be handled by negative attributes are natural numbers (unsigned) and structures (although there' s more thinking to be done on that). A poll has already approved structures. I realise this analysis is simplistic, not based on the actual source code, which I haven't yet read. But I'm struggling to see why these things would be so difficult. Why am I wrong? This idea doesn't deal with the issue of minimal storage of strings, but like Shawn, I think 8-bit chars are becoming obsolete. Cheers Peter Robinson -= B E G I N =- X-EUFORUM: 21948 Date: 2008 May 30 14:38 From: Jeremy Cowgar <jeremy at c??gar.com> Subject: Re: getenv Kenneth Rhodes wrote: > > > Your kidding, right? {} and " " are empty values. Muck arround with Windows > to your hearts content, thats what its there for. > Hm, I do not follow. {} is empty, " " is a space, it's not empty. Fact is that this C program: void main() { printf("...%s...\n", getenv("HELLO")); } acts differently on Windows and Linux. That's the root cause that makes Euphoria act differently also. C:\> c_test.exe ...NULL... C:\> SET HELLO=A C:\> c_test.exe ...A... C:\> SET HELLO= C:\> c_test.exe ...NULL... $ c_test ...NULL... $ export HELLO=A $ c_test ...A... $ export HELLO= $ c_test ...... Notice the last.... It does not return null, it returns "", an empty value. In windows it will return NULL, therefore, in Windows you have no idea if a env var is actually empty or non-existent. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21949 Date: 2008 May 30 15:05 From: Bernie Ryan <xotron at bluef?og?com> Subject: Linux GPM ? Is there away to compile a version of EXU with the GPM mouse enabled ? The 3.1.1 source still contains the GPM code. I still do not understand why this was removed it has nothing to do with ncurses. How can pure Euphoria code be used in Linux without mouse support ? How does this improve the use of Euphoria on Linux ? Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21950 Date: 2008 May 30 15:12 From: Kenneth Rhodes <ken_rhodes30436 at yahoo.?o?> Subject: Re: getenv Jeremy Cowgar wrote: . > ... therefore, in Windows you have no idea if a > env var is actually empty or non-existent. > If the problem is under Windows, shouldn't that be where the fix is applied? I admit that I am hampered by my lack of programming expertise. Your patience is appreciated. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21951 Date: 2008 May 30 15:29 From: Jeremy Cowgar <jeremy at cowgar.c?m> Subject: Re: getenv Kenneth Rhodes wrote: > > If the problem is under Windows, shouldn't that > be where the fix is applied? > Yes, that would be ideal, but I do think that is possible. Windows does not provide the means (that I can find) to tell if an environment variable is set with an empty value or unset. For both of those cases, it returns the same value. So, we have two options. #1 dumb down the Linux version so that Euphoria is consistent or document that getenv() works differently on Windows and Linux (which is not my favorite option). Maybe someone else knows a function call we can make in the win/dos api? -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21952 Date: 2008 May 30 15:53 From: CChris <christian.cuvier at agriculture.go?v.?r> Subject: Re: Constrained sequences Peter Robinson wrote: > > I may have some time in a few weeks to look at the source, and I'm thinking > about the proposal for sequences of types. I'm thinking it shouldn't be all > that difficult. Correct me if I'm wrong. > > The following syntax would only declare a sequence. It doesn't declare any integers > or atoms:- > > sequence of integer x > sequence of sequence of atom x > > What it says is that I'm declaring a sequence, but when I make assignments to > it in the future they must fit the constraint (“of integer” or “of sequence > of atom”). Only the far right type is open – everything to the left of an “of” > must be “sequence”. So, in the parsing phase, instead of adding a symbol to > the table with an attribute like SEQ, it needs a pair attribute like {depth, > type}, where depth is the level of the last “of” and “type” is the far-right > type. So the attributes of the declarations above (using zero-based indexing) > would be something like:- > > sequence of integer x -- { 1, INTEGER } > sequence of sequence of atom y -- { 2, ATOM } > > Notice that both these pairs represent sequences. Any attribute with depth > > 0 represents a sequence. Traditional types could be typed by the same system:- > > sequence x -- { 0, SEQ } I'd think {1, OBJECT} rather. Just nitpicking. > atom y -- { 0, ATOM } > > So for starters, apart from adjusting the scanner and adding the keyword “of”, > it would be necessary to slightly change the structure of symbol attributes, > and obviously the functions that test those attributes. > > The constraints only play a significant role when an assignment occurs TO the > constrained sequence. But this is a trigger point anyway. The interpreter has > to check the type of assignments. The checking code just needs an extra branch > to handle data flagged as a constrainted sequence. It has to check that the > RHS matches the pattern of the constraint. > This means the parser will have more checks to perform. But isn't the aim to help optimised code to be run instead? That's why a separate string type is needed. Possibly in 8/16/32 flavors. > When such an assignment occurs, I'm figuring that the types of the assigned > values are already stored in a symbol table since the interpreter needs them > for certain purposes. (e.g when you assign to an element of an element: x[2]{3] > = 7, where x[2] must be a sequence with at least 3 elements; OR function_call( > x[1] ), where x[1] must be an integer). So the interpreter already handles typing > the elements of a sequence. > > Occurrences of elements of a constrained sequence in an expression would also > have to be considered, but I suspect that they're just variations of the above. > Once an assignment to a constrained sequence is validated, other operations > on the sequence occur as normal. > > It occurred to me that the proposed atribute pair would also provide an opportunity > to implement strings as a form of constrained sequence. It was a coincidence > that Matt happened to raise a post about this recently. > > The new attrbitue pair would have no natural meaning for negative values of > the depth variable. Sequences with no (or implied) depth specifictions could > be represented by negative depth values. E.g:- > > ascii sequence x -- { -1, INTEGER } > unicode sequence y -- { -2, INTEGER } > How would the following be coded: sequence of unicode sequence of sequence of string ? > By treating these quasi-types as constrained sequences, all the usual sequence > treatments can apply without change unless we choose to override them. In relation > to strings, we may well want to change the translation of operators like “=”. > When the interpeter sees a sequence operation on “=”, it must look at the variable's > constraint to check whether it is a string, and apply the natural operation. > > Other types that could be handled by negative attributes are natural numbers > (unsigned) and structures (although there' s more thinking to be done on that). > A poll has already approved structures. > There is a sequence() type operator. How would I build a "sequence of sequence of atom"() operato? Or an UDT based on a nestde sequence? Well this could be handle by an "is" keyword: <eucode> ssa is sequence of sequence of atom type sssma(ssa x) --sequence of sequence of small atoms for i=1 to length(x) do for j=1 to length(x[i]) do if x[i][j]<-3.14 or x[i][j]>9.7 then return 0 end if end for end for return 1 end type </eucode> That would work. > I realise this analysis is simplistic, not based on the actual source code, > which I haven't yet read. But I'm struggling to see why these things would be > so difficult. Why am I wrong? > > This idea doesn't deal with the issue of minimal storage of strings, but like > Shawn, I think 8-bit chars are becoming obsolete. > They are, but a lot of apps still doesn't need to deal with many different languages, so any UTF-8 encoding would do, with minimal storage requirements. Further, copying substings is much faster, because chars in a string don't have a reference count, don't point to atoms holding a large value and so on. This is why I don't think an implementation piggybacking on sequences will reap much bnefits. Unfortunately, like for NIL or large integers, adding a new native type in the current backend looks hopeless. I have been saying that to myself for years, but never felt the motivation to start that rewrite, which would be a huge effort for... which benefits? If we do it collectivelt, there is a chane to get a meaner Eu. Not in 4.0. CChris > Cheers > Peter Robinson -= B E G I N =- X-EUFORUM: 21953 Date: 2008 May 30 15:53 From: Matt Lewis <matthewwalkerlewis at gmail.??m> Subject: Re: Str Jason Gade wrote: > > All that has been done so far, though, is discussion of what needs to be done > to integrate Unicode into Euphoria. While Jeremy has done a good job of > listing the issues involved, no one who has a vested interest has taken the > lead on developing for it. All that's been done *recently*. This issue has been discussed in the past. Adding another primitive type is not a trivial matter. There are some performance implications that I think are difficult to figure out without doing the implementation. Consider that in the backend, we need to always check for different types, first of all. Now consider all of the different operations, and the amount of work this would be to add one additional type. We go from 3*3 to 4*4. Unfortunately, manipulating large amounts of text in memory is just not a task for which euphoria is that well suited, and it's not an easy thing to fix. Matt -= B E G I N =- X-EUFORUM: 21954 Date: 2008 May 30 16:01 From: Matt Lewis <matthewwalkerlewis at ??ail.com> Subject: Re: Linux GPM ? Bernie Ryan wrote: > > Is there away to compile a version of EXU with the GPM mouse enabled ? > The 3.1.1 source still contains the GPM code. > I still do not understand why this was removed it has nothing to do > with ncurses. > > How can pure Euphoria code be used in Linux without mouse support ? I write lots of console stuff that doesn't use mouse. > How does this improve the use of Euphoria on Linux ? libgpm was causing a lot of problems due to incompatible versions. See the discussions here: http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=9&toMonth=1&toYear=D&postedBy=&keywords=gpm Matt -= B E G I N =- X-EUFORUM: 21955 Date: 2008 May 30 16:06 From: Jeremy Cowgar <jeremy at ?owg?r.com> Subject: Re: Str Jason Gade wrote: > > While Jeremy has done a good job of listing > the issues involved, no one who has a vested interest has taken the lead on > developing for it. I mustn't take credit for that. Aku and Derek did that work. I do believe that both Aku and Derek have a vested interest. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21956 Date: 2008 May 30 16:06 From: Kenneth Rhodes <ken_rhodes30436 at ya??o.com> Subject: Re: getenv Jeremy Cowgar wrote: > > Kenneth Rhodes wrote: > > > > If the problem is under Windows, shouldn't that > > be where the fix is applied? > > > > Yes, that would be ideal, but I do think that is possible. Windows does not > provide the means (that I can find) to tell if an environment variable is set > with an empty value or unset. For both of those cases, it returns the same value. > > So, we have two options. #1 dumb down the Linux version so that Euphoria is > consistent or document that getenv() works differently on Windows and Linux > (which is not my favorite option). > > Maybe someone else knows a function call we can make in the win/dos api? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Once again, I'm probably talking over my head here... I do understand the simplicity of "dumbing down" the Linux version of Euphoria, its the easiest way out-- at least as far as cross-platform consistency. However, it strikes me as fundamentally wrong to throw away, ignore, or mis-report information which might be useful. So is it really that difficult to document the deficient functioning of Windows? ;-) Can cross-platform consistency be achieved by a platform contingent routine? Or did we drop platform()? Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21957 Date: 2008 May 30 16:19 From: CChris <christian.cuvier at agricultur?.?ouv.fr> Subject: Re: getenv Jeremy Cowgar wrote: > > Kenneth Rhodes wrote: > > > > If the problem is under Windows, shouldn't that > > be where the fix is applied? > > > > Yes, that would be ideal, but I do think that is possible. Windows does not > provide the means (that I can find) to tell if an environment variable is set > with an empty value or unset. For both of those cases, it returns the same value. > > So, we have two options. #1 dumb down the Linux version so that Euphoria is > consistent or document that getenv() works differently on Windows and Linux > (which is not my favorite option). > > Maybe someone else knows a function call we can make in the win/dos api? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> It will never work under DOS: in the environment segment, an env var is coded as follows: <var-name>=<value>0 The 0 is the separator between two variable descriptions. From this, it would follow that an empty string would be coded as <var-name>=00 But 00 marks the end of the environment table. And, since I strongly suspect M$ uses the same representation of an env block under DOS and Windows, there is nothing as an env string with a null value under Windows. So how did George get one? Simply because he entered it. For any operation on environment, 0 is treated as a variable separator, not as a terminating \0. So there is no inconsistency nor miracle. He didn't get it for long I bet. CChris -= B E G I N =- X-EUFORUM: 21958 Date: 2008 May 30 16:23 From: Lucius L. Hilley III <euphoria at unkma?.co?> Subject: Re: Changes to Euphoria ken mortenson wrote: > > Thoughts inspired by Jason and Jeremy's discussion... <SNIP> > while (1) > ... > end while > > I would claim that quicker comprehension occurs with this construct... > > Loop > ... > End Loop > <SNIP> > > What about FOR. What does FOR add to the game that LOOP doesn't give you > already? FOR gives you an INDEX. What a great idea. But perhaps > if a minimalist were trying to add an implicit INDEX he or she might have > realized you don't need to add FOR at all! > > Loop from 10 by 5 > ... > End Loop > <SNIP> 1) You suggestion looks nice, Yet incomplete. Explained below: 2) Replacing or Removing the current while and for loop structures will make virtually all break virtually every current euphoria program. Incomplete Explained: You don't show using the index values. Someone suggested or assumed that it would be Loop. Thusly: <eucode> Loop from 1 by 1 ? Loop End Loop </eucode> The problem is with nested Loops. <eucode> for iy = 1 to 5 do for ix = 1 to 5 do print(1, {iy, ix}) enf for puts(1, 10) end for </eucode> Best Regards, Lucius L. Hilley III - Unkmar -= B E G I N =- X-EUFORUM: 21959 Date: 2008 May 30 16:32 From: Bernie Ryan <xotron at b?uefrog?com> Subject: Re: Linux GPM ? Matt Lewis wrote: > > Bernie Ryan wrote: > > > > Is there away to compile a version of EXU with the GPM mouse enabled ? > > The 3.1.1 source still contains the GPM code. > > I still do not understand why this was removed it has nothing to do > > with ncurses. > > > > How can pure Euphoria code be used in Linux without mouse support ? > > I write lots of console stuff that doesn't use mouse. > > > How does this improve the use of Euphoria on Linux ? > > libgpm was causing a lot of problems due to incompatible versions. > See the discussions here: > > <a href="http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=9&toMonth=1&toYear=D&postedBy=&keywords=gpm">http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=6&fromYear=9&toMonth=1&toYear=D&postedBy=&keywords=gpm</a> > Matt: It's seems to me that you have had problems with shared objects with wxWindows but didn't ask the users to quit using it. Try doing frame buffer coding in Euphoria without access to a mouse. Using Euphoria I have graphics working, keyboard working, Fonts, Colored Text, and NO MOUSE. I have tried placing gpm code in a shared object but I can't get a way to interface to it with Euphoria. A compiled "C" program will run the GPM mouse. It seems the only way is to have GPM built into Euphoria is the only way I can get access to a mouse. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21960 Date: 2008 May 30 16:33 From: Bernie Ryan <xotron at bluefrog.c??> Subject: Re: getenv CChris wrote: > > Jeremy Cowgar wrote: > > > > Kenneth Rhodes wrote: > > > > > > If the problem is under Windows, shouldn't that > > > be where the fix is applied? > > > > > > > Yes, that would be ideal, but I do think that is possible. Windows does not > > provide the means (that I can find) to tell if an environment variable is set > > with an empty value or unset. For both of those cases, it returns the same value. > > > > So, we have two options. #1 dumb down the Linux version so that Euphoria is > > consistent or document that getenv() works differently on Windows and Linux > > (which is not my favorite option). > > > > Maybe someone else knows a function call we can make in the win/dos api? > > > > -- > > Jeremy Cowgar > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > It will never work under DOS: > in the environment segment, an env var is coded as follows: > > <var-name>=<value>0 > > The 0 is the separator between two variable descriptions. From this, it would > follow that an empty string would be coded as > > <var-name>=00 > > But 00 marks the end of the environment table. > > And, since I strongly suspect M$ uses the same representation of an env block > under DOS and Windows, there is nothing as an env string with a null value under > Windows. > > So how did George get one? Simply because he entered it. For any operation > on environment, 0 is treated as a variable separator, not as a terminating \0. > So there is no inconsistency nor miracle. He didn't get it for long I bet. > > CChris DWORD GetEnvironmentVariable( LPCTSTR lpName, // address of environment variable name LPTSTR lpBuffer, // address of buffer for variable value DWORD nSize // size of buffer, in characters ); Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21961 Date: 2008 May 30 16:36 From: Matt Lewis <matthewwalkerlewis at ?m?il.com> Subject: Re: Linux GPM ? Bernie Ryan wrote: > > It's seems to me that you have had problems with shared objects > with wxWindows but didn't ask the users to quit using it. True, but they didn't have a problem running the interpreter. > Try doing frame buffer coding in Euphoria without access to a mouse. > Using Euphoria I have graphics working, keyboard working, Fonts, > Colored Text, and NO MOUSE. > I have tried placing gpm code in a shared object but I can't get a > way to interface to it with Euphoria. A compiled "C" program will > run the GPM mouse. It seems the only way is to have GPM built into > Euphoria is the only way I can get access to a mouse. I seriously doubt that. If the interpreter could dynamically link, then we should be able to do that from euphoria. I haven't really used gpm at all, so I'm not familiar enough to help out with a wrapper. Matt -= B E G I N =- X-EUFORUM: 21962 Date: 2008 May 30 16:48 From: Jeremy Cowgar <jeremy at ?o?gar.com> Subject: Re: getenv Kenneth Rhodes wrote: > > > Once again, I'm probably talking over my head here... > > I do understand the simplicity of "dumbing down" the Linux version > of Euphoria, its the easiest way out-- at least as far as cross-platform > consistency. However, it strikes me as fundamentally wrong to throw away, > ignore, or mis-report information which might be useful. > Yes, I agree. > So is it really that difficult to document the deficient functioning > of Windows? ;-) > I think this is worse then dumbing down the Linux version. If the language is cross-platform then it should do it's best to be truly cross-platform. As a developer, I want to know that it runs on Windows therefore it will work on Linux. I do not want to have to code all sorts of ifdef's or if platform() checks all over. > Can cross-platform consistency be achieved by a platform contingent > routine? Or did we drop platform()? platform() was never dropped. I posted a message with a misleading subject that made some people think that (I was not thinking). However, there is a much better way of doing platform checks now that will probably lead to platform() becoming a function that no one uses. instead of if platform() = WIN32 then ... you can do ifdef WIN32 then ... The later decision is made at parse time only once in your applications life. The platform() check is done as many times as you call it. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21963 Date: 2008 May 30 16:50 From: Jeremy Cowgar <jeremy at ?owgar.?om> Subject: Re: getenv Bernie Ryan wrote: > > > DWORD GetEnvironmentVariable( > LPCTSTR lpName, // address of environment variable name > LPTSTR lpBuffer, // address of buffer for variable value > DWORD nSize // size of buffer, in characters > ); > Thank you, however, we still have a problem with DOS. Now, how to solve that one... otherwise, we will have Win32 and Linux that work alike, but now your app will have problems in DOS :-( -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21964 Date: 2008 May 30 16:55 From: Jason Gade <jaygade at ?ahoo.co?> Subject: Re: getenv Jeremy Cowgar wrote: > > Bernie Ryan wrote: > > > > > DWORD GetEnvironmentVariable( > > LPCTSTR lpName, // address of environment variable name > > LPTSTR lpBuffer, // address of buffer for variable value > > DWORD nSize // size of buffer, in characters > > ); > > > > Thank you, however, we still have a problem with DOS. Now, how to solve that > one... otherwise, we will have Win32 and Linux that work alike, but now your > app will have problems in DOS :-( > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I don't think that differences in the operating system internals is the responsibility of the interpreter. If the two OSes operate differently for this edge case, so be it, document it and move on. I mean, after a point, being cross-platform is a best-effort proposition. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21965 Date: 2008 May 30 16:59 From: Jeremy Cowgar <jeremy at c??gar.com> Subject: Re: getenv Jason Gade wrote: > > If the two OSes operate differently for this edge case, so be it, document it > and move on. > > I mean, after a point, being cross-platform is a best-effort proposition. > Yes, but we should at least try to solve any problems we can. As a developer, I don't want to have to worry about platform A or platform B or some new platform that 4.1, 4.2, 5.0 makes available that I do not even have access to. If at all possible, I would like my Euphoria app to run across the board as expected. Given, that I am using Euphoria routines. Obviously this is not the desired case if I start linking into OS dependent libraries. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21966 Date: 2008 May 30 17:00 From: Matt Lewis <matthewwalkerlewis at gmail?c?m> Subject: Re: getenv Jeremy Cowgar wrote: > > > So is it really that difficult to document the deficient functioning > > of Windows? ;-) > > > > I think this is worse then dumbing down the Linux version. If the language is > cross-platform then it should do it's best to be truly cross-platform. As a > developer, I want to know that it runs on Windows therefore it will work on > Linux. I do not want to have to code all sorts of ifdef's or if platform() checks > all over. It's true that you want to smooth out a lot of the differences, but at some point you have to recognize that they're different operating systems, and that there are probably valid reasons for letting that come through to the coder. I'm not sure if this is one of those cases, but it's certainly a candidate in my book. Matt -= B E G I N =- X-EUFORUM: 21967 Date: 2008 May 30 17:06 From: Jeremy Cowgar <jeremy at ?o?gar.com> Subject: Re: getenv Matt Lewis wrote: > > It's true that you want to smooth out a lot of the differences, but at some > point you have to recognize that they're different operating systems, and > that there are probably valid reasons for letting that come through to > the coder. I'm not sure if this is one of those cases, but it's certainly > a candidate in my book. > In all my Linux experience I've never seen anything depend on an empty env var. For instance: export ABC that just doesn't happen. export ABC=1 or export ABC=YES happens, which is fine. My suggestion would be to forget about trying to make Windows and DOS work just as Linux, but make Linux act like Windows. That's easy and it's practical. Due to how getenv() works in linux, your checks would have to be: var = genenv("ABC") if atom(var) or length(var) = 0 then ... end if and that's what most people will have to do. Again, while my knowledge is not infinite on Linux I do have a great deal of experience, I have never seen simply the ABC var being in existence triggering something. It's ABC=1, ABC=YES, etc... -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21968 Date: 2008 May 30 17:12 From: Kenneth Rhodes <ken_rhodes30436 at ya?o?.com> Subject: Re: getenv Jeremy Cowgar wrote: > > Kenneth Rhodes wrote: > > > > > > Once again, I'm probably talking over my head here... > > > > I do understand the simplicity of "dumbing down" the Linux version > > of Euphoria, its the easiest way out-- at least as far as cross-platform > > consistency. However, it strikes me as fundamentally wrong to throw away, > > ignore, or mis-report information which might be useful. > > > > Yes, I agree. > > > So is it really that difficult to document the deficient functioning > > of Windows? ;-) > > > > I think this is worse then dumbing down the Linux version. If the language is > cross-platform then it should do it's best to be truly cross-platform. As a > developer, I want to know that it runs on Windows therefore it will work on > Linux. I do not want to have to code ALL SORTS of IFDEF'S... checks > ALL OVER. > ... > instead of if platform() = WIN32 then ... you can do IFDEF WIN32 then ... The later decision is made at parse time ONLY ONCE in your applications life... > > Jeremy Cowgar So which is it? ALL SORTS / ALL OVER or ONLY ONCE? It sounds as though your new ifdef code might simply the cross-platform problem with getenv() without having to dumb down Linux. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21969 Date: 2008 May 30 17:16 From: Jeremy Cowgar <jeremy at c?wgar.com> Subject: Re: getenv Kenneth Rhodes wrote: > > So which is it? ALL SORTS / ALL OVER or ONLY ONCE? It sounds as > though your new ifdef code might simply the cross-platform problem > with getenv() without having to dumb down Linux. > It makes it possible but it does not simplify anything. It just places the burden on the programmer. The programmer must know there is a difference, then he/she must account for that difference in their program. And the real issue to me is that the getenv() returning "" in Linux has no practical benefit. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21970 Date: 2008 May 30 17:24 From: Jason Gade <jaygade at yaho?.com> Subject: Re: Linux GPM ? Matt Lewis wrote: > > Bernie Ryan wrote: > > > > It's seems to me that you have had problems with shared objects > > with wxWindows but didn't ask the users to quit using it. > > True, but they didn't have a problem running the interpreter. > > > Try doing frame buffer coding in Euphoria without access to a mouse. > > Using Euphoria I have graphics working, keyboard working, Fonts, > > Colored Text, and NO MOUSE. > > > I have tried placing gpm code in a shared object but I can't get a > > way to interface to it with Euphoria. A compiled "C" program will > > run the GPM mouse. It seems the only way is to have GPM built into > > Euphoria is the only way I can get access to a mouse. > > I seriously doubt that. If the interpreter could dynamically link, then > we should be able to do that from euphoria. I haven't really used gpm at > all, so I'm not familiar enough to help out with a wrapper. > > Matt Not to butt in too much, but can't Bernie just define EGPM in the makefile or on the command line or in one of the headers? It's just a switch, right? Then Bernie can see whether it works on his system. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21971 Date: 2008 May 30 17:37 From: Kenneth Rhodes <ken_rhodes30436 at ?aho?.com> Subject: Re: getenv Jeremy Cowgar wrote: > > Bernie Ryan wrote: > > > > > DWORD GetEnvironmentVariable( > > LPCTSTR lpName, // address of environment variable name > > LPTSTR lpBuffer, // address of buffer for variable value > > DWORD nSize // size of buffer, in characters > > ); > > > > Thank you, however, we still have a problem with DOS. Now, how to solve that > one... otherwise, we will have Win32 and Linux that work alike, but now your > app will have problems in DOS :-( > > -- > Jeremy Cowgar I haven't a clue as to what Bernie's code actually does. However, if it "smarten's" up Euphoria/Win32 code up to the point where it is compatible with Linux, then I'm all for it. DOS<-->Linux developers will have to bear the burden of any onerous cross-platform code - as they always have, right? Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21972 Date: 2008 May 30 17:43 From: Bernie Ryan <xotron at blu?f?og.com> Subject: Re: getenv Jeremy Cowgar wrote: > And the real issue to me is that the getenv() returning "" in Linux has no > practical benefit. I think it is because on Linux getenv() is used in script files that are looking to see that nothing is in a variable. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21973 Date: 2008 May 30 17:44 From: Jason Gade <jaygade at yaho??com> Subject: Re: getenv Jeremy Cowgar wrote: > > Kenneth Rhodes wrote: > > > > So which is it? ALL SORTS / ALL OVER or ONLY ONCE? It sounds as > > though your new ifdef code might simply the cross-platform problem > > with getenv() without having to dumb down Linux. > > > > It makes it possible but it does not simplify anything. It just places the burden > on the programmer. The programmer must know there is a difference, then he/she > must account for that difference in their program. > > And the real issue to me is that the getenv() returning "" in Linux has no practical > benefit. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Right, but that's a "feature" of Linux and not a "bug" in Windows. If the OS returns an empty string then so should Euphoria. If the OS returns "does not exist" then so should Euphoria. en = getenv("FOO") if atom(en) or length(en) = 0 then -- empty end if -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21974 Date: 2008 May 30 17:46 From: Jeremy Cowgar <jeremy at ?owgar.?om> Subject: Re: getenv Jason Gade wrote: > > > Right, but that's a "feature" of Linux and not a "bug" in Windows. If the OS > returns an empty string then so should Euphoria. If the OS returns "does not > exist" then so should Euphoria. > Hm, then Euphoria does not aim to be a cross-platform language. It's simply a language that will run on multiple platforms. The difference is a cross-platform language handles cross-platform issues for the user. A language that runs on multiple platforms simply does that, it leaves all the cross-platform nuances up to the programmer to know, understand and deal with in code. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21975 Date: 2008 May 30 17:50 From: Bernie Ryan <xotron at blue??og.com> Subject: Re: getenv Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > > > Right, but that's a "feature" of Linux and not a "bug" in Windows. If the OS > > returns an empty string then so should Euphoria. If the OS returns "does not > > exist" then so should Euphoria. > > > > Hm, then Euphoria does not aim to be a cross-platform language. It's simply > a language that will run on multiple platforms. The difference is a cross-platform > language handles cross-platform issues for the user. A language that runs on > multiple platforms simply does that, it leaves all the cross-platform nuances > up to the programmer to know, understand and deal with in code. > > -- Jeremy: THE MOUSE DON'T WORK ON ALL PLATFORMS Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21976 Date: 2008 May 30 17:53 From: Jason Gade <jaygade at yaho?.co?> Subject: Re: getenv Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > > > Right, but that's a "feature" of Linux and not a "bug" in Windows. If the OS > > returns an empty string then so should Euphoria. If the OS returns "does not > > exist" then so should Euphoria. > > > > Hm, then Euphoria does not aim to be a cross-platform language. It's simply > a language that will run on multiple platforms. The difference is a cross-platform > language handles cross-platform issues for the user. A language that runs on > multiple platforms simply does that, it leaves all the cross-platform nuances > up to the programmer to know, understand and deal with in code. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> How does Java deal with this situation? C#/Mono? Kinda like path separation and whether drives are assigned letters or not. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 21977 Date: 2008 May 30 17:54 From: Jeremy Cowgar <jeremy at c?wgar?com> Subject: Re: getenv Bernie Ryan wrote: > > > > > Hm, then Euphoria does not aim to be a cross-platform language. It's simply > > a language that will run on multiple platforms. The difference is a cross-platform > > language handles cross-platform issues for the user. A language that runs on > > multiple platforms simply does that, it leaves all the cross-platform nuances > > up to the programmer to know, understand and deal with in code. > > > > -- > > > THE MOUSE DON'T WORK ON ALL PLATFORMS > I'm sorry to laugh at your problems right now, but that's pretty funny, but this does bring up a good point. At one time it did and it did so the exact same way it did in DOS and Windows. Hence, Euphoria's original goal at being a cross-platform language. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21978 Date: 2008 May 30 17:57 From: Jeremy Cowgar <jeremy at ?owgar?com> Subject: Re: getenv Jason Gade wrote: > > How does Java deal with this situation? C#/Mono? > > Kinda like path separation and whether drives are assigned letters or not. > Hm, I am not sure about getenv, I'll look. About path seperations, they provide functions like we do now in the standard library with filename, fileext, pathinfo, join_path. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21979 Date: 2008 May 30 18:07 From: Derek Parnell <ddparnell at bigpo?d.c?m> Subject: Re: getenv Bernie Ryan wrote: > DWORD GetEnvironmentVariable( > LPCTSTR lpName, // address of environment variable name > LPTSTR lpBuffer, // address of buffer for variable value > DWORD nSize // size of buffer, in characters > ); Please note that this Windows API function does NOT find environment symbols that have no value because such symbols will not exist. In such case the return value is zero. The corresponding function ... BOOL WINAPI SetEnvironmentVariable( LPCTSTR lpName, LPCTSTR lpValue ); does not set/create the symbol if lName is NULL, or points to a null, or points to a string that contains an '=' character. Also, if lpValue is NULL or points to a null, it deletes the symbol if it existed. The symbols are stored in RAM using the format ... Var1=Value1\0 Var2=Value2\0 Var3=Value3\0 ... VarN=ValueN\0\0 But Windows and DOS never has an entry in the form ... VarX=\0 So, I'm inclined to let the current functionality of getvar() remain unchanged. If someone is actually relying on testing for the existance of a symbol regardless of its value then either that code needs to be wrapped in an 'ifdef' block or only run on *nix platforms. However, I suspect that this will be a very rare requirement so I think the risk is acceptable. There is no need to homogenize the function. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21980 Date: 2008 May 30 18:09 From: ken mortenson <kenneth_john at yah?o.c?m> Subject: Re: Str-Kat I've been reading this string thread and I'm quite astonished because of two simple facts. Strings are just data and we are supposed to be programmers. There are different types of strings of course, like BSTRings, unicode strings and every C programmers favorite, null terminated strings. All of these strings are referenced by address via pointer. The last fact is we already have a euphoria word that produces a string... allocate_string. Perhapa this needs to be promoted into the core, but we have it already. I reiterate, we are programmers. We are free to manipulate such strings in any way a programmer can, which is to say any way at all. Limited only by the programmers imagination. So where is the problem? Unicode, same deal. There may be a lot of things that are difficult for programmers to do mainly because of undocumented interfaces, but manipulation of data should not be one of them. Are we not all programmers? Stand up and be counted. -= B E G I N =- X-EUFORUM: 21981 Date: 2008 May 30 18:13 From: Derek Parnell <ddparnell at bigp?n?.com> Subject: Re: Str Jeremy Cowgar wrote: > > Jason Gade wrote: > > > > While Jeremy has done a good job of listing > > the issues involved, no one who has a vested interest has taken the lead on > > developing for it. > > I mustn't take credit for that. Aku and Derek did that work. I do believe that > both Aku and Derek have a vested interest. There will be increase unicode support but somethings are going to be difficult. I think we will start small and simple and as we gather experience and understanding, further developments will happen. It may be that we will need to use a third-party library to support the more advanced functions such as working with case and sorting. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21982 Date: 2008 May 30 18:14 From: Kenneth Rhodes <ken_rhodes30436 at y?hoo?com> Subject: Re: getenv Jeremy Cowgar wrote: > > Kenneth Rhodes wrote: > > > > So which is it? ALL SORTS / ALL OVER or ONLY ONCE? It sounds as > > though your new ifdef code might simply the cross-platform problem > > with getenv() without having to dumb down Linux. > > > > It makes it possible but it does not simplify anything. It just places the burden > on the programmer. The programmer must know there is a difference, then he/she > must account for that difference in their program. > I would say that if the ifdef code only has to be used once, then it is a vast simplification. I understand that the programmer must know the difference, but that knowledge can be easily provided in the language documentation. > And the real issue to me is that the getenv() returning "" in Linux has > no practical benefit. > From Bernie's recent post: >I think it is because on Linux getenv() is used in script files that >are looking to see that nothing is in a variable. From Jason's recent post: >Right, but that's a "feature" of Linux and not a "bug" in Windows. If >the OS returns an empty string then so should Euphoria. If the OS >returns "does not exist" then so should Euphoria. > en = getenv("FOO") > if atom(en) or length(en) = 0 then > -- empty > end if From your (Jeremy Cowgar) recent post: > Hm, then Euphoria does not aim to be a cross-platform language. It's > simply a language that will run on multiple platforms. The difference > is a cross-platform language handles cross-platform issues for the user. > A language that runs on multiple platforms simply does that, it leaves > all the cross-platform nuances up to the programmer to know, understand > and deal with in code. Your solution is not to "handle" a cross-platform issue, but to make a false report about it. Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 21983 Date: 2008 May 30 18:25 From: Lucius L. Hilley III <euphoria at unkmar?c?m> Subject: Re: Str Kat's problem appears to be 2 pronged. 1) Currently, files up to 2 Gb in size can be handled. Beyond that, some file operations may not work correctly. http://www.rapideuphoria.com/lib_h_o.htm#open 2) Can't load the entire file into memory because there isn't enough available. Waste of 4-bytes per 1-byte or 2-bytes of required data makes the problem worse. Result: Break a large file into many smaller files and create a convuluted set of routines just to handle this hack. PS: I moved to euphoria because of the speed and the increased memory available over the QBasic I was using at the time. Simplicity of the language was a bonus. Lucius L. Hilley III - Unkmar -= B E G I N =- X-EUFORUM: 21984 Date: 2008 May 30 18:33 From: Jeremy Cowgar <jeremy at ?owgar?com> Subject: Re: getenv Kenneth Rhodes wrote: > > Your solution is not to "handle" a cross-platform issue, but to > make a false report about it. > Wow. A false report? My attempt at a solution was to simply harmonize platforms which takes place all the time in *any* cross-platform libraries. That's the whole reason for such libraries and languages. Most programmers would not even know what the C api does or returns, they only know the language docs that says "getenv returns the value or -1 on non-existent or empty value." If people want it left alone, that's fine, but I guess this is where I will be glad over being able to override internal functions: <eucode> override function getenv(sequence name) object v v = getenv(name) if atom(v) or length(v) = 0 then return -1 end if return v end function </eucode> So that at least I will not have to deal with senseless checks added for absolutely no value in my code. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 21985 Date: 2008 May 30 18:39 From: Derek Parnell <ddparnell at bigpon?.?om> Subject: Re: getenv Jeremy Cowgar really meant to write: <eucode> override function getenv(sequence name) object v v = eu:getenv(name) ifdef LINUX then if atom(v) or length(v) = 0 then v = -1 end if end ifdef return v end function </eucode> ;-) -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21986 Date: 2008 May 30 18:45 From: ken mortenson <kenneth_john at y?hoo?com> Subject: Re: Changes to Euphoria CChris wrote: > How do you get minimalism in a language without terse syntax, and many lines > to implement the simplest construct? Chris, I'm not just glad you asked this question I'm ecstatic. My cable modem is flaking our on me at the moment, so I hope I can respond in one shot. There's a lot of confusion being expressed about what minimalism is and frankly, I think different people have a different definition. But for me it's embodied in the phrase that some may have difficulty parsing... ...as simple as possible, no simpler. I don't hold completely to the first part. To me, 'as possible' is not to be taken to extreme. For me, the no simpler part is the deal braker. Regarding terseness, some people think minimalist refers to key strokes. It doesn't. It refers to functionality. Being able to read your own code a week later also plays into it. So do I want to eliminate FOR loops? Never. They are very practical and easy to comprehend. But the most important point from a minimalist perspective is they do add something that is near and dear to a minimalists heart... they reduce clutter! Perhaps some will say I'm not a pure minimalist and perhaps they are right. But I hold the principle of less clutter in very high regard. Take for example strings. VB strings are horrible. You don't want to do string manipulation in a loop. The performance impact is incredible. How do I know? Because I've written a string class that I use in situations that require performance and it gives me about a 20x increase in speed. A minimalist keeps his focus on results. How am I able to day in and day out produce over a thousand lines of good code in VB? I couldn't if the language didn't have sufficient capability that I was constantly having to invent the functionality. I also couldn't do it if my job involved interface work all the time, which involves research; an entirely different thing from being creative in a language or writing business logic. Give me functionality. Don't put roadblocks in my way. One roadblock that reduces my efficiency as a programmer is twelve ways to do essentially the same thing. I'm a very safe driver, but I don't have to think much to do it. I've been described by programmers I work with as writing rock solid, bullet proof code. I don't have to expend an extreme amount of concentration to do that either. Because my tool is comfortable and has sufficient functionality in most cases. Where it fails, I try to create a solution, like my string class. I'm not the fastest coder. I worked with some phenominal people that make me look like a sloth where lines of code produced daily are concerned. But for me (and YMMV) being a practical minimalist makes me very efficient. I like that. I have another expression I use. Supermen make bad programmers. Always trying to be smarter than the other guy. Writing tricky code. My code is hardly ever tricky. I'm writing to an audience of other professionals that I have a high regard for. So I try to write as clear as I am able. Terseness often makes code harder to read. So I like it simple, but not too simple. In this case I'm not specifically refering to functionality. I hope I've given you some insight into my thought process. -= B E G I N =- X-EUFORUM: 21987 Date: 2008 May 30 18:50 From: Ricardo Forno <ricardoforno at tutop?a.?om> Subject: Re: Str-Kat My two cents on the subject: Since it seems that something will be done regarding strings, a solution I envision is to add a field to the internal sequence descriptor telling how many bits has an atom for this particular sequence. The programmer will in principle be unaware of the atom length, and EU will automatically take care of this attribute. For example, assume an empty sequence is being filled with chars via &= or append(). This sequence will contain only 8-bits atoms. If an Unicode char is added, then all the previous elements will be transformed to 16-bit format. If an integer is added (having a negative or high value), then all the previous elements will be upgraded to the corresponding size. This will even allow for 1-bit elements, or to have integers up to 128 using a single byte, so increasing both space and time efficiency. After all, this is already done when you append a fraction to a sequence that is only composed by integers. Regards. -= B E G I N =- X-EUFORUM: 21988 Date: 2008 May 30 19:03 From: Bernie Ryan <xotron at ?luefrog.co?> Subject: Re: getenv Derek Parnell wrote: > > Jeremy Cowgar really meant to write: > > > <eucode> > override function getenv(sequence name) > object v > v = eu:getenv(name) > ifdef LINUX then > if atom(v) or length(v) = 0 then > v = -1 > end if > end ifdef > return v > end function > </eucode> > > > ;-) > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell if not getenv(name) and platform() = 3 then return -1 else return getenv(name) ) Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21989 Date: 2008 May 30 19:08 From: Bernie Ryan <xotron at bluefro??com> Subject: Re: getenv CORRECTION Bernie Ryan wrote: > > Derek Parnell wrote: > > > > Jeremy Cowgar really meant to write: > > > > > > <eucode> > > override function getenv(sequence name) > > object v > > v = eu:getenv(name) > > ifdef LINUX then > > if atom(v) or length(v) = 0 then > > v = -1 > > end if > > end ifdef > > return v > > end function > > </eucode> > > > > > > ;-) > > > > -- > > Derek Parnell > > Melbourne, Australia > > Skype name: derek.j.parnell > <eucode> if not getenv(name) and platform() = 3 then return -1 else return getenv(name) end if </eucode> Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21990 Date: 2008 May 30 19:14 From: Derek Parnell <ddparnell at bigpond.?om> Subject: Re: getenv CORRECTION Bernie Ryan wrote: > <eucode> > if not getenv(name) and platform() = 3 > then return -1 > else return getenv(name) end if > </eucode> Apart from the fact that that code would fail (getenv() returns a sequence or an atom), the platform() test would be executed every time and getenv() would be called twice. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell -= B E G I N =- X-EUFORUM: 21991 Date: 2008 May 30 19:19 From: Bernie Ryan <xotron at ?luefrog.com> Subject: Re: getenv CORRECTION Derek Parnell wrote: > > Bernie Ryan wrote: > > > <eucode> > > if not getenv(name) and platform() = 3 > > then return -1 > > else return getenv(name) end if > > </eucode> > > Apart from the fact that that code would fail (getenv() returns a sequence or > an atom), the platform() test would be executed every time and getenv() would > be called twice. > > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell <eucode> if equal(getenv(name),0) and platform() = 3 then return -1 else return getenv(name) end if </eucode> Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 21992 Date: 2008 May 30 19:19 From: Ricardo Forno <ricardoforno at tuto?ia?com> Subject: walk_dir() Hi, Rob. 1) The docs say that walk_dir() returns an integer, but the meaning of this integer is unexplained. 2) The walk_dir() routine receives the result of my function as an object, since the abort_now variable is defined as an object. My routine may actually return a sequence, an atom or an integer. As walk_dir() may return abort_now, the program may receive a non-integer; so, the docs are not right. I am using version 3.1.1. Regards. -= B E G I N =- X-EUFORUM: 21993 Date: 2008 May 30 19:21 From: ken mortenson <kenneth_john at yah?o.co?> Subject: Re: Changes to Euphoria Lucius L. Hilley III wrote: > 1) You suggestion looks nice, Yet incomplete. > Explained below: > 2) Replacing or Removing the current while and for > loop structures will make virtually all break > virtually every current euphoria program. > > Incomplete Explained: > You don't show using the index values. > Someone suggested or assumed that it would be Loop. > Thusly: > <eucode> > Loop from 1 by 1 > ? Loop > End Loop > </eucode> > > The problem is with nested Loops. > <eucode> > for iy = 1 to 5 do > for ix = 1 to 5 do > print(1, {iy, ix}) > enf for > puts(1, 10) > end for > </eucode> > > Best Regards, > Lucius L. Hilley III - Unkmar Thank you Lucius (and please to me ya!) Your question is specific enough to make it easier to respond to. Something I try but often fail to fully achieve. I appreciate it. I think the FOR loop should be retained for precisely the reasons you've outlined, but I'm going to be more specific in a moment (damn cable modem again, grrrr...) I'd also retain while(1) for the reasons other have given, to not break existing code. Frankly, if my ideas are ever to come to fruition it will likely be the result of a clean sheet approach (which I certainly am not ready to jump into at this point.) I would add Loop...End Loop to Euphoria, because we already have it's complete functionality covered by WHILE and FOR (this is the practical minimalist in me kicking in!) Having said all that, let me respond to your specific issues. I don't like the idea of overloading Loop to be the name of the Index. I prefer to call the Index some other name. Let me see, what would I call it? (give me a break, I don't do stand up for a living!) Suspense over, I prefer the name Index, partly because I'm appalled at single letter var names like i. That's the maintenance programmer in me. Try to find all the references to i in somebodies ten page function and you'd know what I'm talking about. BTW, basic overloads the return value of a function the same way and I much prefer the RETURN idiom. I'd also like to not have RETURN in a routine that reaches it's end, but I digress. For nested loops, my Loop...End Loop would general require assignment to a variable because as you enter another level of nesting it goes out of scope (an var with the same name, Index or whatever, is created for each level of nesting and is visible only at it's level.) Let me repeat the example and hopefully the discussion above makes it a bit clearer... Loop from 1 x=Index -- x will get the values 1,2,3,4,5 Loop from 2 by 2 y=Index -- y will get the values 2,4,6 if (y>5) Exit End Loop if (x>4) Exit End Loop If you did this... Loop from 1 if (Index>4) Exit x=Index -- x will get the values 1,2,3,4 Loop from 2 by 2 if (Index>5) Exit y=Index -- y will get the values 2,4 End Loop End Loop Hopefully the difference is clear. Does that help? -= B E G I N =- X-EUFORUM: 21994 Date: 2008 May 30 19:23 From: Jim Brown <jbrown105 at linuxbuddhist?ne?> Subject: Re: getenv CORRECTION This is still broke. It does not address a SINGLE issue that Derek raised. Importantly, getenv() never returns 0 on any platform. equal(getenv(name), "") is what you want to do. But then there are the other two issues Derek raised. Original message: <snip> if equal(getenv(name),0) and platform() = 3 then return -1 else return getenv(name) end if -= B E G I N =- X-EUFORUM: 21995 Date: 2008 May 30 19:26 From: Jim Brown <jbrown105 at linuxbu?dhist?net> Subject: Re: getenv Ok, I'll give you this. I just tried exu 2.3 (old version, back when the binary still linked to and used ncurses and gpm) and it segfaults when I call get_mouse(). In fact mev (gpm's included test utlitiy to prove that GPM works) doesn't work either. I can't get gpm working period. Maybe somebody should fix gpm first, before we talk about integrating it back into Euphoria. Bernie Ryan wrote: > > Jeremy Cowgar wrote: > > > > Jason Gade wrote: > > > > > > > > > Right, but that's a "feature" of Linux and not a "bug" in Windows. If the OS > > > returns an empty string then so should Euphoria. If the OS returns "does not > > > exist" then so should Euphoria. > > > > > > > Hm, then Euphoria does not aim to be a cross-platform language. It's simply > > a language that will run on multiple platforms. The difference is a cross-platform > > language handles cross-platform issues for the user. A language that runs on > > multiple platforms simply does that, it leaves all the cross-platform nuances > > up to the programmer to know, understand and deal with in code. > > > > -- > > Jeremy: > > > THE MOUSE DON'T WORK ON ALL PLATFORMS > > Bernie > > My files in archive: > WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API > > Can be downloaded here: > <a href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a> -= B E G I N =- X-EUFORUM: 21996 Date: 2008 May 30 19:39 From: Matt Lewis <matthewwalkerlewis at gm?i?.com> Subject: Re: Linux GPM ? Jason Gade wrote: > > Not to butt in too much, but can't Bernie just define EGPM in the makefile or > on the command line or in one of the headers? It's just a switch, right? > > Then Bernie can see whether it works on his system. Yeah, he could re-integrate the gpm code into the source. I doubt it would go into the official distribution, for the same reasons it left in the first place, unless we could fix them, which might be possible. Matt -= B E G I N =- X-EUFORUM: 21997 Date: 2008 May 30 19:40 From: ken mortenson <kenneth_john at yahoo??om> Subject: Re: Changes to Euphoria ken mortenson wrote: > I would add Loop...End Loop to Euphoria, because we already have it's > complete functionality covered by WHILE and FOR (this is the practical > minimalist in me kicking in!) This is a typo folks, I would NOT add Loop which the second part should have made clear regardless of my brain fart. Don't get excited. -= B E G I N =- X-EUFORUM: 21998 Date: 2008 May 30 19:41 From: ChrisBurch2 <crylex at freeuk??o.uk> Subject: Re: Str-Kat ken mortenson wrote: <snip> > > Are we not all programmers? Stand up and be counted. Are you not yet entertained? (sorry, wine and gladiatorial reference sprang to mind) Chris -= B E G I N =- X-EUFORUM: 21999 Date: 2008 May 30 19:54 From: ken mortenson <kenneth_john at ya?oo.co?> Subject: Re: Changes to Euphoria ken mortenson wrote: > > Best Regards, > > Lucius L. Hilley III - Unkmar > > Thank you Lucius (and please to me ya!) Should have been, Pleased to meet ya (you). I'm blaming my cable modem which is forcing me to repeatedly reboot both the modem and my computer. The lights indicate it's got a good connection to the central office, but the PC and modem don't seem to be playing nice today... That's my story and I'm sticking to it. -= B E G I N =- X-EUFORUM: 22000 Date: 2008 May 30 20:17 From: Kat <KAT12 at coos?hs.net> Subject: Re: Str-Kat ken mortenson wrote: > > I've been reading this string thread and I'm quite astonished because of two > simple facts. > > Strings are just data and we are supposed to be programmers. > > There are different types of strings of course, like BSTRings, unicode strings > and every C programmers favorite, null terminated strings. All of these > strings are referenced by address via pointer. The last fact is we already > have a euphoria word that produces a string... > > allocate_string. Yeasbut, all the sequence operators will need to be recoded for the string type of your choosing. How exactly the string is implemented then becomes irrelavant (or irreverant for the language purists). Namespacing will make this easier, i suspect: compare(seq,seq) strings:compare(string,string) but it still must be coded up. It would also be easier if Eu returned unused memeory to the OS via some command or other, but an outboard strings.euu (a la .tpu) managing it's memory thru api calls, wluod mkae it wrok too, in a very non-euphorian way. I had considered making this sorta thing, but like working on eunet, eubot, etc, i just couldn't do it with humans in the way objecting to it, i gave up. Kat -= B E G I N =- X-EUFORUM: 22001 Date: 2008 May 30 20:26 From: Lucius L. Hilley III <euphoria at unk?ar.com> Subject: Re: Str-Kat Kat wrote: > > It would also be easier if Eu returned unused > memory to the OS via some command or other, but an outboard strings.euu (a > la .tpu) managing it's memory thru api calls, wluod mkae it wrok too, in a very > non-euphorian way. I had considered making this sorta thing, but like working > on eunet, eubot, etc, i just couldn't do it with humans in the way objecting > to it, i gave up. > > Kat That is a clever work around. Load a euphoria program that shares memory space for the explicit reason of being able to close out and reload said program to manage the memory. Lucius L. Hilley III - Unkmar -= B E G I N =- X-EUFORUM: 22002 Date: 2008 May 30 20:34 From: ken mortenson <kenneth_john at y?hoo.co?> Subject: Re: Str-Kat Kat wrote: > It would also be easier if Eu returned unused > memeory to the OS via some command or other I believe it does Kat. I believe I remember seeing free() routine? -= B E G I N =- X-EUFORUM: 22003 Date: 2008 May 30 21:04 From: Kenneth Rhodes <ken_rhodes30436 at yah?o?com> Subject: Re: getenv CORRECTION Jim Brown wrote: > > This is still broke. It does not address a SINGLE issue that Derek raised. Importantly, > getenv() never returns 0 on any platform. > > equal(getenv(name), "") is what you want to do. But then there are the other > two issues Derek raised. > > Original message: > <snip> > > if equal(getenv(name),0) and platform() = 3 > then return -1 > else return getenv(name) end if Can something like this be done? <eucode> -- what I am trying to say here is: -- if you Window's return of -1 can mean either that -- the env variable has not been set, or it is empty, -- then conform the innocuous ambiguous value to something -- cross_platform compatible -- whats good for the Goose is good for the Gander if equal(getenv(name),-1) and platform() < 3 then return {} -- or " ", if necessary (essentially what George suggested) else return getenv(name) end if </eucode> Ken Rhodes Folding at Home: http://folding.stanford.edu/ 100% MicroSoft Free SuSE Linux 10.3 No AdWare, SpyWare, or Viruses! Life is Good, :-) -= B E G I N =- X-EUFORUM: 22004 Date: 2008 May 30 22:12 From: Kat <KAT12 at coosahs.??t> Subject: Re: Str-Kat ken mortenson wrote: > > Kat wrote: > > > It would also be easier if Eu returned unused > > memeory to the OS via some command or other > > I believe it does Kat. I believe I remember seeing free() routine? So it's only a matter of using allocate() and free()? No wonder it's not been done yet! Where is the magic spell that makes compare() and equal() and string[2] and length(string) work, after you get allocate() and free() typed out? Kat -= B E G I N =- X-EUFORUM: 22005 Date: 2008 May 30 22:16 From: Kat <KAT12 at c?osa?s.net> Subject: Re: Str-Kat ken mortenson wrote: <snip> Ken, you gotta realise, there's been substancial resistance to actual strings in Eu. Sequences are great things, wonderful things. But most of the world is strings, like this sentence. Or this paragraph. And the world is a big place, there's a looooot of strings out there. And most people would rather fight having strings in Eu in any form, especially if i write about it, or write the code. Just ask CK or JBrown. And i just can't justify anything i say, well enough to get anything to change. If i had a code block that did all i believe should be done in Eu, i'd be ashamed to say so. Kat -= B E G I N =- X-EUFORUM: 22006 Date: 2008 May 30 22:21 From: Jim Brown <jbrown105 at l?nuxbu?dhist.net> Subject: Re: Str-Kat Kat wrote: > > ken mortenson wrote: > > > > Kat wrote: > > > > > It would also be easier if Eu returned unused > > > memeory to the OS via some command or other > > > > I believe it does Kat. I believe I remember seeing free() routine? > > So it's only a matter of using allocate() and free()? No wonder it's not been > done yet! Where is the magic spell that makes compare() and equal() and string[2] > and length(string) work, after you get allocate() and free() typed out? > > Kat --string.e --------------------- namespace string global function compare(atom a, atom b) integer i, ac, bc i = 0 ac = peek(a) bc = peek(b) while 1 do if ac > bc then return 1 elsif ac < bc then return -1 elsif (ac = bc) and (ac = 0) then return 0 else i = i + 1 ac = peek(a+i) bc = peek(b+i) end if end while end function global function equal(atom a, atom b) return compare(a,b) = 0 end function global function length(atom a) integer i i = 0 while peek(a+i) != 0 do i = i + 1 end while return i end function --string[2] is impossible to do currently, but there is this workaround global function slice(atom a, integer i) return peek(a+i) end function -= B E G I N =- X-EUFORUM: 22007 Date: 2008 May 30 22:39 From: c.k.lester <euphoric at ??lester.com> Subject: Re: Str-Kat Kat wrote: > > And most people would rather fight having > strings in Eu in any form, especially if i write about it, or write the code. > Just ask CK or JBrown. I've never fought against string. Why do I keep getting caught up in your insanity? Please leave already. -= B E G I N =- X-EUFORUM: 22008 Date: 2008 May 30 22:39 From: ken mortenson <kenneth_john at y?hoo.com> Subject: Re: Str-Kat Kat wrote: > So it's only a matter of using allocate() and free()? No wonder it's not been > done yet! Where is the magic spell that makes compare() and equal() and string[2] > and length(string) work, after you get allocate() and free() typed out? Kat, please don't be snarky. You could write that stuff couldn't you? I would agree that classes would make it simpler, but again it's just data and Euphoria gives you all the tools you need. Could it more effeciently be written into the core? Absolutely. There is where perhaps you could make your case. But your case would be a lot stronger if you had written a string library and already found it's performance limited. I haven't checked the archive but if someone there has written a string library you might find an ally to adding it to the core? Something to think about anyway. I hope I've given you some helpful ideas. -= B E G I N =- X-EUFORUM: 22009 Date: 2008 May 30 23:02 From: Kat <KAT12 at coosa?s.n?t> Subject: Re: Str-Kat c.k.lester wrote: > > Kat wrote: > > > > And most people would rather fight having > > strings in Eu in any form, especially if i write about it, or write the code. > > Just ask CK or JBrown. > > I've never fought against string. "especially if i write about it, or write the code." > Why do I keep getting caught up in your insanity? Please leave already. Proves my point. Kat -= B E G I N =- X-EUFORUM: 22010 Date: 2008 May 30 23:05 From: ken mortenson <kenneth_john at yaho?.co?> Subject: Re: Str-Kat Kat wrote: > Ken, you gotta realise, there's been substancial resistance to actual strings > in Eu. Sequences are great things, wonderful things. But most of the world is > strings, like this sentence. Or this paragraph. And the world is a big place, > there's a looooot of strings out there. And most people would rather fight having > strings in Eu in any form, especially if i write about it, or write the code. > Just ask CK or JBrown. And i just can't justify anything i say, well enough > to get anything to change. If i had a code block that did all i believe should > be done in Eu, i'd be ashamed to say so. I understand your point Kat. These guys must be some kind of minimalists or something, eh? ;-) What you need are allies, Kat. Instead of beating heads and walls (one of my favorite pastimes btw) find out if others have the same need you do. It would make a lot stronger case if you had others to champion the cause. It is unfortunate, but people do resist ideas for lot's of human reasons which have little to do with the ideas themselves. Personally, I don't see a compelling case for strings in Euphoria because I really like how sequences have been implemented (particularly with regard to allocation/deallocation, no garbage collection or memory leaks.) They provide a way to send and receive strings from foreign DLLs. Now if you add strings, you open up a whole lot of potential memory issues that Euphoria thankfully doesn't have. That isn't a show stopper in my mind. I think strings can be handled well. C has the cleanest strings (just a pointer and a null terminator) but it makes the programmer do all the management tasks. VB has a slightly more complicated BSTRing type and does the management for you, but it's a really slow implementation. I wish you well Kat. Any champians out there? Anyone know how to spell champian? -= B E G I N =- X-EUFORUM: 22011 Date: 2008 May 30 23:20 From: Matt Lewis <matthewwalkerlewis at gm?il.c?m> Subject: Re: Str-Kat Kat wrote: > > ken mortenson wrote: > <snip> > > Ken, you gotta realise, there's been substancial resistance to actual strings > in Eu. Sequences are great things, wonderful things. But most of the world is > strings, like this sentence. Or this paragraph. And the world is a big place, > there's a looooot of strings out there. Yes, and euphoria does a pretty good job with most string jobs I've run across. We all agree that sequences with millions of elements don't work well with today's hardware, which happens to be your use case. > And most people would rather fight having strings in Eu in any form, > especially if i write about it, or write the code. Just ask CK or JBrown. Yeah, some people disagree with you. Some don't. But it doesn't matter what anyone wants if no one can figure out a good way to implement them, which happens to be the case with strings. > And i just can't justify anything i say, well enough to get anything to > change. If i had a code block that did all i believe should be done in Eu, > i'd be ashamed to say so. Few people have. It *does* help if you have some code that does it. Asking others to do the work on stuff you're interested in works less well in a volunteer setting. The only code of yours I've seen really has been strtok stuff, and it seemed good enough to me. I haven't really seen the assaults on your code, but I've sure heard you talk about them a lot. I certainly sympathize with your RL issues. Matt -= B E G I N =- X-EUFORUM: 22012 Date: 2008 May 30 23:22 From: ken mortenson <kenneth_john at y?hoo.co?> Subject: Mixed lib by Bernie Ryan I see that Bernie wrote a library that includes string manipulation. What are his thoughts about adding string manipulation into Euphoria's core? I tend to be against it but I've been wrong before (yes, and I'll be wrong in the future too. Place your bets early and often!) -= B E G I N =- X-EUFORUM: 22013 Date: 2008 May 30 23:26 From: Kat <KAT12 at coo?ahs.?et> Subject: Re: Str-Kat ken mortenson wrote: <snip> > But your case would be a lot stronger if you had written a string library > and already found it's performance limited. Did, done, found it so. Try winxp on a computer with 512megs memory, and load and use strtok's parse on a 100kbyte string. 100K byte isn't hard to find, some webpages are over 100Kbytes, NOT counting the css, js, and pics. You'll get bogged down with drive swapping the memory back and forth. Kat -= B E G I N =- X-EUFORUM: 22014 Date: 2008 May 30 23:33 From: Kat <KAT12 at c?o?ahs.net> Subject: Re: Str-Kat ken mortenson wrote: > > Kat wrote: > > > Ken, you gotta realise, there's been substancial resistance to actual strings > > in Eu. Sequences are great things, wonderful things. But most of the world is > > strings, like this sentence. Or this paragraph. And the world is a big place, > > there's a looooot of strings out there. And most people would rather fight having > > strings in Eu in any form, especially if i write about it, or write the code. > > Just ask CK or JBrown. And i just can't justify anything i say, well enough > > to get anything to change. If i had a code block that did all i believe should > > be done in Eu, i'd be ashamed to say so. > > I understand your point Kat. These guys must be some kind of minimalists or > something, eh? ;-) > > What you need are allies, Kat. Instead of beating heads and walls (one of my > favorite pastimes btw) find out if others have the same need you do. > > It would make a lot stronger case if you had others to champion the cause. > It is unfortunate, but people do resist ideas for lot's of human reasons > which have little to do with the ideas themselves. > > Personally, I don't see a compelling case for strings in Euphoria because > I really like how sequences have been implemented (particularly with regard > to allocation/deallocation, no garbage collection or memory leaks.) They > provide a way to send and receive strings from foreign DLLs. > > Now if you add strings, you open up a whole lot of potential memory issues > that Euphoria thankfully doesn't have. That isn't a show stopper in my > mind. I think strings can be handled well. C has the cleanest strings > (just a pointer and a null terminator) but it makes the programmer do all > the management tasks. VB has a slightly more complicated BSTRing type and > does the management for you, but it's a really slow implementation. > > I wish you well Kat. Any champians out there? Anyone know how to spell champian? You have spelled champion before. I can write the code as an include, and it might be better left at that. I used a lot of pointers to strings in TurboPascal (making PowerBasic catch my eye) and lots of pchars, so doing the same in Eu would be fairly easy. Btw, people rallied against pointers too. Pointers seem real un-Eu-like, apparently, and i wouldn't release code that has them, i been flamed for my code enough already, even recently. I even left #Euphoria for CK's pleasure. He still isn't satisfied, as you can see. Kat -= B E G I N =- X-EUFORUM: 22015 Date: 2008 May 31 0:08 From: ken mortenson <kenneth_john at ?ahoo.?om> Subject: Re: Str-Kat Kat wrote: > > ken mortenson wrote: > > But your case would be a lot stronger if you had written a string library > > and already found it's performance limited. > > Did, done, found it so. Try winxp on a computer with 512megs memory, and load > and use strtok's parse on a 100kbyte string. 100K byte isn't hard to find, some > webpages are over 100Kbytes, NOT counting the css, js, and pics. You'll get > bogged down with drive swapping the memory back and forth. I put together computer from the junk I've got around the house that only had 32mb or RAM. I had to search all over the internet for utils and a browser that would perform on such a limited machine (The power switch died on it and I haven't replaced it, so I took another machine out of storage which is a bit better.) Anyway, you're probably able better than some of the younger folk (assuming there are younger folk here, I really have no idea of the age demographic) to remember when we had to tape sorts? I'm talking millions of records on 9 track tape. We made it work. Your always going to find applications where this isn't enough memory. Having four times the memory (or having Euphoria use real strings instead of sequences) isn't going to change that much. I would take a careful look at what you're doing with the data and try to manipulate it in a way that doesn't fill memory so much which is putting you in a disk churning situation because of memory swaps. I usually only deal with a subset of my data. If I had to fill memory with an application I'd probably have to get a machine that allowed me to add enough memory to do the job (I can't afford my dream machine, but that's what others have done.) When I say subset of data, that doesn't mean I'm not processing all of it. It just means I try do deal with it in managable chunks. It sounds to me like you really don't have a string issue. The issue seems to be more about what algoritms your choosing. If you are a bit more detailed in your description, perhaps someone will have some ideas. Best to ya. -= B E G I N =- X-EUFORUM: 22016 Date: 2008 May 31 0:30 From: ken mortenson <kenneth_john at y??oo.com> Subject: Re: Str-Kat Kat wrote: > I can write the code as an include, and it might be better left at that. I used > a lot of pointers to strings in TurboPascal (making PowerBasic catch my eye) > and lots of pchars, so doing the same in Eu would be fairly easy. Btw, people > rallied against pointers too. Pointers seem real un-Eu-like, apparently, and > i wouldn't release code that has them, i been flamed for my code enough already, > even recently. > > I even left #Euphoria for CK's pleasure. He still isn't satisfied, as you can > see. The asbestos underwear does come in handy at times. I never really understood why pointers are so bad, they're just an address in memory. You can get carried away with pointers to pointers to pointers and so forth and I never did like asterisk as a choice of symbol as C uses. I always thought @ said address to me, but it's not so much better either. PowerBasic ever adds a few more wrinkles because they have more than pass by value and pass by address (I can't think of what it is right now but I did find it interesting.) In my O.T.L. (trademark and EEEVIL patent pending) everything is a function where the return value can be ignored (doesn't have to be assigned to a junk variable) Every parameter is passed by address and subs passes back an address. As with Euphoria, this allows passing back multiple values. Which is funny when I think about it cuz I'm really more of a pass by value kind of guy. Go figure! -= B E G I N =- X-EUFORUM: 22017 Date: 2008 May 31 0:49 From: ken mortenson <kenneth_john at ya?oo.c?m> Subject: Dark Basic, Real Basic and Bears, Oh my! I've got a copy of Real Basic which is kind of a kitchen sink language. I find it's performance to be awful and it's development environment puts my teeth on edge. I bought Dark Basic because it sounded good on the box. IMHO, it's unpredictable garbage collection lags are a deal breaker. But I bet Euphoria could add wire model and texturing features that would blow dark basic away. That would be added functionality that would promote usage. Minimalist my ass, I say! Damn the torpedos, full speed ahead. (torpedos during that era being more a keg of black powder than what we think of as a torpedo today.) Dark basic wraps directX. I'd think Euphoria would use OpenG (what is the name? I forgot. Old age, creaping up on me.) Don't shoot the messenger. Just one of many thoughts bouncy around in my pretty little head (think, thunderous echos.) -= B E G I N =- X-EUFORUM: 22018 Date: 2008 May 31 0:55 From: Jeremy Cowgar <jeremy at c?wgar.c?m> Subject: Re: Dark Basic, Real Basic and Bears, Oh my! ken mortenson wrote: > > But I bet Euphoria could add wire model and texturing features that would > blow dark basic away. That would be added functionality that would promote > usage. Minimalist my ass, I say! Damn the torpedos, full speed ahead. > (torpedos during that era being more a keg of black powder than what we > think of as a torpedo today.) > There are SDL, OpenGL and DirectX wrappers in the archive you may be interested in. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 22019 Date: 2008 May 31 1:03 From: Kat <KAT12 at coo?ahs.?et> Subject: Re: Str-Kat ken mortenson wrote: > > Kat wrote: > > > > ken mortenson wrote: > > > But your case would be a lot stronger if you had written a string library > > > and already found it's performance limited. > > > > Did, done, found it so. Try winxp on a computer with 512megs memory, and load > > and use strtok's parse on a 100kbyte string. 100K byte isn't hard to find, some > > webpages are over 100Kbytes, NOT counting the css, js, and pics. You'll get > > bogged down with drive swapping the memory back and forth. > > I put together computer from the junk I've got around the house that only > had 32mb or RAM. I had to search all over the internet for utils and a > browser that would perform on such a limited machine (The power switch died > on it and I haven't replaced it, so I took another machine out of storage > which is a bit better.) > > Anyway, you're probably able better than some of the younger folk (assuming > there are younger folk here, I really have no idea of the age demographic) > to remember when we had to tape sorts? I'm talking millions of records > on 9 track tape. We made it work. Yes, my first NLP program involved 2 5inch floppy drives and 2 to 3 hours of manually swapping disks as the computer requested each disc. I had just escaped using 8 inch floppy drives, still have the drives tho. > Your always going to find applications where this isn't enough memory. > Having four times the memory (or having Euphoria use real strings instead > of sequences) isn't going to change that much. > > I would take a careful look at what you're doing with the data and try > to manipulate it in a way that doesn't fill memory so much which is putting > you in a disk churning situation because of memory swaps. Been there, 20K was a huge amount of ram to have. I once paid $100 for a single byte of solid state static ram in the late 60's. It's how i know how to manage to get Eu to load a 37meg file so it can be match()'d thru several times per second, something i couldn't do with the file out onthe drive. But please, if it makes you happy, continue to question my experience rather than the size of the problem. > I usually only deal with a subset of my data. If I had to fill memory > with an application I'd probably have to get a machine that allowed me > to add enough memory to do the job (I can't afford my dream machine, but > that's what others have done.) > > When I say subset of data, that doesn't mean I'm not processing all of it. > It just means I try do deal with it in managable chunks. Like one short line at a time out of a 100k text file? Is that what you are seriously telling me i should do on a modern computer running Euphoria?? > It sounds to me like you really don't have a string issue. The issue seems > to be more about what algoritms your choosing. If you are a bit more > detailed in your description, perhaps someone will have some ideas. So parsing a single webpage's html is unreasonable, and i should write it to disk, then handle the file only one line at a time and writing it back to the drive? What's the difference there vs letting the OS do it? Why is munging even a 100K byte file too excessive?? > Best to ya. You too. Kat -= B E G I N =- X-EUFORUM: 22020 Date: 2008 May 31 1:05 From: c.k.lester <euphoric at ckle?ter.co?> Subject: Re: Str-Kat Kat wrote: > > I even left #Euphoria for CK's pleasure. He still isn't satisfied, > as you can see. My initial comment in the channel was light-hearted, given our relationship going so far back. I tried to pad it with smilies or misspellings enough to indicate that I wasn't being totally serious... We've both been Euphoria programmers for some time and have shared good conversation in the past. I might even have the logs to prove it. No doubt you do. I've always sympathized with your plight(s), even when the stories become somewhat unbelievable. But then something clicks in your brain and all of a sudden you're this paranoid delusional freak that invites everybody to her pity party and then lashes out at friend and foe. Others know what I'm talking about because it's quite abrupt sometimes... and sad. Kat, I've never bad-mouthed your code, and I've never seen or heard anybody else say anything bad about your code. I suspect that nobody really has and that you've taken criticism out of context or you're so lacking in self- confidence that you consider all negative words to be direct attacks against poor little you. As far as I'm concerned, you have good ideas and are very skilled at getting computers to do what you want. I used strtok for a long time until improvements were made and certain funcs and procs were sped up. At that time, I think you were on sabbatical from Euphoria. It was a peaceful time. :) So, I don't care if you stick around or not. My wish is that you would leave the delusional paranoia behind, the victim-mentality, or whatever psychosis/ neurosis is driving you these days, and become a mature member of this Euphoria community, who understands that not everybody is going to see things the same way, and that some ideas just won't be implemented. Heck, I want a few things still (see the requested features list) that I don't think will be implemented unless I do them myself... and right now, until that lottery ticket hits, I don't have the time or skills to touch the interpreter. However, I shouldn't say never because there's grumbling about adding GOTO to Euphoria. Will you live to see it?!!? I pray you're not rotting in jail subsisting on bread, water, and daily beatings when that day comes. -= B E G I N =- X-EUFORUM: 22021 Date: 2008 May 31 1:13 From: ken mortenson <kenneth_john at ya?oo.co?> Subject: Re: Dark Basic, Real Basic and Bears, Oh my! What's with the latest win32lib, it seems to be a password protected zip? My brain was telling me I was missing something between the OpenG & L. -= B E G I N =- X-EUFORUM: 22022 Date: 2008 May 31 1:34 From: ken mortenson <kenneth_john at yahoo?co?> Subject: Re: Str-Kat Kat wrote: > Like one short line at a time out of a 100k text file? Is that what you are > seriously telling me i should do on a modern computer running Euphoria?? If it works. > So parsing a single webpage's html is unreasonable I don't know your application. I can't say one way or the other. But I can say, there are cats and there are ways to skin 'em. When you come up with a solution, I'd be happy to hear how you did it. -= B E G I N =- X-EUFORUM: 22023 Date: 2008 May 31 2:13 From: c.k.lester <euphoric at ckle?ter?com> Subject: Re: Dark Basic, Real Basic and Bears, Oh my! ken mortenson wrote: > > Dark basic wraps directX. I'd think Euphoria would use OpenG (what is the > name? I forgot. Old age, creaping up on me.) OMG! Have you checked the archive? Check out Akita's stuff. wooooo! -= B E G I N =- X-EUFORUM: 22024 Date: 2008 May 31 2:14 From: c.k.lester <euphoric at cklester.co?> Subject: Re: Dark Basic, Real Basic and Bears, Oh my! Jeremy Cowgar wrote: > ken mortenson wrote: > > But I bet Euphoria could add wire model and texturing features that would > > blow dark basic away. That would be added functionality that would promote > > usage. Minimalist my ass, I say! Damn the torpedos, full speed ahead. > > (torpedos during that era being more a keg of black powder than what we > > think of as a torpedo today.) > There are SDL, OpenGL and DirectX wrappers in the archive you may be interested > in. Okay, so I reply as I read them... so, yeah, what he said. :) -= B E G I N =- X-EUFORUM: 22025 Date: 2008 May 31 2:16 From: c.k.lester <euphoric at ckleste?.co?> Subject: Re: Str-Kat ken mortenson wrote: > > ...there are cats and there are ways to skin 'em. Oooooh! Never say that to a Kat!!! -= B E G I N =- X-EUFORUM: 22026 Date: 2008 May 31 3:01 From: Jeremy Cowgar <jeremy at co?ga?.com> Subject: Re: Dark Basic, Real Basic and Bears, Oh my! c.k.lester wrote: > > Okay, so I reply as I read them... so, yeah, what he said. :) > What I do is I read through the messages one by one using the "Next" link. When I find one that I want (or think I want) to reply to, I click the "Next" link with the Control key pressed. In Firefox, this opens it in a new tab. I then continue on reading this way until I get to the very end. If I see an answer has been given to a thread I wanted to comment on, then I simply go back to it's tab (which still has the message there waiting for me to reply to) and close that. When I'm all done, the only tabs left open are ones that I want to answer and have not been answered. Just one way of doing it. -- Jeremy Cowgar http://jeremy.cowgar.com -= B E G I N =- X-EUFORUM: 22027 Date: 2008 May 31 4:21 From: Peter Robinson <indorlaw at ?ahoo.?om.au> Subject: Re: Constrained sequences Hi Chris CChris wrote: > > 0 represents a sequence. Traditional types could be typed by the same system:- > > > > sequence x -- { 0, SEQ } > > I'd think {1, OBJECT} rather. Just nitpicking. Not sure why you think this is more natural, or better. But it's just a representation anyway - one's as good as another. > > The constraints only play a significant role when an assignment occurs TO the > > constrained sequence. But this is a trigger point anyway. The interpreter has > > to check the type of assignments. The checking code just needs an extra branch > > to handle data flagged as a constrainted sequence. It has to check that the > > RHS matches the pattern of the constraint. > > > > This means the parser will have more checks to perform. But isn't the aim to > help optimised code to be run instead? That's why a separate string type is > needed. Possibly in 8/16/32 flavors. I'm uncertain what you're responding to here. This is the part of my proposal dealing with sequence of types - nothing to do with strings. The sequence of types proposal has been voted on (it wasn't my proposal), and inevitably implementation of extra options means extra branches/checking, n'est-ce pas? This is where I made a passing suggestion about strings. > > It occurred to me that the proposed atribute pair would also provide an opportunity > > to implement strings as a form of constrained sequence. It was a coincidence > > that Matt happened to raise a post about this recently. > > > > The new attrbitue pair would have no natural meaning for negative values of > > the depth variable. Sequences with no (or implied) depth specifictions could > > be represented by negative depth values. E.g:- > > > > ascii sequence x -- { -1, INTEGER } > > unicode sequence y -- { -2, INTEGER } > > > > How would the following be coded: > sequence of unicode > sequence of sequence of string > ? And yes, this is a good point, that if you combine both proposals (sequence of types and string sequences), my suggestion of using the redundant negative values doesn't do the job. So you would have to tag the inner dimension in another way - but that's not a problem. > There is a sequence() type operator. How would I build a "sequence of sequence > of atom"() operato? I didn't overlook this, but didn't mention it because when it was touched on in the original discussions, (from memory) it received at best a mixed reception. Since the syntax 'sequence of type' is infinite, I don't see that you can mirror the built-in syntax: sequence( x). But you could have a built-in that took 2 (extra) args, the depth and the type of the inner constraint. I don't see this as affecting my proposal. > Or an UDT based on a nestde sequence? > Well this could be handle by an "is" keyword: > <eucode> > ssa is sequence of sequence of atom > type sssma(ssa x) --sequence of sequence of small atoms > for i=1 to length(x) do > for j=1 to length(x[i]) do > if x[i][j]<-3.14 or x[i][j]>9.7 then > return 0 > end if > end for > end for > return 1 > end type > </eucode> > That would work. Yes. But if we build-in 'sequence of type', we should also build-in the test function, shouldn't we? Is new syntax required for this narrow concept? Is 'is' better here than an old-fashioned function? (Mind you, I'm keen on introducing declaratory-style syntax, and 'is' would fit that). > They are, but a lot of apps still doesn't need to deal with many different languages, > so any UTF-8 encoding would do, with minimal storage requirements. Further, > copying substings is much faster, because chars in a string don't have a reference > count, don't point to atoms holding a large value and so on. This is why I don't > think an implementation piggybacking on sequences will reap much bnefits. > Unfortunately, like for NIL or large integers, adding a new native type in the > current backend looks hopeless. I have been saying that to myself for years, > but never felt the motivation to start that rewrite, which would be a huge effort > for... which benefits? If we do it collectivelt, there is a chane to get a meaner > Eu. Not in 4.0. > > CChris > In terms of speed and allocation, I think it's certain that an implementaion piggy-backing on sequences would NOT reap benefits. But at least some of the discussion about string-handling in the past has been about the failure of Euphoria to treat strings naturally in some operational contexts - applying sequenc operations rather than string operations. If strings were implemented as sequences tagged with special attributes, some of these could be handled quite easily. If intriducing a new primitve string type is nearly impossible, doesn't that support an intermediate solution? In any event Chris, thanks for the reply. But one reason I posted was to get feedback on my general thoughts on implementation of sequence of types. That isn' a 'new primitve type' issue so far as I can see. I don't read you as directly criticising my proposal on that. Have I misunderstood? Cheers Peter Robinson -= B E G I N =- X-EUFORUM: 22028 Date: 2008 May 31 4:49 From: Kat <KAT12 at coosa?s.ne?> Subject: Re: Str-Kat Wow, deja vu. CK labeled me with more psychobabble (again), and my responce is tied up or deleted in moderation (again). Kat -= B E G I N =- X-EUFORUM: 22029 Date: 2008 May 31 8:41 From: ChrisBurch3 <crylex at ?m?il.com> Subject: Re: Dark Basic, Real Basic and Bears, Oh my! ken mortenson wrote: > > What's with the latest win32lib, it seems to be a password protected zip? Hi I think this has been covered befor. If you use Windows to open the file, then it can't read some levels of compression, and thinks its password protected. If you use (eg) 7-zip, then its read ok. Or it could be corrupted. re download. Or it could really be password protected, and yet again everyones getting at you! (notice now :-) :-) ) Chris > > My brain was telling me I was missing something between the OpenG & L. -= B E G I N =- X-EUFORUM: 22030 Date: 2008 May 31 8:58 From: CChris <christian.cuvier at ag?iculture.gou?.fr> Subject: Re: getenv Jason Gade wrote: > > Jeremy Cowgar wrote: > > > > Kenneth Rhodes wrote: > > > > > > So which is it? ALL SORTS / ALL OVER or ONLY ONCE? It sounds as > > > though your new ifdef code might simply the cross-platform problem > > > with getenv() without having to dumb down Linux. > > > > > > > It makes it possible but it does not simplify anything. It just places the burden > > on the programmer. The programmer must know there is a difference, then he/she > > must account for that difference in their program. > > > > And the real issue to me is that the getenv() returning "" in Linux has no practical > > benefit. > > > > -- > > Jeremy Cowgar > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > Right, but that's a "feature" of Linux and not a "bug" in Windows. If the OS > returns an empty string then so should Euphoria. If the OS returns "does not > exist" then so should Euphoria. > > en = getenv("FOO") > if atom(en) or length(en) = 0 then > -- empty > end if > Or, faster: <eucode> en = getenv("FOO") if compare(en,"")=1 then -- empty end if </eucode> CChris > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. -= B E G I N =- X-EUFORUM: 22031 Date: 2008 May 31 9:32 From: CChris <christian.cuvier at ??riculture.gouv.fr> Subject: Re: Str-Kat Jim Brown wrote: > > Kat wrote: > > > > ken mortenson wrote: > > > > > > Kat wrote: > > > > > > > It would also be easier if Eu returned unused > > > > memeory to the OS via some command or other > > > > > > I believe it does Kat. I believe I remember seeing free() routine? > > > > So it's only a matter of using allocate() and free()? No wonder it's not been > > done yet! Where is the magic spell that makes compare() and equal() and string[2] > > and length(string) work, after you get allocate() and free() typed out? > > > > Kat > > --string.e > --------------------- > namespace string > > global function compare(atom a, atom b) > integer i, ac, bc > i = 0 > ac = peek(a) > bc = peek(b) > while 1 do > if ac > bc then > return 1 > elsif ac < bc then > return -1 > elsif (ac = bc) and (ac = 0) then > return 0 > else > i = i + 1 > ac = peek(a+i) > bc = peek(b+i) > end if > end while > end function > > global function equal(atom a, atom b) > return compare(a,b) = 0 > end function > > global function length(atom a) > integer i > i = 0 > while peek(a+i) != 0 do > i = i + 1 > end while > return i > end function > > --string[2] is impossible to do currently, but there is this workaround > global function slice(atom a, integer i) > return peek(a+i) > end function On an Intel CPU, the length function needs only be this: push edi push ecx xor eax,eax xor ecx,ecx mov edi,[esp+4] cld repnz scasb jecxz ret sub eax,ecx pop ecx pop edi ret A whopping 20 bytes. You can shave 2 more if ecx is discardable. The jecxz is optional too, becuse machines with 4Go RAM are still hard to find. That comes to 16 bytes, which nicely fits into a cache line. Oh, and the string address needs not to be on the stack if ecx is discardable. Can still shave some cycles. How much slower would the string: code above be? I'd bet between 10 and 30 times. CChris -= B E G I N =- X-EUFORUM: 22032 Date: 2008 May 31 9:48 From: CChris <christian.cuvier at agriculture?g?uv.fr> Subject: Re: Dark Basic, Real Basic and Bears, Oh my! ken mortenson wrote: > > What's with the latest win32lib, it seems to be a password protected zip? > > My brain was telling me I was missing something between the OpenG & L. This problem has been reported already. WinXP appears to think the zip is protected, while it is not. Couldn't figure why. Just view the contents in Explorer and drag them to your folder of choice. This has always worked. CChris -= B E G I N =- X-EUFORUM: 22033 Date: 2008 May 31 9:59 From: CChris <christian.cuvier at agricu?ture.gou?.fr> Subject: Re: Constrained sequences Peter Robinson wrote: > > Hi Chris > > CChris wrote: > > > 0 represents a sequence. Traditional types could be typed by the same system:- > > > > > > sequence x -- { 0, SEQ } > > > > I'd think {1, OBJECT} rather. Just nitpicking. > > Not sure why you think this is more natural, or better. But it's just a representation > anyway - one's as good as another. > > > > The constraints only play a significant role when an assignment occurs TO the > > > constrained sequence. But this is a trigger point anyway. The interpreter has > > > to check the type of assignments. The checking code just needs an extra branch > > > to handle data flagged as a constrainted sequence. It has to check that the > > > RHS matches the pattern of the constraint. > > > > > > > This means the parser will have more checks to perform. But isn't the aim to > > help optimised code to be run instead? That's why a separate string type is > > needed. Possibly in 8/16/32 flavors. > > I'm uncertain what you're responding to here. This is the part of my proposal > dealing with sequence of types - nothing to do with strings. The sequence of > types proposal has been voted on (it wasn't my proposal), and inevitably implementation > of extra options means extra branches/checking, n'est-ce pas? > > This is where I made a passing suggestion about strings. > > > It occurred to me that the proposed atribute pair would also provide an opportunity > > > to implement strings as a form of constrained sequence. It was a coincidence > > > that Matt happened to raise a post about this recently. > > > > > > The new attrbitue pair would have no natural meaning for negative values of > > > the depth variable. Sequences with no (or implied) depth specifictions could > > > be represented by negative depth values. E.g:- > > > > > > ascii sequence x -- { -1, INTEGER } > > > unicode sequence y -- { -2, INTEGER } > > > > > > > How would the following be coded: > > sequence of unicode > > sequence of sequence of string > > ? > > And yes, this is a good point, that if you combine both proposals (sequence > of types and string sequences), my suggestion of using the redundant negative > values doesn't do the job. So you would have to tag the inner dimension in another > way - but that's not a problem. > > > There is a sequence() type operator. How would I build a "sequence of sequence > > of atom"() operato? > I didn't overlook this, but didn't mention it because when it was touched on > in the original discussions, (from memory) it received at best a mixed reception. > Since the syntax 'sequence of type' is infinite, I don't see that you can mirror > the built-in syntax: sequence( x). But you could have a built-in that took > 2 (extra) args, the depth and the type of the inner constraint. I don't see > this as affecting my proposal. > > > Or an UDT based on a nestde sequence? > > Well this could be handle by an "is" keyword: > > <eucode> > > ssa is sequence of sequence of atom > > type sssma(ssa x) --sequence of sequence of small atoms > > for i=1 to length(x) do > > for j=1 to length(x[i]) do > > if x[i][j]<-3.14 or x[i][j]>9.7 then > > return 0 > > end if > > end for > > end for > > return 1 > > end type > > </eucode> > > That would work. > > Yes. But if we build-in 'sequence of type', we should also build-in the test > function, shouldn't we? Is new syntax required for this narrow concept? Is 'is' > better here than an old-fashioned function? (Mind you, I'm keen on introducing > declaratory-style syntax, and 'is' would fit that). > > > They are, but a lot of apps still doesn't need to deal with many different languages, > > so any UTF-8 encoding would do, with minimal storage requirements. Further, > > copying substings is much faster, because chars in a string don't have a reference > > count, don't point to atoms holding a large value and so on. This is why I don't > > think an implementation piggybacking on sequences will reap much bnefits. > > Unfortunately, like for NIL or large integers, adding a new native type in the > > current backend looks hopeless. I have been saying that to myself for years, > > but never felt the motivation to start that rewrite, which would be a huge effort > > for... which benefits? If we do it collectivelt, there is a chane to get a meaner > > Eu. Not in 4.0. > > > > CChris > > > > In terms of speed and allocation, I think it's certain that an implementaion > piggy-backing on sequences would NOT reap benefits. But at least some of the > discussion about string-handling in the past has been about the failure of Euphoria > to treat strings naturally in some operational contexts - applying sequenc operations > rather than string operations. If strings were implemented as sequences tagged > with special attributes, some of these could be handled quite easily. If intriducing > a new primitve string type is nearly impossible, doesn't that support an intermediate > solution? > > In any event Chris, thanks for the reply. But one reason I posted was to get > feedback on my general thoughts on implementation of sequence of types. That > isn' a 'new primitve type' issue so far as I can see. I don't read you as directly > criticising my proposal on that. Have I misunderstood? > > Cheers > Peter Robinson No a direct criticism. However, * given how sequences are actually implemented, fast handling for optimised sequences of types won't work often; * assuming it does, the backend will have to choose which sort of optimised handling to use. The likelihood of the added, very very frequent testing offsetting the benefit from the partial optimisations is quite high. This is why, while having such types, _prominently among which_ string types, would be a clear bonus to Euphoria, I'm afraid they won't play nice in the current implementation of the language. Hoping to be proved wrong. CChris -= B E G I N =- X-EUFORUM: 22034 Date: 2008 May 31 11:33 From: Jim Brown <jbrown105 at linu?buddhist.ne?> Subject: Re: Str-Kat CChris wrote: > > Jim Brown wrote: > > > > Kat wrote: > > > > > > ken mortenson wrote: > > > > > > > > Kat wrote: > > > > > > > > > It would also be easier if Eu returned unused > > > > > memeory to the OS via some command or other > > > > > > > > I believe it does Kat. I believe I remember seeing free() routine? > > > > > > So it's only a matter of using allocate() and free()? No wonder it's not been > > > done yet! Where is the magic spell that makes compare() and equal() and string[2] > > > and length(string) work, after you get allocate() and free() typed out? > > > > > > Kat > > > > --string.e > > --------------------- > > namespace string > > > > global function compare(atom a, atom b) > > integer i, ac, bc > > i = 0 > > ac = peek(a) > > bc = peek(b) > > while 1 do > > if ac > bc then > > return 1 > > elsif ac < bc then > > return -1 > > elsif (ac = bc) and (ac = 0) then > > return 0 > > else > > i = i + 1 > > ac = peek(a+i) > > bc = peek(b+i) > > end if > > end while > > end function > > > > global function equal(atom a, atom b) > > return compare(a,b) = 0 > > end function > > > > global function length(atom a) > > integer i > > i = 0 > > while peek(a+i) != 0 do > > i = i + 1 > > end while > > return i > > end function > > > > --string[2] is impossible to do currently, but there is this workaround > > global function slice(atom a, integer i) > > return peek(a+i) > > end function > > On an Intel CPU, the length function needs only be this: > push edi > push ecx > xor eax,eax > xor ecx,ecx > mov edi,[esp+4] > cld > repnz scasb > jecxz ret > sub eax,ecx > pop ecx > pop edi > ret > > A whopping 20 bytes. You can shave 2 more if ecx is discardable. The jecxz is > optional too, becuse machines with 4Go RAM are still hard to find. That comes > to 16 bytes, which nicely fits into a cache line. > > Oh, and the string address needs not to be on the stack if ecx is discardable. > Can still shave some cycles. > > How much slower would the string: code above be? I'd bet between 10 and 30 times. > > CChris I was going for simplicity, not speed. I would have just done define_c_func(open_dll(""), "strlen", ....) and let your OS vendor take care of the speed hack. Both of them would be a lot faster than a pure eu length function. In fact, you can define_c_func() strcmp for compare(), and also get a speed boost for compare() and equal(). But Kat doesn't do C (and who can blame her?) -= B E G I N =- X-EUFORUM: 22035 Date: 2008 May 31 11:33 From: Shawn Pringle <shawn.pringle at ?mail?com> Subject: Kat's 8bit sequences ** The Idea ** Some sequences store their values using 64-bits each value others 32 bits. Yet it is transparent to the user. See the performance note under strings. What was done for 32 bit values could also be done for 8 bit byte values. Call them Kat sequences. The EUPHORIA syntax wouldn't change, yet under the hood the amount of memory used for some sequences is 1 byte per value plus sequence overhead. ** The Need? ** When EUPHORIA was released 15 years ago when computers were lucky to have a 500 MB HARD DRIVE this wasn't a problem. It would seem less important these days with so much RAM. Yet, Robert Craig didn't think it was an issue then. Is it an issue today? War and Peace ( 3.13 MB ) The Bible ( 4.57 MB ) Don Quixote ( 2.24 MB ) [ From project Gutenburg ] You could multiply these sizes by 10 without significantly taxing RAM. If you are working with ASCII records. It would seem to me you only need two in RAM at the same time, if you are doing a comparison operation of some kind. Perhaps Kat is working for Big Brother and has everybody's DNA finger print in Alabama on her computer. When you move to HTML even, you still are shy of this 500 MB limit for the longest books of all time. Although it seems ridiculous to most of us. It may become reasonable as RAM gets cheaper to load an entire video file into memory for editing, for example. And It might be more convenient to edit as a stream of bytes rather than quads. Shawn Pringle -= B E G I N =- X-EUFORUM: 22036 Date: 2008 May 31 11:37 From: Jim Brown <jbrown105 at li?ux?uddhist.net> Subject: Re: getenv CChris wrote: > > Or, faster: > <eucode> > en = getenv("FOO") > if compare(en,"")=1 then > -- empty > end if > </eucode> > > CChris > Also wrong. It fails to catch the (more portable) getenv() = -1 case. You want (compare(en,"") or compare(en,-1)), or possibly find(en, {"",-1}) (I'm not sure which would be faster.) Unless you meant this: > en = getenv("FOO") > if compare(en,"")=1 then > en = -1 > end if -= B E G I N =- X-EUFORUM: 22037 Date: 2008 May 31 13:46 From: Jerry Story <story.jerry at g?ail.co?> Subject: wxStaticBoxSizer - again I'm getting the following error: wxStaticBoxSizer has not been declared This came up before and if I remember right it was corrected. But I'm getting the same error again. I installed the latest version of wxEuphoria from here: http://sourceforge.net/project/showfiles.php?group_id=73684 I downloaded and installed this one: wxeu-bin-ubuntu710-0-12-0-beta.2.tar.gz wxEuphoria_Version prints: 0 12 0 wxNEED_BUILD prints: 12 -= B E G I N =- X-EUFORUM: 22038 Date: 2008 May 31 15:12 From: Greg Haberek <ghaberek at gmail.c??> Subject: Re: Kat's 8bit sequences I sure could use 8-bit (or 16-bit Unicode) strings! I'm coming up on my next release of wxEditor (boy, does it sure look nice! /gloat) and one stumbling block I've found is that I'm loading files into sequences of strings, one line being its own sequence (much easier to manipulate this way, IMHO), which quickly inflates the memory usage, because I've got 4x (or 2x) the RAM being used per character. I've tried writing my own 8-bit string routines, but nothing comes close to the ease of manipulation I get with sequences. I really think we'd benefit from storing strings as strings and sequences as sequences, and still manipulate them equally. -Greg -= B E G I N =- X-EUFORUM: 22039 Date: 2008 May 31 15:28 From: irv mullins <irvm at ellija?.co?> Subject: Re: Kat's 8bit sequences Shawn Pringle wrote: > > ** The Idea ** > > Some sequences store their values using 64-bits each value others 32 bits. > Yet > it is transparent to the user. See the performance note under strings. What > was done for 32 bit values could also be done for 8 bit byte values. Call them > Kat sequences. The EUPHORIA syntax wouldn't change, yet under the hood the > amount of memory used for some sequences is 1 byte per value plus sequence > overhead. > > > ** The Need? ** > > When EUPHORIA was released 15 years ago when computers were lucky to have a > 500 MB HARD DRIVE this wasn't a problem. It would seem less important these > days with so much RAM. Yet, Robert Craig didn't think it was an issue then. Is > it an issue today? I learned a long time ago two things about programming: 1. I could manipulate many megs of data using only a few hundred bytes of memory. 2. I would be an idiot to try to do it that way. Why take weeks to create a slow, complex, probably bug-ridden program when you can throw cheap hardware at the problem and get the results much quicker, with less chance for errors, using a simple script? So is there a need? Not for most of us, in fact probably only one here. The others who do this kind of thing probably investigated Eu and decided it was handicapped compared to other languages. Therefore, you won't see them here. That doesn't mean they don't exist. -= B E G I N =- X-EUFORUM: 22040 Date: 2008 May 31 16:38 From: Matt Lewis <matthewwalkerlewis at gm?il.co?> Subject: Re: wxStaticBoxSizer - again Jerry Story wrote: > > I'm getting the following error: > wxStaticBoxSizer has not been declared > > This came up before and if I remember right it was corrected. But I'm getting > the same error again. > > I installed the latest version of wxEuphoria from here: > <a href="http://sourceforge.net/project/showfiles.php?group_id=73684">http://sourceforge.net/project/showfiles.php?group_id=73684</a> > > I downloaded and installed this one: > wxeu-bin-ubuntu710-0-12-0-beta.2.tar.gz > > wxEuphoria_Version prints: 0 12 0 > wxNEED_BUILD prints: 12 Sounds like that binary was created before wxStaticBoxSizer was added. Matt -= B E G I N =- X-EUFORUM: 22041 Date: 2008 May 31 17:01 From: ken mortenson <kenneth_john at yaho?.co?> Subject: Re: Kat's 8bit sequences Greg Haberek wrote: > > > I sure could use 8-bit (or 16-bit Unicode) strings! I'm coming up on my next > release of wxEditor (boy, does it sure look nice! /gloat) and one stumbling > block I've found is that I'm loading files into sequences of strings, one line > being its own sequence (much easier to manipulate this way, IMHO), which quickly > inflates the memory usage, because I've got 4x (or 2x) the RAM being used per > character. I've tried writing my own 8-bit string routines, but nothing comes > close to the ease of manipulation I get with sequences. > > I really think we'd benefit from storing strings as strings and sequences as > sequences, and still manipulate them equally. You make sense Greg. If the goal is to make Euphoria more 'full featured' then adding other types like strings would seem to be part of that goal. It the goal is, "Hey, I'm doing this volunteer work. I'll code whatever cool thing I think of" that 'goal' would likely produce different results. If your goal is to fill in gaps or holes without much changing the language... well, that's a different thing as well. My concern about adding string types is the potential that Euphoria will then have to do the type of garbage collection that is normally associated with string usage. This can create unacceptable performance lags. If strings can be implemented without the danger of such hiccups, I'd be much less concerned about there addition. Is there a formal process for adding features? I ask because I'm not aware of any. -= B E G I N =- X-EUFORUM: 22042 Date: 2008 May 31 17:06 From: ken mortenson <kenneth_john at ?ahoo.c?m> Subject: Re: Dark Basic, Real Basic and Bears, Oh my! CChris wrote: > > ken mortenson wrote: > > > > What's with the latest win32lib, it seems to be a password protected zip? > > > > My brain was telling me I was missing something between the OpenG & L. > > This problem has been reported already. WinXP appears to think the zip is protected, > while it is not. Couldn't figure why. > Just view the contents in Explorer and drag them to your folder of choice. This > has always worked. Thanks Chris, that seems to have worked fine. -= B E G I N =- X-EUFORUM: 22043 Date: 2008 May 31 17:18 From: Jason Gade <jaygade at yahoo.c??> Subject: Re: Kat's 8bit sequences ken mortenson wrote: > > Greg Haberek wrote: > > > > > > I sure could use 8-bit (or 16-bit Unicode) strings! I'm coming up on my next > > release of wxEditor (boy, does it sure look nice! /gloat) and one stumbling > > block I've found is that I'm loading files into sequences of strings, one line > > being its own sequence (much easier to manipulate this way, IMHO), which quickly > > inflates the memory usage, because I've got 4x (or 2x) the RAM being used per > > character. I've tried writing my own 8-bit string routines, but nothing comes > > close to the ease of manipulation I get with sequences. > > > > I really think we'd benefit from storing strings as strings and sequences as > > sequences, and still manipulate them equally. > > You make sense Greg. > > If the goal is to make Euphoria more 'full featured' then adding other types > like strings would seem to be part of that goal. It the goal is, "Hey, I'm > doing this volunteer work. I'll code whatever cool thing I think of" that > 'goal' would likely produce different results. If your goal is to fill in > gaps or holes without much changing the language... well, that's a different > thing as well. Not necessarily. More types are a bad thing, IMO, except for user-defined types. I like the generecity of the language as it is. > > My concern about adding string types is the potential that Euphoria will then > have to do the type of garbage collection that is normally associated with > string usage. This can create unacceptable performance lags. If strings > can be implemented without the danger of such hiccups, I'd be much less > concerned about there addition. Euphoria already does garbage collection by reference counting. There's no reason this would change with the addition of strings. > > Is there a formal process for adding features? I ask because I'm not aware > of any. http://sourceforge.net/tracker/?group_id=182827&atid=902785 -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j. -= B E G I N =- X-EUFORUM: 22044 Date: 2008 May 31 17:43 From: Matt Lewis <matthewwalkerlewis at gmail??om> Subject: Re: Kat's 8bit sequences ken mortenson wrote: > > If the goal is to make Euphoria more 'full featured' then adding other types > like strings would seem to be part of that goal. It the goal is, "Hey, I'm > doing this volunteer work. I'll code whatever cool thing I think of" that > 'goal' would likely produce different results. If your goal is to fill in > gaps or holes without much changing the language... well, that's a different > thing as well. I don't think there's a whole lot of "whatever cool thing" going on. They often get proposed, but there's usually a fair amount of discussion before these things happen. Still, since it's all volunteer work, those who are interested are the ones who tend to write the code. > My concern about adding string types is the potential that Euphoria will then > have to do the type of garbage collection that is normally associated with > string usage. This can create unacceptable performance lags. If strings > can be implemented without the danger of such hiccups, I'd be much less > concerned about there addition. As Jason said, we've already got garbage collection. There are other implementation details that have so far prevented the addition. > Is there a formal process for adding features? I ask because I'm not aware > of any. Not really. It gets talked about, and if the general consensus is thumbs up, then someone has to do it. You could always code something up and present it, and try to get it accepted by the community (again, no formal process currently exists). The project is open to pretty much anyone who is interested. Matt -= B E G I N =- X-EUFORUM: 22045 Date: 2008 May 31 18:19 From: Shawn Pringle <shawn.pringle at gmai?.?om> Subject: Re: Kat's 8bit sequences Jason Gade wrote: > > > Not necessarily. More types are a bad thing, IMO, except for user-defined types. > > I like the generecity of the language as it is. > Kat-sequences wouldn't compromise generecity(is that a word?). They would simply be a memory optimization perhaps with a flag in the sequence structure telling us it is 8 bit or 16 bit. Whoever thinks that kat-sequences would make the language less general misunderstands the idea. The idea, nothing would change in either the API or the core language definition. Simply an implementation change. Two bits in the sequence structure could say, okay everything stored as members are 8-bit or 16-bit integers and then the interpreter would have to convert in combining sequences of different internal types. Which generally would never happen, but the interpreter would have to check for that. Shawn Pringle B.Sc. > > > > My concern about adding string types is the potential that Euphoria will then > > have to do the type of garbage collection that is normally associated with > > string usage. This can create unacceptable performance lags. If strings > > can be implemented without the danger of such hiccups, I'd be much less > > concerned about there addition. > > Euphoria already does garbage collection by reference counting. There's no reason > this would change with the addition of strings. > > > > > Is there a formal process for adding features? I ask because I'm not aware > > of any. > > <a href="http://sourceforge.net/tracker/?group_id=182827&atid=902785">http://sourceforge.net/tracker/?group_id=182827&atid=902785</a> > > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. -= B E G I N =- X-EUFORUM: 22046 Date: 2008 May 31 18:37 From: Bernie Ryan <xotron at bluefro??com> Subject: Re: Kat's 8bit sequences There are many ways to use 8-bit data manipulation . 1. Use my MIXEDLIB which contains "C" string routines written in Euphoria and assembler which should work on any Platform. 2. Use the "C" string calls in the Windows C-runtime. 3. Use the "C" string calls in Linux C-runtime. The only thing it takes is time to write the code. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan -= B E G I N =- X-EUFORUM: 22047 Date: 2008 May 31 18:43 From: ken mortenson <kenneth_john at yah?o.co?> Subject: Re: Kat's 8bit sequences Jason Gade wrote: > More types are a bad thing, IMO, except for user-defined types. I'm in general agreement with this statement; however, different opinions exist. Core types are a big part of the Rebol language for instance. There are a lot of things that VB gives me that I am unwilling to give up. So perhaps I should write a sequence type for use in VB? The problem with that is that every operation on a VB sequence class would be of the nature... sequence_class.ADD(sequence_type_var,10) Instead of the prefered (IMHO) syntax... sequence_type_var += 10 With respect to adding any type to Euphoria this is among the issues. It's all tradeoffs, my friends.