World: r3wp
[!REBOL3 Extensions] REBOL 3 Extensions discussions
older newer | first last |
Ladislav 28-Nov-2009 [352x2] | generally, struct {...} my-struct; declares my-struct, while struct {...}; does not declare anything |
(should have been my_struct) | |
Robert 28-Nov-2009 [354] | I commented the struct part and than it works. So either we need to give it a name, which will result in a ->struct_name.series sequence. Not sure if this makes any difference instead of just putting the members into the union. |
Ladislav 28-Nov-2009 [355x3] | yes, it makes a difference |
(since it is a union) | |
-only one of the variants is correct | |
Robert 28-Nov-2009 [358x4] | Ok, right. Using int32 and ser as struct names. |
Works. | |
BTW: I'm currently making a R3 SQLite extension. | |
Looks like one need to be carful when designing the command interface (arguments) because if you insert an argument, the refinements shift to a new position. As the access to arguments on the c side is via positions you need to adjust your code. Need to think abou a good way to abstract this. | |
jocko 29-Nov-2009 [362] | is there a document showing how to define refinements in extensions ? |
Robert 29-Nov-2009 [363x2] | What do you mean with "define"? On the Rebol side or on the C side? |
Anyhow, yes refinements are no problem. | |
jocko 29-Nov-2009 [365] | well in fact I have not found any mechanism to call a function with a changing number of arguments, like, for instance: my-func a b my-func a b c or, my-func a b my-func/my-refinement a b c |
Graham 29-Nov-2009 [366] | use a block of arguments ? |
jocko 29-Nov-2009 [367x2] | Yes, of course it is a solution, but not a clean on in my case in fact, you cannot know, from inside the C part of the code, the real number of arguments send to the function. |
RXA_COUNT returns the number of arguments defined by the prototype of the function, not the actual one | |
Gabriele 29-Nov-2009 [369] | Jocko... you know... it has never been possible in REBOL to define functions with a variable number of arguments... |
Rebolek 29-Nov-2009 [370] | it is possible, but usefull only in console |
jocko 29-Nov-2009 [371] | that is why I was thinking of refinements |
BrianH 29-Nov-2009 [372] | The method of calling with refinements is currently awkward. That is one of the problems that is intended to be addressed in the near future in further revisions of the extensions api. |
jocko 29-Nov-2009 [373] | thanks, ... I hope that another (awkward) item will be callbacks. |
Robert 29-Nov-2009 [374] | It works but it's only done via position, so you don't get the name of the refinement. This rule is an unnecessary dependency from Rebol code to C code. |
jocko 29-Nov-2009 [375] | Ok, I understand ... |
BrianH 29-Nov-2009 [376] | Same as APPLY, actually. Fortunately the C implementation and the REBOL declaration are bundled together, so you tend to be the one setting the positions in the first place. This makes the whole process easier. |
jocko 29-Nov-2009 [377] | Ok, I see |
BrianH 29-Nov-2009 [378x2] | However, don't expect such awkwardness to continue for much longer. This is just version 11 :) |
11 -> 1 (stupid keyboard) | |
Robert 29-Nov-2009 [380x2] | May be, but that's what's available at the moment. |
Is there anyway to do a callback? Or trigger R3 to do something? At the moment I use a localhost port for this. | |
BrianH 29-Nov-2009 [382x2] | Not at the moment. That is as good a method as any for now. Maxim has beeen doing some research on this, and the device model is supposed to solve this problem in the long run. |
Some parts of R3 are more alpha than others - the extension model is one of these. | |
Robert 29-Nov-2009 [384] | That's bad because it's IMO an enabler and promoter for R3. As long as the GUI is missing, at least R3 can be used on the server with extensions. |
BrianH 29-Nov-2009 [385x3] | The API is versioned for exactly this reason. Carl came up with enough of an extensions API to actually function and to let people experiment with various techniques to make it better. Carl is not the only designer of R3 - we all help, and need to. We can't know how to design the extensions API until we get an idea of how it will need to be used. |
I'm not as much help in this as I'd like, since the current API is just fine for what I need to do - at least until we get device extensions. Maxim has been more help, since his needs aren't met by the current system. If you are writing a database API, your experience will likely help refine the model too. | |
R3 needs feedback about the kinds of problems that only arise from use. Without that feedback, design stalls. | |
Maxim 29-Nov-2009 [388x2] | I have been waiting for extensions for a decade, and its almost there. |
a lot of stuff depends on the improvement of extensions and addition of device extensions. not just for me but for Carl also. Unfortunately I am not at liberty right now to tell what that is, but I can assure you extensions will have to improve in the short term because a new player (company) in the REBOL community needs this, already. this company might become one of the levers to propel REBOL into adoption in (several) very large corporations (fortune 500) & scientific organisations around the world, so RT has vested interest into doing as much as it can to make this happen... and right now... the host code and extensions is the key to most of it. | |
Graham 29-Nov-2009 [390] | The Vatican keeps popping up! |
BrianH 29-Nov-2009 [391] | Don't be silly - everyone knows the Vatican uses LOLCODE :) |
Graham 29-Nov-2009 [392] | Using Roman numerals has always been a challenge for their coding. |
Ashley 30-Nov-2009 [393] | It's that damn i word (for I I X ...)! |
Gabriele 30-Nov-2009 [394] | Rebolek, that is not really true - the function still takes a fixed number of argument, and you're just passing a unset! value to some of them (which is a side effect of R2 passing unset! at the end of the block, i think R3 does not even do that) |
Rebolek 30-Nov-2009 [395] | Gabriele, you're right that it's just a R2 side-effect and it's true that it does not work in R3. Not that I miss it. |
Micha 3-Dec-2009 [396] | Could someone write gzip compress and decompress functions for rebol3 extensions? what the cost would be? |
Graham 3-Dec-2009 [397x2] | There's already zip for R2 ... |
Check the rebol.org library | |
Rebolek 4-Dec-2009 [399] | I thought about writing extension for zlib, but haven't started anything yet. But it should be easy I think. |
Maxim 6-Dec-2009 [400] | you can always use the zlib code in putty. its MIT licensed :-). |
Robert 7-Dec-2009 [401] | Doing a R3 extension for this would be a no-brainer if the gzip code is simple to call. Getting the data to/from Rebol is easy. |
older newer | first last |