1. Last minute Beta suggestions

if ? is good then ?? is better


We now have ? for quick and easy display of a object, in its natural numeric format.

It would be handy if ?? could display an object as if it were string data. This could be a kind of pretty_print() without arguments.

sequence test = "try this" 
? test 
-- {116,114,121,32,116,104,105,115} 
?? test 
-- "try this" 


  • it would be very convenient for developing programs
  • it would make introducing Euphoria to newcomers much easier
  • it would make example and tutorial programs simple

loop until


The syntax for loop until breaks the Euphoria pattern.

currently:

loop do 
	a = a*2 
	x = x-1 
until x < 0 


Could this be at least allowed as an "alternative" syntax?

loop do 
	a = a*2 
	x = x-1 
until x < 0 end loop 


The "end" keyword is fundamental to current Euphoria syntax. In the documentation we now have to explain (apologize) that this has a "distinctive form."

For example, it is generally clear that scope for a syntax element finishes at the "end" keyword. In "loop do" this no longer applies.

It would be best if the patterns of syntax now in Euphoria are maintained.

new topic     » topic index » view message » categorize

2. Re: Last minute Beta suggestions

_tom said...

if ? is good then ?? is better


We now have ? for quick and easy display of a object, in its natural numeric format.

It would be handy if ?? could display an object as if it were string data. This could be a kind of pretty_print() without arguments.

Or maybe ? could be made to be a little more intelligent. But in any case, I think this idea can wait for 4.1.

_tom said...
  • it would be very convenient for developing programs
  • it would make introducing Euphoria to newcomers much easier
  • it would make example and tutorial programs simple

loop until


The syntax for loop until breaks the Euphoria pattern.

currently:

loop do 
	a = a*2 
	x = x-1 
until x < 0 


Could this be at least allowed as an "alternative" syntax?

loop do 
	a = a*2 
	x = x-1 
until x < 0 end loop 


The "end" keyword is fundamental to current Euphoria syntax. In the documentation we now have to explain (apologize) that this has a "distinctive form."

For example, it is generally clear that scope for a syntax element finishes at the "end" keyword. In "loop do" this no longer applies.

It would be best if the patterns of syntax now in Euphoria are maintained.

I agree that loop is an exception, but making the 'end loop' optional would also be an exception. To be consistent, 'end loop' should be mandatory, but then it makes the construct a bit unwieldy.

I've changed my local copy of Euphoria to allow 'end loop' to be optional and it is not a large change (7 lines of code) so if we agree, it can be added immediately.

new topic     » goto parent     » topic index » view message » categorize

3. Re: Last minute Beta suggestions

_tom said...

if ? is good then ?? is better

I forgot to mention that we almost have this now.

include std/console.e 
 
display("test string") 
display(12.34) 
display(56) 

gives ...

test string 
12.34 
56 

new topic     » goto parent     » topic index » view message » categorize

4. Re: Last minute Beta suggestions

DerekParnell said...

I've changed my local copy of Euphoria to allow 'end loop' to be optional and it is not a large change (7 lines of code) so if we agree, it can be added immediately.

It should be mandatory or not allowed. Allowing it to be optional means the code itself won't be consistent...

new topic     » goto parent     » topic index » view message » categorize

5. Re: Last minute Beta suggestions

Please add the "end loop" (as the only choice) to the Beta. The display() routine means that ideas like ?? can until for the 4.1 release.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Last minute Beta suggestions

_tom said...

Please add the "end loop" (as the only choice) to the Beta. The display() routine means that ideas like ?? can until for the 4.1 release.

As long as until and end loop are not required to be on the same line (as in the example posted previously), I'm fine with this.

e.g.

loop do 
... 
until X 
end loop 

I'm guessing this is already the case in Derek's changes, but I just want to make sure...

new topic     » goto parent     » topic index » view message » categorize

7. Re: Last minute Beta suggestions

jimcbrown said...
_tom said...

Please add the "end loop" (as the only choice) to the Beta. The display() routine means that ideas like ?? can until for the 4.1 release.

As long as until and end loop are not required to be on the same line (as in the example posted previously), I'm fine with this.

e.g.

loop do 
... 
until X 
end loop 

I'm guessing this is already the case in Derek's changes, but I just want to make sure...

This construct is very bad at all. The Russian translation of "until" is "do teh por, poka", and "loop" is extra word here. So I'd like:

do 
... 
while X 
end do 


Or just abandon it for ever, please.
But ?? seems to be very nice, I like this idea very much.

kinz

new topic     » goto parent     » topic index » view message » categorize

8. Re: Last minute Beta suggestions

kinz said...
jimcbrown said...
_tom said...

Please add the "end loop" (as the only choice) to the Beta. The display() routine means that ideas like ?? can until for the 4.1 release.

As long as until and end loop are not required to be on the same line (as in the example posted previously), I'm fine with this.

e.g.

loop do 
... 
until X 
end loop 

I'm guessing this is already the case in Derek's changes, but I just want to make sure...

This construct is very bad at all. The Russian translation of "until" is "do teh por, poka", and "loop" is extra word here. So I'd like:

do 
... 
while X 
end do 


Or just abandon it for ever, please.

kinz

do .. while .. end do ; has an opposite meaning than ; loop do .. until .. end loop

I don't see a problem with having the russian version use do .. until .. end do and the english version use loop do .. until .. end loop, however.

new topic     » goto parent     » topic index » view message » categorize

9. Re: Last minute Beta suggestions

jimcbrown said...

do .. while .. end do ; has an opposite meaning than ; loop do .. until .. end loop

We have

while X -- check for condition X **before** doing 
do 
... 
end while 


And we can have

do 
... 
while Y -- check for condition Y **after** doing 
end do 


All depends on conditions X and Y, see?
And we do not need the new "loop" and "until" key words.

jimcbrown said...

I don't see a problem with having the russian version use do .. until .. end do and the english version use loop do .. until .. end loop, however.

Hey, Jim, do you speak Russian? smile
Then, code has to be translated word-to-word to avoid any confusion.

kinz

new topic     » goto parent     » topic index » view message » categorize

10. Re: Last minute Beta suggestions

Tom, your idea about ?? seems to be excellent!
Congrats!

kinz

new topic     » goto parent     » topic index » view message » categorize

11. Re: Last minute Beta suggestions

Tom, your idea about ?? seems to be excellent!
Congrats!

kinz

new topic     » goto parent     » topic index » view message » categorize

12. Re: Last minute Beta suggestions

kinz said...
jimcbrown said...

do .. while .. end do ; has an opposite meaning than ; loop do .. until .. end loop

We have

while X -- check for condition X **before** doing 
do 
... 
end while 


And we can have

do 
... 
while Y -- check for condition Y **after** doing 
end do 


All depends on conditions X and Y, see?

No.

do 
... 
while Y -- check for condition Y **after** doing, if Y is false then exit loop 
end do 


do 
... 
until Y -- check for condition Y **after** doing, if Y is true then exit loop 
end do 


kinz said...

And we do not need the new "loop" and "until" key words.

It is true that 'until X' could be replaced with 'while not(X)'

kinz said...
jimcbrown said...

I don't see a problem with having the russian version use do .. until .. end do and the english version use loop do .. until .. end loop, however.

Hey, Jim, do you speak Russian? smile
Then, code has to be translated word-to-word to avoid any confusion.

With the correct documentation, I don't see this as being strictly necessary. Jumping from "loop do" to the Russian version of "do" and from "end loop" to the Russian for "end do" doesn't seem to be very difficult for a human being to do.

For an automated code parser (e.g. that translates code from russian to english and back), some extra work is required, but no more than the what would be required to change Eu's parser to use 'while' in the manner that you suggest.

new topic     » goto parent     » topic index » view message » categorize

13. Re: Last minute Beta suggestions

These double messages 10 and 11 seems to be produced by the Reload button pressed in browser on the Thanks page. Is it a bug or feature if so?

kinz

new topic     » goto parent     » topic index » view message » categorize

14. Re: Last minute Beta suggestions

kinz said...

These double messages 10 and 11 seems to be produced by the Reload button pressed in browser on the Thanks page. Is it a bug or feature if so?

kinz

It is a known issue in the forum software, with a bug in the bug tracker.

new topic     » goto parent     » topic index » view message » categorize

15. Re: Last minute Beta suggestions

I like the "end loop" idea. It is consistent with other ways of ending branching and looping constructs.

Shawn Pringle

new topic     » goto parent     » topic index » view message » categorize

16. Re: Last minute Beta suggestions

jimcbrown said...
kinz said...

These double messages 10 and 11 seems to be produced by the Reload button pressed in browser on the Thanks page. Is it a bug or feature if so?

kinz

It is a known issue in the forum software, with a bug in the bug tracker.

Really? You can hit refresh and it double posts? Ug!

Jeremy

new topic     » goto parent     » topic index » view message » categorize

17. Re: Last minute Beta suggestions

Or, are you pressing "Reload" on the "Message posted OK" page? I can see that happening.

Jeremy

new topic     » goto parent     » topic index » view message » categorize

18. Re: Last minute Beta suggestions

jeremy said...

Or, are you pressing "Reload" on the "Message posted OK" page? I can see that happening.

Jeremy

There is the specialised thread on this issue - "test".
Yes, if I press "Reload" on the "Message posted OK" page, then message posts again.

kinz

new topic     » goto parent     » topic index » view message » categorize

19. Re: Last minute Beta suggestions

I wholeheartedly agree with the "end loop" proposal. When I read for the first time the specs of Euphoria 4.0, I thought I would never use the loop / until construct because of its inconsistent syntax. (Euphoria 4.0 is however a huge improvement: a great thanks to all the developers!)

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu