REBOL3 - !REBOL3 ([web-public])

Return to Index Page
Most recent messages (300 max) are listed first.

#UserMessageDate
20826Grahamso I just approached it by supplying a callback to format the directory13-Jan-10 20:31
20825BrianHHowever, FTP directory listings are a different issue, protocol overhead that needa a lot of special-case code, as I recall.13-Jan-10 20:31
20824GrahamAnyway, ... we need some decisions made about the base context, network tracing etc13-Jan-10 20:30
20823GrahamSo, the opportunity for code reuse was limited13-Jan-10 20:29
20822GrahamAnd it uses STAT instead of STOR for uploading files ...13-Jan-10 20:29
20821BrianHIn theory R3 schemes should just handle the protocol overhead and provide an abstracted behavior model, then the concrete work should be done in the handler or by the port actions.13-Jan-10 20:28
20820GrahamSo, for hylafax which uses the ftp protocol ... I would have to rewrite the whole scheme because the ftp scheme assumed the directory listing was always in a certain format etc.13-Jan-10 20:28
20819Grahamhaving simple port abstractions helps the early user but is very limiting to experienced users13-Jan-10 20:27
20818GrahamMy issue with the r2 schemes is that too much was abstracted so that you could not easily do stuff without rewriting the scheme13-Jan-10 20:26
20817BrianHRight, thanks.13-Jan-10 20:26
20816Grahamoff topic guys13-Jan-10 20:25
20815BrianHI have AltME running on an SD card, so it's even slower, but the big problem is the sending lockups and network dropouts. Chat works so much better - AltME 3 can't come quickly enough for me.13-Jan-10 20:24
20814Pekreh, I am out from net in something like 30 minutes. The four star hotel charges 15 EUR for 100 minutes of wifi. That is stupid :-) When we do wifi, we suggest hotels to provide such service for free.13-Jan-10 20:23
20813CarlBecause they write state variable files constantly for the apps.13-Jan-10 20:21
20812BrianHPekr, I was going to work on the network scheme revamp after that. I have to put things I already know how to do first, and there are a few LOAD and module changes that have accumulated that I know how to do already.13-Jan-10 20:20
20811Pekrboth altme and IOS are not designed for USB. Strange, as altme does not have much files to read from (in comparison to IOS chat, where one msg = 1 file), but slow anyway ...13-Jan-10 20:19
20810CarlFor those countries, maybe next DevCon?13-Jan-10 20:19
20809PekrWhat do you know about those countries btw? ;-) You were supposed to - was to BrianH ... I have some 10-15 sec lag here ...13-Jan-10 20:17
20808CarlPekr, seems too slow for USB flash. I think it's on floppy or R/W CDROM.13-Jan-10 20:17
20807CarlB: sounds good.13-Jan-10 20:16
20806Carl(Romania)13-Jan-10 20:16
20805CarlPekr, do you mean rewamp? Are you sure you're not visiting Transylvania?13-Jan-10 20:15
20804BrianHCarl, the design od that was finalized and the work will be done this week.13-Jan-10 20:13
20803PekrI thought it is slow because I run it from USB flash ... I am in Hungary on business trip for 3 days .... :-)13-Jan-10 20:13
20802PekrYou were supposed to do the rewamp, no? :-) Now as Graham produces schemes, we will be lazy to redo it :-)13-Jan-10 20:13
20801CarlI really think we need an EXPORT word that make exports easier to manage. Simple I think.13-Jan-10 20:12
20800CarlMan this system is slow.... help! Let's move this puppy!... I mean world.13-Jan-10 20:12
20799Pekrbtw - were exports "finalized? Remember you posted blog about it. Ditto read/write topic (Prunning down the read/write blog ... and following talking about read/string)13-Jan-10 20:11
20798CarlAlso, for testing purposes... if you need to add a system/standard object, just unprotect and append to the object. I think the kernel will accept that. (But, do not reMAKE the standard object!)13-Jan-10 20:11
20797BrianHThe model is good, but most of the wrapper and helper code needs work, or revamping.13-Jan-10 20:10
20796CarlOnce we understand the exports, we can then formally define the module, title, export list, etc.13-Jan-10 20:09
20795CarlIn R3, you can create a module inline with one line of code. That's where to start.13-Jan-10 20:09
20794CarlI would propose a Networking Module that can hold misc functions and variables, debugging modes, etc.13-Jan-10 20:08
20793CarlGraham is corrrect. We need to finalize a base context for networking.13-Jan-10 20:07
20792Pekrnot overhaul of ports, but schemes. Ppl were thinking about FSM etc.13-Jan-10 20:07
20791CarlThe first thing people need to know is that THIS IS NOT R2! The first mistake is to approach ports the same as R2. That will not work here.13-Jan-10 20:06
20790CarlPekr, there is no "overhaul" of the approach. I spent several months on the new design, and it's much better than R2. There may be a few small tweaks to make and a few issues to consider, but other than that, it's quite good.13-Jan-10 20:05
20789GrahamStill need a place for set-net, network timeouts, email object .... commonly used parse rules and bitsets, network error handlers13-Jan-10 20:01
20788PekrUDP implementation? (Needed for dns:// scheme to work?)13-Jan-10 20:00
20787Grahameg. write ftp://ftp.rebol.com/uploads %matrix.mov13-Jan-10 19:59
20786Pekrcurrent implementation is not what I thought is going to happen - the rehaul of aproach we are taking for schemes. Some ppl are also confused by read/write function names vs read, write event names, and IIRC Graham also noticed few other issues ...13-Jan-10 19:59
20785Pekrthere is one very usefull doc describing device communication (don't remember the name now), but stil some things are going to be missing ...13-Jan-10 19:58
20784CarlAs related to: http://www.rebol.net/wiki/Ports:_Synchronous_and_Asynchronous_Operations13-Jan-10 19:49
20783CarlOk, that's great. So, by "sync wrappers" you mean some kind of internal utility to deal with the sync/async differences when called from the user level?13-Jan-10 19:43
20782Grahamhttp://rebol.wik.is/Rebol3/Schemes13-Jan-10 19:39
20781GrahamMost need sync wrappers around them, and some actors to provide the previous way of doing things13-Jan-10 19:32
20780GrahamAs mentioned in chat, most of the common schemes are now "done"13-Jan-10 19:31
20779CarlHow are things going on adding a few schemes?

I mentioned that I would review the docs and add more examples; however, if someone has implemented a simple scheme example, like finger or such, then let's use that as the starting point, clean it up (if necessary), and put it on the wiki for others to learn from.

13-Jan-10 19:28
20778Henrikalso serves as a security measure13-Jan-10 8:54
20777BrianHYeah, I picked up on that later Maxim :)13-Jan-10 8:50
20776Henrikby tripping, I assume it means, if the parse somehow returns a function, that when run would cause an error, hence the get-word!.13-Jan-10 8:49
20775Maximin R3 it doesn't trip anymore which is what my post is about, the only place where :get-words have been usefull for me are for passing functions as values or to handle unset values.13-Jan-10 8:45
20774BrianHNot always needed, but good for bulletproof code :)13-Jan-10 8:41
20773BrianHUse :done so the error doesn't trip.13-Jan-10 8:40
20772Maximthe disarmed state of error objects in R3 is REALLY cool... simplifies code and switches them to usefull data, which is an alien concept to most other languages.

