Re: rosettacode 500 milestone passed

new topic     » goto parent     » topic index » view thread      » older message » newer message

That seems pretty good, not that I've analysed it in any detail.
I have to ask, are you quite certain there are no data sets that might ever need a treble or quadruple (etc) swap?

Just for a laugh, and because I can do so fairly trivially, I had a bash at supporting those orac idioms in Phix.
(All under control of a new "global ORAC = 1" flag so that I can disable/locate them easily.)
Admittedly dot subscripting affected more places and raised more questions than first anticipated, but seems done.
Documenting them (and shipping a new release) is a whole different beanbag, of course.

That raised me a few questions:
I assume that q.2.3 would be treated as q[2.3], not q[2][3] (please say yes!).
The dot notation also precludes ever treating ".4" as a number (must be written as 0.4 - no biggie).
You allow "q.i.j" as an alternative to "q[i][j]":
Would "q.i[j]" be equivalent to "q[i[j]]"?
Would "q[i].j" be equivalent to "q[i][j]"?
You allow "q[i to j]" but not "q.i to j" as an alternative to "q[i..j]"? (please say yes!)
You do not allow "q.i+1" as an alternative to "q[i+1]"[?], but I assume "q.(i+1)" would work.
sort(t, 4) seems like something worthwhile, but I skipped that for now, ditto assert.
Lastly, your scope rules are off, you allow eg:

for i=1 to ~s do  
   int w 
end for 
w = 0  

which in Phix terminates with "w has not been declared" (obvs. fixed by declaring w before the loop)

Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu