World: r3wp
[Core] Discuss core issues
older newer | first last |
Graham 4-Jun-2006 [4816x2] | Anyone tried printf from the library? |
>> do %printf.r >> printf ["%d" .02 ] ** Access Error: Cannot open sprintf ** Where: routine-call ** Near: routine: make routine! spec library | |
Gabriele 5-Jun-2006 [4818] | note that r3 will make it easier to create non-bound words (i.e. symbols) for the cases when you want to use words as symbols (dialects, data, etc) and not variables. anyway, as anton says, i don't think anyone would ever really need more than 8k distinct words, so when you get that error it means that probably you are doing something wrong :) (ah, and given that contexts are extensible in r3, i expect the 8k word limit to go away) |
Pekr 5-Jun-2006 [4819] | Gabriele - as you mention dialects, will parse see any changes/enhancements in R3? Just curious :-) |
Gabriele 5-Jun-2006 [4820] | maybe. we've been discussing a few things. nothing decided yet. |
Anton 5-Jun-2006 [4821] | I wonder if beginners will take longer to realise the error of their ways... |
Gabriele 5-Jun-2006 [4822] | anton, yes that could be an issue. maybe we could have a soft limit or something like that for contexts. but, i don't know if there's an hard limit, i'm just assuming there isn't, but i may be wrong. |
Anton 5-Jun-2006 [4823] | They'll find the hard limit when they exhaust memory. :) |
Pekr 5-Jun-2006 [4824] | :-) |
JaimeVargas 5-Jun-2006 [4825] | Graham, I bet printf is not finding the either the DLL or the function on the DLL. |
Graham 5-Jun-2006 [4826] | Is this a standard windows dll? |
JaimeVargas 5-Jun-2006 [4827x2] | Yes. |
Humm. It seems that WinXP' kernel32.dll doesn't includes the sprintf function. I will apreciate if anyone can point to the proper DLL. | |
BrianH 6-Jun-2006 [4829x2] | msvcrt.dll |
That is the C runtime. There are a few other (older) C runtimes on Windows, but that is generally the best one. | |
JaimeVargas 6-Jun-2006 [4831x2] | Thanks Brian. |
New printf.r script with fix commited to the library. | |
Graham 6-Jun-2006 [4833] | Thanks. |
JaimeVargas 14-Jun-2006 [4834x6] | Humm. I give up. Has somebody found a solution to the path capture problem? #!/usr/local/bin/rebol -sq REBOL [] print first system/options/args |
What I need is to be able to capture the full path of the first arg passed to such script. | |
Not just the filename. | |
The reason is that the script is no of the same path of /usr/local/bin the script fails to find the file. | |
Which is passed as arg | |
Hopefully this is not too convoluted... | |
Gabriele 14-Jun-2006 [4840] | if you encap it, the CD will be the dir where the program was started from. when run with a shebang though... not sure if there's a way. |
JaimeVargas 14-Jun-2006 [4841] | No SDK in OSX :-/ |
Ingo 14-Jun-2006 [4842] | Hi Jaime, I think you're looking for this system/script/path |
Volker 14-Jun-2006 [4843x2] | probe system/options |
IIRC the shell-dir is somewhere there. Or try system/options/script/parent/path. | |
JaimeVargas 14-Jun-2006 [4845] | Thx, Ingo and Volker, what I was looking for is SYSTEM/OPTIONS/PATH |
BrianW 14-Jun-2006 [4846x6] | Dumb question: When I'm printing a string, what's the best way to show special characters (^/ etcetera) in their special form, rather than just expanding them (turning ^/ into an actual newline, for example)? |
well, I know probe is the way to do it direct to stdout, but I want to save the "probe" value to a string | |
and for the public record, at least part of my answer is: raw-str: mold real-str | |
yay for "source probe" | |
How about going the other way? Turning newlines into ^/ characters and so on? | |
and again I answer my own bloody question: replace/all (mold real-text) "^/" "^^/") Guess I don't actually start thinking for myself until I ask the question somewhere that I can look dumb ;) | |
Izkata 14-Jun-2006 [4852] | But that's the best way - you're more likely to remember it then! |
james_nak 15-Jun-2006 [4853] | Is there a way to "copy" an object (already defined) so the result is a distinct object? It's probably something easy but for the life of me... |
Anton 15-Jun-2006 [4854] | make |
james_nak 15-Jun-2006 [4855] | Thanks Anton. Yep, right after I wrote that I said to myself "Self, why don't you try 'd: make c [ ]'" and it works...and it is in the docs on objects. Duh. Thanks. |
Anton 15-Jun-2006 [4856] | :-) |
BrianW 15-Jun-2006 [4857] | Good to know I'm not the only one :) |
james_nak 15-Jun-2006 [4858] | You kidding? I hate it when I spend hours trying to figure out what's up. : ( |
Anton 15-Jun-2006 [4859x2] | Just remember, strings are copied, blocks are deep copied, but sub-objects are shared. |
>> o: make object! [s: "hello" b: [there] o: make object! []] >> o2: make o [] >> same? o/s o2/s == false >> same? o/b o2/b == false >> same? o/o o2/o == true | |
james_nak 15-Jun-2006 [4861] | Thanks! Sub-objects shared. Hmmm. That would have thrown me fo sure. |
Robert 16-Jun-2006 [4862x2] | This is IMO inconsistent and should be changed: >> ? for USAGE: FOR 'word start end bump body DESCRIPTION: Repeats a block over a range of values. FOR is a function value. ARGUMENTS: word -- Variable to hold current value (Type: word) start -- Starting value (Type: number series money time date char) end -- Ending value (Type: number series money time date char) bump -- Amount to skip each time (Type: number money time char) body -- Block to evaluate (Type: block) (SPECIAL ATTRIBUTES) catch throw >> a: 2.0 == 2.0 >> for test 1 a 1 [print test] ** Script Error: for expected end argument of type: integer ** Near: for test 1 a 1 >> number? a == true It should be possible to use decimal! as well. The interpreter should implicitly convert it to an integer! |
The docs state number! and not integer! | |
BrianH 16-Jun-2006 [4864] | The type of the start and end variables must be the same. If you look at the source of for, you will see that it throws that error when they are not. |
Robert 17-Jun-2006 [4865] | Yes, but 2.0 can be converted to 2, so no problem. |
older newer | first last |