success?: all [ done: try [parse data rules] not error? done not string? done ]

here strings are the return type for parse block created (syntax?) errors in the source data

13-Jan-10 7:55
20771Grahamdone => down.13-Jan-10 0:15
20770GrahamI've added a REBOL forum to my new vbulletin forum .. since reboltalk seems to be done http://synapse-ehr.com/forums/forumdisplay.php?3-Rebol13-Jan-10 0:15
20769GabrieleBrian: pipe was not posted publicly, though, nothing that i know of is using it (i did it for Maarten but he didn't use it :), so at this point is a lone function in a lone file... given that it will need adaptation to work in R3, feel free to make a R3 version out of it. it would be hard to claim copyright on that even if I wanted to. ;)12-Jan-10 9:17
20768GrahamSeems to have worked .. managed to upload 32Mb using ftp12-Jan-10 9:04
20767BrianHCheck first, and remember to manage your buffers well.12-Jan-10 8:51
20766Grahamthat being the case, I can just write 32,000 bytes each time there is a wrote event12-Jan-10 8:40
20765BrianHAnd other tasks can still do their stuff, once we have those.12-Jan-10 8:25
20764BrianHYou can use async by providing a handler, or use one of the sync wrapper functions. If you use the sync wrappers it is still internally async, but not as far as you know.12-Jan-10 8:24
20763HenrikBrianH, silly question, but where does the async nature of R3 ports then go, if writing blocks?12-Jan-10 8:22
20762BrianHI would expect so, but you'd block your task! until it was done if you do it in one WRITE. And that means blocking quite a bit until tasks are properly working.12-Jan-10 8:20
20761BrianHIt is documented, as I recall, as part of the basic port model.12-Jan-10 8:18
20760GrahamIf I write a 100Mb file to a tcp port ... does R3 automatically write it in chunks for me?12-Jan-10 8:18
20759GrahamGood to know12-Jan-10 8:16
20758BrianHThere are no series-like ports in R3.12-Jan-10 8:15
20757BrianHAll ports in R3 are like /direct ports in R2, autoadvancing with an internal position.12-Jan-10 8:14
20756GrahamIf so, this seems to be the only documentation!12-Jan-10 8:02
20755GrahamDoes the skip occur automatically on a file port?12-Jan-10 8:01
20754Grahamwhere is the skip occuring to advance thru the from-file?12-Jan-10 7:59
20753Grahamthere's this example on http://www.rebol.net/wiki/Port_Examples

copy-file: func [ "Copy a large file" from-file to-file /local file1 file2 data ] [ file1: open from-file file2: open/new to-file while [not empty? data: read/part file1 32000] [ write file2 data ] close file1 close file2 ]

12-Jan-10 7:58
20752BrianHCASE is used for that stuff a lot in the mezz code.11-Jan-10 20:05
20751Grahamahh.. ok11-Jan-10 20:01
20750BrianHcase [any-function? :a [...] file? :a [...]]11-Jan-10 20:00
20749GrahamI guess I could use

function! native! [ .... ]

11-Jan-10 19:58
20748GrahamNope .. then I have to check for native!11-Jan-10 19:56
20747BrianHswitch type?/word :a [...11-Jan-10 19:55
20746BrianHLess overhead than TO-WORD too.11-Jan-10 19:55
20745Grahamthat evaluates the function11-Jan-10 19:54
20744Henrikah yes, couldn't remember what the specific method was.11-Jan-10 19:54
20743BrianHTYPE?/word is best for now - less overhead than the REDUCE method.11-Jan-10 19:54
20742Henrikswitch to-word type? a [...11-Jan-10 19:53
20741Grahamswitch type? a reduce [ function! [ print "function" ] file! [ print "file" ]11-Jan-10 19:52
20740GrahamIf I have

a: :print or a: %file.txt

how can I check for what it is ?

switch type? a [ function! [ print "function" ] file! [ print "file" ]

11-Jan-10 19:51
20739BrianHNo decision yet. It certainly will do for now.11-Jan-10 19:48
20738GrahamHas any decision been made to use Gab's rlp format for documentation and code generation yet ?11-Jan-10 19:25
20737GrahamGeez, if you gave me the host code, I'll probably end up in the science channel ....11-Jan-10 19:17
20736Pekrwe need Holger back, to finish networking :-)11-Jan-10 19:15
20735BrianHLearn :)11-Jan-10 19:13
20734GrahamHeh .... and what would I do with it? lol11-Jan-10 19:05
20733BrianHAsk and you'll have it too. The source for tcp:// is in it as well.11-Jan-10 19:03
20732GrahamHost code .. that's the one some guys have now?11-Jan-10 19:02
20731BrianHAnd other fine schemes.11-Jan-10 19:00
20730GrahamNeeded to do reverse dns lookups11-Jan-10 19:00
20729BrianHUDP would be defined in the host code - if it's not there, it's not in R3 yet.11-Jan-10 18:59
20728BrianHIt's been hard to get enough spare time with a working brain. Too many emergencies lately that take up my time, mostly my sleep time.11-Jan-10 18:58
20727GrahamWhere's UDP?11-Jan-10 18:57
20726BrianHNot much yet - I'm still reviewing the lower levels. There are two levels below the http scheme: TCP and the port model.11-Jan-10 18:56
20725Fork^-- Actually, it need not keep you from writing (to-word type? foo) if it knew that datatypes should have the last ! chopped if turned into a word11-Jan-10 18:56
20724Grahamand what have you discovered?11-Jan-10 18:55
20723BrianHOh wait, that happened to me too. The http scheme doesn't handle server errors well, and the internet has been getting increasingly crappy lately. That's why I've been looking over the scheme lately.11-Jan-10 18:54
20722GrahamSteeve talked about using a dialect to write schemes .. to create the FSM needed ... weren't you also doing something along these lines as well?11-Jan-10 18:54
20721GrahamBrianH - crashed on windows 711-Jan-10 18:52
20720ForkRegarding some of the above discussions of type?/word, I feel the confusing bit is that integer! the datatype and integer! the word probe identically. If the word was integer! and the datatype were integer!! (for instance) then it would prohibit you from writing (to-word type? foo) but at least you could tell what was going wrong in your switch, because it would tell you that integer!! wasn't defined as an actual word. You could still write (integer! = type? foo) in expressions.11-Jan-10 18:48
20719BrianHDon't add proposed options either - we can add them when they become actual. The rebol.net wiki is the place to put proposals.11-Jan-10 18:40
20718BrianHActually, can you update it to remove all optioins not supported by R3? READ and WRITE are low-level functions in R3.11-Jan-10 18:38
20717GrahamThe other refinements look wrong as well.11-Jan-10 18:37
20716BrianHCool. Does the READ doc have the same /binary option?11-Jan-10 18:37
20715Grahamupdated 'write documentation to remove the /binary11-Jan-10 18:36
20714BrianHAnd have you tried logging into the manual with your chat ID?11-Jan-10 18:34
20713PekrGraham - if you have sufficient R3 Chat ranking (IIRC 40), you can log-in and edit R3 Docs ... authentication database is shared ...11-Jan-10 18:34
20712BrianHWhich platform?11-Jan-10 18:33
20711Grahambefore I crashed it with an invalid dataype error11-Jan-10 18:30
20710GrahamI was on last night11-Jan-10 18:30
20709BrianHThe manual uses the same login.11-Jan-10 18:29
20708BrianHAre you on R3 chat? That is the first step in getting write access to the R3 manual wiki.11-Jan-10 18:26
20707GrahamIt would help if someone updated the docs ... or gave us write access to the help/doc wiki11-Jan-10 18:18
20706GrahamAn old time reboler like me still gets confused hence the question ...11-Jan-10 18:18
20705BrianHIs it alright with you if we try to adapt PIPE? Has it been posted publicly? I remember seeing it but can't remember if it was private.11-Jan-10 14:57
20704BrianHGabriele, PIPE should definitely be included in R3, even if it's mezzanine. It would be worth it just to keep people from overloading READ with too much high-level crap. It would be mezzanine first in any case - we only convert functions to native once their behavior is agreed upon and we can say for sure that performance is worth it.11-Jan-10 14:34
20703BrianHThe basic function to load REBOL code is DO. Most types are constructed, not literal. Even the scoping is procedural.11-Jan-10 14:20
20702BrianHNo, LOAD doesn't execute code, and the point of MOLD is to generate executable code. LOAD/all does something different.11-Jan-10 14:16
20701sqlabmold/all11-Jan-10 14:15
20700sqlabI think load should be the match for mold, and load/all for mold7all11-Jan-10 14:14
20699BrianHOr native!, op! or action! values.11-Jan-10 14:13
20698BrianHR3 won't be fully serializable, even when the bugs are fixed. You won't be able to serialize handle!, command!, task! or module! values.11-Jan-10 14:12
20697BrianHPekr, the opposite of LOAD is MOLD/all, the opposite of DO is MOLD. MOLD doesn't generate serialized syntax.11-Jan-10 14:10
20696BrianHYes, but MOLD/all loses the procedural syntax that MOLD generates, so many types just don't work when loaded because of binding.11-Jan-10 14:08
20695PekrBrianH: what does it mean, that serialised syntax will be lost? I thought that we are closer to the state, when REBOL is going to be fully serialisable :-)11-Jan-10 14:06
20694sqlabI just checked it. loading after a mold/all still gives the datatype!11-Jan-10 14:05
20693BrianHThere was a suggestion that SWITCH treat certain words as keywords, translating them to their standard values, in particular logic! and datatype! keywords. This would make SWITCH work like CONSTRUCT, and would likely require an /only refinement for the non-keyworded behavior like CONSTRUCT has. This would add a little overhead to SWITCH, but not as much as the workaround code already adds. The question hasn't yet been resolved, and should be brought up again for final resolution - some mezzanine code would need revising.11-Jan-10 14:04
20692sqlabDo you use it during mold? I think you loose it thru load.11-Jan-10 14:04
20691BrianHPekr, "The cases can be any datatype" refers to the type of the values, not their value. The type of integer! is datatype!, the value is #[datatype! integer!]. You can use the serialized syntax if you want to specify dataype! values directly, but watch out: If your build process goes through a MOLD then the serialized syntax will be lost - this tripped me up when I was porting R2/Forward to the R2 mezzanine code, I had to rewrite TYPES-OF and TO-TYPESET.11-Jan-10 13:55
20690Pekrah, interesting ....11-Jan-10 13:38
20689sqlabswitch works with datatype!, if you use a datatype! (read a true datatype!) in the block. see switch type? %test.r [#[datatype! file!] [print "type file!"]]11-Jan-10 13:36
20688RebolekAs Orbital said, "sad but true". Fixing docs is probably !1.11-Jan-10 13:23
20687Pekrfixing docs as well ...11-Jan-10 13:22
20686RebolekAlso I think that adding those five characters "/word" to your (or Graham's who asked initialy) code takesmuch less time than this discussion.11-Jan-10 13:19
20685RebolekAh, ok, some kind of dialect - I'm not against it, if you design something and put it here I thing it will get some attention, it will be enhanced and it also may become part of Rx. But SWITCH uses "the only holy way" and that's good :)11-Jan-10 13:18
20684PekrThen there would not be need for type?/word ...11-Jan-10 13:16
20683Rebolek...why IT works...11-Jan-10 13:15
20682Pekrno, you don't understand. It is just you understanding the only one holy way - submitting function a regular REBOL code :-) Whereas I was just wondering, with rather uniform design of switch (case followed by code to execute), if we could supply kind of dialect to switch function as a body. The same way as how we have 'secure, 'get-modes or other dialects ...11-Jan-10 13:15
20681RebolekI agree that it may look confusing to some people, same as:

>> f: func [a][append [] a] >> f 1 == [1] >> f 2 == [1 2]

But as I said, it's better to understand why works this way than dumbening the language just because newbies may be confused.

11-Jan-10 13:15
20680RebolekWhat you want is that words that get evaluated to datatype! should be evaluated but other words shouldn't. That's inconsistent and for everyone trying REBOL is better to understand the difference between word! and it's value than otherwise.11-Jan-10 13:11
20679PekrIt is difficult for me to explain, but - I thought, that 'switch case block could be treaded some other way internally. Not reduced, but in kind of "DELECT" or dialect kind of type. Then you could really write any datatype for the case ..... not sure it is doable nor neccessary, just thinking aloud ...11-Jan-10 13:07
20678PekrBut - was switch always native?11-Jan-10 13:05
20677PekrI surely don't want all blocks being reduced. I think I know what you are talking about. But then let's stop claiming 'switch can accept any datatype for the case branching. It can't ...11-Jan-10 13:05
20676RebolekAnd that's wrong. And if people don't get it, they're free to use some other language.11-Jan-10 12:47
20675RebolekPekr, you may be right about correcting docs, I'm not sure, haven't read them in a while. But in all other aspects you are wrong. What you want is basically same as what that crazy spammer on blog wanted few weeks ago. Blocks always reduced.11-Jan-10 12:46
20674SteevePekr my friend, it was just a little tease :-)11-Jan-10 12:42
20673PekrIt was Graham who actually asked, how is he supposed to handle datatype! datatype in 'switch function. If he was confused for a fraction of minute, then novices could be confused too. The function behaviour is inconsistent, at least in reference to docs, period. Even if I never used type?/word (as I don't work with dynamic code much), I used to-word type? value in 20 seconds, so I found may way around the "problem".

Maybe now I understand, why some external ppl see REBOL community as bunch of "we are best, we know the best" luxury fools - we try to make idiots from ppl not actually as knowleable as some elite members.

11-Jan-10 12:31
20672SteeveOr maybe a new mezz would be good to have.

Krenzelokize: func [bum this [block!]][ switch type?/word bum this ]

11-Jan-10 12:18
20671PekrIt might be usefull to add idiom like you mentioned to the end of examples? Now I at least know, what type?/word exists ...11-Jan-10 12:15
20670Pekr"The cases can be any datatype" - is imo wrong, as it is not obviously true. You can't use datatype! type for the case. You have to convert it to word! type ...11-Jan-10 12:14
20669Steevei don't see anything wrong in the definition, but yeah, we could add some use cases11-Jan-10 12:13
20668Pekrhttp://www.rebol.com/r3/docs/functions/switch.html .... or someone should correct docs so that this special case is more obvious ...11-Jan-10 12:11
20667PekrIf the case can be ANY datatype, and it works with xy datatypes, there is no point into turning datatype! dtype into word first, no?11-Jan-10 12:10
20666PekrHelp string to 'switch does not reveal much. And docs are imo even incorrect:

"Switch also returns the value of the block it executes. The cases can be any datatype. If none of the other cases match, use the /DEFAULT refinement to specify a default case."

11-Jan-10 12:09
20665Steeveuhuh11-Jan-10 12:07
20664PekrThe reason why /word has to be introduced is imo because exactly 'switch is not able to handle datytype directly in its body, and that is what I am pointing out ...11-Jan-10 12:07
20663PekrSteeve - I don't care. type?/word looks awfull ...11-Jan-10 12:06
20662Steeveincluding R2-forward.r , 14 occurences in R2 8 occurences in R311-Jan-10 11:35
20661Steevethe idiom [switch type? /word [...]] is used in such lot of places in mezz functions. You should be well aware of that now ;-)11-Jan-10 11:30
20660Rebolek:)11-Jan-10 11:28
20659SteevePekr, an old Reboler like you...11-Jan-10 11:26
20658Rebolekfile! in the switch body is not datatype! but word! Understanding this will help to better understand how REBOL works.11-Jan-10 11:24
20657RebolekBy reading manual probably11-Jan-10 11:23
20656sqlabno need for reducing type? first [#[datatype! file!]]11-Jan-10 11:23
20655Pekrhow is novice supposed to know, that actually submitting result of type? %user.r is not going to work with file! datatype in a switch body?11-Jan-10 11:22
20654WuJian>> a: 1 == 1 >> switch a reduce [a ["ok"]] == "ok"11-Jan-10 11:19
20653Rebolek"...switch should be supplied a reduced block"

no, that's wrong. See:

>> a: 1 == 1 >> switch 'a [a ["ok"]] == "ok" >> switch 'a reduce [a ["ok"]] == none

11-Jan-10 11:18
20652PekrWe are not talking about block here, but a function body. And if I write switch type? %user.r [file! [print "... a file"]] ... it is imo supposed to work ...11-Jan-10 11:16
20651PekrRebolek - then switch should be supplied a reduced block :-)11-Jan-10 11:15
20650PeterWoodGraham: Binary is the default for read & write in R3. The documentation doesn't seem to have been fully updated for R3 yet,11-Jan-10 11:10
20649RebolekIt may look confusing, but it makes perfect sense, it same as:

