World: r4wp
[!REBOL3] General discussion about REBOL 3
older newer | first last |
BrianH 17-Feb-2013 [1021x3] | It can do more than that, but that's the basics. And you can have words as well, not just numbers. |
If you are writing tests, there are a few things you should know about the behavior-as-designed of REWORD: - values is a collection of key/value pairs, like a map. If a block, no reduce is done, it's just data. - Keys are converted to strings if they aren't strings already, and are considered equivalent if their strings are equivalent. - Empty strings don't count, but the check for empty keys is done after the string conversion so none is not empty, it's "none". - If a value is unset or none, the key/value pair is ignored. - If the same key is specified more than once, the last value of that key takes precedence. - After all of the key/value conflicts are resolved, if there are ambiguities between keys (like "ab" vs. "a") then the first key gets priority. That means that you probably want to put the longer key first, same as with PARSE alternates. If we're writing tests, we need to write tests for all of those. And we probably need tests because it was intended that REWORD be converted to a native for speed after we settled on its behavior. The current REWORD works as designed, but we might want to tweak the design after further discussion. | |
Oh, and if a value is a function, that function will be called every time with an argument of the string at the position of the escape. We need to test for that too. This makes *really* flexible replacement possible. | |
AdrianS 17-Feb-2013 [1024] | Just for this, Brian. http://stackoverflow.com/questions/14924801/what-considerations-should-be-made-when-using-reword-in-rebol |
BrianH 17-Feb-2013 [1025] | Damn. Now I have to answer that :-/ |
AdrianS 17-Feb-2013 [1026x2] | heh |
just cut and past - almost | |
BrianH 17-Feb-2013 [1028] | And edit, because SO is much better for this kind of thing. And maybe provide a little context for why the function exists at all. |
AdrianS 17-Feb-2013 [1029] | Hey, you downvoted it because of that? |
BrianH 17-Feb-2013 [1030] | It's a timing thing. I have other things to do for the next several days. This is one more thing. |
AdrianS 17-Feb-2013 [1031x2] | And that calls for a downvote? Well, that's a great incentive to ask questions. |
There's no hurry to have to answer is there? | |
BrianH 17-Feb-2013 [1033] | One of the problems of SO (generally, not in this case I hope) is that the asker chooses which answer is the accepted one, not someone who knows enough about the situation to know which answer is better. So I tend to try to work around this social bug by answering earlier to discourage less-informed people from trying to answer badly. In this case, I have to answer because I'm the one who designed and wrote the function, at Carl's request. |
Andreas 17-Feb-2013 [1034] | AdrianS: I don't think BrianH downvoted your question. But whoever did (I didn't either) probably has a point, as it's a very broad and open question. SO generally prefers more specific questions based on actual problems, so that it's reasonably clear when an answer is practical. |
AdrianS 17-Feb-2013 [1035x3] | sure, Fork pointed out the same thing |
it was just an attempt to capture what Brian had just posted here. | |
Maybe the question could be re-worded to make it less of lame Jeopardy-like 'question'. | |
BrianH 17-Feb-2013 [1038] | I didn't downvote it, and I might have enough reputation to rewrite it so it's a better question. Or request that Fork does, because he certainly does. |
AdrianS 17-Feb-2013 [1039] | If you can't re-write it, let me know how you'd prefer the question. |
BrianH 17-Feb-2013 [1040] | I'm working on the answer. Once it's done, we'll know the question. Yes, SO is a lot like Jeopardy :) |
AdrianS 17-Feb-2013 [1041x2] | From now on, I'll have to be careful in asking question where you're the intended answerer since you go overboard in the details. It might makes sense in some cases to just put a summary and leave a note that there's more to be said somewhere down the road. |
Crap, I hate not being able to edit what I just posted. Used to being sloppy on the SO chat. I see that I managed two typos above... | |
BrianH 17-Feb-2013 [1043x3] | Well, we've been encouraged lately to put these up, and we can point other pages to SO if need be, or copy the answers to a documentation page when we have those. I mostly see it as a place to write short documentary articles in a Q&A format, much like Yahoo answers is a place to write jokes in Q&A format. |
If it were Cracked, I'd be writing numbered lists instead :) | |
Answered. So, how do we phrase the question? | |
AdrianS 17-Feb-2013 [1046x2] | It should be something that captures a wider range of searches, for example on general purpose template expansion, resolving prepared statements, etc. |
Even if some of this is not incorporated into the question, it should at least be tagged with the appropriate keywords. | |
Rebolek 22-Feb-2013 [1048] | What are the steps for compiling r3 under Windows using MinGW? Is there some documentation I can use? |
Ladislav 22-Feb-2013 [1049] | You need MSYS in addition to MinGW |
Cyphre 22-Feb-2013 [1050x2] | yes, the problem is MINGW is using own 'custom' version of MAKE called "mingw32-make.exe" which doesn't behave well on the R3 makefile (at least from my experience). So my Windows setup is: -I installed CodeBlocks with MINGW support -then I installed MSYS and extracted only 'necessary' files from MSYS/bin folder and put it into CodeBlocks\msys\bin\ folder -then I deleted the MSYS instalation to not have bloat on my disk -I set paths to CodeBlocks\MinGW\bin CodeBlocks\msys\bin in the WIndows console -from now I can just type MAKE ALL in the CMD console and R3 builds fine Just in case here is the list of "necessary" MSYS/bin files I extracted (around 3MB of data): cp.exe make.exe mkdir.exe msys-1.0.dll msys-iconv-2.dll msys-intl-8.dll msys-regex-1.dll msys-termcap-0.dll rm.exe rmdir.exe sh.exe |
(note: the paths to bin/ folders must be in the specific order mentioned above) | |
Rebolek 22-Feb-2013 [1052] | Thaks, I will try it |
Cyphre 22-Feb-2013 [1053x3] | If you wantt I can put the "minimal" MSYS bin folder into a zip archive so you can download it and just copy it into your codeblocks instalation... |
I did the same for Ladislav and it worked for him well AFAIK. | |
also, other option is to create CodeBlocks setup file so you can build directly from CodeBlocks using mingw but I guess noone did that so far ;) | |
Rebolek 22-Feb-2013 [1056] | Cyphre, that would be very nice. |
Cyphre 22-Feb-2013 [1057x2] | here you go: http://cyphre.mysteria.cz/stuff/msys.zip |
just unpack it and copy to <your path to codeblocks>/CodeBlocks/ main dir | |
Rebolek 22-Feb-2013 [1059] | Thanks, I will try it |
AdrianS 22-Feb-2013 [1060x2] | Actually, to keep things as simple as possible for people, all you need is Code::Blocks, the CB project file and a slightly modified make-make.r that is soon to be checked in by Andreas (or which I could provide). Then, you can build from CB (and debug), navigate your C source propertly, etc. |
Ping me either here or on SO chat if you would like the two files. | |
GrahamC 23-Feb-2013 [1062x3] | This is a tip for where you have those pesky @s in a username. You still can't get past that by using %40 in a url as Rebol converts those when it evaluates the url but you can do this >> cmd: open decode-url "ftp://user%40rebol.com:[password-:-ftp-:-rebol-:-com]" make object! [ title: "FTP Protocol" scheme: 'ftp ref: [scheme: 'ftp pass: "password" user: "user%40rebol.com" host: "ftp.rebol.com"] path: none host: "ftp.rebol.com" port-id: 21 pass: "password" user: "user%40rebol.com" ] port opened ... |
saves a bit of typing out the whole spec | |
now we just have to add a dehex inside the open port actor | |
Gregg 24-Feb-2013 [1065] | Does the old charset patch no longer work? net-utils/url-parser/user-char: union net-utils/url-parser/user-char make bitset! #"@" |
GrahamC 24-Feb-2013 [1066] | didn't try ... ! |
Rebolek 25-Feb-2013 [1067] | R3 CALL seems pretty useless to me compared to R2. Is there anybody trying to improve it? |
Andreas 25-Feb-2013 [1068x2] | I'm working on it, but only for Posix (Linux/OSX) so far. |
And starting first with the basics I need (/wait + /input /output /error). (So no full scheme & async at the start.) | |
Rebolek 25-Feb-2013 [1070] | Great news, Andreas! Linux is good for me and basic input/output is enough too. Just what I need. |
older newer | first last |