World: r3wp
[!REBOL2 Releases] Discuss 2.x releases
older newer | first last |
BrianH 2-Jun-2009 [392x2] | Tomc, look here for the answer, though you might need to do some math: http://curecode.org/rebol3/ticket.rsp?id=879 |
Copied here: Answer: currently, there are two primary random generators: 1. old method, high speed, simple multiplicative: next = next * 1103515245L + 12345L; tmp = next & 0xffff0000; next = next * 1103515245L + 12345L; tmp |= (next >> 16); 2. much slower, SHA1() of a repeating pattern of the integer bytes (20 bytes total). | |
GiuseppeC 2-Jun-2009 [394] | Hello, I have big conceptual problems with REBOL objects. They differ a lot from common OOP. Inheritance is done by copying, no accessors, function redefinitions needs binding, the object is composed of multiple blocks and I don't know how REBOL compiler interprets them. |
BrianH 2-Jun-2009 [395] | They don't differ that much from standard prototype-based OOP. The only difference is that delegation is done manually. |
GiuseppeC 2-Jun-2009 [396] | I really ask myself why the REBOL object model is so different than standard OOP. I need some very good documentation but I have fount it nowhere. Does it exists ? Is it one of the best kept secrets ? I have read that someone was able to buil a full class system using REBOL with multiple inheritance but this is a myth for me. |
BrianH 2-Jun-2009 [397] | It only differs from class-based OOP. There are at least 3 standards for OOP, and only class-based OOP has inheritance. |
GiuseppeC 2-Jun-2009 [398x3] | BrianH, I have learnt OOP in Thinking in Java and VB.NET programming language. |
I admit I know only class-based OOP | |
However, the question remains the same. Does a good article/documentation exists for rebol OOP ? | |
BrianH 2-Jun-2009 [401x2] | The main reason REBOL's object! model is not class-based is because it was initially developed after it became known that class-based OOP has a lot of downsides. That's wasn't known about class-based OOP at first. |
As for the docs/articles, I think they exist but I don't know where. | |
GiuseppeC 2-Jun-2009 [403x3] | I'll wait for the answer of other people to continue. The I'll start experimenting and asking questions. I stopped working using REBOL object lot of time ago when I found really difficult to have an unique template to build many object with different fuctions. |
Also I needed to have the ability to change a function in many objects like you do in other languages changing a single pointer to the destination fuction. | |
Late night here. Hope to read you soon ! | |
BrianH 2-Jun-2009 [406] | In prototype-based object languages, you handle code sharing with delegation. A "class" is a common object that many similar objects delegate to. Since delegation is explicit in REBOL, that means that object functions call other object functions or other functions explicitly. In the case you mention, you just assign a new function to the word in the shared object or global context. |
james_nak 2-Jun-2009 [407] | Have any of you ever seen where the request-date requester does not display the correct month? For example, it will say May 2009 when it is actually displaying June 2009. Selecting a date will give you the june date. Using the /date refinement doesn't seem to help either. |
kcollins 2-Jun-2009 [408] | Wikipedia has an article about prototype based programming: http://en.wikipedia.org/wiki/Prototype-based_programming |
Tomc 3-Jun-2009 [409] | thanks BrianH and Ladislav I found curecode and ticket 879 it will do nicely. |
Henrik 3-Jun-2009 [410] | james, yes, it's a known bug. |
Graham 3-Jun-2009 [411] | never noticed a date issue .. but then I use rebgui's date requester. |
Gregg 3-Jun-2009 [412] | Giuseppe, in the context of REBOL as a messaging/data language, can you picture how it might work as a class-based model? And do you think a class-based model is more appropriate in distributed environments? |
Janko 3-Jun-2009 [413x2] | the feature that you can disarm error and turn it into object / data that you can store then is very good ! |
is something like this possible also with other dynamic languages? I am not aware of, but I never really explored at other | |
Henrik 3-Jun-2009 [415] | actually it's going out in R3, because it's annoying having to disarm errors. :-) |
Maxim 3-Jun-2009 [416] | more precisely... errors are disarmed automatically. |
Janko 3-Jun-2009 [417x3] | how will it work there ? reverse .. you manually trigger them .. I see that they are triggered in R2 as they are evaluated (except probably function takes them as lit-word (without eval))? |
aha | |
ok.. as long as you can use them as data also | |
BrianH 3-Jun-2009 [420] | In R3 you have to DO the error! to trigger it. |
Janko 3-Jun-2009 [421] | ok, probably more predictable and consistent behaviour .. |
GiuseppeC 3-Jun-2009 [422x2] | Gregg, I do not want to criticize the REBOL object model but the lack of in-depth documentation leave me in the blindness. I have no answer for you. My skill level is too low but I whish to increase it. Now I have learnt that REBOL object are Prototype Based and I have read the Wikipedia article about this kind of object orientation. I know domething more. |
Try to search using google: "rebol prototype based objects site:rebol.com" You will find nothing apart "Core product information" and something on "Rebol/View" then only in the lower part of the page you will findd something in REBOL3 docs. | |
BrianH 3-Jun-2009 [424x3] | The transition from class-based OOP languages to non-class-based OOP is usually rough, because the makers of class-based OOP tend to teach that the only style of OOP is class-based, and that if there are no classes it's not OOP :( |
It's even tougher in REBOL, which is not an OOP language at all. | |
REBOL has prototype-based objects, but that is not the primary programming model of REBOL. | |
GiuseppeC 3-Jun-2009 [427] | BrianH you are right. Until your messages I didn't ever know another kind of OOP was possible. |
BrianH 3-Jun-2009 [428] | There's also functional OOP, which you can sort-of do in R3 with closures :) |
GiuseppeC 3-Jun-2009 [429x3] | But believe me there is a deep gap between what the standard documentation teaches and what should be written there to fully understand not only objects but the full ideology behind REBOL. |
Only asking to GURUS like you one can reach the level needed to have a upper gear in REBOL programming. | |
I have just added a STUB to R2 articles to write what I will discover about REBOL objects. The trip has just started. | |
Steeve 3-Jun-2009 [432x2] | Most of the inner schemes used in Rebol are hidden. Carl never talked a lot about them and never officialy |
I think it's related to his choice to protect the sources | |
Gregg 3-Jun-2009 [434] | Giuseppe, I didn't mean to sound critical of you either. I just meant to pose it as a thought problem. Something fun to think about. e.g., in a world where you can send objects around, what does it mean if you can send a standalone object, versus one that needs a class to instantiate itself from? And what does that mean with regards to execution and untrusted code? |
Janko 4-Jun-2009 [435] | I just use this feature to spawn actors (which are rebol objects) at remote locations in my playing with actors system |
WuJian 3-Aug-2009 [436] | call "C:\Program Files\Windows Media Player\wmplayer.exe" This line does not work on Rebol2.76 ,but works well on Rebol3 Who can tell me why? |
Graham 3-Aug-2009 [437x2] | try call/show |
call is broken in R2 | |
WuJian 3-Aug-2009 [439] | It works. Thank you.,Graham |
Graham 3-Aug-2009 [440] | it's a problem since 2.7.6 ... when 'call was fixed ... |
TomBon 5-Aug-2009 [441] | does somebody knows how to create a null-terminated string pointer for this api call? winlib: load/library %user32.dll SendMessage: make routine! [ hWnd [integer!] "[in] Handle to the window whose window procedure will receive the message." Msg [integer!] "[in] Specifies the message to be sent." wParam [integer!] "[in] Specifies additional message-specific information." lParam [integer!] "[in] Specifies additional message-specific information." return: [integer!] "The return value specifies the result of the message processing; it depends on the message sent." ] winlib "SendMessageA" the-char-result: make however the -> null-terminated string pointer ??? creating a struct! doesn't work either. char-len: SendMessage: hWnd WM_GETTEXTLENGTH 0 0 char-pointer: SendMessage: hWnd WM_GETTEXT char-len the-char-result WM_GETTEXTLENGTH is working fine but the WM_GETTEXT seems to need a pointer to a string. any idea? tom |
older newer | first last |