World: r3wp
[Core] Discuss core issues
older newer | first last |
btiffin 1-Apr-2008 [9997] | Yeah any word! reduced is still the word! |
Henrik 1-Apr-2008 [9998] | sorry: >> type? false == logic! >> type? reduce false == logic! R2 and R3 behave identically here. |
Geomol 1-Apr-2008 [9999] | Henrik, yes, but >> type? reduce 'false == word! Is that the same in R3? |
Fork 1-Apr-2008 [10000] | It seems like reduce is a core notion, and it would be nice to see a list mapping what conversions it performs. Changing that between R2 and R3 seems rather... fundamental? |
btiffin 1-Apr-2008 [10001] | Fork; There are also "lexical forms" for all these values. #[false] is loaded by REBOL as the logic! value false. No need to evaluate in that case. John; yes. |
Fork 1-Apr-2008 [10002] | I'd suggest coming up with a new keyword, e.g. reduce3, if something like that were to change. |
Henrik 1-Apr-2008 [10003] | geomol, yes, they are identical |
Geomol 1-Apr-2008 [10004] | Fork, we're normally ok with not being completely compatible with new versions. Better to correct the failures as soon as possible. |
btiffin 1-Apr-2008 [10005] | Brian; It comes down to the ill-documented sequence of load/evaluate and the spellings of some the values. false, true, none are the most common gotchas. |
Henrik 1-Apr-2008 [10006] | Fork, R3 is not meant to be compatible with R2, so that would not be likely to happen. If a function doesn't behave consistently, it will change. Just for the record. :-) |
Geomol 1-Apr-2008 [10007] | Alternative: >> type? do load form 'false == logic! But the most simple must be: >> type? do 'false == logic! There are so many ways to get the same result. |
Fork 1-Apr-2008 [10008x3] | Ok, I appreciate the help... but I do wonder if there is a certain answer that Rebol 3 reduces words to logic |
So my earlier example, would it act different in R3? | |
>> if ( reduce first find [false true] 'false ) [print "false is in the list"] false is in the list | |
btiffin 1-Apr-2008 [10011] | Nope; words reduce as words. Here is a good article by one of heroes; http://en.wikibooks.org/wiki/REBOL_Programming/Advanced/Interpreter |
Henrik 1-Apr-2008 [10012x2] | same result |
and it would be because we are in that example always dealing with words. | |
Fork 1-Apr-2008 [10014] | Ok, so Henrik, does that mean you retract your statement "Fork, Rebol 3 does, so this may be an inconsistency in Rebol 2." |
Henrik 1-Apr-2008 [10015] | yes :-) sorry about that. I mixed up some results. |
Fork 1-Apr-2008 [10016x2] | In regards to what I said: "Im confused as to why reduce, which seems to perform other evaluations, would not (in R2) turn false into a logic!... Henrik, you are saying it does?" |
Ok, whew. Good :) | |
btiffin 1-Apr-2008 [10018] | Give Ladislav's article a read...it cleared up a lot for me, but I still can't explain it :) |
Fork 1-Apr-2008 [10019x2] | reduce does not turn words into logic. do does. I'll write that down :) |
Thanks for the link, I will check it out. Ladislav seems to think about some of the same general issues I do, as he apparently made lfunc... we're probably on the same page in other ways... | |
Geomol 1-Apr-2008 [10021] | Fork, you also have a problem with your check, if 'false isn't in the series: >> first find [true something-else] 'false ** Script Error: first expected series argument of type: series pair event money date object port time tuple any-function library struct ... |
Henrik 1-Apr-2008 [10022] | generally I only use REDUCE on blocks, because it does not seem very useful on anything else. |
Fork 1-Apr-2008 [10023] | Yes, I knew that bit :) |
Geomol 1-Apr-2008 [10024] | ok |
Henrik 1-Apr-2008 [10025] | Geomol, that works in R3. :-) |
btiffin 1-Apr-2008 [10026] | Yep; he seems to "get it". Normal rebols just flail about until it sinks in. |
Fork 1-Apr-2008 [10027] | I've programmed since 6502 assembly, have an EE degree, and have designed very abstract DSLs. Nothing shocks me. :) I know all the ways one can make decisions, I merely need to understand the decision set that was made in REBOL. |
Henrik 1-Apr-2008 [10028] | the reason is that statistically it makes better sense to have FIRST, SECOND, etc. be gentler, so we don't have to check anything if we reach tail. |
Fork 1-Apr-2008 [10029x2] | And then ponder the implications. |
Thanks for your help everyone, I will clean up enum a bit... read Ladislav's article, and look into the implementation of lfunc and a few other "critical" missing pieces from my point of view... | |
btiffin 1-Apr-2008 [10031x2] | Yep. Ladislav has a bunch of technical articles. Good reading, but not for newbies; although maybe they should be. :) |
http://www.fm.tul.cz/~ladislav/rebol/ | |
Geomol 1-Apr-2008 [10033] | 6502! :-) You may wanna check out my 6502 asm and emulator written in REBOL: http://www.fys.ku.dk/~niclasen/rebol/language/ |
Henrik 1-Apr-2008 [10034] | Fork, you can download the Rebol3 alpha from rebol.net. It's public. That might help you to understand if something that seems weird in R2 is changed in R3. |
Fork 1-Apr-2008 [10035x5] | Well, an article that shows me how to "print 1 + 2" as a first example is the wrong angle of attack for teaching me (in particular) a new language. I'm not at all troubled by C++ class libraries for sending email, drawing graphics, etc... so "syntax sugar" doesn't matter, my approaches are usually generative anyway. |
I will write a blog article about REBOL and put enum in it and do a screencast | |
And explain what I've learned... | |
But for now, lunch! Thanks again! | |
Geomol: ah, memories... :) | |
btiffin 1-Apr-2008 [10040] | It's good to have Brians around. :) |
Henrik 1-Apr-2008 [10041] | It's good to have more talent in here. |
btiffin 1-Apr-2008 [10042] | The weird part Henrik; most rebols are talent. Or they'd be C coders and rely on mickey soft visual studio products. But I'll agree. Superstar rebols can drag the rest us along quite nicely. :) (Note I said rely on ... not dissing anyone that uses studio ... just dissing those that use it a crutch to pretend to program.) |
Henrik 1-Apr-2008 [10043] | The funny thing is that I find those IDEs to be a hindrance to do any real work. I wouldn't even know how to use them as a crutch. :-) |
btiffin 1-Apr-2008 [10044] | Well; you're not a pretend programmer then :) Henrik; to be honest, count yourself in the top ten, I do. |
Anton 1-Apr-2008 [10045] | Fork, does has func : "converting the container". This must be a first impression only, since each of those creates a function! (See ?? has ?? does ?? func) This is a nice gradation of function specifications which saves keystrokes (and thus overall script size and complexity), by gradually increasing the options. So you only ever specify what you need to specify. Using shorter words will not speed up rebol much, because they are converted at load time to symbols (which is just an integer, internally). However, the general aim is to shrink the program in order to make it more easily understandable. In mathematics, concepts have been reduced to single-letter symbols, and can thus be more easily manipulated in a single page. (Of course, I don't recommend using single-letter symbols in rebol, most of the time.) You can share functions in an object by putting them in a "sub-object", eg. enum!: context [ v: none ; current value access: context [ get-enum: func [enum] ... set-enum: func [enum new-value] ... ] ] Then: my-enum/access/set-enum my-enum 'new-value The "sub-object" (access) will be shared amongst all enum! instances (unless you explicitly clone it when you make your enum! instances). (Cloning is done just using MAKE.) if find [false true] 'false ... You will almost never have to do this (using true and false, that is). It usually boils down much simpler, you will happily discover. |
Fork 1-Apr-2008 [10046] | Wow Anton, that sub-object thing definitely is a bit of a surprise. I should probably get straight to reading Ladislav's article! |
older newer | first last |