>> a: 1 == 1 >> type? first [a] == word! >> type? first reduce [a] == integer!

11-Jan-10 11:04
20648Rebolek>> type? first reduce [word!] == datatype!11-Jan-10 11:02
20647Rebolekbecause the block is not evaulated11-Jan-10 10:55
20646PekrHmm, you are right:

>> type? file! == datatype!

>> type? first [file!] == word!

11-Jan-10 10:55
20645Pekrwhy is datatype a word? :-)11-Jan-10 10:54
20644RebolekSo you need word! from type! or reduce the seitch block to get datatype! instead of word! .11-Jan-10 10:52
20643RebolekPekr, return of type? is datatype!! but the datatype in the switch block is just word!, not datatype! .11-Jan-10 10:51
20642Steevetype?/word is here for that11-Jan-10 10:50
20641RebolekAlso this works:

>> switch type? 1 reduce [integer! [print "ahoj"]] == ahoj

11-Jan-10 10:50
20640Pekrso return of 'type? is not a type? Well, we have not a datatype type? Yes, we have - datatype! .... but help reveals you can't do "to-datatype" ...11-Jan-10 10:49
20639PekrGraham, weird, but you can try:

>> switch to-word type? %test.r [file! [print "... a file"]] ... a file

11-Jan-10 10:48
20638RebolekGraham: >> switch type?/word 1 [integer! [print "ahoj"]] == ahoj11-Jan-10 10:46
20637GrahamGab, you should pipe up with the source to pipe :)11-Jan-10 10:43
20636Grahamswitch type? %test.r [ .... ]

