World: r3wp
[!REBOL2 Releases] Discuss 2.x releases
older newer | first last |
BrianH 3-May-2010 [1647x2] | This is not the R2 equivalent of the !REBOL3 group. Please don't abuse the fact that we can't move messages in AltME :( |
I'm sorry, I don't want to be a jerk about this. This group is used as a reference when we do new R2 releases. It's of less value as a reference if off-topic stuff is overwhelming the release discussions. Please be nice to the R2 release manager :( | |
Maxim 3-May-2010 [1649] | sorry to add junk, but I *really* think this group should be renamed (this is On Topic :-) probably !REBOL2-release or something like that. its too easy to mistake right now with !REBOL3 being such an active group. |
BrianH 3-May-2010 [1650] | Requested. |
Gregg 3-May-2010 [1651] | Done. |
BrianH 3-May-2010 [1652] | Thanks :) |
Graham 14-May-2010 [1653x2] | If I want to set something to the index of a series, or something else if it's not there I have to do this b: either a: find series var [ index? a ][ default ] when I'd rather do b: any [ index? find series var default ] So how about letting index? also take none as an argument ? |
b: any [ attempt [ index? find series var ] default ] | |
Ladislav 14-May-2010 [1655x2] | funny thing is, that the former code is exactly as long as the latter one, does not need the additional variable, and it is faster |
...and I find it more readable | |
Steeve 14-May-2010 [1657x2] | yep, no need for additional var. all [b: find series var b: index? b] |
oups, not what you'he done | |
Ladislav 14-May-2010 [1659] | indeed, I just meant: b: either b: find series var [index? b] [default] |
Anton 14-May-2010 [1660] | I'm pretty sure I'd be ok with NONE == INDEX? NONE |
BrianH 14-May-2010 [1661] | That kind of change is not going into R2 - it's not backwards-compatible. Try R3. |
Gregg 14-May-2010 [1662] | But it's easy enough to create a safe INDEX? function. I think Gabriele calls his INDEX?? and I borrowed it from him. |
Graham 14-May-2010 [1663x4] | that's another issue .. how to easily redefine words |
that also invoke the original word .... | |
index?: func [ [ series! | none! ] ][ either series [ index? series ][ none ] ] would likely cause a stqack overflow | |
[ series! none! ] | |
Gabriele 15-May-2010 [1667] | Gregg, I don't remember that, so maybe it was from someone else. |
BrianH 15-May-2010 [1668x2] | Gregg, the problem is that the changed INDEX? would have the possibility of returning data that is not an integer. Most R2 code doesn't screen for that, so changing INDEX? in this way would lead to data corruption in existing code. Remember, compatibility with existing code is the highest priority in the further development of R2. Incompatible changes are reserved for R3 *only* - we try to not make them in R2, on principle. |
Defining a new function with a different name is a good way around that problem :) | |
Graham 15-May-2010 [1670] | Or, adding a refinement |
BrianH 15-May-2010 [1671] | Adding refinements to low-level natives can double their overhead for each refinement - more for mezzanines. Not a good idea. |
Graham 15-May-2010 [1672x2] | So, how can we redefine old words without causing a stack overflow? |
Current r2 code would be using an error handler to see if index? threw an error ... not a biggie | |
BrianH 15-May-2010 [1674] | Use a local reference to the old function, then call through the reference. You can do this with a private variable, or composing the code block of the new function to have a direct reference to the old function value. That last method can be awkward with functions called with refinements, but it can be done; the private variable metod is less awkward. |
Graham 15-May-2010 [1675] | example? |
BrianH 15-May-2010 [1676x2] | Yes, but current R2 code would be depending on that error to trigger the code in the error handler, rather than just propagating the error to where it would do more damage. Error handling code is there for a reason. |
use [idx?] [ idx?: :index? index?: func [series [ series! | none! ]] [ either series [ idx? series ][none] ] ] | |
Graham 15-May-2010 [1678] | that looks untested to me |
BrianH 15-May-2010 [1679x2] | You wanted an example. I just converted your code to a style that wouldn't have a stack overflow. |
The | was in your original code :) | |
Graham 15-May-2010 [1681] | I amended it ! |
BrianH 15-May-2010 [1682x2] | :) |
That's not the part that was changed though: a private variable was added to refer to the old function. This deals with the stack overflow. | |
Graham 15-May-2010 [1684] | Brian ... has anyone looked at the network protocol enhancements ... |
Gregg 16-May-2010 [1685] | Gabriele, maybe Cyphre then. I just remember, or think I remember, that I didn't come up with it. |
Graham 16-May-2010 [1686] | using Brian's trick means you don't have to rename it! |
Gregg 16-May-2010 [1687x2] | Yes, but having a none-afe version with a different name allows you to choose. |
none-safe | |
Graham 23-May-2010 [1689x2] | Has the 2.7.8 project died ? |
or gone into hibernation? | |
GiuseppeC 24-May-2010 [1691] | You are asking too much ! :-) |
Graham 24-May-2010 [1692] | asking anything is too much :( |
Maxim 25-May-2010 [1693] | no there are a lot of mezzanines in dev chat ready for the 2.7.8. AFAIK, Carl either works on R3 or R2. not both... right now, he is working on R3 so until we get another big release (the one with extracted view) I would't bet on a 2.7.8. though I have been using a few of the functions with dev chat which Brian coded for R2/forward. |
GiuseppeC 25-May-2010 [1694] | This the price/benefit of one man work on REBOL/Core. |
Maxim 25-May-2010 [1695] | its also possible that with the AGG fixes done or pending, we might get a 2.7.8 beta which has current mezz code and the bigger native changes pushed to a 2.7.9 release... but I'm just throwing a guess in the air. |
GiuseppeC 25-May-2010 [1696] | However, I am not dissatisflied. I apreciate the amount of work done and every release is a gift to the community. Long life to Carl ! |
older newer | first last |