1. Euphoria 4.0.1
- Posted by mattlewis (admin) Feb 28, 2011
- 3092 views
We're getting close to the planned release of Euphoria 4.0.1 (about three weeks away). This is a bug fix release, plus some enhancements to the standard library. There are no major language changes included in this release.
If anyone has any other issues, now is the time to speak up, so that we might be able get a fix in before releasing 4.0.1. (Andy, we're already planning to remove the negative subscripting.)
Here is the current version of the 4.0.1 Release Notes, if anyone's interested in seeing what's been done so far.
Matt
2. Re: Euphoria 4.0.1
- Posted by jaygade Mar 12, 2011
- 2765 views
I don't see any major issues unless any particular tickets need to be worked on. What date do you see for release?
Right now (12 March 2011) my 4.0 branch has one test fail (t_eutest.e) and my main branch has 3 tests fail (translated t_bitwise.e, t_eutest.e, t_pipeio.e).
3. Re: Euphoria 4.0.1
- Posted by Vinoba Mar 12, 2011
- 2751 views
We're getting close to the planned release of Euphoria 4.0.1 (about three weeks away)....
If anyone has any other issues, now is the time to speak up, so that we might be able get a fix .....
Matt
Matt:
1. The facility in Math to be able to use a single value against a sequence can only be accomplished via use of Object type on both sides of the Math function. Is there no other way of allowing a sequence against a single value? In other words, can we not allow the low level functions themselves decide that one side is a sequence and the other a single element and automatically execute appropriately?
2. How do we convert a single element value to a sequence?
I am posting examples of the above two situations as treated by APL. This might have been considered and discarded by RC years ago. Anyway, I thought I would try and find out.
⍝ Examples start here.
A ← ⍳10 ⍝ here we create a sequence of 1 to 10
A ⍝ Show A
1 2 3 4 5 6 7 8 9 10
A ÷ 2 ⍝ here we divide a sequence by a single value 2 ( a scalar)
0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
B ← 43.89
B
43.89
⍴ B ⍝ Shape of B is a null
C ← ,B ⍝ Ravel function (,) Convert from single to sequence and store in C
⍴ C ⍝ Shape of C is a one element sequence
1
⍝ Examples end here.
Forked into: Math with sequences and single values
4. Re: Euphoria 4.0.1
- Posted by jaygade Mar 12, 2011
- 2743 views
We're getting close to the planned release of Euphoria 4.0.1 (about three weeks away)....
If anyone has any other issues, now is the time to speak up, so that we might be able get a fix .....
Matt
Matt:
1. The facility in Math to be able to use a single value against a sequence can only be accomplished via use of Object type on both sides of the Math function. Is there no other way of allowing a sequence against a single value? In other words, can we not allow the low level functions themselves decide that one side is a sequence and the other a single element and automatically execute appropriately?
2. How do we convert a single element value to a sequence?
I am posting examples of the above two situations as treated by APL. This might have been considered and discarded by RC years ago. Anyway, I thought I would try and find out.
⍝ Examples start here.
A ← ⍳10 ⍝ here we create a sequence of 1 to 10
A ⍝ Show A
1 2 3 4 5 6 7 8 9 10
Example:
include std/sequence.e sequence A A = series(1, 1, 10) ? A {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
Reference: http://openeuphoria.org/docs/std_sequence.html#_2498_series
A ÷ 2 ⍝ here we divide a sequence by a single value 2 ( a scalar)
0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Example:
? A / 2 {0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5}
This has ALWAYS been a part of Euphoria. It's a long standing-feature and a strong selling point of the language, otherwise Euphoria would just be "Pascal Lite". Reference: http://openeuphoria.org/docs/lang_def.html#_8_operationsonsequences
B ← 43.89
B
43.89
⍴ B ⍝ Shape of B is a null
C ← ,B ⍝ Ravel function (,) Convert from single to sequence and store in C
⍴ C ⍝ Shape of C is a one element sequence
1
⍝ Examples end here.
I'm not sure I understand this last bit, but isn't it just:
object B = 43.89, C C = {B} ? B ? C 43.89 {43.89}
You can always use atom() or sequence() to determine if something is an atom or a sequence. Reference: http://openeuphoria.org/docs/lang_decl.html#_118_atom
http://openeuphoria.org/docs/lang_decl.html#_119_sequence (Hmm. That could stand to be re-written to describe better what the sequence() function does.)
5. Re: Euphoria 4.0.1
- Posted by mattlewis (admin) Mar 13, 2011
- 2710 views
I don't see any major issues unless any particular tickets need to be worked on. What date do you see for release?
Right now (12 March 2011) my 4.0 branch has one test fail (t_eutest.e) and my main branch has 3 tests fail (translated t_bitwise.e, t_eutest.e, t_pipeio.e).
Hmm....here (on Linux) my 4.0.1 branch is passing everything currently. I haven't run Windows tests in a while.
Test results summary: Files (run: 334) (failed: 0) (100% success) cd ../tests && sh check_diffs.sh Both std/memory.e and std/safe.e provide the same interface to std/machine.e....good. The include std/safe.e provides as many symbols as as std/memory.e...good.
I still think we need to move that last bit into a regular test...
Matt
6. Re: Euphoria 4.0.1
- Posted by Vinoba Mar 13, 2011
- 2660 views
-- Start of test code stest.ex without type_check without warning include std/console.e include machine.e include sort.e include misc.e sequence spurchages = { "Screws" , "Nails" , "Rivets" } sequence spr = { 7.34, 2.54, 6.72 } sequence squan = { 12, 20, 24 } -- atom squan = 12 -- sequence squan = 12 -- integer squan = 12 -- sequence squan = { 12, 12, 12 } atom ttotal = 0 sequence sdetails sdetails = invoice ( spr , squan ) -- Now go and print invoice using spr, squan, sdetails and ttotal function invoice (sequence sprice , sequence squantity ) -- Multiply each element of sequence sprice with each element of squantity and return in ttotal integer isize = length ( sprice ) sequence sitemcost = repeat (0 , isize) for i = 1 to isize do sitemcost [ i ] = sprice [ i ] * squantity [ i ] ttotal = ttotal + sitemcost [ i ] end for return sitemcost end function -- End of test code stest.ex
In this example, if I use the quantities in squan as a full matching length sequence, I am OK. But look at the alternatives I have commented out.
But supposing I want to use a derived amount as a result of some other calculations or simply if the quantities for all items purchased is 12, I have to use 12, 12, 12.
Thus the facility of one value being used against many in Math operations is not properly usable. I can use atoms but even then within the function, I have to do a direct
sitemcost = sprice * squantity
There is no comfortable way of doing the invoice presuming that a single value for quantity or price would be acceptable within the function off and on as the situation arises. Also if the invoicing function has to be used for a single item purchased the function will not work comfortably.
7. Re: Euphoria 4.0.1
- Posted by Vinoba Mar 13, 2011
- 2631 views
For all of the standard dyadic (two arguments) math, it is easy enough to check within the assembler code ((or hopefully with the C code) whether one or the other side has only one element, and act accordingly. It would be nice if the function definition and other areas are also equally forgiving.
8. Re: Euphoria 4.0.1
- Posted by mattlewis (admin) Mar 13, 2011
- 2633 views
In this example, if I use the quantities in squan as a full matching length sequence, I am OK. But look at the alternatives I have commented out.
But supposing I want to use a derived amount as a result of some other calculations or simply if the quantities for all items purchased is 12, I have to use 12, 12, 12.
Thus the facility of one value being used against many in Math operations is not properly usable. I can use atoms but even then within the function, I have to do a direct
sitemcost = sprice * squantity
There is no comfortable way of doing the invoice presuming that a single value for quantity or price would be acceptable within the function off and on as the situation arises. Also if the invoicing function has to be used for a single item purchased the function will not work comfortably.
I'm not sure what the issue is here. You gave the solution that accomplishes what you appear to want. You could also use math:sum:
include std/math.e function invoice (sequence sprice , object squantity ) -- Multiply each element of sequence sprice with each element of squantity and return in ttotal sequence sitemcost = sprice * squantity ttotal = sum( sitemcost & ttotal ) return sitemcost end function
Now, you end up with a sequence of totals, plus the total. For a single item, you simply have a sequence with a single price, or you do something like this (you'll find this idiom in a lot of euphoria code:
include std/math.e function invoice (object sprice , object squantity ) if atom( sprice ) then sprice = {sprice) end if -- Multiply each element of sequence sprice with each element of squantity and return in ttotal sequence sitemcost = sprice * squantity ttotal = sum( sitemcost & ttotal ) return sitemcost end function
Did I miss something else that you wanted to be able to do? Or why this isn't an acceptable solution?
Matt
9. Re: Euphoria 4.0.1
- Posted by Vinoba Mar 13, 2011
- 2629 views
Did I miss something else that you wanted to be able to do? Or why this isn't an acceptable solution?
Matt
Matt: 1. I am trying to create an invoice, a frequent daily requirement in the smallest of businesses. Therefore a function is required which would work flawlessly any time with different data given to it. 2. Euphoria documentation says emphatically that a sequence can be used against a single value, - to be more precise, a single quantity can be applied in the above example against multiple prices. User input might say that. A derived quantity from another calculations might say quantity 12 for all items bought.
The function fails unless you put in a sequence on each side of the multiplication. This is not the end of the story. In modern software writing this action might only be a small part of much larger application, and yet this simple function I wrote will not work unless both sides of the multiplication are sequences. In other words, you can't buy a dozen each of oranges, apples, and peaches at different prices and expect the invoice to work unless you put the quantity 12 three times, - My question is why has this weakness been allowed to stay?
Supposing there is a batch of invoices being processed with some where the length of the sequence of quantities matches the length of the sequence of prices and others where they may not match because the same quantity has been bought for 100 different items at different prices - such as when a retailer goes and buys a variety of tiles at different prices but asks for same quantity of each. The function I wrote will not work for different situations. It is not that I cannot write a more involved function allowing for these different values - the concern is at the lower level, being why does euphoria claim that a multiplication will work between a sequence and a single value and yet the implementation of it is not easy to say the least.
10. Re: Euphoria 4.0.1
- Posted by mattlewis (admin) Mar 13, 2011
- 2605 views
The function fails unless you put in a sequence on each side of the multiplication.
You are wrong. Consider, for example:
? {1, 2, 3, 4 } * 2 -- prints {2,4,6,8}
This is not the end of the story. In modern software writing this action might only be a small part of much larger application, and yet this simple function I wrote will not work unless both sides of the multiplication are sequences. In other words, you can't buy a dozen each of oranges, apples, and peaches at different prices and expect the invoice to work unless you put the quantity 12 three times, - My question is why has this weakness been allowed to stay?
I think the weakness is with your code. I gave you a version that would work with the quantity as an atom. And above, I gave a very simple example of multiplying a sequence and an atom.
It is not that I cannot write a more involved function allowing for these different values - the concern is at the lower level, being why does euphoria claim that a multiplication will work between a sequence and a single value and yet the implementation of it is not easy to say the least.
Perhaps you should give us an example that doesn't work. Because it does work in general.
Matt
11. Re: Euphoria 4.0.1
- Posted by Vinoba Mar 13, 2011
- 2586 views
Perhaps you should give us an example that doesn't work. Because it does work in general.
Matt
I started by giving the example of the function. The function only forks if you invoke the function using a sequence for quantity and same length sequence for prices. I have given three or four alternative there for quantity, commented out and the only one that will work would be a sequence for quantity.
Try the function using a single value for quantity or single value for price - IT DOES NOT WORK if you want to use a single element for quantity against multiple prices or single price for various different quantity. It is so obvious when you try it.
The statement of a single value against a sequence (as you have shown) WORKS ONLY in immediate mode - YOU CANNOT DEFINE IT AS PARAMETERS IN A FUNCTION.
12. Re: Euphoria 4.0.1
- Posted by mattlewis (admin) Mar 13, 2011
- 2590 views
Perhaps you should give us an example that doesn't work. Because it does work in general.
I started by giving the example of the function. The function only forks if you invoke the function using a sequence for quantity and same length sequence for prices. I have given three or four alternative there for quantity, commented out and the only one that will work would be a sequence for quantity.
Try the function using a single value for quantity or single value for price - IT DOES NOT WORK if you want to use a single element for quantity against multiple prices or single price for various different quantity. It is so obvious when you try it.
The statement of a single value against a sequence (as you have shown) WORKS ONLY in immediate mode - YOU CANNOT DEFINE IT AS PARAMETERS IN A FUNCTION.
And I responded with a version of the function that works like you seem to want. As I said, the problem isn't with euphoria (as far as I can tell), but with your code. If you really think that euphoria can't multiple (or add or whatever) a sequence with an atom, please give us an example that does not. You did not do that.
Your function fails elsewhere, but not at the point of multiplication. Please show me a simple example, like I did, that gives you an error when doing some arithmetic:
-- test.ex ? {{1,2}, 3, {4.5, 8.6}} * 3 <eucode> {{{ $ eui test.ex { {3,6}, 9, {13.5,25.8} } }}} Matt
13. Re: Euphoria 4.0.1
- Posted by Vinoba Mar 13, 2011
- 2590 views
-- test.ex ? {{1,2}, 3, {4.5, 8.6}} * 3 <eucode> {{{ $ eui test.ex { {3,6}, 9, {13.5,25.8} } }}} Matt
Tiny little samples is not what I am talking about. In my original function I would introduce discounts sometimes the discounts are blanket discount (Like you see in stores as "10% off every Tuesday") therefore that day and only on that day there will be a single value in a third parameter called sdiscount. On other days there would be individual discounts so there would be a sequence of same length for discounts. Then a customer would come in and buy several items where there is no discount and one item where there is a discount. All this has to accommodate with in loop - you cannot use a blanket statement in every instance (sitemcost = squantiy * (sprice - (sprice * sdiscount)) - you have to define loops because the input may be a sequence (in a majority of cases) but off and and the discount would be one value for all items in the purchased list. Again there may be an individual discount on some items and then as you are walking along the aisle you will see "all tiles extra 5% off today". Then you have a problem of the sequence you are using. so ultimately the function WILL HAVE TO CONTAIN A LOOP.
i regret you have not been able to see the imbalance in what euphoria says (quite rightly) about single value against a sequence and its actual us fullness or rather the difficulty of use in real life writing of functions where one is faced with having to use loops to separate out action on each item of the sequence.
14. Re: Euphoria 4.0.1
- Posted by jaygade Mar 13, 2011
- 2608 views
I don't see any major issues unless any particular tickets need to be worked on. What date do you see for release?
Right now (12 March 2011) my 4.0 branch has one test fail (t_eutest.e) and my main branch has 3 tests fail (translated t_bitwise.e, t_eutest.e, t_pipeio.e).
Hmm....here (on Linux) my 4.0.1 branch is passing everything currently. I haven't run Windows tests in a while.
Test results summary: Files (run: 334) (failed: 0) (100% success) cd ../tests && sh check_diffs.sh Both std/memory.e and std/safe.e provide the same interface to std/machine.e....good. The include std/safe.e provides as many symbols as as std/memory.e...good.
I still think we need to move that last bit into a regular test...
Matt
I'm running on Linux too, Ubuntu 10.04 32-bit kernel 2.6-32-29-generic. Here's the output, the relevant part I believe:
make test TESTFILE="t_eutest.e" cd ../tests && EUDIR=/home/jason/my-euphoria-working-4.0 EUCOMPILEDIR=/home/jason/my-euphoria-working-4.0 \ /home/jason/eubins/eui -i ../include ../source/eutest.ex -i ../include -cc gcc \ -exe "/home/jason/my-euphoria-working-4.0/source/build/eui" \ -ec "/home/jason/my-euphoria-working-4.0/source/build/euc" \ -eubind "/home/jason/my-euphoria-working-4.0/source/build/eubind" -eub /home/jason/my-euphoria-working-4.0/source/build/eub \ -lib "/home/jason/my-euphoria-working-4.0/source/build/eu.a" \ -verbose t_eutest.e interpreting t_eutest.e: CMD '/home/jason/my-euphoria-working-4.0/source/build/eui -i ../include -d UNITTEST -batch t_eutest.e ' interpreting t_c_no_err_file.e: sh: eui: not found FAILURE: t_c_no_err_file.e No valid control file was supplied. Test results summary: FAIL: t_c_no_err_file.e Files (run: 1) (failed: 1) (0% success) interpreting t_c_good_err_file.e: sh: eui: not found FAILURE: t_c_good_err_file.e No valid ex.err has been generated. Test results summary: FAIL: t_c_good_err_file.e Files (run: 1) (failed: 1) (0% success) failed: eutest t_c_good_err_file.e, expected: 1 but got: 0 interpreting t_test_true.e: sh: eui: not found FAILURE: t_test_true.e program died with status 32512 Test results summary: FAIL: t_test_true.e Files (run: 1) (failed: 1) (0% success) failed: eutest t_test_true.e, expected: 1 but got: 0 t_eutest summary: 3 tests run, 1 passed, 2 failed, 33% success FAILURE: t_eutest.e program died with status 256
For some reason there's a reference to my eubins eui which I used to ./configure. I'll replace it and go from there. "eubins" is just a link to a current eubin directory I just moved the link to my freshly-made build directory.
Nope, that's not it. It looks like "t_c_no_err_file.e" does not exist. I don't see that file in the default branch, either.
15. Re: Euphoria 4.0.1
- Posted by jaygade Mar 13, 2011
- 2586 views
Vinoba, I'm sorry but I am totally lost on what you are asking for. Can you write a simple requirement for the function or give the function in say C or Pascal so we can understand what you are saying?
We should probably fork this conversation since it isn't related solely to Euphoria 4.0.1.
16. Re: Euphoria 4.0.1
- Posted by Vinoba Mar 13, 2011
- 2582 views
Vinoba, I'm sorry but I am totally lost on what you are asking for. Can you write a simple requirement for the function or give the function in say C or Pascal so we can understand what you are saying?
We should probably fork this conversation since it isn't related solely to Euphoria 4.0.1.
I am only trying to point out the fallacy of saying that the simple math functions (+ - * / ) work on sequence against sequence AND sequence against a single element. It does work in an immediate mode as Matt has tried to demonstrate, but hen you have a moderately complicated business need such that you and I have to design a function for an end user, we run into a problem as we have to access each element of a sequence separately and at time the sequence may be a sequence and at times the "sequence" may only be a single value.
Look at the function I wrote above and now we are going to expand it to a moderately relaistic level
500 items in a store. Each item has a separate price Some have discounts (on varying days) Whole section of items (e.g. all tiles) have one single discount as a special which will last only till Friday and then not. Customers come in and buy - sometime 5 items and sometimes 100 items and in small and large quantities. Whilst the cashier is busy, the manger comes to her and says "give him 10% discount on all lumber and 5% on all trusses", the demure old lady next in queue is waiting to buy one screwdriver only with its special discount today. What I have described is a normal store. Yes they all have nicely programmed cash machines so you and I do have to write a program for them, but supposing you were writing an application?
Somewhere in this situation we are faced with having to operate on single values in a sequence and a function with parameters defined as (sequence a, sequence b, sequence c, sequence x, sequence y, sequence z ) does not work if we have to build a loop around each sequence items, because here, there and everywhere, now and then and tomorrow, the sequence supplied will not be sequence but a single element.
Similar problem would arise in a 80 employee office getting payroll. some have exact percentage deductions, some have special deductions, some have holiday pay etc. To accommodate all this in a FUNCTION, you have to work in a loop of a sequence of names or numbers and apply sequences of pay/hour etc. You end up with a loop and your parameter definitions (sequence a,sequence b,sequence c,sequence x,sequence y, sequence z, ) bombs.
17. Re: Euphoria 4.0.1
- Posted by jaygade Mar 13, 2011
- 2597 views
Then you should probably be using a data base system, either EDS or an external database, if you are working with so many different items.
I'm formulating a reply in the forked thread. But it seems as if you are trying to stretch an idiom beyond it's breaking point.
I don't know what you mean by "immediate" mode. Euphoria doesn't have an immediate mode. To me, at least, that means that Euphoria would have a REPL loop like some other languages. It doesn't, yet.
There are times when you have to access each element of a sequence individually. So what's the problem? But your assertion that you cannot use + - * / with a sequence on one side and a single value on another is wrong as has been pointed out.
I still do not understand your objection.
18. Re: Euphoria 4.0.1
- Posted by mattlewis (admin) Mar 13, 2011
- 2582 views
I am only trying to point out the fallacy of saying that the simple math functions (+ - * / ) work on sequence against sequence AND sequence against a single element.
And I am afraid you are failing spectacularly. You quoted my working example. Please explain what you think was wrong with it. What do you think it should do?
It does work in an immediate mode as Matt has tried to demonstrate, but hen you have a moderately complicated business need such that you and I have to design a function for an end user, we run into a problem as we have to access each element of a sequence separately and at time the sequence may be a sequence and at times the "sequence" may only be a single value.
It's hard to understand what you really want to do here (even taking into account the cashier use case). I can't see what this has to do with sequence vs atom arithmetic.
Look at the function I wrote above and now we are going to expand it to a moderately relaistic level
500 items in a store. Each item has a separate price Some have discounts (on varying days) Whole section of items (e.g. all tiles) have one single discount as a special which will last only till Friday and then not. Customers come in and buy - sometime 5 items and sometimes 100 items and in small and large quantities. Whilst the cashier is busy, the manger comes to her and says "give him 10% discount on all lumber and 5% on all trusses", the demure old lady next in queue is waiting to buy one screwdriver only with its special discount today. What I have described is a normal store. Yes they all have nicely programmed cash machines so you and I do have to write a program for them, but supposing you were writing an application?
There's a lot here. There are interface issues. You're implying a lot of filtering (i.e., Lumber vs trusses vs other stuff). This is a lot more complex than the function that calculates prices.
Somewhere in this situation we are faced with having to operate on single values in a sequence and a function with parameters defined as (sequence a, sequence b, sequence c, sequence x, sequence y, sequence z ) does not work if we have to build a loop around each sequence items, because here, there and everywhere, now and then and tomorrow, the sequence supplied will not be sequence but a single element.
Similar problem would arise in a 80 employee office getting payroll. some have exact percentage deductions, some have special deductions, some have holiday pay etc. To accommodate all this in a FUNCTION, you have to work in a loop of a sequence of names or numbers and apply sequences of pay/hour etc. You end up with a loop and your parameter definitions (sequence a,sequence b,sequence c,sequence x,sequence y, sequence z, ) bombs.
It sounds like you want some magical language construct that knows what you want to do. I can't see any fallacy here, other than that you seem to not understand how euphoria handles sequence vs atom arithmetic. It's not some magical construct. It is either analogous to multiplying a vector by a scalar (sequence multiplied by an atom) or multiplying each element of a sequence with the respective element of another sequence (sequence multiplied by another sequence).
So, once again. Please give us an example of what you think euphoria should do, vs what it actually does. All you've done here is to present a fairly complex use case, and complain that euphoria can't read your mind, or something (sorry, but that's how it's coming across to me.)
I've given you an example that does exactly what you asked about: multiply a sequence by an atom. We can certainly discuss how to write a function using common euphorian idioms, but you're complaining about a basic operation that euphoria has always done, and you're saying it doesn't do it. Even when I've demonstrated that it does. And I also modified your function to do what I thought you were asking about.
Matt
19. Re: Euphoria 4.0.1 (t_eutest.e)
- Posted by mattlewis (admin) Mar 13, 2011
- 2602 views
I'm running on Linux too, Ubuntu 10.04 32-bit kernel 2.6-32-29-generic. Here's the output, the relevant part I believe:
make test TESTFILE="t_eutest.e" cd ../tests && EUDIR=/home/jason/my-euphoria-working-4.0 EUCOMPILEDIR=/home/jason/my-euphoria-working-4.0 \ /home/jason/eubins/eui -i ../include ../source/eutest.ex -i ../include -cc gcc \ -exe "/home/jason/my-euphoria-working-4.0/source/build/eui" \ -ec "/home/jason/my-euphoria-working-4.0/source/build/euc" \ -eubind "/home/jason/my-euphoria-working-4.0/source/build/eubind" -eub /home/jason/my-euphoria-working-4.0/source/build/eub \ -lib "/home/jason/my-euphoria-working-4.0/source/build/eu.a" \ -verbose t_eutest.e interpreting t_eutest.e: CMD '/home/jason/my-euphoria-working-4.0/source/build/eui -i ../include -d UNITTEST -batch t_eutest.e ' interpreting t_c_no_err_file.e: sh: eui: not found FAILURE: t_c_no_err_file.e No valid control file was supplied.
For some reason there's a reference to my eubins eui which I used to ./configure. I'll replace it and go from there. "eubins" is just a link to a current eubin directory I just moved the link to my freshly-made build directory.
Nope, that's not it. It looks like "t_c_no_err_file.e" does not exist. I don't see that file in the default branch, either.
The eubins reference is correct. The makefile uses that interpreter to invoke eutest.ex. The key seems to be the {{{ sh: eui: not found }} I'm not sure why that would appear there. I think we may need to add in the -exe switch with the correct interpreter. It looks like you don't have a euphoria interpreter installed on your path, and it assumes that you do.
I just pushed up a change to t_eutest.e. See if that works for you.
Matt
20. Re: Euphoria 4.0.1 (t_eutest.e)
- Posted by jaygade Mar 13, 2011
- 2599 views
- Last edited Mar 14, 2011
Okay, I think that worked. I got 100% success.
Edit: Yes, you're right that I don't have a Euphoria interpreter installed in my path. I removed it while testing the previous build bug and have not reinstalled.
Right now I am making sure that I 'alias' eui to the eui which I want to use and make sure and put a eu.cfg into the working directory.
21. Re: Euphoria 4.0.1
- Posted by petelomax Mar 14, 2011
- 2566 views
your parameter definitions (sequence a,sequence b,sequence c,sequence x,sequence y, sequence z, ) bombs.
I can't see any fallacy here
It is quite simple. Vinoba is defining a function which accepts SEQUENCE parameters and then trying to pass ATOM arguments. The whole thing should go away (ie work) if he declares the function with OBJECT parameters.
Pete
22. Re: Euphoria 4.0.1
- Posted by evanmars Mar 14, 2011
- 2532 views
your parameter definitions (sequence a,sequence b,sequence c,sequence x,sequence y, sequence z, ) bombs.
I can't see any fallacy here
It is quite simple. Vinoba is defining a function which accepts SEQUENCE parameters and then trying to pass ATOM arguments. The whole thing should go away (ie work) if he declares the function with OBJECT parameters.
Pete
Or perhaps the code calling the function could "cast" the ATOM to a SEQUENCE, as in Matt's example, i.e.
if atom( sprice ) then sprice = {sprice) end if
23. Re: Euphoria 4.0.1
- Posted by Vinoba Mar 14, 2011
- 2523 views
your parameter definitions (sequence a,sequence b,sequence c,sequence x,sequence y, sequence z, ) bombs.
It is quite simple. Vinoba is defining a function which accepts SEQUENCE parameters and then trying to pass ATOM arguments. The whole thing should go away (ie work) if he declares the function with OBJECT parameters.
Pete
petelomax: I quite agree with what you are saying. In fact, if you see my initial posts I said that that was the only way to do it. The problem comes when you try to expand the function to a business level (with several sequences or rather atoms), where you are forced to loop through each element of the sequences, and you are faced with a situation where you cannot loop though the sequences because some may arbitrarily and unknowingly be single elements.
Anyway, I want to bring this discussion to an end as obviously I have not been able to explain the problem and I have the availability (solution) in a couple of other languages and also via assembler (and pokes and peeks), which I am very comfortable with.
Thanks to all for the help and suggestions.
24. Re: Euphoria 4.0.1
- Posted by mattlewis (admin) Mar 14, 2011
- 2490 views
petelomax: I quite agree with what you are saying. In fact, if you see my initial posts I said that that was the only way to do it. The problem comes when you try to expand the function to a business level (with several sequences or rather atoms), where you are forced to loop through each element of the sequences, and you are faced with a situation where you cannot loop though the sequences because some may arbitrarily and unknowingly be single elements.
Yes, algorithms often require checking to see whether you have a sequence or an atom. This is inherent in the nature of euphoria objects. If you look at published euphoria code, you'll find many examples. In a previous post, I used the standard library function sum() as a way to abstract this very issue:
public function sum(object a) atom b if atom(a) then return a end if b = 0 for i = 1 to length(a) do if atom(a[i]) then b += a[i] else b += sum(a[i]) end if end for return b end function
Sorry, I'm really not trying to beat a dead horse, but claims like "euphoria doesn't do what is says it does" need to be substantiated or proven false (or opened as a ticket, so we can fix a bug!). There's a big difference between that sort of statement and, "That's an interesting feature, but it's not really very useful to me in this context."
Matt
25. Re: Euphoria 4.0.1
- Posted by Vinoba Mar 14, 2011
- 2486 views
Yes, algorithms often require checking to see whether you have a sequence or an atom. This is inherent in the nature of euphoria objects. Matt
You finally stated my problem and suggestion in a better way than I could.
If some function parameters DID NOT REQUIRE the specification of whether sequence, atom or Integer or what have you, and the function itself can internally check, then a single element sequence in place of a real sequence would be accepted and executed. At assembly language I have written routines where INC ECX (usually the counter register) or EBX, EDX can be made to NOT Increment by a simple macro which decides whether or not to increment.
Unfortunately for me, I have been used to low level software where the type of variable does NOT have to be specified in a function call. I have considered it a plus point that I do not have to specify type in those tools, and it has been further brought home to me in this little dialog. Perhaps C or C plus constraints prevent such usage or such ambiguities in function definitions.
Anyway, I have got round the problem in another way and am hoping that the C, C plus or DLL output from my auxiliary effort will integrate with the rest of the work I do in Euphoria. To date, I have not had the experience of linkage or DLL calls between such hybrids, but there's always a first time. I might even have to make the Euphoria portion as an add-on instead of being the main portion - only experimentation will decide for me. It is easier in assembler, but then I would be stuck to using Intel CPUs.
BTW, I am eagerly awaiting wxEuphoria and wxide using wxWidgets 2.9.1. Hoping you will have time for it.
Forked into: Euphoria on non-Intel CPUs
26. Re: Euphoria 4.0.1
- Posted by petelomax Mar 14, 2011
- 2437 views
Anyway, I have got round the problem in another way
Do tell, I'm intrigued.
Pete