what do I need to write in the block to catch it ?

11-Jan-10 10:40
20635Grahamhow does switch on type? work?11-Jan-10 10:34
20634Grahammy lower level is working like this

write port [ RETR "bigfile" %bigfile ]

11-Jan-10 10:33
20633Gabrielemy implementation of PIPE is only a few lines. i think it should be native to R3.11-Jan-10 10:29
20632Gabrielepipe ftp://somehost/somefile %/path/to/somefile11-Jan-10 10:29
20631GabrieleGraham, I'd do what you want with:11-Jan-10 10:28
20630Grahamhttp://www.rebol.com/r3/docs/functions/write.html

says there is a /binary refinement .. but this doesn't exist any more

11-Jan-10 9:50
20629PekrHere's related ML discussion - http://www.rebol.org/ml-display-thread.r?m=rmlFDMJ11-Jan-10 9:39
20628Steeveyup we should start with the html one in R3, it's a huge one currently11-Jan-10 9:38
20627GrahamI suspect that you have to write a few schemes to see what is needed and then write the scheme dialect11-Jan-10 9:37
20626HenrikLadislav has done one too. Time for a FSM battle?11-Jan-10 9:36
20625PekrOne from gabriele - http://www.colellachiara.com/soft/Misc/qml/fsm.rlp11-Jan-10 9:33
20624GrahamGregg11-Jan-10 9:33
20623Pekrsomeone did FSM in the past. Gregg? Henrik?11-Jan-10 9:32
20622SteeveRebol is especially good with those things11-Jan-10 9:32
20621Grahammeta programming11-Jan-10 9:31
20620Steeveyes a dialect to construct schemes11-Jan-10 9:31
20619GrahamOr do you mean use a dialect to define the scheme?11-Jan-10 9:30
20618Steeveuniserve has some good ideas11-Jan-10 9:29
20617Steeve;-)11-Jan-10 9:29
20616GrahamLike uniserve?11-Jan-10 9:28
20615Steeveshames=schemes11-Jan-10 9:28
20614SteeveTo my mind, we need a better framework to design shames using a FSM dialect11-Jan-10 9:28
20613GrahamWe need a place to set a system timeout ...11-Jan-10 9:27
20612GrahamSteeve .. don't waste your time on a r2 chat .. there's no traffic on there. Spend your time on schemes :)11-Jan-10 9:24
20611Steeveeasy to talk hard to do11-Jan-10 9:24
20610Steevesorry again (it's true i said this)11-Jan-10 9:23
20609GrahamWell, I am using a write spec block ...11-Jan-10 9:22
20608Pekrbtw - some time ago someone stated here, that current https scheme is done "old school". Was that you? Isn't now the right time to define the better way (if any) to aproach schemes and networking? :-)11-Jan-10 9:22
20607PekrSteeve - it is good we have you here :-)11-Jan-10 9:21
20606SteeveWell, we don't need of specific refinements, cause we can pass a block to read (which is converted to a port!).

>> read [scheme: 'ftp host: ... path:... other_data: ....]

The block format could be used to pass other parameters in a more handy way.

>> read [ftp://ftp.rebol.com/matrix.avi file: %movies/matrix.avi]

And the good news, is that it's absolulty possible to have something like that now. We just have to patch the function: system/intrinsic/make-port

11-Jan-10 9:19
20605GrahamI think my schemes are making R3 unstable. Tried to post a message and got from chat

rebol system error #1301: invalid datatype 99 ... should never happen ...

11-Jan-10 8:51
20604GrahamNeed some way to pass parameters to scheme actors. Andreas is using read/lines !11-Jan-10 8:30
20603Pekrhmm, but /as was proposed to specify just type of encoding IIRC, not some other functionality ... some of us wanted /as being more general, allowing you to specify a codec to decode. Codecs are so far inefficient (not streamed), because you have to read all data firts, then pass it to encode/decode.

Carl never posted a resolution to read/write case ....

11-Jan-10 8:27
20602Grahamread/as ftp://ftp.rebol.com/matrix.avi [ file: %movies/matrix.avi ]

and to resume

read/ask/seek ftp://ftp.rebol.com/matrix.avi [ file: %movies/matrix.avi ] current-file-size-of-matrix.avi

11-Jan-10 8:17
20601PekrI am with ones proposing having read/write as simple as possible, adding just /as for codec support. Codec API should be defined, the same way as we have Device API, port API, etc. /string should be no excuse .... in the past (1.2 days), Holger posted to IOS:

read http://something.com :my-callback

11-Jan-10 8:16
20600PekrI don't know. Just read realated discussions - many opinions, what read/write should (not) do ...11-Jan-10 8:14
20599Grahamwell, I guess we could specifiy it in the /as block11-Jan-10 8:13
20598Pekr16-Apr-2008: Prunning down read and write - http://www.rebol.net/r3blogs/0127.html 11-Nov-2009: Finalising read and write - http://www.rebol.net/r3blogs/0294.html11-Jan-10 8:08
20597PekrAnd maybe design of read/write was never actually finished ;-)11-Jan-10 8:07
20596GrahamWhy not? Because refinements slow down 'read?11-Jan-10 8:05
20595PekrGraham: my reply from R3 Chat: I think that we will not get much refinements for read/write functions. The planned ones were /string (text) and /as (enconding). What you want is read working in a streamed way. We might get it in future, but I doubt we get what you propose.11-Jan-10 8:03
20594GrahamHow about we have some more refinements to read ??11-Jan-10 3:28
20593BrianHBolek, THROW and CATCH work in R3 but there is a strange interaction with TRY.7-Jan-10 22:28
20592CarlTesting.7-Jan-10 22:23
20591Rebolekthrow/catch does not work in R3?1-Jan-10 13:35
20590BrianHRare for the kind of thing you tend to do though (emulators, iirc).31-Dec-09 23:20
20589BrianHNot really, for code that plays to REBOL's strengths. It happens quite often.31-Dec-09 23:18
20588Steeverare31-Dec-09 23:17
20587BrianHOh, and that means that the mezzanine is faster than the native :)31-Dec-09 23:16
20586BrianHAn interesting example of that is AJOIN. The R3 version has less memory overhead, the R2 version in 2.7.7 is faster.31-Dec-09 23:15
20585Steevebut there is several criteria to optimize something. - Best Speed - Shortest code - shortest memory overhead - best ratio of above criteria31-Dec-09 23:13
20584BrianHThat happened with some REBOL-vs-Java code the other day here.31-Dec-09 23:11
20583BrianHFor certain project domains, R3 interpreted code can be faster than compiled code, once it's been through the REBOL optimizer.31-Dec-09 23:10
20582Steevesure :)31-Dec-09 23:08
20581BrianHIt's the best optimizer known to man :)31-Dec-09 23:07
20580Steeve-_-;31-Dec-09 23:06
20579BrianHThe "REBOL optimizer" is a running joke. The best way to optimize your REBOL code is to post it publicly in AltME or R3 chat and dare people to improve it. Then the community tries to one-up each other to improve it :)31-Dec-09 23:05
20578SteeveWho's that optimizer ?31-Dec-09 23:03
20577BrianHWe should make a whole module of math functions, with test code. Let the REBOL optimizer at it and then see what we can include.31-Dec-09 23:02
20576GreggMaybe I'll remember if we write a test suite for it.31-Dec-09 22:55
20575GreggYeah, I'm trying to remember (since I didn't comment it) why I coerced the result. Something in my brain says there was a good reason.31-Dec-09 22:54
20574BrianHv1/1: v1/0 + :v231-Dec-09 22:53
20573Steevei was not seriously doing a proposal :-)31-Dec-09 22:53
20572BrianHAnd faster. Reversing the order of arguments might not be a good idea though - some operators are more forgiving of their left value.31-Dec-09 22:52
20571Steevei should have used forall, less uggly :-)31-Dec-09 22:51
20570GreggIt uses a lambda local. :-)31-Dec-09 22:49
20569Steeve...31-Dec-09 22:48
20568Steeveyeah !!!! i do not use any locals31-Dec-09 22:47
20567Steeveuggly one-liner version.

