World: r3wp
[!REBOL3-OLD1]
older newer | first last |
BrianH 8-Jan-2008 [5534x2] | Well, in the case you did above the effect of the closure is on the code block you pass to the inner call to func. A closure! is returned by the closure function above. When that closure! is run, the func call in its body then creates a function that is returned. |
In other languages their equivalents to FUNC or CLOSURE are declarations - in REBOL they are actions. | |
BrianW 8-Jan-2008 [5536] | okay, so I need to study more about what a closure actually is :-) |
[unknown: 5] 8-Jan-2008 [5537x2] | hey while your working on REBOL3 add something that can do this alias object/item "myfunc" |
We could really use a feature that can do that or if someone knows how to that would be cool. | |
BrianH 8-Jan-2008 [5539x3] | It's pretty simple really, as long as you realize that the closure function creates a value of the closure! type. The main difference between a closure! and a function! is that a closure! creates a context every time it is run and binds the words in its body to that context, like USE in REBOL 2. A function! just uses a special context instead with stack-local references, which goes away when the function! is done - there is no REBOL 2 equivalent to that, but a C function is close. |
Paul, I'm not sure which of the arguments is supposed to be the alias and what is supposed to be aliased. Try myfunc: does [object/item] or object/item: does [myfunc] depending on which direction you meant. | |
ALIAS is really only meant for internationalization. Assignment is for value aliasing, and functions are values. | |
BrianW 8-Jan-2008 [5542] | Is there a convenient way to list they keys of a map? |
BrianH 8-Jan-2008 [5543] | Not yet. It's on the todo list. |
BrianW 8-Jan-2008 [5544] | ok, thanks. Sorry for the questions, I'm just rummaging through the bag of goodies that is R3 right now. |
BrianH 8-Jan-2008 [5545x2] | Actually, you bring up a good point. There is currently no reason to know what keys are currently defined in a map because in theory all possible keys are defined in a map - they just don't have values yet. If you try to retrieve the value for a key that is not in the map yet, you get #[none] (the value, not the word). If you want to not have a key in the map, just set its value to #[none]. Yeah, that key may be physically still in the map, but who cares? The effect is the same - the only difference is memory usage. |
If it matters to you whether a key is in the map or not (regardless of its value), you should probably be using object! instead. With object! there is actually a difference between the key being there or not, and you can always expand an object with new fields if you need to in R3. | |
btiffin 8-Jan-2008 [5547] | Anyone that is not a fan of the Win console. Try Cygwin and install rxvt. (No need for the X11, rxvt runs beautifully as a windows app). It's not as featured as the REBOL 2 console, but it's a step up (and a little sideways) from the dos console. |
BrianH 8-Jan-2008 [5548] | If that works, tell me. I haven't been having any luck in using alternate consoles with the R3 alpha - the stdio device is broken. |
Ashley 8-Jan-2008 [5549] | Anyone else think it's kind of freaky when we have 3 Brian's messaging in the same group at the same time? ;) |
BrianH 8-Jan-2008 [5550] | It's just multiple views of the greater Brian ideal :) |
btiffin 8-Jan-2008 [5551] | :) |
BrianH 8-Jan-2008 [5552] | Pan-Brianism :) |
BrianW 8-Jan-2008 [5553] | I was thinking about the difference between a map and a normal object. It's easy to slip into a Perl/Python sort of mindset, where maps are often the most convenient way to describe data. It can be easy to forget the flexibility of Rebol datatypes. |
BrianH 8-Jan-2008 [5554] | If you don't like the way a datatype works, try another. At least we're not going the Perl route and adding operators. :) |
BrianW 8-Jan-2008 [5555] | thank goodness for that. I'm enjoying perl 6, but man oh man I get lost in the syntax sometimes. |
BrianH 8-Jan-2008 [5556x2] | The behavior of map! is part of a general change in R3 to make the none value be a placeholder for missing data, like null in SQL. Even the series accessors (first, second, ...) now return none when accessing indexes off the end - this means that you can now thing of the current length of a series as an relatively unimportant detail that you can ignore in some circumstances. |
thing -> think | |
btiffin 8-Jan-2008 [5558x2] | rxvt quick tests; stdio is not reliable (with the defaults - these are quick tests) $ ./rebhost.exe -q >> call "ls" works >> call "less readme.html" does not detect console. $./rebhost.exe < small.r does not work so in short, not a good choice for redirection, but seems ok for the testing I've been doing. Haven't tried running gnu readline with it yet to see if command line recall will work. I've gotten too used to editing source and do'ing. |
$ rlwrap rebhost.exe gives nice command line recall within R3 under the rxvt console. (Win98 currently. It worked under Cygwin Vista too, but I've been away from my dual-boot Linux machines for a few months now and hadn't tried readline under '98). Vista had an issue with the TERM needing to be set to cons25, but this box works ok with the default TERM=xterm setting and TERM=rxvt. But as before, nothing beats $ vi and >> do :) | |
Pekr 9-Jan-2008 [5560x2] | btiffin - what about PowerShell from MS? Haven't tried yet ... |
well, just downloaded PowerShell and it boots 3 - 5 secs on my Core2 Duo, 2 GB RAM :-) It can't run executables or I don't know how - it seems that it extends commands for Windows admins, dunno how to launch externall app from that :-) | |
[unknown: 5] 9-Jan-2008 [5562] | Thanks BrianH. |
btiffin 9-Jan-2008 [5563] | Petr; It was the MS "Genuine Vista" info grab for the free download that led me to Cygwin. :) I dutifully registered both my copies of Vista, and what? MS doesn't remember? <swearword> 'em. I never tried PowerShell. Once I discovered rxvt I quit searching. Kinda like REBOL. My progamming language quest is over. Now the (language) interest is only cursory and even though I try and check out something new just about everyday ... nothing competes. Go REBOL Go! |
Pekr 9-Jan-2008 [5564] | Googling, I just found out, that Cygwin allows also some other consoles. Poderosa allows tabs, that might be interesting running multiple sessions and switching between them ... |
BrianH 9-Jan-2008 [5565] | I can't wait until DevBase goes public. We could definitely use some help with these kind of bugs. |
btiffin 9-Jan-2008 [5566] | Brian; Umm...Carl gave the nod to release the url for DevBase to the REBOL friendly a few days after it's initial rollout. Has that changed? |
Pekr 9-Jan-2008 [5567] | BrianH - you should notice Carl privately about the need to accept latest submissions. Well, once done, do you think we are mostly ready for full R3 upload? I mean - all View and host C code? |
BrianH 9-Jan-2008 [5568x2] | Yeah. The security model doesn't scale right now. I have designed a new security model and am almost done implementing it. |
The !DevBase group would be a better place for this discussion. | |
Kaj 9-Jan-2008 [5570] | Same here, BrianT. It's nice to come home after a journey |
Micha 10-Jan-2008 [5571] | there is the better solution ? handl: func [event /local port] [ probe event/type port: event/port switch event/type [ connect [ print [ now port/spec/host ] write port [ GET %/index.html ] false] read [ false ] wrote [ false] done [ print [ port/spec/host length? event/port/data ] true] close [ close port true] error [ close port true] ] ] get-fast: func [hosts /local port ][ foreach hst hosts [ port: make port! to-url join http:// hst port/awake: :handl open port wait 0.03 ] ] ;example urls: [ www.rebol.com www.rebol.net ;"www.rebol.org" www.apple.com ;"www.oracle.com" ;"www.google.com" ] loop 10 [get-fast urls] |
btiffin 10-Jan-2008 [5572] | All; I'm the volunteer for the new VID 3 documentation. (And don't really feel that worthy, but that can't be an excuse to make it complete, concise and a nice read ... anyway ...) It's only just in initial draft still (my bad), but it's all to save Gabriele and the rest of the core team time so they can get to the important bits. If you have anything that needs clarification, discoveries, how-to, complaints, well anything; please drop a note to this group, the btiffin user chat or please feel free to update the discussions page from http://rebol.net/wiki/VID_User_Guideand we'll try and keep some of the flotsam and jetsom noise out of Carl, Gabriele, Richard and Henrik's way while they finalize the REBOL 3 VID. (And being a wiki, feel free to update the actual doc for that matter; keeping in mind that consistent style and tone is also one of the goals.). Thanks and cheers. |
[unknown: 5] 10-Jan-2008 [5573] | btiffin, I would prioritize all the new stuff at first to get everyone up to speed. I know that Carl use to supply us with a changes document to simply update us on the changes with a new release. That might suffice better to get everyone up to speed faster. |
BrianH 10-Jan-2008 [5574] | Perhaps another page referenced in the Welcome section. VID3 is based on a different semantic model, so we shouldn't expect there to be a whole lot in common with VID2. It would probably be better to not confuse the VID3 docs with comparisons to VID2. |
Rod 10-Jan-2008 [5575x2] | Brian, that is a huge bunch of work you have got in there already! Will try and give a hand with the obvious things at least though I am less worthy than you by a good bit. |
Has any Mac user tried to get the Alpha going yet, via parallels on an intel mac or darwine on a ppc mac? | |
Jean-François 10-Jan-2008 [5577] | btiffin, I was playing a bit with VID3 today and had trouble with Options. I think it would be good to have a listing of the Options available for each Style. In particular, I was trying to control the lenght of a field, alas without success. |
Gabriele 11-Jan-2008 [5578x3] | Jean: mainly because things are not complete yet. in the end, options will be more consistant across styles (and they will look a bit more like CSS when it comes to look options). |
in any case, the size of a field can be set by providing a second string. ideally, that would be the "mask" string (that tells what chars are allowed and so on), but it's currently only used as an example to determine the size. | |
for eg, if your field will hold a percentage, you could write: field "3%" "100%" so that it will be appropriately sized so that "100%" would be visible in it without scrolling. | |
Henrik 11-Jan-2008 [5581x2] | REBOL 3 works fine in VMWare Fusion on an intel mac. |
it is also currently the only way for me run run rebol 2 :-) | |
Will 11-Jan-2008 [5583] | Henrik, you mean rebol2/view right? Would it take much time for Carl to build an intel version for osx ? |
older newer | first last |