[REBOL] Re: ANN: CitrusWeb v02e
Hi Luke. Thanks. This looks very good! I'm looking forward to start using it! Elan Luke wrote: >Dear List > >CitrusWeb v02e (BETA) is released for your enjoyment. >[...] > > - Luke Orlando Emmet >__ > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: newbie question
Hi Greg. I'm not sure whether or not you realize that whenever help documents something like open/lines and help also documents something like open/direct then you can also use the combination of the two: open/lines/direct Brondo, Greg wrote: >Where are things like open/lines/direct documented? If I execute 'help >open' I can see 'open/lines' and 'open/direct' but no the >'open/lines/direct'. How is a newcomer to this language supposed to 'know' >these things? > >Not to sound like a whiner but I *really* want to use this language I'm just >having trouble convincing myself to use it for any projects due to the lack >of thorough docs and the 'black box' nature of it.. > >Instead I'm having to look into something like Ruby (or Python) for my >clients project > > >Thanks! > >Greg B. > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: IE Plugin: Congrats To Carl and Staff (and some requests/proposals/suggestions)
Hi Anton. I attempted to join the world you refer to by downloading the Altme software and installing it. Apparently there is a whole complex access protocol that requires and invitation, setting up and account and all sorts of things. I''m not sure how all of that works. So, I think I'll just leave at that for now. If you think that this topic of a licensing engine (see previous email "e: [REBOL] Licensing Engine for Commercial Applets") should be raised at Altme, please be so kind and forward it to their plugin group. TIA, Elan Anton Rolls wrote: >Hi Elan, > >Carl does not participate here very often now. >I suggest, to get involved in plugin discussions, >to try to join Rebol-View altme world, where >there is the plugin group. > >You have a chance then to talk directly to joshm >who is helping Carl implement the plugin. > >Anton. > > > >>Hi Carl, staff, and list. >> >>I just happened to drop by at the REBOL site, and discovered the Alpha >>release of the new View dll. Downloaded and installed it, and it is >>beauty! The demo UI that is displayed by default is visually pleasing. >> >> > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Licensing Engine for Commercial Applets - was IE Plugin: Congrats To Carl and Staff (and some requests/proposals/suggestions)
Hi Volker. I think that three arguments that can be made in favor of implementing the applet licensing code in the rebol.dll plug-in. 1. Avoiding Bandwidth Waste Due to Code Duplication 2. Applet Plug-in Platform Independence 3. Simplified Development/Maintenance (Less Errors) Thanks To Standard HTML call interface to REBOL: 1. Wasted Bandwidth Due to Code Duplication Let's say that the code needed to a) check if there is an up-to-date version of the rebol.dll (up-to-date relative to the requirements of the applet plugin); b) download a current version of the rebol.dll plug-in if applet plug-in cannot find rebol.dll or if the version that was found on the consumer's machine is not up-to-date; c) check the certificate of the applet plugin; d) load the rebol.dll or display a "pirate" alert; e) activate the loaded rebol.dll and pass it an entry-point to the applet plug-in f) plus all the additional code necessary to have Internet Explorer install the applet plug-in totals no more than 30KB (binary code) (probably a little more ). Then each and every applet plug-in will have to extra carry this code with it. Let's say a Web site consists of ten pages that include some applet plug-in (catalog, shopping cart, member registration, live support, live salesperson, feedback, order entry, order status checking, animations, etc.). So, we're looking at a total of 300KB additional footprint. 300KB is certainly not a catastrophe, but it's not a good starting point. Now, let's assume the Web site is fairly busy and generates an average of 1000 visits a day that make use of all ten Web pages. So, now the 300KB total overhead * 1000 users translates into 300MB of extra bandwidth required per day, or a little over 9 GB of bandwidth wasted per month. Putting all the necessary code into the REBOL plug-in instead of the applet plug-in avoids this wasted 9GB bandwidth. 2. Applet Plug-in Platform Independence Applet Plug-ins should not be dlls: Imagine if you have to create, test, and debug three different versions of your applets, for each expected consumer platform, Windows, Linux, or OS/X (what about Solaris, AIX, HPUX, Amiga/OS, Elate?) because your applet plug-in as a Windows dll will not run under Linux, etc. If, however, the rebol.dll (or an equivalent rebol embeddable for Linux, OS/X, etc.) are used to encapsulate all that stuff, then the applet plug-in can be a platform independent plug-in with platform support provided transparently by the platform-specific rebol plug-in that is executing your code. The Web browser loads the platform specific rebol executable, and the rebol executabe then loads one and the same platform-independent 3rd party applet. 3. Simplified Development/Maintenance (Less Errors) Thanks To Standard HTML call interface to REBOL: By delegating the authentication to REBOL we also gain the advantage of a single, uniform call interface when we use the rebol.dll, whether rebol.dll is used execute some source code, or some protected, commerial binary code. While the programmer is testing his code, he will be asking to the Web browser to call the rebol.dll with a REBOL source file argument, as for instance, the REBOL example panel on rebol.net http://www.rebol.com/downloads/plugin/rebolplugin.cab#Version=0,0,0,2"; WIDTH="360" HEIGHT="414"> http://www.rebol.net/plugin/tests/test.r";> He'll have an easier time switching between source code and compiled version of his applet, if he only needs to change the PARAM value filename suffix, instead of having to change the whole OBJECT call sequence. You wrote: >Would do that the other way around. make the rebol.dll loadable from your dll. >that way certificates-checker knows its your dll and certificate, not RT's >dll and certificate. > > I don't see why there would be any confusion about that. If the REBOL plug-in is designed to support licensing for 3rd party applet plug-ins, then the REBOL plug-in will know how to interact with the applet plug-in it loads to obtain the pertinent information it needs in order to authenticate the proper licensing of the applet, and not of itself. Again, each REBOL plug-in on any platform (i.e. the freely available version) should support licensing for commercial applets, and RT makes its income by providing commerccial tools to create licenseable applets. (I would propose low fee for tools from programmer, to ensure a large following of programmers, and then make money on distributed products by this large following.) I think that currently the market lacks a commercially exploitable client-side universal scripting language and this would really be widely needed product. elan Volker Nitsch wrote: >Am Freitag, 5. März 2004 22:22 schrieben Sie: > > >>Hi Carl, staff, and list. >> >> >> >[snip] > > &g
[REBOL] Re: YAPAQ
Hi Hallvard. you wrote: (1) >I want to parse a string like this: > >{word1 word2 "expression 1" "expression 2" word3 "expression 3"} >and I want the output to be: > >["word1" "word2" "expression 1" "expression 2" "word3" "expression 3"] > > > and (2) >Yes, but: >>> a: parse {e1 e2 "e 3" e4 ee"e 5" e6 ^{e 7^}} none >== ["e1" "e2" "e 3" "e4" {ee"e} {5"} "e6" "{e" "7}"] >>> print third a >e 3 > > >So 1) I need a parse rule that will see { } as string delimiters, and preferably > >also divide {ee"e 5"} into ["ee" "e5"] or [{ee"e 5"}] And 2) I want to keep the >quotes, > >so that this could be the output: >>> print third >"e 3" > > Comparing your two posts I'm confused as to what you want. In post one the string "expression 3" was supposed to evaluate to "expression 3". Well, print "expression 3" will look like your first "e 3" example, namely minus quotation marks. If, instead, print third a (note the missing a in your example code the second time around) should evaluate to "e 3", then in your first post, you should have asked that "expression 3" evaluate to {"expression 3"}. Now, I don't know where your error is: Is the error in your first post, and "expression 3" should have become {"expression 3"} in your example? Or is the error in your second post, and you do not realize that "expression 3" will be displayed as expression 3, whereas what you are looking for is >> print mold third a "e 3" -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] IE Plugin: Congrats To Carl and Staff (and some requests/proposals/suggestions)
Hi Carl, staff, and list. I just happened to drop by at the REBOL site, and discovered the Alpha release of the new View dll. Downloaded and installed it, and it is beauty! The demo UI that is displayed by default is visually pleasing. I'm very excited about this new technology, because IMHO this opens up a relevant commercial market for REBOL programmers/consultants. I'm so excited about this technolgoy that I've even created a new email address, to be able to remain subscribed to this list ([EMAIL PROTECTED] is being spamed so massively, that I constantly run out of mailbox space, and then I get kicked off the REBOL list.) I 'm looking forward to the announced Plugin Developer's Kit (PDK). Any idea when alpha or beta of PDK will become available? Suggestion: PDK built-in end-user licensing mechanism. 1. For commerial applications I would prefer not to have to include the REBOL dll in each released PDK based application. Instead, the standard REBOL dll should have the ability to load an application specific dll created with the PDK. I would be supplying the application specific dll and the official View plugin would then load the binary application dll. 2. There should be some licensing mechanism included, such that binary application dlls created with the PDK can demand some verification against the originating domain name. I.e. if the Web site is accessed at www.techscribe.com/plugin-demo and delivers the Web page index.html, and index.html submits a dll for the View/Plugin, then, upon loading this dll, the View/Plugin may check for a valid license key against the domain name www.techscribe.com or against www.techscribe.com/plugin-demo, or www.techscribe.com/plugin-demo/index.html. The PDK application dll would instruct the View/Plugin whether it should check for a site-wide license, or for a Web page specific license. The View/Plugin will then request a URL for the license code, and the View/Plugin could then simply compare the license code to a key created by encrupting one or the other part of the URL, in order to verify that the application dll is being applied to an authorized Web page, similar to the way Unix passwords are treated (i.e. the URL or parts of the URL would be encrypted creating a unique key, and that key would then be compared to the license key stored at the advertised URL, similar to how Unix passwords are stored in the password file as encrypted character sequences, and are then compared to the result of encrypting the user's input, when that user responds to a prompt demanding his password as part of his login.) The application plug-in provider would then be able to license his technology either on a per Web page basis, or per Web site license (volume discount), etc. There's no reason why REBOL Technologies should not receive a (albeit miniscule ;-) percentage on the license fee... 3. RDBC? Another possible source of income fo REBOL Tech would be to include an RDBC technology, similar to ODBC, or JDBC, to enable IE Reblets to interact directly with online databases. RDBC based database transactions would be supported with the same vocabulary already in use for series!, based on a new series! data type, namely dbtransaction!. I.e. >> trans: open rdbc://user:[EMAIL PROTECTED]/mydatabase >> type? trans == dbtransaction! >> first trans == [name: Krenzelok firstname: Petr status: active] >> last trans == [name: Santilli firstname: Gabriele status: active] >> foreach [name firstname status] trans [ print ["First name: " firstname " Last name: " name " status: " status ] ] First name: Petr Last name: 4. Could REBOL by default include an alias for error! called yikes! ? Please let me know when the PDK becomes avilable for testing etc. TIA, Elan -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: REBOL the official Guide
Hi Patrick. The update-scripts.r script is approx four years old and attempts to access a host that no longer services this book. I'll contact you off list regarding updates. Elan [EMAIL PROTECTED] wrote: > On page 38 of "REBOL the official Guide" instructions are given which sate > > >* > > Enter the following instructions at REBOL's prompt: > >» do %update-scripts.r > >REBOL will connect to the authors' Web site, http://www.commercebox.com >and will download a file called rebol-book.xip from the Web site. This file contains >the latest version of the scripts for this book and some bonus scripts. The update- >scripts.r program saves this file to a file in the REBOL folder. The name of the fil >is official-guide-update.xip. The file is evaluated and creates a folder called book >It creates script files in folders in the book folder. For each chapter there will be >a >separate subf older created in the book folder. Additional information regarding tr >contents of the scripts will be displayed when REBOL has completed unpacking >the downloaded scripts archive. You are encouraged to use the updated scripts th< >you download from authors' site. > > > > >However these links no longer work. I have searched the Internet without success to >see >if the opdates are anwhere else without success. > >Does any one know where these updates can be found? > >Thanks > >Patrick > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: No return Value???
Hi Tim. 1. You can use unset? to check for words that do not return values . >> unset? print "" == true >> if unset? print "" [result: "<>"] 2. If you need to assign the return value of the tested function to some local word, you can use set/any to avoid an error. 3. Why doesn't print return a value? Wel;l, I suspect that is because the purpose of print is to display its argument. If print were to return a value, it would not only be displaying its argument, it would force the REBOL interpreter to display print's return value as well. I.e. you would see a combination of the printed argument and print's return value on the screen. Instead of >> print "" >> which is the expected result, for instance, you would get >> print_with_return: func [arg] [ print arg return true ] >> print_with_return "" == true >> BUT the argument to print was NOT "==true" it was "". Hope this helps. Elan Tim Johnson wrote: >Hello Rebols: >I've got a question: >I've written a function called 'fetch, which has print >stubs to help follow the flow control. > >If you evaluate 'print with 'fetch, no value is >returned. > >Can someone tell me why this is so? >TIA >tim > >(example and code follows) >Example: > > >>>do %test-fetch.r >>> >>> >Script: "Untitled" (none) > > >>>fetch 'abc >>> >>> >type = 'word >val is unset >returning unset words as default value >== none > > >>>fetch 'print >>> >>> >type = 'word >val is set > >The code for 'fetch and helper function 'safe-reduce >follows: >REBOL[] >; --- >make object! [ >default-value: none >set 'fetch func[ {safe data retrieval. Handles any value} > val [any-type!] > /seed {set default value} /deep {If block, reduce} > /same {If unset return 'val} > /local tmp][ > either word? val[ > print "type = 'word" > either value? val[ > print "val is set" > get val > ][ > print "val is unset" > either same[ > print "returning unset word as the word" > val > ][ > print "returning unset words as default value" > default-value > ] > ] > ][ ; any other type but 'word > print ["type = " (type? val)] > either block? val[ > either deep[ > safe-reduce/deep val > ][ > safe-reduce val > ] > ][ > val > ] > ] > ] > ] >; --- >safe-reduce: function[blk[block!] {reduce block, leaving unset values} > /deep {reduce nested blocks} ][rblk _reduce][ > dummy: func[val /deep][val] ; pass > ; below a function assignment using the prefix colon > _reduce: either deep[:safe-reduce][:dummy] > ; since 'reduce is a native value (compiled into binary) > ; try it first > either all[(not deep) (rblk: attempt[reduce blk])][ > print "Used native 'reduce" > rblk > ][ > print "Block with unset values, using 'safe-reduce" > rblk: make block! length? blk > foreach element blk[ > either word? element[ > either value? element[ > append rblk (get element) > ][ > append rblk element > ] > ][ > either block? element[ > append/only rblk _reduce/deep element > ][ > append rblk element > ] > ] > ] > rblk > ] > ] > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: File writing issue
Hi Matt. If you copy the file manually to the directory, and then attempt to email it using REBOL, do you get correct results? If not, how are you determining how many bytes you are sending out? Does the fiile contain binary data or ascii? Are you emailing it as an attachment, or as the text body? Elan Matt MacDonald wrote: >Ok here's one more for everyone to ponder. When you write a file in rebol >that is somewhat large (around 1 meg or so) and then immediately after >writing it you want to do something with it (email it, etc) I get an error >message that the file is not there. On inspection of the directory where it >is supposed to be, it is there. So I'm guessing there is a little delay >between the time when you write the file (and rebol returns) until the file >is really accessable. So I put this line of code in to counteract that > >while [not exists? file] [] >to make it wait for the file to be there. > >So now I can do things with the file, but not the whole file. When I email >it it usually shows up as 64B. So then I entered this line of code >while [size? file <> fsize] [] ; where fsize is how big the file should be, >thinking that the file might get written to the disk in peices so I want to >make sure the whole file is there before doing stuff with it. This didn't >work either, it did wait, but the file still doesn't come through complete. >Any suggestions? > >Matt > >_ >Cheer a special someone with a fun Halloween eCard from American Greetings! >Go to http://www.msn.americangreetings.com/index_msn.pd?source=msne134 > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: paths & lookups & change
Or - then again - maybe not. ;-) Elan wrote: >Hi Romano. > >Right. Looks like a 'mold bug. The mold output in this case is: > >== { >make object! [ >first word: 1 >]} > >Should be: >== { >make object! [ >"first word": 1 >]} > > >Elan. > > > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: paths & lookups & change
Hi Romano. Right. Looks like a 'mold bug. The mold output in this case is: == { make object! [ first word: 1 ]} Should be: == { make object! [ "first word": 1 ]} Elan. Romano Paolo Tenca wrote: >Hi Elan, > > > >> >> db: make object! reduce [ to-set-word "first word" 1 to-set-word >>"second word" 2 ] >> >> > >but these don't work: > >probe do mold make object! reduce [ to-set-word "first word" 1] >probe do mold/all make object! reduce [ to-set-word "first word" 1] > >and objects use a little more memory than blocks. > >But i agree on the fact that objects are more easy to use than blocks. > >For very small blocks of data, i like the form: > >db: [id1 [name "Joe" num 32]] > >to be read with > >db/id1/name >db/id1/num > > >--- >Ciao >Romano > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: paths & lookups & change
Hi Robert. My preference for this kind of tasks is using objects. Even though it is a little more verbose, I find it quite intuitive to use the get and set functions, as in: >> db: make object! reduce [ to-set-word "first word" 1 to-set-word "second word" 2 ] >> probe db make object! [ first word: 1 second word: 2 ] >> key: to-word "second word" >> set in db key (get in db key) + 1 >> probe db make object! [ first word: 1 second word: 3 ] Elan Brett Handley wrote: >Hi Robert, > >Thanks for the explanation of your reasoning. Looking at the Core guide, >paths look purpose-built for this sort of database. So your reasons have >good company :^) > >Regards, >Brett. > > > >>Hi, there are several reasons: >> >>- For storing data I'm always working with nested blocks of name/value >>pairs. This has proven to be the best approach yet. My goal is to keep >>this "database" as the master of data, the source. To avoid copying around >>and to minimize searches in big databases, I always try to work "in place" >>by using a reference. >> >>- Such paths are easy to create programmatically. This code can be used to >>access/alter record structures in an abstract way, because I can specify >>parts of a path! (including the last part of a path!) by variables. >> >>- I find it logical in the Rebol context. >> >>I hope these are good reasons for it :-) Robert >> >> > > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: reduce/deep
Hi Robert. >> b: a: [a 1 b 2] == [a 1 b 2] >> same? a b == true >> a: b: "xyz" == "xyz" >> d: c: reduce [a b] == ["xyz" "xyz"] >> same? d c == true Robert M. Münch wrote: >On Mon, 20 Oct 2003 12:33:29 +1000, Anton Rolls <[EMAIL PROTECTED]> >wrote: > > > >>Use SAME? >> >>a: b: [123] >>same? a b >>;== true >> >> > >Hi, ahhh forgot about this one. Rebol just has to many words to remember >;-) But this doesn't seem to work for nested blocks: > > > >>>a: [a 1 b 2] >>> >>> >== [a 1 b 2] > > >>>b: [a 1 b 2] >>> >>> >== [a 1 b 2] > > >>>same? a b >>> >>> >== false > > >>>d: reduce [a b] >>> >>> >== [[a 1 b 2] [a 1 b 2]] > > >>>e: reduce [a b] >>> >>> >== [[a 1 b 2] [a 1 b 2]] > > >>>same? d e >>> >>> >== false > >So I tink for nested structures we would need something like a same?/deep. >Robert > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: continue word
Hi Maxim. The example you bring: foreach number [ 8 0 2 4 0 5][ if number = 0 [continue] print 100 / number ] could just as well (better? ;-) ) be written as foreach number [ 8 0 2 4 0 5][ [ if number > 0 [ print 100 / number ] ] I wonder if the combination of if, either and any, all enables us to cover any and all relevant cases? Elan Maxim Olivier-Adlhoch wrote: >is there any word (I haven't found any) which skips one iteration of a loop at >current point. > > >like in: > > >foreach number [ 8 0 2 4 0 5][ > if number = 0 [continue] > print 100 / number >] > > >TIA! > > >-MAx >--- >"You can either be part of the problem or part of the solution, but in the end, being >part of the problem is much more fun." > > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: Cunning use of [], () & {} in R# and in future? Rebol versions?
Hi Andrew. You wrote: >I've noticed that when I'm writing block!, paren! & > string values, I leave white space before and after > the [], () & {} characters. After puzzling over your intro briefly, it appears to me that you see the additional space as being significant in distinguishing between your two examples: (1) With space >>X: ["a" "b" "c"] >> >> == ["a" "b" "c"] and (2) without space >>X[2] >> >> == "b" Notice, however, that the colon is also missing in example 2. I.e., even if you were not to supply the extra space in example 1, i.e. >> X:["a" "b" "c"] ;- example 3 you would still have the significant distinction to example 2 in that in example 3 you again have the colon separating the X from the block , whereas in example (i.e. X[2]) there is no such colon. Andrew Martin wrote: >It occurred to me as I was writing Rebol code, that it's possible to >re-use these characters [], () & {}, in useful ways. I've noticed that >when I'm writing block!, paren! & string values, I leave white space >before and after the [], () & {} characters. It would be nice to have: > > > >>>X: ["a" "b" "c"] >>> >>> >== ["a" "b" "c"] > > >>>X[2] >>> >>> >== "b" > >In other words, by running the block "hard" against the word, it's like: > pick X 2 > >I don't know what use () and {} could have, though. What's your >thoughts? > >Andrew J Martin >Attendance Officer >& Grail Jedi who is tapping on the dungeon wall with Rebol... >Colenso High School >Arnold Street, Napier. >Tel: 64-6-8310180 ext 826 >Fax: 64-6-8336759 >http://colenso.net/scripts/Wiki.r?AJM >http://www.colenso.school.nz/ > >DISCLAIMER: Colenso High School and its Board of Trustees is not responsible (or >legally >liable) for materials distributed to or acquired from user e-mail accounts. You can >report any >misuse of an e-mail account to our ICT Manager and the complaint will be >investigated. >(Misuse can come in many forms, but can be viewed as any material sent/received that >indicate or suggest pornography, unethical or illegal solicitation, racism, sexism, >inappropriate >language and/or other issues described in our Acceptable Use Policy.) > >All outgoing messages are certified virus-free by McAfee GroupShield Exchange >5.10.285.0 >Phone: +64 6 843 5095 or Fax: +64 6 833 6759 or E-mail: [EMAIL PROTECTED] > > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: holding lit-word! values in a word...
Hi Maxim. >> a: to-lit-word 'r == 'r >> type? :a == lit-word! >> type? get 'a == lit-word! Using the colon prefis or the get function you get the correct result. Notice the difference: >> type? a == word! Or: >> a: 'r == r >> type? :a == word! Hope this helps. Elan Maxim Olivier-Adlhoch wrote: >helo, > >an advanced question: > >is it possible to store a lit-word value inside a word? > >so far this seems impossible (including in view 1.2.10) > > > >>>a: to-lit-word 'r >>> >>> >== 'r > > >>>probe a >>> >>> >== r > > >>>type? a >>> >>> >== word! > > >so far I'm only able to store lit-word values within a BLOCK... ex: > > >>>a: append [] to-lit-word 'r >>> >>> >== ['r] > > >it seems to work with set-word types (in view v1.2.10 and probaly in core >2.5.6)... > > >>>a: to-set-word 'r >>> >>> >== r: > > >>>probe a >>> >>> >== r: > > >>>type? a >>> >>> >== set-word! > >be carefull, older version of rebol will give you an error with the above >set-word! examples... that is because the newer versions evaluate word values >less aggressively. The older core complains that "r needs a value" whenever you >reference the word a . > >any ideas are welcome > >-MAx > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: CGI with REBOL on FREE Web Hosting Services
Hi Carlos. Carlos Lorenz wrote: >[...] >Are you aware of what version of REBOL free.prohosting >could use? >I have tried BSDi (as Maarten Koopmans said ) with no success >[...] > "... with no success ..." lacks specifity. It's difficult to suggest any remedy, if you leave it this vague. I cannot find Maarten Koopmans email in my mailbox, so I don't know whether or not not he pointed you to the following URL: http://hammer.prohosting.com/~rebol/rebol-cgi-prohosting.html It's entitled "How to set-up REBOL CGI at free.prohosting.com" which sounds rather promising with respect to your questions. Hope this helps. Elan -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: IDIOMS: setting multiple words
Hi Sunanda. Incidentally, > set [foo bar baz] copy [] will not set any of the words to a value (because REBOL attempts to set foo, bar, and baz to the value value(s) contained IN the block) . What I described in my previous email would be true for set [foo bar baz] reduce [ copy [] ] -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: The needs that Rebol answers
Hi Bryan. [EMAIL PROTECTED] wrote: > do the shared libraries on Unix have to be ANSI C? I'm no expert on shared libraries on Linux, but I think an intelligent guess would be that shared libraries may be written in any language that ultimately can output shared libraries. The format of a shared library should in no way reflect the the programming language that was used to implement it. -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: IDIOMS: setting multiple words
Hi Sunanda: >If you are going to use set, you could use a shorter method: > > set [foo bar baz] copy [] > You will find that only foo is set set to a block, whereas bar and baz are initialized to the value none. This is unlike using set [foo bar baz[] 3 ;- (i.e. some non-series value where all words will be initialized to the same value. > >Another method you will see around is: > > foo: bar: baz: copy [] > Note that, unlike in Greg's example, here all three words will be set to one and the same block. I.e. any modifications made to the block baz will also affect the blocks foo and bar, because they are one and the same block. -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: The needs that Rebol answers
Hi Bryan. bryan wrote: >Since Rebol is written in ANSI C can one, with the sdk version, use >parsers written in ANSI C? > On Linux the sdk offers an interface to shared libraries, DLLs are supported under MS Windows. -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: New Q module - Translate
Hi Anton. You are opening a delightful discussion. The obvious question is: "Correct" by what standards? Which standards should we strive for? Is a more "human" software interface one that understands me better (including my ideosyncracies, typical misspellings, and "personal" choice of words), or should we strive for some objective standard of correctness and have the software penalize anyone, who does not adhere to that standard? I think that this is an interesting design decision for any human-software interface that is calculated to interface more comfortably with its users. Any ideas? Elan Anton Rolls wrote: >What if what you say is incorrect? >(over and over again.) Then Q helps you >to fool yourself. >Does the engine assume that the human as >teacher always knows what is correct? > >Anton. > > > >>if repetitive patterns occurs, it should ask if a specific item >>is equivalent to something else... so that you can interchange >>its expected word and yours without ill effect in any of its >>language. an example is that if you always say open instead of >>load, eventually it could catch this and ask you if open is >>equivalent to load... >> >>If Q is supposed to be all about helping in a natural manner, >>maybe it should learn to help its user help himself. ;-) >> >>Maybe some of this is already part of Q, but I'm just throwing my >>ideas on the wall as they occur to me... >> >>HTH in any way! >> >>Q idea is nice. >> >>-MAx >> >> > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: CGI session variables like in PHP
Hi Carlos. Create a session cookie with a unique, random name, and create a temporary file server-side with the same name to hold the session information, including session vaqriables.. That's how PHP does it according to Julie Meloni writing for "Webmonkey" (http://www.webmonkey.com) in her article "Authenticate and Track Users with PHP". She writes: >>>>> a session is an ethereal blob that can hold all sorts of variables and values. This blob of stuff, also known as a session object, has an identification string. The identification string, such as 940f8b05a40d5119c030c9c7745aead9, is sent to the user via a cookie called PHPSESSID. On the server side, a matching temporary file (think of it as the physical representation of the session object) is created with the same name (i.e., 940f8b05a40d5119c030c9c7745aead9). Each session object has variables registered with it. Inside the session file, on the server, the registered variables and their values are kept safe and sound. Since these values and variables are not kept in a database, no additional system resources are required <<<<< Hpe this helps. Elan Carlos Lorenz wrote: >Hello list, > >I'm just thinking about wich is the best way to handle >persistent words between HTML pages such as PHP does >with its session variables. > >Any thoughts? > >TIA > >Carlos > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: Newbie questions
Hi Kai. For "the most elegant way" I would direct you to Gabriele ;-). A workable way would be: given the ini file name1="value1" name2=640 name3=SVGA Let's assume we are looking for the value of name3: We need to convert the ini file into something that can be conveniently processed under REBOL, for instance a block. The final expression could look something like this: select make block! replace/all read %IniFile.ini "=" " " 'name3 1. We read the contents of the file IniFile.ini ... read %IniFile.ini The percent sign is needed to tell REBOL IniFile.ini is a file name. 'read returns a string. 2. Since we will want to use select (see help select for details) we want to rid of the '=' signs and replace them by a space. ... replace/all ... "=" " " (see help replace for details on replace/all) 3. We use the string returned by replace to create a block. ... make block! replace/all ... 4. Now we can retrieve the value associated with name3 by using select: select make block! ... 'name3 Note that we must use the literal word 'name3 We cannot use name3, since REBOL would believe it to be a word, and attempt to look up the value of name3. Hope this helps. Elan Kai Peters wrote: >Hi all ~ > >just stumbled upon REBOL yesterday and have started writing my first min-app >and the following questions >have come up thus far: > >what is the most elegant way to read a value out of an ini file? > >tried to find some docs on error handling but thus far have not succeeded - >is there anything out there? > >how do i know that a read from ftp succeeds and how do i know which error >occured if it fails? > >Thanks for all input > >Kai > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: Rebol parsing 101
Hi Mike. Which values - besides (pending) - are possible for the fourth, optional, item? Elan Mike Weber wrote: >im brand new to Rebol and not getting the hang of string parsing > >for example: assume i have string >fcontents >== {09/29/03 ATM/POS ACTIVITY $28.68 (pending) 09/29/03 ATM/POS ACTIVITY $11.41 >09/29/03 ATM/POS ACTIVITY $ >21.71 ... > >i would like to convert this string into a set of blocks where each block has 4 >elements of the types [date string money string] (the 4th element is optional >[09/29/03 "ATM/POS ACTIVITY" $28.68 (pending)] >[09/29/03 "ATM/POS ACTIVITY" $11.41] >[09/29/03 "ATM/POS ACTIVITY" $21.71] > > >i've been plodding around trying to get anything to work, like > >find/any fcontents ["09/*/03"] > >but im not understanding how to isolate the elements > >i suspect i should be able to create something akin to a regular expresion that i can >use as a pattern to apply to the string > > > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: sizeof(structure)
Hi Gregg. Nice. Doesn't this belong in the Cookbook? I know, it's "simple examples for new users." But "new REBOL users" could be veteran C programmers ... And from the p.o.v. of a Windows programmer, this example is simple enough. Take Care, Elan Gregg Irwin wrote: >Hi Paul, > >PT> Yeah I actually tried that thinking the same but had no luck with it. I get >PT> a return value of 0 which denotes failure of the GetVersionEx function. > >The fixed char array will give you grief, if you haven't already dealt >with them in structs. Here's a very quick hack for you, with credit to >Pekr and Cyphre for the nifty trick of generating elements dynamically >to emulate char arrays in structs. > >-- Gregg > >make-elements: func [name count type /local result][ >if not word? type [type: type?/word type] >result: copy "^/" >repeat i count [ >append result join name [i " [" type "]" newline] >] >to block! result >] > >kernel.dll: load/library %kernel32.dll > >OSVERSIONINFOEXA: make struct! OSVERSIONINFOEXA-def: compose/deep [ >dwOSVersionInfoSize [integer!] ; DWORD >dwMajorVersion [integer!] ; DWORD >dwMinorVersion [integer!] ; DWORD >dwBuildNumber [integer!] ; DWORD >dwPlatformId[integer!] ; DWORD >(make-elements 'szCSDVersion 128 #"@") ; TCHAR >] none >OSVERSIONINFOEXA/dwOSVersionInfoSize: length? third OSVERSIONINFOEXA > >GetVersionEx: make routine! compose/deep/only [ >lpVersionInformation[struct! (OSVERSIONINFOEXA-def)] ;LPOSVERSIONINFO >return: [integer!] ;BOOL >] kernel.dll "GetVersionExA" > >get-version: has [res] [ >res: GetVersionEx OSVERSIONINFOEXA >either 0 = res [none][OSVERSIONINFOEXA] >] > >res: get-version >print [ >"Major:" res/dwMajorVersion newline >"Minor:" res/dwMinorVersion newline >"Build:" res/dwBuildNumber newline >"Version:" to-string copy/part at third OSVERSIONINFOEXA 21 128 >] > >free kernel.dll > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: About View
Hi Stefan, We will continue to need a /Core version for CGI scripts. Most ISPs who run Linux or FreeBSD do not install XLib on their server because they are not running XWindows (the machine is configured as a server machine, not as a workstation). At the time /View is loaded the Linux loader checks for the availability of these library files, even if they aren't used by the CGI scripts that will subsequently be run under /View. Elan [EMAIL PROTECTED] wrote: > > Hi, > I've got a question, earlier (IIRC) it was said that Rebol/View should > replace Rebol/Core, that it is Core with the graphics stuff added, what > happened to this? If it's still supposed to be, why make a Rebol/Core/Pro? > > /Regards Stefan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] REBOL - Official Guide DBMS Scripts
hat documents the dbms dialect (the one proble being time ;-). I don't know if I can legally do that (copyright). I don't care if it sells the book, but the "selling the book" aspect may make it easier for me to get a go ahead from the publisher. I'll check into that. Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Curl
Hi David, a few suggestions: 1. Open Source Applications I don't have the time (right now) to pursue this, but REBOL stands to gain in exposure if there are Open Source REBOL projects advertised on SourceForge, SlashDot, FreshMeat, etc. The challenge is to identify attractive, feature-rich applications (backend designs for Websites, for instance), provide intelligent configuration, and processing dialect that enable an interested developer to easily adapt the application to his needs, and actively pursue their implementation. 2. REBOL based productivity tools for popular programming languages: REBOL enables you to easily design dialect based CASE tools that can simplify the construction of programs in other programming languages emphasizing platform independence and reusability (across platforms). By platforms I means programming language platforms, not only hardware platforms. Tools that target the PHP, Java, and ASP community and provide language independence and portability are likely to expose a tremendous number of programmers to REBOL. 3. Traditional commercial applications that integrate REBOL as an automation language. Commercial applications whose success is thoroughly advertised to manager/investor/business media to make the financers and decision makers listen up. Requires financing and support from the REBOL community. David Vydra wrote: > > Elan, > > Do you have any specific suggestions? > > How about a REBOL conference? -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Curl
Hi David, let's make REBOL succeed! Elan David Vydra wrote: > > Christian, > > Thanks for informing us about Curl. After spending an > hour looking at it, I am sure that: > 1. I like REBOL better in most cases > 2. I am worried about REBOL's future > > Why $52M? For the marketing department, of course. > > We have all seen many great technologies shelved due > to competitors better marketing. > > My personal complaints for REBOL are: > 1. R/View is not marketed as a GUI component for > large client/server systems, specifically servers > written in Java. > > 2. REBOL is not being ported to Java. Curl announced > their intention to do so. > > > Several years ago, I joined Forte Software, which had > "technically" the best solution for 3-tier > client/server systems. When Sun announced their Java > EJB spec, Forte stock plummeted from $40 to $3. > Ironically, Sun bought the company for $20/share a few > years later, but the original Forte TOOL language > seems to be dying off. > > Forte was very proprietory -- not a single book on the > TOOL language has been published, so REBOL is doing > better in that department. > > For all of the evils of Java, one has to admit that > there are many useful toolkits available, a few very > nice IDEs and Java does run on more platforms than > REBOL. > > > I hope 2 years from now I will program in REBOL, not > Curl. > > Regards, > > David > > --- Christian Langreiter <[EMAIL PROTECTED]> > wrote: > > Curl seems to be quite similar in scope and > > direction to REBOL: > > > > http://www.cag.lcs.mit.edu/curl/wwwpaper.html > > http://www.curl.com > > > > They just got $52m in funding. > > > > Any opinions? > > > > Best regards, > > Chris > > > > -- > > To unsubscribe from this list, please send an email > > to > > [EMAIL PROTECTED] with "unsubscribe" in the > > subject, without the quotes. > > > > = > please reply to: [EMAIL PROTECTED] > > __ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/ > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Elan's update-scripts.r
Hi, thanks for buying the book. I hope you will find it helpful. Unfortunately I no longer have access to the www.commercebox.com site, where my script was originally hosted. You can reach me directly at my email address ([EMAIL PROTECTED]). I do have some bug fixes for chapter 7 (errors were introduced during the formatting of the scripts and these errors migrated to the scripts as they exist on the CD ROM). I have a few more people waiting for these bug fixes and I'll send them out together. Also there is a (extremely low bandwidth, 1 email every 3 months approximately ;-) mailing list hosted on yahoo (formerly egroups) for the book. Please send me a private email and let me know if you prefer the chapter 7 scripts in MS Windows (zip) format, or gzip'd for Linux. If you want me to register you with the mailing list, please let me know that as well. mailto:[EMAIL PROTECTED] Take Care, Elan "Dr. Louis A. Turk" wrote: > > Dear Elan, > > I bought your book, and am trying to learn REBOL. I am trying to update > the scripts in your book by using update-scripts.r. I get the following error: > > >> do %update-scripts.r > Script: "REBOL Book Script Updater" (10-May-2000) > connecting to: www.commercebox.com > ** User Error: Error. Target url: > http://www.commercebox.com/rebol-book/rebol-book.xip could not be > retrieved. Server response > : HTTP/1.1 404 Not Found. > ** Where: write/binary %official-guide-update.xip read/binary > http://www.commercebox.com/rebol-book/rebol-book.xip > do > >> > > Any idea what is wrong? > > Thanks, > Louis > > PS I like your book. > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Hello?
Hi Joel, good to hear from you again. I was thinking of contacting you off list to find out what happened to you. Been quite busy myself, and haven't had a chance to participate as much as I'd like to. Have you had a chance to take a peek at /Express yet? If not, perhaps you can free up some time ... Take Care, Elan Joel Neely wrote: > > I feel that I owe the list members a word of apology/explanation... > > Following my nearly-annual adventure with bronchitis (I don't > recommend it as a substitute for vacations ;-), I have had a > change in position and responsibilities with my employer (all very > much to my benefit and liking, I should add!), which have left me > scrambling like mad to get my head around an entirely new set of > tasks and projects. Consequently, my opportunities (and available > time) to spend actively pursuing things REBOL has diminished > considerably. > > Unfortunately, participating in rebol-list discussions, offering > answers to questions, pestering RT folks about bugs/features, > enjoying enthusiastic debates/brainstorming with Elan, Petr, > Ladislav, Gabriele, Jeff, ... well, actually everyone, and I > don't want to slight anyone ..., will be rare-spare-time-only > activity for the next little while. > > I'll likely be able to slip in the odd comment from time to time > ("unaccustomed as I am to public speaking"... ;-) but I wanted > to post this message as both an apology for not responding > or participating for the past few weeks, and as a request not to > interpret upcoming bursts of silence as disinterest. > > Unfortunately, I have only 42 hours in a day... > > -jn- > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Quote character replacement
Hi Gabriele, you wrote: > Then I can imagine what Elan's going to propose: replace all > newlines with a space. Close, but not quite ;-). There may be newlines that need to be preserved, and we are only interested in those newlines that cause our problem, which are newlines embedded in double-quoted strings. strip-quoted-nl: func [string [string!] /local nl-rule] [ nl-rule: [thru {"} to "^/" mark: (change mark " ") thru {"}] parse string [some [nl-rule | skip] ] string ] print-strings-rule: [ set s string! (print mold s) | skip ] parse load strip-quoted-nl read %test-strings.txt [some print-strings-rule] YAA (Yet Another Approach) Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Quote character replacement
Hi Rod, Do you need to preserve the newlines in the string? Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: /View as a Product
Hi Paul, I agree with you that a switch could be used to switch off the X dependency. This could be the default for the CGI switch (which I believe is what you are saying). Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: /View as a Product
Hi Holger, well, I was going to propose dynamic library loading. But you beat me to it. Guess it won't work. (Personally, I'm quite happy keeping the CGI overhead low and using /Core. What's more, I use /Core most of the time anyway. Haven't even installed the extended expiration version of /View yet. But that's not to say that I'm not interested in /View. /Core is just a better fit for what I'm currently doing). Take Care, Elan Holger Kruse wrote: [..] > It would be possible to work around this by using dynamic library loading and > linking, but that creates a flurry of other problems (compatibility, versioning > etc.), so we would rather not do it. The best solution is to keep Core and > View separate. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: /View as a Product
Hi Paul, Chris, Chris wrote: > > Paul Tretter wrote: > > > /View that way RT makes profits off of /View scripts that customers want to > > distribute. After all /View is the product that most users will want to > > distribute their scripts in the Runtime format. > > And what of those who just use Rebol for ci-scripting and the like? It > is important to keep the overhead of the interpreter for such scripts > to a minimum or the delay while loading, decompressing and starting > the interpreter will affect response times. 1. Can /View start up without XWindows libraries being present on the hosting machine? 2. Can it reasonably be assumed that most Linux (xxxBSD) Web hosting machines on the net will have XWindows libs installed (what for?). If the answers to 1. and 2. are both "No" then in IMHO it is not feasible to use /View as a CGI interpreter. /View would have to be able to determine if the required XWindows libs are available, and, if not, start up in /Core mode without attempting to load XWin libs, to be useful as a CGI Interpreter. Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: System/Scheming
Also the nntp.r file that includes the nntp protocol should be very useful. Elan Allen Kamp wrote: > > Hi Brett, > > Another shorter protocol that might be useful to learn from is the > > http://www.rebol.org/web/dict.r > > Implements the dict protocol as per RFC2229 > > Also these http and ftp protocols might be interesting too, find at > > http://www.rebol.org/unsupported/ > > Cheers, > > Allen K > > - Original Message - > From: "Brett Handley" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, February 06, 2001 9:25 PM > Subject: [REBOL] Re: System/Scheming > > > Yes that is what got me started on this. Damned useful bit of code too > (I've > > been hanging out for that functionality for some time). But it is only > half > > the equation I think. > > > > How/when is the handler called? > > What needs to be set? > > What functions are part of the scheme framework and what are specific to > the > > protocol? > > Can someone draw it in UML (probably another topic in itself)? > > > > Thanks > > Brett. > > > > - Original Message - > > From: "Petr Krenzelok" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Tuesday, February 06, 2001 10:09 PM > > Subject: [REBOL] Re: System/Scheming > > > > > > > just look at Kevin's email subjected to POP3 TOP topic He included > > Jeff's > > > special version of POP3 protocol in his message ... > > > > > > -pekr- > > > > > > Brett Handley wrote: > > > > > > > Thinking caps please. > > > > > > > > Has anyone written their own scheme from scratch and plugged it into > > > > system/schemes? > > > > > > > > I've been looking at the code for the build-in schemes and I would > like > > to > > > > know how it all hangs together, and how one can create their own > schemes > > for > > > > use by a client or a server. I've a rough idea, but it would be great > if > > > > someone could explain it in a top down fashion. > > > > > > > > Just dreaming of programs supported by downloadable protocols > > (bootstrapped > > > > by http :) ). > > > > > > > > Thanks in advance. > > > > > > > > Brett. > > > > > > > > -- > > > > To unsubscribe from this list, please send an email to > > > > [EMAIL PROTECTED] with "unsubscribe" in the > > > > subject, without the quotes. > > > > > > -- > > > To unsubscribe from this list, please send an email to > > > [EMAIL PROTECTED] with "unsubscribe" in the > > > subject, without the quotes. > > > > > > > -- > > To unsubscribe from this list, please send an email to > > [EMAIL PROTECTED] with "unsubscribe" in the > > subject, without the quotes. > > > > > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Returning true when parsing a blank line
Hi Doug, if your intention should be to remove blank lines, then the following should work quite well: replace/all x "^/^/" "^/" Note that I am assuming that by "blank lines" you mean lines that only contain an eol character, and not lines that contain blanks, or other whitespace characters. Replace is a mezzanine function, you can see the source for replace by entering source replace at the REBOL prompt. You can adept the function to your needs. Hope this also helps, Elan doug hudgeon wrote: > > After I have read in a file line by line, how do I > check for blank lines? > > eg > > x: read/lines %file.txt > foreach line x [ > parse line [?] > ] > > -- > Best regards, > dougmailto:[EMAIL PROTECTED] > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Want FreesiteUK's scripts?
Hi Petr, you wrote: > How many times should I repeat that? try >> random/seed now >> random good-to-hear-from-you * have-you-been-busy? Hope this helps ;-), Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Random CGI
Hi Terry, I'm using the following quick hack in a CGI program that appears to work well enough: create-password: func [/local alpha index password] [ alpha: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" random/seed now password: "" for i 1 8 1 [ index: random 62 insert password pick alpha index ] return password ] Hope this helps, Elan Terry Brownell wrote: > > Hello All. > > Don't know if this has been asked before? > > I have a CGI script that generates a random number... > > id: random 100 > > The problem is, it always picks the same number regardless? > > 957367 > > Same goes with a script like > > n: ["option a " "option b"] > > print pick n random (length? n) > > works fine in a console, but when used with CGI, always picks "option b" > > Go figure? > > T Brownell > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: A hard question
Hi Ladislav, looks like fun. What if we upgrade Larry's function as follows? hard: func [x y][ if error? set/any 'error try [ do reduce [x first y] ][ return :error ] ] That solves the problem at hand. I'm curious where this will take us? Take Care, Elan Ladislav Mecir wrote: > > Correcting myself: > > > to be a solution, HARD must pass any test. Let's try: > > > arg1: func [x] [return make error! x] > arg2: ["some error"] > probe disarm arg1 first arg2 > > The result is: > > make object! [ > code: 800 > type: 'user > id: 'message > arg1: "some error" > arg2: none > arg3: none > near: [return make error! x] > where: none > ] > > > while the result of HARD is: > > > > probe disarm hard :arg1 arg2 > ** User Error: some error > ** Near: return make error! x > > > The question is, if HARD could really meet the requirements. > > > > > Hi Ladislav > > > > > > Sounds like fun! Will this solve the puzzle? > > > > > > >> hard: func [x y][do reduce [x first y]] > > > >> hard :sine [52] > > > == 0.788010753606722 > > > >> hard func [x][x * x] [52] > > > == 2704 > > > >> > > > > > > Cheers > > > -Larry > > > > > > - Original Message - > > > From: Ladislav Mecir <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Saturday, February 03, 2001 11:03 AM > > > Subject: [REBOL] A hard question > > > > > > > > > > The task is to create a function HARD, that is a Normal Argument > Passing > > > > function (i.e. nor a Fetched Argument Function, neither an Unevaluated > > > > Argument Function) and takes two arguments, ARG1 and ARG2. HARD is not > > > > required to do any argument checking, moreover, you can assume, that > the > > > > supplied arguments are really the data they are supposed to be. > > > > > > > > ARG1 is a Normal Argument Passing Function taking exactly one > argument. > > > > > > > > ARG2 is a block of length 1. > > > > > > > > The function HARD shall do exactly the same thing, as the function > ARG1 > > > > would do if used with the first element of ARG2 as its argument. > > > > > > > > Moreover, you can assume, that the first element of ARG2 is a correct > > > > argument to ARG1. > > > > > > > > Any trials? > > > > > > > > Regards > > > > Ladislav > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Re(3): 'parse-url - where defined?
Hi Anton, yes, they are all defined in system/words find first system/words 'some-newly-defined-word (even words defined in use contexts). Elan Anton wrote: > > Thanks guys, > > I've got DocKimbel's help patch, > and Bo's browse-system.r. > > I really do need to spend some time > poking through the system object more. > > One question: > Is everything contained in the system object? > Are all objects in 'system ? > All words and objects defined by me - > do they end up in 'system somewhere? > > Anton. > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: works for GET, not POST
Hi GS Jones, I didn't read your message as containing anything negative. In the version I'm using on the Website I use the make object! in the calling function instead of in the retrieve-user-data function. That's incidental. The reason for make object! is: decode-cgi returns a block that contains set-word! value pairs: [name: "some-name" phone: "some-phone"] To conveniently retrieve the values by using a path notation, result/name result/phone I use the block returned by decode-cgi to construct an object: result: make object! decode-cgi input If I were to simply say result: decode-cgi input then I wouldn't be able to access the values in the block using the path notation in combination with the names: result/name wouldn't work because in the block name appears as name: result/name: wouldn't work because upon parsing a set-word as the last element of a path REBOL expects that you are changing the value following the word name and I would get an error reporting that the value being assigned to result/name: is missing. The one option would be to reduce the block returned by decode-cgi. Then name and phone will become global words that are associated with their respective values. I prefer to work with words that are local to the object's context to avoic conflicts with other words that may be in use. Hope this helps, Elan GS Jones wrote: > > No problem, Elan, and I certainly didn't mean to imply anything negative. > Being new to the language, I just was "wondering out loud" that perhaps a > change in the version of REBOL required a change in the method. Through no > one's fault but my own, I am unclear why a "make object!" is needed. > Obviously, your site's version works both on your system and mine (at least > when I am using /View), but not on Ryan's. And Ryan says that his works > with the "make object!" phrase left in, but only with GET. When I use his > version, all I get is "?object?" printed for the data. As I have said to > Carl R., I probably shouldn't be pitching my two pennies in because I am > still a novice with REBOL. But I like mysteries and solving them helps me > learn the language more quickly. > > Thanks for your input. > --- Scott (The "S" in GS Jones) > > > Hi GS Jones > > [...] > > > left out the "make object!" phrase. > > [...] > > > > I didn't do that intentionally. I just happened to implement it that way > > when I wrote the code for this Website. > > > > Elan > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: works for GET, not POST
Hi GS Jones [...] > left out the "make object!" phrase. [...] I didn't do that intentionally. I just happened to implement it that way when I wrote the code for this Website. Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: works for GET, not POST
Hi Ryan, > My system is as follows: > > Apache/1.3.14 (Unix) mod_bwlimited/0.8 mod_log_bytes/0.2 PHP/4.0.4 mod_perl/1.24_01 >mod_frontpage/3.0.4.3 mod_ssl/2.7.1 OpenSSL/0.9.5 on Linux > > The function I use works with GET, but not with POST > > retrieve-user-data: func [] [ > return make object! decode-cgi > either system/options/cgi/request-method = "POST" [ > input > ][ > system/options/cgi/query-string > ] > ] > Using POST: What exactly happens, if anything? Have you tried replacing this function simply by input ? Could you send me a dump of what input returns? I.e. replace the above line by write %dump.txt mold input TIA, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Scope? Any advice would be appreciated.
Hi David, I was talking about versions of the software that came out in the mid or late eighties. At the time the packages you mentioned were competing on the DBMS market. I think this would also be true for 4GL languages, even if they were not marketed as a companion product to a proprietary DBMS technology. Their fate is determined by the dynamics of the DBMS market. If a DBMS company eventually takes over a significant market share (Oracle), then it sets standards not only with respect to the DBMS itself, but also with respect to accompanying products. I believe that, in contrast, REBOL is competing on what has been traditionally the scripting or programming languages market. Here the dynamics may be a little different. A DBMS oriented product (also 4GL) will attempt to improve something with respect to existing DBMS technologies. A programming or scripting language, on the other hand, may include support for DBMSs to extend the sphere of influence of programmers who use this language. These two distinct developments may occassionally overlap, where a DBMS oriented shop will invest in a scripting language because it feels that the language improves their abilities to solve problems that are specific to their DBMS market, for instance, but that does not mean that the fate of the language is has now beomce dependent on the dynamics of the DBMS market, as a 4GL would be. Hope this clears it up, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Re(2): 'parse-url - where defined?
Hi Anton, it's really worth your while to explore the system. Just start at the top-level system object: >> print mold next first system look through the list it generates, check the types of the different words contained in the block >> foreach word next first system [ print [word "has type" type? in system word] ] and then look at what the words that are objects contain. Or, if you're too lazy to do that manually ;-), you can use Bo's system object inspector, which should in rebol.com's archive. It's an interactive tool that lets you explore the system object to a degree. Hope this helps, Elan Anton wrote: > > Allen, Elan, Nenad, > > > Hi Anton, Elan, Nenad, > > > > That particular parse-url is in the system/view/vid object. > > read-via is also > > in the same object. (it is not the same as the one in net-utils, though it > > does call that one) > > How did you discover this? > Did you know 'parse-url already or did you have to search? > How would you go about searching for a word > whose value is defined in some other context? > Is there a way of determining which > context a word's value is defined in? > Is there a way of listing all contexts? > > Anton. > > > >> f: get in system/view/vid 'parse-url > > >> source f > > f: func [url /local purl][ > > net-utils/url-parser/parse-url > > purl: context [user: pass: host: port-id: path: target: none] url > > if all [purl/target purl/host] [purl] > > ] > > > > To explore Vid a bit more you can print it to a file. > > > > echo %vid.txt > > probe system/view/vid > > echo none > > > > ;Happy reading! > > > > Cheers, > > > > Allen K > > > - Original Message - > > From: "Anton" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Wednesday, January 31, 2001 1:33 AM > > Subject: [REBOL] 'parse-url - where defined? > > > > > > > Hi, > > > > > > Looking at > > > source read-via > > > > > > It uses 'parse-url in the second line of read-via's function body. > > > Where does parse-url come from? > > > On the console, parse-url has no value. > > > How then, does read-via work? > > > > > > my system/version == 0.10.38.3.1 > > > > > > >> parse-url > > > ** Script Error: parse-url has no value. > > > ** Where: parse-url > > > > > > >> source read-via > > > read-via: func [ > > > {Read a file via the cache. Returns binary. Failure returns error.} > > > url [url! file!] > > > /progress callfunc port-hand > > > /update "Force update from source site" > > > /local path file data purl loc-path > > > ][ > > > if file? url [return read url] > > > if none? purl: parse-url url [return none] > > > loc-path: rejoin [system/options/home/public "/" purl/host "/" any > > > [purl/path ""]] > > > file: join loc-path purl/target > > > path: rejoin ["/" any [purl/path ""] purl/target] > > > either all [not update exists? file] [data: read/binary file] [ > > > data: either progress [read-net/progress url :callfunc > > port-hand] > > > [read-net url] > > > if data [ > > > if not exists? loc-path [make-dir/deep loc-path] > > > write/binary file data > > > ] > > > ] > > > data > > > ] > > > > > > Anton. > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: works for GET, not POST
Hi Ryan, I don't understand why you are having problems (haven't followed this thread). I am routinely using the following function with POST under an Apache Webserver on Linux using REBOL/Core current stable version and it works without complaints every time: retrieve-user-data: func [] [ return decode-cgi either system/options/cgi/request-method = "POST" [ input ][ either system/options/cgi/query-string [ system/options/cgi/query-string ][ "" ] ] ] Which problems are you having? Take Care, Elan "Ryan C. Christiansen" wrote: > > I'm still lost on how to use POST to create an object! containing the > values submitted in a form. The following function creates a string! > value called 'data, correct? > > retrieve-user-data: func [] [ > either system/options/cgi/request-method = "POST" [ >data: make string! 2002 > read-io system/ports/input data 2000 > ][ > cgi: make object! decode-cgi-query > system/options/cgi/query-string > ] > ] > > The /Core user's guide says "a good format for POST data is to use > a REBOL dialect and create a simple parser. The POST data can be > loaded and parsed as a block." > > Why isn't there a built-in function for parsing POST data into an > object? Am I missing something? > > -Ryan > > > Ryan, > > > > It appears as though you will need to read from system/ports/input to > > receive the actual POST query data. This process is explained in more > > detail in the "REBOL/Core User's Guide," which is available in pdf > > format online at: > > > > http://www.rebol.com/download_manual.html > > > > or the print version is available through www.rebolpress.com . > > > > The relevent section begins on page 402, with POST explained on the > > following two pages. > > > > Hope this helps. > > > > - Scott > > > > - Original Message - > > From: "Ryan C. Christiansen" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Friday, January 19, 2001 5:19 PM > > Subject: [REBOL] works for GET, not POST > > > > > > > I'm using the following function, which is derived from the "Official > > > Guide," for CGI. > > > > > > retrieve-user-data: func [] [ > > > return make object! decode-cgi > > > either system/options/cgi/request-method = "POST" [ > > > input > > > ][ > > > system/options/cgi/query-string > > > ] > > > ] > > > > > > > > > I use it as such: > > > > > > cgi-input: retrieve-user-data > > > > > > to give me an object containing the input values. > > > > > > My usage is working for GET operations but not for POST. What am > > > I doing wrong? > > > > > > -Ryan > > > -- > > > To unsubscribe from this list, please send an email to > > > [EMAIL PROTECTED] with "unsubscribe" in the > > > subject, without the quotes. > > > > > > > -- > > To unsubscribe from this list, please send an email to > > [EMAIL PROTECTED] with "unsubscribe" in the > > subject, without the quotes. > > > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: 'parse-url - where defined?
Hi Anton, parse-url is defined in net-utils/URL-Parser/parse-url Anton wrote: > > Hi, > > Looking at > source read-via > > It uses 'parse-url in the second line of read-via's function body. > Where does parse-url come from? > On the console, parse-url has no value. > How then, does read-via work? > > my system/version == 0.10.38.3.1 > > >> parse-url > ** Script Error: parse-url has no value. > ** Where: parse-url > > >> source read-via > read-via: func [ > {Read a file via the cache. Returns binary. Failure returns error.} > url [url! file!] > /progress callfunc port-hand > /update "Force update from source site" > /local path file data purl loc-path > ][ > if file? url [return read url] > if none? purl: parse-url url [return none] > loc-path: rejoin [system/options/home/public "/" purl/host "/" any > [purl/path ""]] > file: join loc-path purl/target > path: rejoin ["/" any [purl/path ""] purl/target] > either all [not update exists? file] [data: read/binary file] [ > data: either progress [read-net/progress url :callfunc port-hand] > [read-net url] > if data [ > if not exists? loc-path [make-dir/deep loc-path] > write/binary file data > ] > ] > data > ] > > Anton. > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Scope? Any advice would be appreciated.
Hi David, > I have always been interested in using higher-level > languages to be productive. My career has progressed > from dBase->Clarion->Gupta SqlWindows->Forte --->Java > and Rebol. All of the above, except Java have a small > market share these days. I just hope Rebol will stay > around long enough for ME to get tired of it -- and > that may be a long time :) A few comments: 1. SQlWindows is not a programming language. It is a product - a database management system - that happens to use SQL. The DBMS product may not have a major market share, but REBOL is not a dbms product, it's a programming language. So we should be comparing it to SqlWindow's programming language. And SQL is quite alive and kicking last time I checked ;-). True, dBase includes its own programming language, as does Clarion (so you never programmed in Paradox, huh?). But in both cases we are again talking about programming languages that are specific to a DBMS product. So the competition here is about DBMS products, not about programming languages. In other words dBase and Clarion (and SqlWindows) lost the database management system competition, not the programming language competition (of course, after all Oracle is also SQL based). As for Forte, I'm not quite sure which Forte you are referring to. I am aware of a Forte Newsgroup reader, and there's a Fort Java IDE. Right, there's also a theorem prover called Forte. You must mean something else? 2. As for the specific REBOL feature we were investigating: statically scoped local variables have been part of C for roughly thirty years and have happily made it into ANSI C++. That's pretty mainstream. The only thing that a C/C++ programmer has to realize is that a (REBOL) word that references a literal block (under all circumstances) acts similar to a (C) local variable that is a pointer (word) referencing a locally declared static buffer (or a globally declared buffer) (== REBOL literal block). Even though you may reassign the pointer to the buffer each time you enter the function, if that buffer was declared static (or the buffer is global), then the buffer will contain whatever was previously put into it during the previous evaluation of the C function. There's really nothing to it. My argument then is that if REBOL's success depends on the acceptance of REBOL's literal block behavior, then, given that mainstream languages C and C++ have been supporting an equivalent feature for quite a few years, REBOL is quite safe. I don't think that REBOL is weird, and I doubt that the weirdness of a language is a guarantee for its success. But Tcl, Perl, and Visual Basic still seem to be doing quite well ... Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: rebol to bash?
Hi Tom, the following works for me: #!/usr/local/bin/rebolcmd -c REBOL [] print "hi" I know, I know, -c is actually intended for CGI, but it does it the trick in this case too. Use your own path of course, and your own rebol version (I'm using rebolcmd). Hope that helps, Elan [EMAIL PROTECTED] wrote: > > hey guys, > > I'm the king of easy questions. I like to print nifty little > one-liners to stdout with rebol, but I can't seem to get them to my $ > prompt. > > In my boundless ignorance, I tried a shell script: > > one-liner.r | bash > > That obviously didn't work. > > anybody have any luck with stuff like this? > > -- > > Eat more spinach. > -tom > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: object/property1: "new value"
Hi Helmut, REBOL has a protect function that protects words from being reassigned. The protect function does not work for words that are implemented in objects. I have previously asked RT to add this functionality. As of the latest experimental /Core release this feature has not been added. Elan Helmut Knoblauch wrote: > > Hi list, > > 1) how can I forbit to change values in an object? > 2) how can I get an event, when an object variable is changed? > > In Visual Basic and VBScript I can do it with: > > Property get variable1() > ... > end Property > > Property let variable1(new) > ... > End Property > > Many Thanks > Helmut > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Scope? Any advice would be appreciated.
Hi David, The body of a function is a block and behaves like a block. What strikes you as an unusual behavior is part of REBOL's consistency. REBOL is different from other programming languages in that it applies a relatively small set of rules consistently across most of its types (including functions). Just as you expect any block (even one that is embedded in an outer block) to preserve its values, so too does REBOL preserve the values of a block that is embedded in a block even though the host block, besides being a block, also happens to be the body of a function. Given the block b that contains a single element, a block that in turn contains three integers, all of which are 0 >> b: [ [0 0 0] ] I can access the internal block using the path notation with the index 1: >> b/1 == [0 0 0] Now let me change the first 0 in the inner block to a 3 >> change b/1 3 == [0 0] The block b now contains a block that contains the three integers 3, 0, and 0 >> b/1 == [3 0 0] Now for a simple function whose body contains a block that contains three 0s >> f: does [ [0 0 0] ] I can access the body block of the function using the second function: >> second :f == [[0 0 0]] I can assign the word c as a reference to the body block: >> c: second :f The wird c is now a reference to a block (namely the body block of the function) like b is a reference to a block >> c == [[0 0 0]] >> b == [[3 0 0]] I can now change the first value of c's embedded block: >> change c/1 3 == [0 0] Now c/1 looks like b/1: >> c/1 == [3 0 0] >> b/1 == [3 0 0] Indeed the are equal: >> b/1 = c/1 == true Let me add a set-word! called block: to both blocks: >> insert b [block:] == [[3 0 0 ]] and let's do the same to c >> insert c [block:] == [[3 0 0]] What does b contain? >> b == [block: [3 0 0]] What does c contain? >> c == [block: [3 0 0]] If we try to get the value associated with block we get an error message in both cases, because the blocks haven't been evaluated yet, and therefore the set-words have not been associated with anything: >> get b/1 ** Script Error: block has no value. ** Where: get b/1 >> get c/1 ** Script Error: block has no value. ** Where: get c/1 Now let's evaluate the function, which means that the block is reduced: >> f == [3 0 0 ] Now we can get the value of the set-word! block: in c (recall that c is simply a word associated with f's body block): >> get c/1 == [3 0 0] Now block: is associated with the block [0 0 0] in the function f. Let's first get rid of this association, and then we'll look at b: >> unset 'block How about b? Since b's block is not associated with a function, we cannot evaluate this non-existent function. We can, however, reduce the block programmtically (reducing a block means evaluating its elements): >> reduce b == [[3 0 0]] The reduction has caused the set-word block! to be associated with the block [3 0 0] in the block b: >> get b/1 == [3 0 0] Finally, we can express evaluation of a function without arguments, refinements, and locals as a block reduction: eval-function: func [body [block!] [ reduce body ] Let's first unset block: >> unset 'block If some f is a "does" function (i.e. without arguments, refinements, or locals), then evaluating the function is the equivalent of passing the function's body to our eval-function: >> f: does [ block: [0 0 0] ] >> first second :f == block: >> get first second :f ** Script Error: block has no value. ** Where: get first second :f >> fbody: second :f >> eval-function fbody == [[0 0 0]] >> get fbody/1 == [0 0 0] >> first second :f == block: >> get first second :f == [0 0 0] Hope this makes it more digestable. Elan David Vydra wrote: > > Gabriele, > > Is this a simple optimization issue or is there a > deeper logic for this "strange" behaviour? > > > r> Lastly, since the code appears to be > > self-modifying, and > > r> behavior of assignments change depdending upon > > whether it is > > r> the first call or a subsequent one, I am curious > > as to what > > r> advantages this has vs the confusion that it > > will cause people > > r> coming from other programming environments. > > > > It's a bit confusing in the beginning, but you'll > > find it obvious > > and natural when you'll have some more experience > > with REBOL. > > > > To be better, you have to be different. :-) > > > > Regards, > > Gabriele. > > __ > Do You Yahoo!? > Yahoo! Auctions - Buy the things you want at great prices. > http://auctions.yahoo.com/ > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Rebol vs PHP
Hi Justin, my $0.02: Since you are not expecting a large amount of users, I don't think that pages per second plays a tremendously significant role for you. From the point of view of speed of implementation, the ease with which you can add sophisticated (processing) features, and ease of maintenance my favorite would be ... (can you guess it? ;-). Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Memory issues
Hi Paul, Paul Tretter wrote: > recycle REBOL has automatic garbage collection and will free previously allocated memory that is no longer needed by itself. You can optionally instruct REBOL to free up memory by using recycle. I would use recycle in two (three) situations, namely when I want to better control at which point in time REBOL spends machine cycles on freeing previously allocated memory a) When I know that I am about to do something that is very memory intensive, and I want to avoid having REBOL free up memory repeatedly while it is evaluating my memory intensive functions; So I force REBOL to reclaim unused memory hoping that this will provide for a large enough available memory pool and REBOL will not have to interrupt the evalution of the following instructions in order to free up memory; b) When I know that I have just used up a huge amount of memory, and I want to avoid having REBOL repeatedly reclaim unused memory as needed during the evaluation of the following code; c) This is a combination of a and b: During the repreated evaluation of memory intensive functions I want to better control at which point memory that is no longer needed should be freed. > clear The clear function empties a series value, such as a block or a string. Elements whose reference count has fallen to zero will be automatically garbage collected (or garbage collection can be forced with recycel). > free When you load a shared library (or dll) under /Command then the resources associated with that library must be explicitly freed using free. These resources are not included in the garbage collection, since REBOL has no way of knowing if the DLL or shared library is still using that resource internally. > unset Unset dis-asscoiates a word from its value. Unset reduces the reference count of a value, and if the reference count has dropped to 0 the value will be garbage collected, and the memory it occupies will be freed. Comparing clear to unset: If I use clear I reclaim the memory used by the elemnts of a series value, but the series value itself, and the word associated with it, continue to exist and occupy memory. If I use unset instead of clear, then not only will the element be garbage collected, but in addition, the series value itself is disposed of, and the word is no longer associated with a value. Hope this helps, Elan > > Did I miss any? > > What are the advantages or disadvantages of each. 'Free apears to be only available >in /Command version. I am very interested in this with a script that I am working on >that is getting a bit memory intensive. > > Paul Tretter > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Rebol vs PHP
Hi Allen, you wrote: > As much as I love REBOL, if above are the parameters to work with, I would > suggest sticking to ASP, anything else would be slower in that set up. ASP > can do about 39 pps, php upto 42pps, CFM 29 pps, REBOL probably somewhere > similar. ASP is spagheti (but probably no more than PHP), but you can have a > small choice of server side languages, Jscript, VbScript, PerlScript and > other installed interpretors. (I want REBOL to get on that list) > These are interesting numbers. You estimate 10pps difference between ASP and REBOL peak peformance. a) I wonder if there are cases in which REBOL outperforms ASP? b) Peak pps performance is not the only criteria for language choice. c) How about letting ASP handle what it's good at - MS db access - and letting REBOL do the rest? (I.e. REBOL requests db results from ASP and uses them, when necessary? BTW, Do you happen to know of a stanardized benchmark that tests more than peak performance? Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Parsing
Hi Andrew, aren't you being a little verbose ;-)? >> at "This part" 4 will give you the substring, which is all Paul really asked for. To avoid modifying the original string you may want to add >> copy at "This part" 4 Paul's example does not prescribe extracting an embedded substring, and therefore you don't really need to use the /part refinement. Probably you wanted to show Paul how to extract a string that ends before the end of the source string? Take Care, Elan Andrew Martin wrote: > > Hi, Paul, you wrote: > > You example didn't work in my case. I am trying to take a and obtain the > rest of the string starting at index 4. > > Have you tried: > >> copy/part at "This part" 6 4 > == "part" > > > Problem is that Parse returns a block. > > It needs to as parse turns one thing into many things. > > > And in your example it still produced the same problem of condensing the > string so that a string of "This is a test" turns out as "Thisisatest" > > That's what rejoin does. Try 'reform to get a space in between. Like: > >> reform parse "axstringxwithxspaces" "x" > == "a string with spaces" > > Can you give an example of input and output? I'm sure I'm still > misunderstanding you. > > Andrew Martin > ICQ: 26227169 http://members.nbci.com/AndrewMartin/ > -><- > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Rebol vs PHP
Hi Justin, Graham, Graham Chiu wrote: > I don't PHP, but I would have thought that PHP being an > Apache module would be faster, and less memory/resource > intensive. It probably depends on what exactly you are doing. My experience with PHP is it uses up a lot of memory. I had to split some scripts up into multiple files, because I was getting an "Out of memory" message on a box that has 512MB RAM or more. > > The other point is whether you really want to use Access > databases to web serve information. It's intended use is as > a desktop database. That's a very good point. There are plenty of very stable, commercial quality Open Source (or at least free) databases out there that are far better suited for an online application. Examples: MySQL, Interbase, FreeBase, and many more. PHP's object implementation is a little weird (look at the trouble you can get yourself into if you use the PHP XML parser from within an object, or if you try to pass the XML parser functions defined in a derived object). Iterating over associative arrays also isn't always fun. While the syntax looks simple enough: while ( list($key, $value) = each ($a_array) { do_something($key, $value); } you actually get each value listed twice: once in assoication with a key that is the index of the value, and a second time with a key that is the key you associated with the value. That's kind of relevant when you want to associate the fieldnames with the values stored in the fields. REBOL does not have the problems I just listed. You can learn REBOL much faster because the REBOL shell is interactive. You can instantly test out ideas for the same reason. REBOL has better error trapping and debugging support. The wealth of datatypes supported by REBOL and its parametric polymorphism make it alot easier to implement code that works as expected. Just compare the code needed under PHP to send an email message, and compare it to the simple REBOL code that you can enter in the REBOL shell >> send [EMAIL PROTECTED] "Hi guys, really great programming language." I find that REBOL enables me to express my intentions much faster and more precisely than PHP. If I'm expected to deliver PHP code, I usually prefer to write REBOL functions that will generate the PHP code, and then express my code in REBOL, or write a small dialect and implement a REBOL compiler that generates the appropriate REBOL code based on the code I write in my dialect. One reason for this approach is that PHP has many more syntactic gotchas then REBOL (the obligatory $ sign at the beginning of variables, which is occassionally forgotten, the obligatory -> operator to access object functions and variables, which occassionally ends up being -, the obligatory ; at the end of each statement, which is occassionally forgotten, it slows you down, especially together with PHP's very terse error messages.) In short, PHP is quite cool, REBOL is great. Sometimes you have to use PHP, unless you have access to REBOL/Command, because /Core has no built-in support for databases. But if you were planning to use Access, then quite possible you don't have a database intensive aplication in mind, and using REBOL plain text files will be sufficeint to store your data. Perhaps something as simple as this REBOL [] address-book: [ "Peter" "Smith" "555 5551212" "345 N. Nowhere Rd." "Noc Ity" "NO State" "Barbara" "Jones" "111 121 " "543 S. Somewhere Rd." "Somec Ity" "Same State" ] print [] print foreach [first-name last-name phone address city state] address-book [ print [] print [first-name last-name phone address city state] print [] ] print print [] will do? Hope this helps, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: REBOL Books
Hi Matt, thank you for your opinion. Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: catch in a function - what does it do?
Hi Anton, let me add a few words. Normally when an error occurs, you get an error message similar to this: >> f: func [] [ try [ 1 / 0 ] ] >> f ** Math Error: Attempt to divide by zero. ** Where: 1 / 0 That's ok in our case. But as soon as we have more complicated call sequences, where one function may call several other functions that in turn call yet other functions: >> g: does [ f ] >> g ** Math Error: Attempt to divide by zero. ** Where: 1 / 0 If this happens during the evaluation of a long script, it'll take some time to determine where this error occurs. The catch attribute works together with the throw native and modifies where the error is reported: >> f: func [ [catch] ] [ throw try [ 1 / 0 ] ] >> g ** Math Error: Attempt to divide by zero. ** Where: f Even though we called the g function and the error occured in the try block of the f function, the error is no longer reported as having occurred ** Where: 1 / 0 instead we get ** Where: f which helps us more easily locate the source of the problem. In our case the error occurs in the f function, and the error message reports that that is where the error occurred. Another example. Let's say many function call the f function, but f fails only sometimes. Now we are no longer interested in the fact that the error in occurs in f, we want to know which of the calling functdions is causing the error. So we remove [catch] from f, and instead use a catch in g to report the calling function: >> g: func [ [catch] ] [ f ] >> f: does [ try [1 / 0] ] >> g ** Math Error: Attempt to divide by zero. ** Where: g Now g is reported as the location at which the error occured, because we have migrated catch attribute to g. In short, the catch-throw combo allows us to conveniently locate errors. Hope this helps, Elan Andrew Martin wrote: > > Anton wrote: > > Can someone explain what it means when 'catch is found in a function > header? > > It's intended to catch errors that occur in the function (usually due to bad > content in arguements and present them as if they occured out side the > function. > > Andrew Martin > ICQ: 26227169 http://members.nbci.com/AndrewMartin/ > -><- > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: REBOL Books
nd take control of what their computer can do for them, instead of relying on Bill Gates and his merry gang to provide them with yet another point-and-click off-the-shelf feature that almost - but never quite - does what they need it to do, provided they add another 256MB of RAM, another 10Gigs, and another 500 MHz to their system. Believe it or not, after watching a few real, live people who fall in this category give up as soon as they had to unzip the REBOL distribution, I decided that we'd have to guide these people through that process, if they were ever to advance to the point of finding out just how easy it is to make REBOL do some useful tricks. > Granted the entire sections on > handling data are good, well that's basically the bulk of the book. Data handling is at the heart of REBOL. > > Now in *my* opinion there's no way you'd use Rebol for coding a > database anyhow - it's just not suitable for that sort of thing. Now is *that* so? I guess that's "*my* opinion", is it? Did you EARN the starts you use to point at yourself? I think REBOL is an excellent basis for a multivalue distributed dbms, for small or medium requirements. The dbms we implemented in the book is not quite up to par, because it was written to showcase REBOL coding techniques, and it is not optimized for dbms transactions, nor does it include any "defensive" error detection, trapping, and handling, because they would have distracted the reader from the essential algorithms. (Try, catch and throw are discussed in a different chapter). But - considering today's PC computing power - a REBOL based dbms could easily perform as well as a dbms written in a compiled language for a 4.77 MHz 8088 IBM PC. And guess what, the 4.77 MHz 8088 IBM PCs did some very useful things in their time. > What > it *is* good for is advanced data mining of the Web and utility > scripting etc especially the native net support. That's not catered > for very well here at all. Well, chapters 12 and 22 should have come in handy. They discuss parsing in some length and some detail. > > IE it doesn't even tell you how to delete a mail from a pop3 box > except to say that you need to use low-level port functions to do it. > > It's not a bad book at all, it just wont suffice as an only book. > It depends on your needs. If it's only going to be one book, then I'd say it's a pretty good choice. But, in all fairness, as its author, I may be a little biased. Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: XML
Hi Brian, looked at parsing, generally speaking, and take a close look at the parse-xml function and the xml-language object. The parse-xml function btw is no more thatn a shortcut, it simply calls the xml-language/parse-xml >> write %xml.r mold xml-language will do the trick. Hope this helps, Elan Brian Rigby wrote: > > I'm a newbie to rebol and am looking at xml parsing and generation > functionality. Basically I want to be able to connect to database on my > server and extract information in XML format and the reverse. What parts of > Rebol should I be looking at? I don't see any reference to XML in the > "Official Guide".. are there any other sources that might steer me in the > correct direction? > > Sorry for the simplicity of this query, but I hope it will save a lot of > searching. > > Brian > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Private Object Function
I was really in a hurry when I wrote this stuff. The class function I included was untested and incorrect. The corrected version is: class: func [ default! [object!] spec [block!] ] [ set [_ private-block _ published-block _ public-block] spec return make default! [ if private-block [private: make object! private-block] if published-block [published: make object! published-block] if public-block [public: make object! public-block] ] ] A better version is: class: func [[catch] default! [object!] spec [block!] /local class-spec] [ class-spec: make block! 6 foreach [section definition] spec [ either block? definition [ insert class-spec compose/deep [ (to set-word! section) make object! [(definition)] ] ][ throw make error! join {Expected definition of type block!. Received } [mold definition " of type " mold type? definition " instead."] ] ] return make default! class-spec ] The second version is more flexible in that it permits spec blocks that exclude any or all of the exposure signifiers (public, published, or private), the declarations may occur in any order, and it catches incorrect definitions. Hope this helps, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Private Object Function
Hi Christophe, > > Hidden objects or contexts are not protected from descendants. > [Do you mean by this it shouldn't be possible to implement it in > REBOL ?] No, I mean that using REBOL's default inheritance mechanism, i.e. >> o: make object! [foo: none make object! [bar: does ["I'm hidden"] set 'foo does >[bar] ] ] >> p: make o [foobar: "I'm p"] p will have inherited foo as a functions that successfully calls bar just like o does. This leads to the following situation. Given: >> o: make object! [ foo: none set-bar: none make object! [ bar: none set 'foo does [bar] set 'set-bar func [value] [ bar: value ] ] ] >> p: make o [] >> o/set-bar "I was set by o." >> print ["o/foo" mold o/foo] o/foo "I was set by o." >> print ["p/foo" mold p/foo] p/foo "I was set by o." >> p/set-bar "I was set by p." >> print ["o/foo" mold o/foo] o/foo "I was set by p." >> print ["p/foo" mold p/foo] p/foo "I was set by p." Note that - unlike your requirements for private values - p and o share o's private value bar. REBOL's inheritance mechanism acts in a "protected" way with respect to children's access to hidden object properties. This means that you should really implement your own custom object mechanism, let's call it class mechanism to separate it from REBOL's objects, which may be built on top of objects. class!: make object! [ private: none published: none public: none ] some-class: class class! [ private [ pa: none pb: none ] published [ ua: none ub: none ] public [ la: none lb: none ] ] class: func [ spec [block!] /local new-class] [ set [_ private-block _ published-block _ public-block] spec return make object! [ private: make object! private-block published: make object! published-block public: make object! public-block ] ] some-child: clone some-class clone: func [parent [object!] /local result] [ ; has to be written. I don't have the time right now. ; what takes a little more time is that you must account ; for possible complex structures such as classes embedded ;in a class, or blocks of objects/classes embedded ... ; If nothing useful pops up on the mailing list perhaps I'll implement something this evening ] > > BTW is there anybody interested by the results I will get ? I do not > want to spam the list with uninteresting stuff... Well, as you've guessed by now, I'd even be interested in contributing some code. I think it'd be an interesting ongoing public project. Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Private Object Function
Hi Gabriele, you're right (just tried it). I thought it had already been repaired in 2.3? Must've been the later experimental versions. Thanks, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: In Praise Of REBOL
Hi Will, Will Arp wrote: > > > Nedit and continue working on my eval-webobject.r script ;-). > > Could you tell more ? > Soon ... Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Private Object Function
Hi Christophe, 1. I think the DBMS I developed in my REBOL book (REBOL The Official Guide) may be a starting point (chapters 15-18). It's not the "last word" in developing a dbms under REBOL, but it does provide some thoughts and examples that may be useful for you. I think the Object Navigator might come in handy. 2. > [In the specific context of my try for OODBMS development, the > persistence of the DBobject should indeed request to be written down > INCLUDING the private methods, because those should contain some business > intelligence needed to access/handle the contained data] You want strictly enforced privacy, and you want the ability to save objects including their private componenets. From the point of view of privacy enforcement REBOL's built-in storage functions (write, save) are non-members that are prohibited from accessing the private components. If they are prevented from accessing the private components, how should they be able to save these private components, unless they are used from within member functions? The OODBMSs I am aware of use two strategies to save objects: a) Each object includes serialization functions used to store the object. Since the serialization functions are members of the object, they do have access to private object conponents. This can be implemented in REBOL. b) The OODBMS uses runtime system information (RTTI) to invade the privacy of the object and automatically determine the components and component types of an object. This can also be implemented in REBOL. > [you're right ! methods would be classified in three exclusives > classes: public, private and protected You appear to follow the Object Pascal (Delphi) conventions. > Sample use of them could be: > - public access : the method can be called from any script in the > application. This is supported in REBOL using paths, or GETting a value IN an object (i.e. get in object 'word). > - private access : the method can be called only from scripts in the > object for which the function was declared (including the sub-objects); the > method cannot be called from descendant of the object. Hidden objects or contexts are not protected from descendants. > - protected access : the method can be called only from scripts for > the object for which the function was declared, and its descendant. Hidden objects or contexts are exposed to descendants. > > c) Under no circumstances must a non-member function be able to access > > private components? > [as I see the implementation for now, my meaning of it is to enforce > the protection of the object's contain by keeping the protected/private part > out-of-bound for the context from which the object is called. That is, using > your words, your point c). See what I wrote above. If you enforce c) then you cannot use REBOL's default functions for saving an object from outside of the object. The serialization functions included IN objects can - of course - make use of write and save. Example: >> o: make object! [ e: none save-me: func [filename] [write/append filename mold self] make object! [ h: does [print "I'm hidden."] set 'e does [h] append second save-me [write/append mold self] ] ] >> probe o make object! [ e: func [] [h] save-me: func [filename][write/append filename mold self write/append filename mold self] ] save-me looks like its saving self twice. These are two different selfs. The first self is bound in the context of the public object, the second self is bound int the object used to hide the h function. I.e. the second self evaluates to the "hidden" object. We can see that by retrieving the body of the save-me function: get second in o 'save-me, and then getting and displaying the two self words, using get second ... and get fourth ... respectively, to get the value associated with the second word (self), and the fourth word (self) in the block: >> print mold get second second get in o 'save-me make object! [ e: func [][h] save-me: func [filename][write/append filename mold self write/append filename mold self] ] >> print mold get fourth second get in o 'save-me make object! [ h: func [][print "I'm hidden."] ] Note that - as demonstrated - it is possible to get at the hidden stuff, if you go out of your way to do so. The solution IMHO is to implement your own objects and supporting function in which you enforce private/protected/public rules. As long as your code does not use REBOL's built-in functions to violate these rules, you're fine, provided you don't mind the extra overhead. Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Private Object Function
Hi Christophe, > I would like to > implement a coherent OODBMS - which I announce in the list sometime ago. I just checked my REBOL folder, and I don't appear to have that one. Could you send me the email you are referring to offlist? It may help me understand where you are heading with this. If it's to be an OODBMS then my guess is that you won't be served with a solution that prevents you from storing the private components of an object together with the object? Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Private Object Function
Hi Christophe, > > 4. Should the object be serializable including hidden functions? > [I do not understand 'serializable' ?] By "serializable" I mean that: If I have the object (including its private components) loaded in memory, should I be able to write the object including its private components to a file? Or is it sufficient if I only write the public components of the object to a file? I.e. o: make object! [something: none] write %filename.ext mold o will write this object to a file. If I add private components to this object, and I want to write the object to a file, should the private components be written along with the object? Or should the object be written without the private components, which means that when the object is subsequently loaded from this file, it will not include the private components. > > > 5. Should descendants have access to hidden functions? > [yes they should. Although it should be interressant to me to have a > mean to control this: some sort of 'protected function' which is known to > the ancestor, but not to the child objects...] Is this "protected" function in addition to the private function? If not, then I don't see how descendants can access the hidden function, if this hidden function is not known to descendants. > That is, a private function is a function only known and accessible > from within the context of the object. A public one is part of the public > interface of the object and is therefore accessible from outside the object, > by another object from exemple] Basically, my question is, to what degree do you want to enforce this? Is it a) more an organizational principle to help you as a programmer organize your code; b) you don't want the private functions/words to show up in the block returned by first object, but if a non-member function absolutely wants to, then it will will be able to also access hidden words ... c) Under no circumstances must a non-member function be able to access private components? That's, basically what I'm asking Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] In Praise Of REBOL
Hi REBOLlers, I'm almost into my third year of programming in REBOL. Some of you may recall that I wrote a book about REBOL last year, and writing that book gave me opportunity to study REBOL in some depth, and spend 10-16 hours daily working with REBOL one way or another for close to a year. One might consider me a somewhat seasoned REBOL scripter by now, for whom REBOL has by now become a barely noticable routine coding tool. Even though my exposure to REBOL has been quite extensive, REBOL continues to astound me. The syntax is so neat, and the language is so well integrated that it is really a joy to code in REBOL. I had to take the time off to air my feelings. Sorry for wasting bandwidth. A (random) heartfelt thanks to Carl and his team, before I return to Nedit and continue working on my eval-webobject.r script ;-). Take Care guys, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: REMOTE Console
Hi Paul, check out rebserv.r at http://www.rebol.org/utility/index.html If that's not what you're looking for, then perhaps little-bell.r on the same page will so the trick. Take Care, Elan Paul Tretter wrote: > > Is there a way to connect remotely to access the console over a network connection >and issues commands or functions? > > Paul Tretter > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: 32 bit - dword values
Hi Paul, try >> to integer! #7fff ;- seven f's and then try >> to integer! #8fff ;- again seven f's and >> to integer! # ;- eight f's In short, REBOL supports SIGNED 32 bit integers. Hope this helps Elan Paul Tretter wrote: > > How do we handle 32 bit numbers when trying to convert them. It seems that special >precautions must be taken to prevent math overflow errors. Can someone from RT tell >us how we should handle these issues. For example if I do a to-hex 55 I get >an error: > > ** Script Error: to-hex expected value argument of type: integer > . > ** Where: to-hex 55 > > but to-hex 5 works fine > > This might be greater than a dword but illustrates my point. Anyone ran into this >problem before? > > Paul Tretter > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Private Object Function
Hi Gabriele, how is this any ifferent from what you can do with the current stable version (2.3)? The questions, however, remain. a) The protection can be circumvented, in as much as I can use get-value's body to access add-one as well as value. b) The object o cannot be serialized together with the hidden words. BTW, Christoph, what are you trying to accomplish? Take Care, Elan I can still access "private" Gabriele Santilli wrote: > > Hello COUSSEMENT Christoph! > > On 15-Gen-01, you wrote: > > CC>>> o/add-one > > CC> here I should get something like... > > CC> ** Script Error: Invalid path value: add-one. > CC> ** Where: o/add-one > > The most recent /Core experimental allows you to write: > > o: make object! [ > ; public > get-value: none > ; private > make object! [ > value: make integer! 1 > add-one: does [value: value + 1] > set 'get-value does [ > add-one > print value > ] > ] > ] > > or: > > o: make object! [ > ; public > get-value: none > ; private > use [value add-one] [ > value: make integer! 1 > add-one: does [value: value + 1] > get-value: does [ > add-one > print value > ] > ] > ] > > Regards, > Gabriele. > -- > Gabriele Santilli <[EMAIL PROTECTED]> - Amigan - REBOL programmer > Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/ > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: ProHosting is... WORKING! cgiemail.r needs to specify server?
You do need to tell REBOL which smtp acccount it should use to send out the mail (set-net, the same thing you do when you install REBOL on your machien. Look in your local user.r file.) I don't think that prohosting gives you an email account, so you probably cannot use something like smtp.prohosting.com, or mail.prohosting.com. The question is if your regular email account (the one you use to send out email), will forward the email for you. I've had problems doing that with my ISP. I've gotten it to work with other ISP's though. Elan Giovanni Cardona wrote: > > Wow Michal... IT WORKED :) > > I configured the html to work with the script, but > seems that the script cgiemailer.r itself requires a little work. > > Any ideas? > > This is the error it reports > > ** User Error: No network server for smtp is specified. ** Where: smtp-port: > open > [scheme: 'smtp] if email? > > (yes I renamed cgiemailer.r to cgiemailer.cgi, converted the text > file to Unix format and chmod to 711) > > - Original Message - > From: Michal Kracik <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Saturday, December 16, 2000 11:41 AM > Subject: [REBOL] Re: ProHosting is NOT Pro-REBOL > > > Hi, > > > > I tried to describe the process at > > http://hammer.prohosting.com/~rebol/rebol-cgi-prohosting.html > > > > Unfortunately it's incomplete and also inaccurate, REBOL executable > > should not be in cgi-bin for security reasons, only scripts should be > > there. > > > > hope this helps, > > > > -- > > Michal Kracik > > > > Lorenz wrote: > > > > > > Could you be more specific at that point you uploaded REBOl at you > cgi-bin? > > > You mean you just uploaded you scripts written in REBOL and all them > worked > > > pretty well? No further configuration necessary? > > > > > > Thanks > > > --Lorenz > > > > > > - Original Message - > > > From: "Ingo Hohmann" <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Wednesday, December 13, 2000 7:06 PM > > > Subject: [REBOL] Re: ProHosting is NOT Pro-REBOL > > > > > > > Hi Giovanni, > > > > > > > > I got an account at prohosting some time ago, uploaded rebol > > > > into my cgi-bin, and voila, it Rebols. > > > > > > > > I've not done anything interesting since then, but three weeks > > > > ago it still worked ... > > > > > > > > > > > > kind regards, > > > > > > > > Ingo > > > > > > > > > > > > Once upon a time Giovanni Cadona from Presario spoketh thus: > > > > > Just to let you know about this site. > > > > > This site was mentioned several days ago, that offer free hosting > with > > > REBOL > > > > > support, but its not true. (as least that what techsupp says) > > > > > > > > > > - Original Message - > > > > > From: "Free Service" <[EMAIL PROTECTED]> > > > > > To: "Giovanni Cardona" <[EMAIL PROTECTED]> > > > > > Sent: Wednesday, December 13, 2000 2:06 PM > > > > > Subject: RE: {ProHosting#129-941} Welcome to ProHosting! > > > > > > > > > > > > > > > Sorry, we don't support REBOL on our servers. > > > > > > > > > > Tesa > > > > > Free ProHosting Tech Support Staff > > > > > free.prohosting.com > > > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > -- > > > > > To unsubscribe from this list, please send an email to > > > > > [EMAIL PROTECTED] with "unsubscribe" in the > > > > > subject, without the quotes. > > > > > > > > > > > > > -- > > > > do http://www.2b1.de/ > > > > _ ._ > > > > ingo@)|_ /| _| _ > > > www./_|_) |o(_|(/_ We ARE all FREE> ingo@| |(_|o(_)| (_| > > > > ._| ._| > > > > -- > > > > To unsubscribe from this list, please send an email to > > > > [EMAIL PROTECTED] with "unsubscribe" in the > > > > subject, without the quotes. > > > > > > > > > > > > > > -- > > > To unsubscribe from this list, please send an email to > > > [EMAIL PROTECTED] with "unsubscribe" in the > > > subject, without the quotes. > > -- > > To unsubscribe from this list, please send an email to > > [EMAIL PROTECTED] with "unsubscribe" in the > > subject, without the quotes. > > > > > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Private Object Function
Hi Christophe, I think your description is incomplete. By privatization do you mean 1. that functions within the object should/should not have access to the privatized function? 2. If 1, then that limits how hidden the hidden function is. Recall that REBOL functions are editable during runtime. This means that I can use any function that accesses the hidden function as an entry point into the hidden function. I.e. o: make object! [ hidden-func: does [] exposed-func: does [hidden-func] ] exposed-hidden-func: get first second get in o 'exposed-func 3. Should the function have access to other functions and words defined in the context of the object? 4. Should the object be serializable including hidden functions? 5. Should descendants have access to hidden functions? Without clarifying these questions I can see a long thread of rejected proposals. Take Care, Elan "CRS - Psy Sel/SPO, COUSSEMENT Christophe, CPN" wrote: > > Hi REBOLS, > > I would like to make an object function private to this object. That is: > > >> o: make object! [ > [value: make integer! 1 > [; some privatization code ... > [add-one: does [value: value + 1] > [get-value: does [add-one > [print value] > [] > >> o/get-value > 2 > >> o/add-one > > here I should get something like... > > ** Script Error: Invalid path value: add-one. > ** Where: o/add-one > > Any idea ? Of course the principle could be extended to the privatization of > variables... > > Thx a lot, > > Best Regards, > > chr== > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: ProHosting is NOT Pro-REBOL
Hi, since you get a CGI bin I imagine you could simply ftp REBOL into your account and use it. I don't know if that is in comflict with their policies. Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: How to check validity of types ?
Hi Christian, the reason you get this behavior is that the words in the block, [integer! string!], are not bound to the REBOL global context. Simply say b: reduce [integer! string!] and that will do the trick. When you reduce the block REBOL binds the words to the global context and now integer! = first b == true, and string! = second b == true as well. Hope this helps, Elan "CRS - Psy Sel/SPO, COUSSEMENT Christophe, CPN" wrote: > > Hi REBOLs, > > I would like to check if a provided value meets pre-defined type > requirements... > > So I define the valid types into a block 'b: > > >> b: [integer! string!] > == [integer! string!] > >> first b > == integer! > >> value: make integer! 1 > == 1 > >> type? value > == integer! > > And I check the requirement: > > >> (type? value) = first b > == false > > Of course the assumed answer was 'right... > > What did I wrong ? Is there another way to get what I want ? Any idea, > suggestion ? > > thx a lot for answering > CU, chr== > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Catching net errors
Hi Fantam, the simple way is to use set/any if error? set/any 'err try [ ...] [ print mold disarm err ] Fantam wrote: > > Hello all, > > How do one catch an error when writing a file to a ftp server. > Following the docs, this should be: > disarm err: try [write ftp://blahblah read blahblah] > > The problem is that write does not return a value on success. So the > script itself results in an error, saying that 'err needs a value. > > Thansk in advance. > -- > mailto:[EMAIL PROTECTED] > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Where can I get documentation for the in-built functions of REBOL
Hi Bo, you wrote: > - REBOL/Express (which will likely be opened up as a public beta > before too long) Finally. It has been suspiciously quiet lately. So, when, when, when? -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Where can I get documentation for the in-built functions of REBOL
Hi Gabriele, what's the point of having a non-public documentation of undocumented functions? Isn't something like having an expired credit card issued by a bank that doesn't exit? (Not quite, but I like the image ...) Anyway, if whoever has that documentation wants to make it public, cool. If not, then why should that prevent us from creating our own? Take Care, Elan Gabriele Santilli wrote: > > Hello Elan! > > On 12-Gen-01, you wrote: > > E> Perhaps it would be an idea to put together an inofficial > E> Webpage that documents undocumented functions? It would be > > It is a nice idea, but I'd like to warn you and others that > there's something like that already. It's not public, I don't know > if I can talk of it, and I don't know when it will be made public. > > Regards, > Gabriele. > -- > Gabriele Santilli <[EMAIL PROTECTED]> - Amigan - REBOL programmer > Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/ > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: headers in a HTTP-request
Hi Petter, you can find the header info in system/options/cgi. Note that besides providing default header info, system/options/cgi also contains block called other-headers, where remaining header info is stored. Elan Petter Egesund wrote: > > Does anybody know how to read the headers after reading a HTTP-request? > > Regards, > > Petter Egesund, Helpinhand > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Back to the Advanced Port stuff again
therefore the block associated with waitports is currently >> waitports == [irc-open-port] How about the other ports? Simple. Assuming that you are using the string "Paul" which identifies the user Paul as set-word! that will be associated with a port: >> user: "Paul" >> word: to set-word! join user "s-open-port" == Pauls-open-port: >> word make port-object! [ ] >> append waitports to word! :word == [] >> probe waitports == [irc-open-port Pauls-open-port] Great, now how do you get the port associated with Pauls-open-port? There are different ways: >> second reduce wait-orts >> get second waitports ;- less compute-intensive if you have a lot of ports >> get waitports/2 >> first find wait-ports 'Pauls-open-port ;- will return the word Pauls-open-port == Pauls-open-port >> get first find wait-ports 'Pauls-open-port ;- will get the port associated with >Pauls-open-port But if you don't know that its "Paul" s-open-port? Here: >> get first find wait-ports to word! join user "s-open-port" Hope this helps, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Where can I get documentation for the in-built functions of REBOL
Hi Carl, guess I'll have toot my own horn. REBOL - Official Guide, p. 688: "The object net-utils also provides some other useful Net-oriented convenience functions, most notabley thr URL-Parser object, which includes the function parse-url." Perhaps it would be an idea to put together an inofficial Webpage that documents undocumented functions? It would be nice to have a Webpage that will accept email message, and if we could agree on a standard format (perhaps following REBOL's User Guide format) for emails describing the functions, and a REBOL script that generates such emails, then we could easily notify the Webpage of functions we happen to come across. Maybe Allen could host this page on his REBOLforces.com server (which is why cc'd this messsage to him personally). Any takers? Carl Read wrote: > > On 12-Jan-01, Gunjan Karun wrote: > > > Hi Gurus, > > Where can I get more documentation for the in-built functions of > > REBOL, specially functions like parse-xml etc. > > Well, this doesn't help you at all, but neither parse-xml or xml gets > a mention in the indexes of "REBOL for Dummies" or "REBOL the > Official Guide." (That said, everyone who's seriously into REBOL > should get the Dummies book at least. Excellent for finding info > about REBOL/Core in a hurry. (Usually. :) ) > > Maybe the REBOL XML words are not in a finished state yet? > > -- > Carl Read > [EMAIL PROTECTED] > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Back to the Advanced Port stuff again
Hi Paul, you wrote: > interesting enough is that when we did a print first waitports we returned > 'irc-open-port. When we stepped through the waitports block to the next > position and did a probe next first waitports we did not return the word > which we believe was because the script was reducing before appending the > port object to the block at some point. That behavior is indeed very interesting. Do you happen to still have the code segment that exhibited this behavior? What I would be interested in is the line in which irc-opent-port is added to waitports, the lines in which other port objects are added to the port, and the line in which the waitports block is probed, first with "firts", and then with next. TIA, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Need some url purification functions
Thanks Andrew. I just realized that the net-utils version is right in setting the object's values to none before beginning to parse, otherwise old values may continue to live. In short, we need a vars block, and the parse-url function should be modified as follows: make object! [ vars: [scheme user pass host port-id path target tag] parse-url: func [ {Return url dataset or cause an error if not a valid URL} url ][ set vars none ... ] The reason is that the included parse rules do not under all circumstances clear out values that result from previous parsing. My vars block is probably overkill - compare to the original in parse-url in net-utils/URL-parser - but it can't hurt. Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Back to the Advanced Port stuff again
Hi Paul, you wrote: > Lets forget about alternative methods for doing this another way for a > moment and explain where I can find the word that is bound to the port > object given only the object. This is really what I seek to know. you apparently are not understanding what you are saying. You say "the word that is bound to the port object"! Who is bound to whom? The word is bound. To whom? To the port-object! The port-object is NOT bound to the word! You cannot make a reverse lookup from object to word, because "the port-object is not bound to the word" means that the object does not know that there is a word, that the word is paul, and that paul is bound to the object! Again, paul is bound to the object, the object is NOT bound to paul, it is a one-way relationship, where the word "knows" what it's bound to - that's what a word is there for anyway - but the value - here an object - does not have the faintest idea that it is bound to anything, nor must it be bound to anything (you can have a value that is not bound to anything. Unfortunately the garbage collector will pick it up quite soon ...) If your design is based around the assumption that you want to associate some kind of name value, paul, or gordon, or whatever, with an object programmatically, by turning the name - ie paul - into a set-word! value programmatically - make set-word! :name - and then associating it with the port object, or whatever value, - name: "Paul" new-port: make set-word! :name new-port make port! port-object then you have a DESIGN BUG! Your idea was that by associating the set-word! (here Paul:) with the port-object! you would be able to follow this association backwards, from the port back to the set-word!, here Paul:. You cannot! It's a one-way street. paul -> port-object. Period. Now backwards following Got it? Now, can we talk about alternative methods? Hope this helps, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Need some url purification functions
Hi, if I understand your problem correctly, then the following code - adapted from REBOL's built-in net-utils (source net-utils) - should be helpful (Code follows after my sign-off). Usage: >> print mold url-parser/parse-url http://www.yahoo.com/sub-directory/filename.html make object! [ scheme: "http" username: none password: none host: "www.yahoo.com" port: none path: "sub-directory/" target: "temp.html" tag: none ] Hope this helps, Elan REBOL [] URL-Parser: make object! [ scheme: none user: none pass: none host: none port-id: none path: none target: none tag: none p2: none digit: make bitset! #{ FF03 } alpha-num: make bitset! #{ FF03FE07FE07 } scheme-char: make bitset! #{ 0068FF03FE07FE07 } path-char: make bitset! #{ F17FFFA7FFAFFE57 } user-char: make bitset! #{ F87CFF23FE87FE17 } pass-char: make bitset! #{ FFF9FEFFFEFF } url-rules: [scheme-part user-part host-part path-part file-part tag-part] scheme-part: [copy scheme some scheme-char #":" ["//" | none]] user-part: [copy user uchars [#":" pass-part | none] #"@" | none (user: pass: none)] pass-part: [copy pass to #"@" [skip copy p2 to "@" (append append pass "@" p2) | none]] host-part: [copy host uchars [#":" copy port-id digits | none]] path-part: [slash copy path path-node | none] path-node: [pchars slash path-node | none] file-part: [copy target pchars | none] tag-part: [#"#" copy tag pchars | none] uchars: [some user-char | none] pchars: [some path-char | none] digits: [1 5 digit] parse-url: func [ {Return url dataset or cause an error if not a valid URL} url ][ parse/all url url-rules return make object! compose [ scheme: (scheme) username: (user) password: (pass) host: (host) port: (port-id) path: (path) target: (target) tag: (tag) ] ] ] -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: ?
Hi SpliFF, 1. Try >> print 1 print 2 print 3 You'll get 1 2 3 which goes to show that - as a rule - REBOL evaluates from left to right, unless instructed to do otherwise. "Instructed to do otherwise" is a little cryptic, so here goes: >> return-string: does [print "ABC" return " A string! "] >> print trim return-string Left to right: First print is evaluated. The word print evaluates to a function that expects an argument. Aha. Let's fetch an argument for print, otherwise we cannot complete the evaluation. The next token in the input stream is the word trim. Now trim is evaluated. Hey, it's also a function, and the trim function also requires an argument. This argument must be a string. Let's look at the next token. The word return-string is evaluated. Oh my, it's also a function. Let's evaluate that function. The return-string function is now evaluated. During the evaluation of the return-string function first the string "ABC" is printed, because the function is being evaluated from left to right, and then return is evaluated, which is a function (actually a value of type native!) that requires an argument of type any-type! (any-type! includes the type unset! which is represented by no value, i.e. f: does [return] - return here with no argument - is legal) that returns the string " A string! ". (BTW, you do not *have* to use return here, since the last value of a block is returned by default, i.e. f: does [return "this"] is works the same as f: does ["this"]). trim is passed " A string! " as its argument, it is successfullly evaluated, and the result of evaluating it is passed to print. Regarding ? using help would be more useful in your case. You will see that ? is a function that expects a literal word ('word) as its argument. When ? is evaluated REBOL looks attempt to interpret the next token in the input stream as a word, and does not evaluate that word, because ? wants a literal word, i.e. the word itself, and not its value. So return-string is not evaluated, instead the literal word return-string is passed to ?. Hope this helps, Elan SpliFF wrote: > > I was wondering how '? (or 'help) can take a word as an input without the > word or it's function being evaluated first. Rebol evaluates from > right-to-left as in: > > >> return-string: does [ print "ABC" return " A string! "] > >> print trim return-string > ABC > A string! > > In that example 'return-string is evaluated first (I think), then 'trim, > then 'print. So what about: > > >> ? return-string > USAGE: > RETURN-STRING > > DESCRIPTION: > (undocumented) > > If this followed the same rule as before then the string "ABC" should have > been printed before the help text. Since '? isn't a native function I > can't see how it can break the standard convention. I thought > > >> source ? > > ... would provide an answer but the output just confused the hell outta > me. I have tried to write functions like this in the past but never had > any success. Clearly my concecpt of the standard convention must be wrong. > Could somebody clarify it for me in plain english please. > > SpliFF > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Advanced port stuff
Hi Paul, if I understand the documentation for dispatch correctly, then it does exactly what you are looking for. (See the pdf version of the /Core manual for a slightly more detailed explanation). Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Millennium + 1 ...
Hi Gabriele, 0 is the privileged neutral position of the counter, where left and right meet. Everything in a block is either to the left or to the right of the counter. Because there can be no element located at the privileged counter position, therefore pick block 0 always returns none. If you change that you create a mess. You create the exact same mess, whether you introduce 0 as the first index to the right or to the left. Case 1) The current situation: + == to the right - == to the left 1 == first 2 == second 3 == third 4 == fourth +1 first index to the right -1 first index to the left +2 second index to the right -2 second index to the left +3 third index to the right -3 third index to the left +4 fourth index to the right -4 fourth index to the left and so on Case 2) Introduce 0 in either direction, and you lose the simplicity of the scheme, it becomes counter-intuitive: Case 2a) 0 as first index of block 0 == first 1 == second 2 == third 0 first index to the right -1 first index to the left +1 second index to the right -2 second index to the left +2 third index to the right -3 third index to the left +3 fourth index to the right -4 fourth index to the left You see it becomes confusing in two respects: second maps to 1, third maps to two, and what is two steps away to my right is +1, whereas what is also two steps but to my left -2 not -1, i.e. chaos. Case 2b) 0 as first index preceding the first element of the block (the first negative index, i.e. to the left) +1 first index to the right 0 first index to the left +2 second index to the right -1 second index to the left +3 third index to the right -2 third index to the left +4 fourth index to the right -3 fourth index to the left What did you win versus case 2a)? It's the same mess in reverse. This time the counter-intuitive stuff is happening on the left, in the negative area. But you are still mapping second to 1, and third to 2, and you what on the right is +2 on the left is now -1. You lose the symmetry. Hope this makes it a little clearer, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Advanced port stuff
Hi Paul, 1. Andrew already pointed out a workable solution. > how do I determine which literal words are these objects referencing? 2. The objects do not reference the words. The words reference the objects. It's important to keep these things straight. 3. Your question bothers me. Why do you need to know which words reference these objects? I suspect that there may be a conceptual bug involved in your question. I.e. a more (REBOLlish) elegant = simpler solution may prevent this question from coming up altogether. What do you think? Elan Paul Tretter wrote: > > I know I may not get an answer to this unless it falls on some real REBOL gurus. >However, here goes... I got a series of port schemes each assigned to a unique word. > In turn I have appended these port assignments into a block called waitports. When >I probe waitports I get their repective object datatype structures. My questions is >how do I determine which literal words are these objects referencing? > > Paul Tretter > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Millennium + 1 ...
Hi Gabriele, however, the way it is implemented is more consistent for a different reason. >> a: [1 2 3 4];- (1) >> pick a 0 == none >> insert a [-4 -3 -2 -1] >> a: skip a 4 >> a == [1 2 3 4] >> pick a 0;- (2) == none (1) and (2) should be equivalent and they currently are. If you were to introduce 0 as the position that precedes the current position of the block, then (1) and (2) would not be equivalent and that would be confusing. Using whole numbers instead of natural numbers for indexing a block would be less user-friendly, because for the second element to be located at index 1 (etc.) is counter-intuitive. Looks to me like the current solution is the best compromise. At the cost of getting a none value at location 0, you avoid zero-indexed blocks (not user friendly), and you avoid inconsistent behavior that depends on whether or not the current block's position happens to be the head of the block. Gabriele Santilli wrote: > > Hello Ladislav! > > On 03-Gen-01, you wrote: > > LM> In a different wording: if I > LM> don't have zero, I can't get a negative number. > > This is a good point. We should let Carl know about this > problem... > > i: 1 > > pick series i > pick series i + 1 > pick series i - 1 ; ??? > > Regards, > Gabriele. > -- > Gabriele Santilli <[EMAIL PROTECTED]> - Amigan - REBOL programmer > Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/ > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Millenium Bug in "info?" function - returns bad date.
Hi Doug, Using my Linux box I ftp'd to a remote site and did an ls on that site. ls returned November and December dates without years. If you look at REBOL's ftp scheme you'll notice that when REBOL parses the returned date, if the parsed date < 3, then REBOL adds the current year. That's where the bug is (in the add-dates function that is embedded in the parse-files function of the ftp scheme.) The add-dates function, add-date: func [] [ month: first pdate system/words/remove pdate system/words/insert skip pdate 1 month if (length? pdate) < 3 [ system/words/append pdate now/year system/words/append pdate to-time time ] in addition to checking for the length of pdate should also check for the month's value, and append now/year - 1, if month > current-month. You can implement the changes yourself if you want. 1. Save the ftp prototype scheme to a file. 2. Make your changes in that file. 3. use net-utils net-install function to install your modified ftp prototocol. Hope this helps, Elan "Vos, Doug" wrote: > > I've found a bug in the info? function. Returns bad date. > > Example: > "info?" reports file date of 21-Dec-2001 for file created on 21-Dec-2000. > > Background: > In my production web-server environment I run Sun-Solaris. > My local Win-95 PC also runs REBOL/Core 2.3 and does some > remote maintenance of files, refreshing files and deleting old files every > night. > > After the Jan 2, 2001 I noticed that the remote file delete script was no > longer working. > Curious as to why I used probe to examine the results of info? via the ftp > connection > and discovered that the reason no old files were being deleted was because > all the files from Dec-2000 were now being intepreted as Dec-2001. > > I verified this in a file by file check with my other FTP tools. > > >> probe info? xfile > make object! [ > size: 1024 > date: 19-Dec-2001/14:27 > type: file > ] > >> > File ...COFG11214-201.txt... is -349 days old. > > NOTE: This file is actually dated 19-Dec-2000 > > Files are supposed to be deleted if older than 5 days, > so now this calculation does not work and I must delete old > files manually until I get a bug fix. > > This seems to be the case under REBOL/Core 2.2 and 2.3 > Info? does not appear to have this problem on local files, >but only when used via FTP. > > What is the real scope of this bug? Any other versions effected? > > Has anyone else seen problems like this? > > Any temporary work arounds? Suggestions? > > Douglas Vos - EDS/GM-BSU Webmaster > e-Mail: mailto:[EMAIL PROTECTED] > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Millenium Bug in "info?" function - returns bad date.
Hi Doug, Using my Linux box I ftp'd to a remote site and did an ls on that site. ls returned November and December dates without years. If you look at REBOL's ftp scheme you'll notice that when REBOL parses the returned date, if the parsed date < 3, then REBOL adds the current year. That's where the bug is (in the add-date function that is embedded in the parse-files function of the ftp scheme.) The add-date function, add-date: func [] [ month: first pdate system/words/remove pdate system/words/insert skip pdate 1 month if (length? pdate) < 3 [ system/words/append pdate now/year system/words/append pdate to-time time ] in addition to checking for the length of pdate should also check for the month's value, and append now/year - 1, if month > current-month. You can implement the changes yourself if you want. 1. Save the ftp prototype scheme to a file. 2. Make your changes in that file. 3. use net-utils net-install function to install your modified ftp prototocol. Hope this helps, Elan "Vos, Doug" wrote: > > I've found a bug in the info? function. Returns bad date. > > Example: > "info?" reports file date of 21-Dec-2001 for file created on 21-Dec-2000. > > Background: > In my production web-server environment I run Sun-Solaris. > My local Win-95 PC also runs REBOL/Core 2.3 and does some > remote maintenance of files, refreshing files and deleting old files every > night. > > After the Jan 2, 2001 I noticed that the remote file delete script was no > longer working. > Curious as to why I used probe to examine the results of info? via the ftp > connection > and discovered that the reason no old files were being deleted was because > all the files from Dec-2000 were now being intepreted as Dec-2001. > > I verified this in a file by file check with my other FTP tools. > > >> probe info? xfile > make object! [ > size: 1024 > date: 19-Dec-2001/14:27 > type: file > ] > >> > File ...COFG11214-201.txt... is -349 days old. > > NOTE: This file is actually dated 19-Dec-2000 > > Files are supposed to be deleted if older than 5 days, > so now this calculation does not work and I must delete old > files manually until I get a bug fix. > > This seems to be the case under REBOL/Core 2.2 and 2.3 > Info? does not appear to have this problem on local files, >but only when used via FTP. > > What is the real scope of this bug? Any other versions effected? > > Has anyone else seen problems like this? > > Any temporary work arounds? Suggestions? > > Douglas Vos - EDS/GM-BSU Webmaster > e-Mail: mailto:[EMAIL PROTECTED] > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Millenium Bug in "info?" function - returns bad date.
Hi Doug, Using my Linux box I ftp'd to a remote site and did an ls on that site. ls returned November and December dates without years. If you look at REBOL's ftp scheme you'll notice that when REBOL parses the returned date, if the parsed date < 3, then REBOL adds the current year. That's where the bug is (in the add-date function that is embedded in the parse-files function of the ftp scheme.) The add-date function, add-date: func [] [ month: first pdate system/words/remove pdate system/words/insert skip pdate 1 month if (length? pdate) < 3 [ system/words/append pdate now/year system/words/append pdate to-time time ] in addition to checking for the length of pdate should also check for the month's value, and append now/year - 1, if month > current-month. You can implement the changes yourself if you want. 1. Save the ftp prototype scheme to a file. 2. Make your changes in that file. 3. use net-utils net-install function to install your modified ftp prototocol. Hope this helps, Elan "Vos, Doug" wrote: > > I've found a bug in the info? function. Returns bad date. > > Example: > "info?" reports file date of 21-Dec-2001 for file created on 21-Dec-2000. > > Background: > In my production web-server environment I run Sun-Solaris. > My local Win-95 PC also runs REBOL/Core 2.3 and does some > remote maintenance of files, refreshing files and deleting old files every > night. > > After the Jan 2, 2001 I noticed that the remote file delete script was no > longer working. > Curious as to why I used probe to examine the results of info? via the ftp > connection > and discovered that the reason no old files were being deleted was because > all the files from Dec-2000 were now being intepreted as Dec-2001. > > I verified this in a file by file check with my other FTP tools. > > >> probe info? xfile > make object! [ > size: 1024 > date: 19-Dec-2001/14:27 > type: file > ] > >> > File ...COFG11214-201.txt... is -349 days old. > > NOTE: This file is actually dated 19-Dec-2000 > > Files are supposed to be deleted if older than 5 days, > so now this calculation does not work and I must delete old > files manually until I get a bug fix. > > This seems to be the case under REBOL/Core 2.2 and 2.3 > Info? does not appear to have this problem on local files, >but only when used via FTP. > > What is the real scope of this bug? Any other versions effected? > > Has anyone else seen problems like this? > > Any temporary work arounds? Suggestions? > > Douglas Vos - EDS/GM-BSU Webmaster > e-Mail: mailto:[EMAIL PROTECTED] > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Odd behavior using copy/part?
Hi Jeff, your problem is the following line (5 lines from the bottom of the code your included in your email): > copy: copy/part header 1 Here you are setting the word copy to the result of copy/part header 1 If you should encounter a problem like this again the easiest way of detecting it is by starting your code off with the function protect-system This will result in an error message when you attempt to set one of REBOL's predefined words to a new value, as is the case here. Pretty sure this helps ;-) Elan Jeff Rubin wrote: > > I have a function which reads the header of a binary file and extracts > certain bits for analysis. > It seems to work fine until > > home: copy/part header 1 > > Then it craps out. And the copy function which is Rebol native function > returns as a variable instead of copy. > You type Help Copy in Rebol/Command after this and it will tell you that > copy is either worth 8 or no help for copy or something similar. > > Which I find distressing, the only way to restore the copy command in > Rebol/Command is to close and restart. > > The solution I implemented was to kill at least half of the code below and > only extract info that was absolutely necessary instead of the whole thing. > > code snippet: > > variable: head variable > header: copy/part variable 4 > header: enbase/base header 2 ;changes it to true binary which is like > "101110010011" > sync: copy/part header 12 > header: skip header 12 > ID: copy/part header 1 > header: skip header 1 > layer: copy/part header 2 > header: skip header 3 > prot: copy/part header 1 > header: skip header 1 > bitrate: copy/part header 4 > header: skip header 8 > freq: copy/part header 2 > header: skip header 2 > pad: copy/part header 1 > header: skip header 1 > priv: copy/part header 1 > header: skip header 1 > mode: copy/part header 2 > header: skip header 2 > modext: copy/part header 2 > header: skip header 2 > copy: copy/part header 1 > header: skip header 1 > home: copy/part header 1 > header: skip header 1 > emphasis: copy/part header 1 > > Thanks, > > Jeff > > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: parse again
Hi Graham, Parsing is very simple. It takes a minimal effort. And you always know exactly what you are doing. If you are writing parse rules and any of these statements do not make sense, then you have uncovered a conceptual bug. For block parsing you should consult with Chapter 22 (REBOL Dialecting). A simple solution to your problem using block parsing would be: test: [9:00 am Get up 9:30 am Eat breakfast 10:00 am Read email] sp: does [prin " "] rule: [set t time! (prin t sp) set ampm word! (prin ampm sp) some [ set activity word! (prin activity sp) ] (prin newline)] >> parse test [some rule] 9:00 am Get up 9:30 am Eat breakfast 10:00 am read email Doing it with a string is not much more difficult: digits: charset "0123456789" test: {9:00 am Get up 9:30 am Eat breakfast 10:00 am read email} rule: [ (print "") begin: 1 2 digits ":" 2 digits end: (prin copy/part begin end) | here: skip (prin here/1) ] >> parse/all test [some rule] 9:00 am Get up 9:30 am Eat breakfast 10:00 am read email Hope that helps, Elan Graham Chiu wrote: > > On Wed, 27 Dec 2000 17:19:57 -0900 > Tim Johnson <[EMAIL PROTECTED]> wrote: > > > If so, Elan has a "tutorial" starting on page 330. > > If you don't, post a response and I will submit > > something. > > Hi Tim, > > I have Elan's book - but that chapter didn't help me much > with this problem which Andrew is suggesting is a bug or > limitation with 'to > > -- > Graham Chiu > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] For Your Entertainment
Hi folks, I just checked my email and found a nice interview excerpt on the K mailing list that I think is apropos and a lot of fun. It is from an interview with Eben Moglin by Jay Worthington, featured in Immaterial Incoroporated at http://www.immaterial.net/page.php3?id=44 WORTHINGTON: How long would you say Linux has been the best good? Five years? It seems like there's a whole world of consumers out there who don't feel themselves capable of judging whether Linux is a better good at all. MOGLEN: There are two possible ways of thinking about this question. One is, how long does it take the current user base to get to free software, and the other is how long does it take the current user base to be replaced by another user base. It's a transitional issue. In 1979, when I was working at IBM, I wrote an internal memo lambasting the Apple Lisa, which was Apple's first attempt to adapt Xerox PARC technology, the graphical user interface, into a desktop PC. I was then working on the development of APL2, a nested array, algorithmic, symbolic language, and I was committed to the idea that what we were doing with computers was making languages that were better than natural languages for procedural thought. The idea was to do for whole ranges of human thinking what mathematics has been doing for thousands of years in the quantitative arrangement of knowledge, and to help people think in more precise and clear ways. What I saw in the Xerox PARC technology was the caveman interface, you point and you grunt. A massive winding down, regressing away from language, in order to address the technological nervousness of the user. Users wanted to be infantilized, to return to a pre-linguistic condition in the using of computers, and the Xerox PARC technology's primary advantage was that it allowed users to address computers in a pre-linguistic way. This was to my mind a terribly socially retrograde thing to do, and I have not changed my mind about that. I lost that war in the early 1980s, went to law school, got a history PHD, did other things, because the fundamental turn in the technology - which we see represented in its most technologically degenerate form, which is Windows, the really crippled version. I mean, I use Xwindows every day on my free-software PCs; I have nothing against a windowing environment, but it's a windowing environment which is network transparent and which is based around the fact that inside every window there's some dialogue to have with some linguistic entity. WORTHINGTON: There's a command prompt in every window. MOGLEN: Exactly. And, of course, network transparency, a central idea of how to organize computers in the world so that what's behind your window might be a process on another computer is largely gone. The whole thing represents a very downmarket view of the way people and machines ought to interact. Perhaps REBOL is a better way to go than APL/2? Take Care, Elan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: An array of objects?
Vache, the reason you are having problems is because of the set-word notation you are using and the fact that you are not reducing your block. Here's what I mean: 1. reducing the block: block: [ make object! [ directions: [0 1 0 1] description: "You are in a dark cave." ] ] What do you have here? You do not have a block consisting of an object! You have a block consisting of the words make object! and an embedded block consisting of the words directions and description, the block [0 1 0 1] and the string "You are in a dark cave.". The length of block is 3, namely the word make, the word object! and the block containing the values you intend for the object: >> length? block == 3 Also try >> first block == make >> second block == object! >> third block == [ directions: [0 1 0 1] description: "You are in a dark cave." ] Compare to: block: reduce [ make object! [ directions: [0 1 0 1] description: "You are in a dark cave." ] ] REBOL will first reduce the block, which means that it evaluates the contents of the block. The reduce function returns a block that contains the evaluated contents of the block it was passed. The word block now references a block that indeed contains an object as you intended. >> length? block == 1 >> type? first block == object! 2. The set-word problem. Now, let's assume you were to use the following code (Note that I added reduce to your first first line): REBOL [] world: make block! reduce [ room1: make object! [ directions: [0 1 0 1] ; N S E W description:"You are in a dark cave!" ] room2: make object! [ directions: [1 0 0 1] description:"You are outside!" ] ] What you now have are two global words called room1 and room2. The block referenced by world now looks like this: >> print mold world [ make object! [ directions: [0 1 0 1] description: "You are in a dark cave." ] make object! [ directions [1 0 0 1] description: "You are outside." ] ] What's changed? The two set-words room1 and room2 are no longer contained in the block. You can now access the block as world/1/directions world/1/description world/2/directions world/2/description Hope this helps, Elan Vache wrote: > > For a text-based game (a MUD, essentially), I'm trying to create a system by which >the players can travel from room to room within the world, via. an array of rooms >(i.e. Room(1,1), Room(200,2) etc.). I thought this would be an easy task but I have >had trouble. How do you create arrays of objects in Rebol? > > I originally tried creating a block of objects, so I could access them like >world/1/description, but it errors (and it isn't in an array, which would makes >things harder down the road) > > --- > > world: make block! [ > > room1: make object! [ > > directions: [0 1 0 1] ; N S E W > description:"You are in a dark cave!" > > ] > > room2: make object! [ > > directions: [1 0 0 1] > description:"You are outside!" > > ] > > ] > > _ > Get free email ==> and Free Fun http://www.BlueJellybean.com > -- > To unsubscribe from this list, please send an email to > [EMAIL PROTECTED] with "unsubscribe" in the > subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.