sum: func[block [block!]][ foreach [v1: v2] next head reduce/into block copy [0 0][v1/1: :v2 + v1/0] ] -_-;

31-Dec-09 22:45
20566Paulok.31-Dec-09 22:23
20565BrianHIn case reducing the block makes a function or some other active value - no double eval. It's a way to trip bad errors quicker.31-Dec-09 22:23
20564PaulYour already reducing the block.31-Dec-09 22:20
20563Paulwhy the :value?31-Dec-09 22:19
20562BrianHThat's the R3 way - throw a useful error so the programmer can fix their code, no DWIM :)31-Dec-09 22:14
20561BrianHAnd it will just throw an error if the block contains anything not addable.31-Dec-09 22:13
20560Steeveright31-Dec-09 22:12
20559BrianHNot for a empty block.31-Dec-09 22:11
20558Steeveforeach do that31-Dec-09 22:11
20557Steeveno need to return the result at the end31-Dec-09 22:10
20556BrianHSome error handing, some speedups, and vector support.31-Dec-09 22:10
20555BrianHsum: func [block [block! vector!] /local result] [ result: 0 foreach value reduce block [result: result + :value] result ]31-Dec-09 22:09
20554PaulSounds like the function is moving along. Great thing is that if you build the one you have what you need for the product function as well.31-Dec-09 22:08
20553GreggAgreed.31-Dec-09 22:06
20552BrianHActually, documenting that this function doesn't do any error handling beyond the arguments of + would be good.31-Dec-09 22:05
20551GreggAgreed. The only issue is if you don't get a decimal value before an overflow occurs, but that's just something to doc.31-Dec-09 22:03
20550BrianHThen any decimal or money in the list will promote.31-Dec-09 22:03
20549BrianHWe might not need to coerce to decimal. The first decimal in the list will make that coersion for us. And we don't want decimal results for a list of integers - it's a loss of precision. I suspect that initializing result with the integer 0 will be sufficient.31-Dec-09 22:02
20548Steeve0 seems better, it prevents throwing useless errors (my old claim)31-Dec-09 22:02
20547GreggZero versus none is a good question Brian. I have SUM return zero, but my AVG func returns none.31-Dec-09 22:00
20546GreggCoercion to decimal would be to prevetn overflow. I prefer not to do that though.31-Dec-09 21:59
20545Steeveyep, but we are always waiting31-Dec-09 21:56
20544BrianHVector math has already been suggested.31-Dec-09 21:55
20543Steevewell, if only the default math operators could accept series of scalars by default, it would be incredibly simple and powerful. It should not be so hard to have that behaviour nativly... A + [1 2 3 4] == A + 1 + 2 + 3 + 431-Dec-09 21:54
20542BrianHShould sum [] return 0 or none?31-Dec-09 21:53
20541PaulWhy the coersion to decimal? Just curious.31-Dec-09 21:50
20540PaulI just added the wish request.31-Dec-09 21:47
20539GreggI'm all for it. I've suggested them in the past, but didn't get much traction. Here's a non-recursive starting point.

