World: r3wp
[Red] Red language group
older newer | first last |
Henrik 22-Jun-2011 [2425] | Andreas, thanks for info. |
Dockimbel 22-Jun-2011 [2426] | Kaj: Null allowed as a function! argument. The changes was very trivial, but I tested only if it compiled. |
Kaj 22-Jun-2011 [2427] | Thanks again! |
Dockimbel 22-Jun-2011 [2428] | Test it first before thanking me. ;-) |
Kaj 22-Jun-2011 [2429] | Will do, but I'm batching the updates :-) |
Dockimbel 22-Jun-2011 [2430] | Well, I guess that we should start to do the same with Red/System very soon. |
Kaj 22-Jun-2011 [2431] | You mean releases? |
Dockimbel 22-Jun-2011 [2432x2] | Yes, I mean, splitting into two branches: one for current version (fixes only) and one for the next version. |
And make versioned releases. | |
Kaj 22-Jun-2011 [2434x6] | That would be good for the public. Myself, I would probably keep updating from trunk. I'm running a Git download through my Syllable build system to install a new version |
Added a bunch of convenience wrappers to the 0MQ binding, to make functions more Red/REBOL like | |
SIZE? of this struct works, but it is given as 40: | |
message!: alias struct! [ content [handle!] flags [byte!] ; unsigned char vsm-size [byte!] ; unsigned char vsm-data1 [integer!] ; unsigned char [ZMQ_MAX_VSM_SIZE] (default 30) vsm-data2 [integer!] vsm-data3 [integer!] vsm-data4 [integer!] vsm-data5 [integer!] vsm-data6 [integer!] vsm-data7 [integer!] vsm-data8 [integer!] ] | |
Apparently, the two bytes are combined into one 32 bits word. Shouldn't they both be aligned? | |
The new size? struct! and null function features seem to work | |
Dockimbel 23-Jun-2011 [2440x2] | Bytes don't require alignment, 32-bit values do. In message!, vsm-data1 is aligned on a 32-bit boundary, leaving a 2-bytes hole after vsm-size. |
You could compensate for that by splitting vsm-data8 in 2 bytes values, so that the global size remains the same as the C struct. The cleaner solution should be to introduce an array! type, which we will do at some point. | |
Kaj 23-Jun-2011 [2442x8] | OK, thanks |
I like the enhanced type casting syntax | |
It solves the problem that you don't know how to write a cast because in for example | |
as [handle!] x | |
handle! is a #define | |
I'm getting this: | |
*** Compilation Error: more than one expression found in parentheses | |
That seriously limits the usefulness of ANY and ALL | |
Dockimbel 23-Jun-2011 [2450] | How does that limit ANY and ALL? |
Kaj 23-Jun-2011 [2451x2] | unless all [ ( message: receive socket 0 as-logic message )( prin "Received request: " print as-c-string message-data message end-message message )( ;wait 1 send socket as [byte-ptr!] reply 1 + length? text 0 ) ][ print zmq-form-error system-error ] |
That's how I always use them | |
Dockimbel 23-Jun-2011 [2453] | You can't do such construction in Red/System. |
Kaj 23-Jun-2011 [2454] | Right, that's what I mean |
Dockimbel 23-Jun-2011 [2455x2] | Assignments can't be used inside an expression, nor can functions that don't have a return value. |
Btw, allowed expressions are now documented: http://static.red-lang.org/red-system-specs.html#section-5.1 | |
Kaj 23-Jun-2011 [2457] | Any plans to support this? |
Dockimbel 23-Jun-2011 [2458] | Red/System is not meant to be a REBOL replacement, you will need to wait for Red. |
Kaj 23-Jun-2011 [2459] | But isn't that the point? :-) There are no replacements for REBOL at all, and we can't wait any longer |
Dockimbel 23-Jun-2011 [2460] | Red/System cannot be a REBOL replacement, it doesn't live at the same level of abstraction. |
Kaj 23-Jun-2011 [2461] | I know, but this one is very doable. I guess it would be a nice project for Brian |
Dockimbel 23-Jun-2011 [2462x2] | I could remove the compiler check, so that your code "might" compile, but that opens a hole for several others issues. |
That compiler check has been added to solve the issues reported here: https://github.com/dockimbel/Red/issues/93 | |
Steeve 23-Jun-2011 [2464] | assignements don't return a value in Red ? It should be doable without pain. |
Dockimbel 23-Jun-2011 [2465x2] | Currently, no. |
There is a possible evolution documented in the specification for that, allowing also multi-assignments as a side-effect. | |
Steeve 23-Jun-2011 [2467] | a cool side effect |
Dockimbel 23-Jun-2011 [2468] | Yeah :-) |
Kaj 23-Jun-2011 [2469] | It sort of pulls the base out from under my efforts to wrap all external functions to return logic! |
Dockimbel 23-Jun-2011 [2470] | You could just write wrapper functions. |
Kaj 23-Jun-2011 [2471] | I did, but after that, I was expecting to plug them into ANY and ALL :-) |
Dockimbel 23-Jun-2011 [2472x2] | or use logic! as return value in the imported function definition? |
(as return type) | |
Kaj 23-Jun-2011 [2474] | No, we discussed that |
older newer | first last |