World: r3wp
[I'm new] Ask any question, and a helpful person will try to answer.
older newer | first last |
Steeve 1-Nov-2010 [3915] | Yeah but still, it's French. It's like doing your coming out :-) |
Ladislav 1-Nov-2010 [3916] | Rien ne va plus! |
srwill 1-Nov-2010 [3917] | I had French in HS... couple semesters in college... Can't read that. I do have great admiration for the French, though. |
Steeve 1-Nov-2010 [3918] | That's enough, you're officially adopted by the French community. |
srwill 1-Nov-2010 [3919x2] | Tres bien! |
Posted the question at Stackoverflow also: http://stackoverflow.com/questions/4073722/rebol-view-how-to-assign-images-to-layout-already-created | |
Maxim 1-Nov-2010 [3921] | I'm working on it. |
Maxim 2-Nov-2010 [3922] | Note I added a bit of meat to the do-events topic raised by Graham, as an extra answer. and yes... it would be swell if you rate the answer as the final one (shameless I know, but worth the time and effort Me thinks ;-) |
rjshanley 23-Nov-2010 [3923] | Is there a way to make objects a and b such that operations like a + b make sense? Like a complex number object. |
Sunanda 23-Nov-2010 [3924] | Geomol has done a complex number library.....Discussion is here: http://www.rebol.org/aga-display-posts.r?offset=0&post=r3wp381x1804 |
rjshanley 23-Nov-2010 [3925] | Thanks, Sunanda. |
rjshanley 24-Nov-2010 [3926] | Geomol's complex number library represents a workable approach to implementing a large integer math library. But has anyone already implemented one? That is, bc's ability to do +, -, *, and / on very large numbers? I've been trying to call bc from REBOL using the CALL stmt, but success has so far eluded me. |
Gregg 24-Nov-2010 [3927] | I have an old string-math lib. I don't remember how complete it is, but the basic ops should work. May no be applicable to what you want to do. |
Sunanda 24-Nov-2010 [3928] | There is this: http://www.rebol.org/view-script.r?script=bignumbers.r But (from a quick squint) it handles numbers as strings. That may be less effective than the usual bignum approach [which, in REBOL terms, might be a block of 32-bit binaries] |
BrianH 24-Nov-2010 [3929] | Isn't there a libbc? |
rjshanley 24-Nov-2010 [3930x2] | The block of binaries would give better performance, but the string approach might be fast enough. I'll take a look at it. Thx. |
The application involves arithmetic associated with disk addresses which can be beyond 2 terrabytes. | |
Sunanda 24-Nov-2010 [3932] | Strings are probably fine for 12 or 13 digit numbers. REBOL3 has 64-bit integers, so that is well within range of a native REBOL 3 INT. Is R3 a possibility for your project? |
rjshanley 24-Nov-2010 [3933x3] | Yes, it is. Native would be great. I just tried some simple stuff on R3 so I'll experiment further. Thanks a lot. |
R3 is a little wierd in its handling of large hex numbers - it displays them in scientific notation with limited precision instead of as integers. | |
>> 0x3333333333333 == 0x3.333333e12 | |
Sunanda 24-Nov-2010 [3936] | That's not a hex number. It's a REBOL pair. For hex, try this: to-hex 333333333333 |
Andreas 24-Nov-2010 [3937x3] | Which exposes a nice bug in A110. There is no longer an issue! type which can be used for arbitrary base literal numbers. |
So to-hex is actually rather misleading. | |
(And should probably be removed.) | |
BrianH 24-Nov-2010 [3940x2] | First of all, we never had a type that could be used for arbitrary base literal numbers, except the string types. |
Next, TO-HEX should probably not be removed, but it should return a string! instead. | |
Andreas 24-Nov-2010 [3942] | how would that differ from to-binary? |
BrianH 24-Nov-2010 [3943] | A binary is only formatted with hex characters (if the binary-base is 16). A string would actually containthe hex characters themselves. |
Andreas 24-Nov-2010 [3944x2] | So to-hex would be shortcut for enbase/base to-binary num 16. Rather useless. |
But my, why not. | |
BrianH 24-Nov-2010 [3946x2] | I expect that TO-HEX is a formatting function that is definitely not useless for web work, for example. |
That usage would require that we keep the issue-generating feature though, even if we couldn't convert back easily. | |
Andreas 24-Nov-2010 [3948] | Or you stop being lazy and add the # manually. |
BrianH 24-Nov-2010 [3949] | TO-HEX is a convenience function. Being lazy in a common situation is the whole point to convenience functions. |
Andreas 24-Nov-2010 [3950] | Being lazy means that there's no point to this discussion. |
BrianH 24-Nov-2010 [3951] | a nice bug in A110 - And which bug is that, exactly? Has it been reported? |
Andreas 24-Nov-2010 [3952] | Nevermind. |
BrianH 24-Nov-2010 [3953] | Trying to find out the bug is why I spoke up in the first place. I am trying to get the bugs reported so they can be fixed, as appropriate. It's amazing how often bugs go unreported and thus unfixed. |
Andreas 24-Nov-2010 [3954] | No bug. TO-HEX works as designed. Nothing to see here, move on people. |
BrianH 24-Nov-2010 [3955] | Ah, OK then. The change in issue! has brought up a lot of issues, so to speak. We are hoping to collect them all and come up with a set of tweaks and enhancements that can make things work. It should be possible to make them work a lot like they did before, with only minor changes (like being non-modifiable). You can replicate a lot of the behavior of a series type in a non-series type by simply having the series functions also work on the other type, as closely as appropriate. Good examples of these are SELECT and APPEND on objects and maps. |
Sunanda 25-Nov-2010 [3956] | I should have given the example: to-binary 33333333 As the above discussion suggests, creating an issue! is a bit of a dead end in this case. A binary! is much more usable.....That is true in R2 as well as R3. |
Duke 29-Nov-2010 [3957] | A function like: [code] func [x] [subtract 6 x] [/code] strikes me as being a lot like an anonymous function or lambda expression. Is that correct? How would I execute the above function from Rebol CLI? I keep getting error messages, so I'm not getting a piece of the puzzle. |
ChristianE 29-Nov-2010 [3958x3] | >> do func [x] [subtract 6 x] 1 == 5 >> apply func [x] [6 - x] [1] == 5 |
I'd say, yes, those are anonymous functions - in the sense that they aren't assigned to a word. But in the stricter sense of a "named" function, REBOL doesn't have that concept at all. You can assign a function to one word, some words, or no words at all. | |
Easy to see for example in code so simple as >> a: b: c: func [ ] [print "What's my name?"] >> do [a b c] | |
Izkata 29-Nov-2010 [3961] | I consider them to be the same as anonymous functions/lambdas, due to how I was introduced to that concept in Scheme - and a similar ability to have multiple words/names reference the same function, as ChristianE shows in Rebol: (define foo (lambda () (print "Hi")) (define bar foo) |
Duke 29-Nov-2010 [3962x2] | @Christian E. Thanks for the examples! In the first one, it just dawned on me that perhaps Rebol is a stack-based language - a bit like Forth et al. Didn't you just put "5" on the stack, then the "apply func" simply pops the the stack for its parameters? |
@Izkata Ithought that I smelled a lambda - maybe a la Rebol - but close enough :) | |
BrianH 29-Nov-2010 [3964] | REBOL has a stack, like most programming languages, but no explicit manipulation of it. DO function! just evaluates the arguments. One of the many gifts of using an interpreted language. |
older newer | first last |