; Should our seed value be 0.0 to coerce to decimal? If they ; include a decimal value before any overflow, it will be OK. ; Changed to match the first type in the block. sum: func [block [any-block!] /local result] [ result: any [ attempt [make pick block 1 0] attempt [0 * pick block 1] 0 ] foreach value reduce block [result: result + value] result ]

31-Dec-09 21:44
20538Paulwill do when I get the chance.31-Dec-09 21:12
20537BrianHSuggest them in CureCode as wishes. Or write them up as mezz or extension functions - those are easy to adapt.31-Dec-09 21:09
20536Paul>> sum [1 2 3] ==631-Dec-09 21:07
20535Paulwhat about a sum or product functions for R3?31-Dec-09 21:07
20534BrianHEspecially when the features can be added later. The rapid release model means that "later" releases are still coming soon :)30-Dec-09 19:39
20533sqlabI think you should stick to announced release dates. Better axe some features than not to deliver30-Dec-09 11:36
20532BrianHAnd in the meanwhile, R3 is usable for some purposes now. More so with some bug fixes. It will be time to go beta soon.30-Dec-09 10:10
20531BrianHTask-safety will require a full code review, natives included. Probably some adjustments to the system model and module code too.30-Dec-09 10:09
20530BrianHNonetheless, extensions and host code in a more usable state is likely. Concurrency less so for the 3.0 release - concurrency is a big issue that needs more review, particularly once the subtleties of the model are well known enough to make the mezzanines task-safe.30-Dec-09 10:06
20529BrianHRapid release model, remember. There's no such thing as a final feature set. Beta means that what is there is expected to work.30-Dec-09 10:04
20528PekrI would like to see Extensions and Host code finished to final state (it means support for devices, vectors, callbacks, etc.), and concurrency added too, or it imo has no sense to call it a beta ...30-Dec-09 9:54
20527BrianHnlikely -> unlikely30-Dec-09 9:49

Return to Index Page