[REBOL] Recursion, rebol crash, and variable visibility once again ...
Hi, I know it was discussed several times already here, but I would like someone to clear things a little bit for me here: I tried to write a function, which looks for some file, on a path given. I use recursion, but Rebol is not able to scan my root directory, something has to overflow somewhere in memory, and I anticipate I am doing something wrong. The calling convention is as follows: - find-on-path %/D/ %Netscape.exe; will look for the file on the path given - find-on-path/subdirs %/D/ %Netscape.exe ; will scan all subdirectories too find-on-path: func [{Find file on given path ... (end dir entries with "/")} path file /subdirs "Scan also subdirectories " /local dir-list reduced-dir-list ][ print ["Scanning: " path] dir-list: copy [] dir-list: load path either found? find dir-list file [ print [file "nalezen na ceste: " path] return path ][ either not subdirs [return none][ reduced-dir-list: copy [] ; let's reduce dir-list to contain directories only ... foreach dir-or-file dir-list [if dir? join path dir-or-file [insert reduced-dir-list dir-or-file]] dir-list: copy reduced-dir-list reduced-dir-list: copy [] foreach dir dir-list [ result: find-on-path/subdirs join path dir file if not none? result [return result] ] return none ; I tried also unset 'dir-list in front of return none here ] ] ] I tried mereyl everything - I am clearing block, initialising them with copy [], setting them as local variables, unsetting blocks, etc. I don't know, where it is overflowing, as dir structure is not so much nested. I remember some discussion on 'foreach making copy of series given? Uh, could anyone help, please? Also, is there any chance to have only directories in the resulted block after loading a path? What does happen in the memory during the recursive call? Is body of function in memory just once, reserving just separate space for each local var, or? Thanks, -pekr-
[REBOL] Using REBOL With Microsoft Personal Web Server Re:(2)
Thanks Sterling. I tried the Windows 95 setup as discribed, but am haveing the same results. I'll need to go back and double check my entries to see if I might have made a mistake in setting it up. I appreciate the NT information as well because thats the next step in my learning schedule. If I can get it to work with PWS I'll use that for a learning platform. Then once I begin to feel comfortable with REBOL I'll start using scripts on our NT intranet server. Again, thank you for the help. Paul From: [EMAIL PROTECTED] We will be adding this info to the CGI How-to soon: Please let me know if you find you had to do something else to get it to work, what that was, and why. Here's the basic Win**, PWS/IIS setup info... thanks to the folks working on PHP who took the time to figure this all out. :) ... __ Get Your Private, Free Email at http://www.hotmail.com
[REBOL] Recursion, rebol crash, and variable visibility once again ... Re:
Hi Petr, Try the release 2.2 when available. That should work better for you. Your program seemed to work find searching my 12Gig drive - jim At 12:59 PM 11/2/99 +0100, you wrote: Hi, I know it was discussed several times already here, but I would like someone to clear things a little bit for me here: I tried to write a function, which looks for some file, on a path given. I use recursion, but Rebol is not able to scan my root directory, something has to overflow somewhere in memory, and I anticipate I am doing something wrong. The calling convention is as follows: - find-on-path %/D/ %Netscape.exe; will look for the file on the path given - find-on-path/subdirs %/D/ %Netscape.exe ; will scan all subdirectories too find-on-path: func [{Find file on given path ... (end dir entries with "/")} path file /subdirs "Scan also subdirectories " /local dir-list reduced-dir-list ][ print ["Scanning: " path] dir-list: copy [] dir-list: load path either found? find dir-list file [ print [file "nalezen na ceste: " path] return path ][ either not subdirs [return none][ reduced-dir-list: copy [] ; let's reduce dir-list to contain directories only ... foreach dir-or-file dir-list [if dir? join path dir-or-file [insert reduced-dir-list dir-or-file]] dir-list: copy reduced-dir-list reduced-dir-list: copy [] foreach dir dir-list [ result: find-on-path/subdirs join path dir file if not none? result [return result] ] return none ; I tried also unset 'dir-list in front of return none here ] ] ] I tried mereyl everything - I am clearing block, initialising them with copy [], setting them as local variables, unsetting blocks, etc. I don't know, where it is overflowing, as dir structure is not so much nested. I remember some discussion on 'foreach making copy of series given? Uh, could anyone help, please? Also, is there any chance to have only directories in the resulted block after loading a path? What does happen in the memory during the recursive call? Is body of function in memory just once, reserving just separate space for each local var, or? Thanks, -pekr-
[REBOL] Recursion, rebol crash, and variable visibility once again ... Re:
[EMAIL PROTECTED] wrote: foreach dir-or-file dir-list [if dir? join path dir-or-file [insert reduced-dir-list dir-or-file]] above line cuases my problems :-) It crashes everytimes on the same directory. There is no strange file in it :-) I replaced it with "if (last to-string dir-or-file) == #"/" " and it seems to work so far maybe 'dir? seems to be too much for Rebol for thousands of files??? But examples at: http://www.rebol.com/user-guide/f_dir.html work, so? :-) -pekr-
[REBOL] http server... Re:
Could someone answer this please? I'd like to use Rebol to connect, and *know* that it will. Thanks, Kat - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, October 23, 1999 11:14 PM Subject: [REBOL] http server... Hey all, I wrote a server that accepts http requests, and displays the data the requestor is sending,, and sends the files. Ok, when i connect with Internet Explorer 5 using this url: http://localhost/d:/aliases/tests.txt it shows: temp = GET /d:/aliases/tests.txt HTTP/1.1 temp = Accept: */* temp = Accept-Language: en-us temp = Accept-Encoding: gzip, deflate temp = User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt) temp = Host: localhost temp = Connection: Keep-Alive and IE5 shows the file. But when i use this line in Rebol: print read http://localhost/d:/aliases/tests.txt the server shows this: temp = GET /d:/aliases/tests.txt HTTP/1.0 temp = Accept: */* temp = User-Agent: REBOL 2.1.2.3.1 temp = Host: localhost temp = and Rebol prints this: connecting to: localhost ** Script Error: Invalid argument: {. ** Where: make integer! value The first "line" in the file is: maskhextodns { and i say "line" in quotes because there *may* not be a CRLF, or just the CR or LF. How can i read this file without Rebol trying to execute it? I also tried "read/binary" and "read /binary" , /string , /direct , /lines , and then i gave up. What is it? Also, the line when IE5 connects that shows "Connection: Keep-Alive" is blank in the Rebol connect, shouldn't Rebol spec the connection? I've also served html web pages downloaded from the net, and IE5 displays them properly when i http://localhost , but Rebol still won't get the files. Kat
[REBOL] http server... Re:(2)
Hi Kat, I don't know the precise answer to your question but will try to offer something. The lack of replies could be due to confusion over just what you are asking. Specifically that line "maskhextodns { ..." that you refer to, it doesn't look like any HTML I've seen. That's in your HTML file that you're trying to serve?? Plain old 'read should do the http:// read just fine... I've used it many times... if it's truly an HTML file. Try reading some other page right off the web, as: page: read http://www.rebol.com == {!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN" HTML HEAD ^-META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=i... type? page == string! length? page == 10839 Here's something I would suggest: create a SIMPLE HTML file to serve... and see if the problem persists. That might at least help pin down if it's the server, REBOL, the file or what that's causing the problem, and where. HTMLHEAD/HEADBODYTEST/BODYHTML Try that. Then try it with some line-feeds after some of the elements: HTML HEAD/HEAD BODY TEST /BODY /HTML Does it serve both of these files ok to REBOL and IE? Perhaps with those results I or someone else can help you more. Russ - At 09:27 AM 11/2/99 -0600, you wrote: Could someone answer this please? I'd like to use Rebol to connect, and *know* that it will. Thanks, Kat - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, October 23, 1999 11:14 PM Subject: [REBOL] http server... Hey all, I wrote a server that accepts http requests, and displays the data the requestor is sending,, and sends the files. Ok, when i connect with Internet Explorer 5 using this url: http://localhost/d:/aliases/tests.txt it shows: etc...
[REBOL] Colors Re:(9)
[EMAIL PROTECTED] wrote: My most esteemed colleague! With what wit and mirth have thy rejoinders retrograded on our shared vector! Thy sweet phrases lilt on the delicate ebb and flow of the time-space continuum. I implore thee, take no offense to my parries. hmmnn... Sounds like something a little MicroSoft CD trapshooting could heal ;-0 Naw.. Bo just had to have the last word, that's all. (-: And that's A-OK with me! ;-) Let's shoot the windows... Steve so is the on-topic the 'Colors' of speech? -jeff ( gumming up the mailing list with needless goofin -- (-; )
[REBOL] input? problem
Hello. Next problem. input? doesn't work correctly when stdin was redirect to file. (or I am so mixed? ;-) simple script: --%aam.r-- REBOL [] print input? print ["1:" input] print ["2:" input] while [input?] [print input] quit --end of %aam.r-- and this testing file: --%mailik-- From [EMAIL PROTECTED] Mon Nov 1 14:11:21 1999 Date: Mon, 1 Nov 1999 15:02:08 +0100 (CET) From: Jan Strejcek [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: ugh -- Jan Strejcek [EMAIL PROTECTED] --end of %mailik-- and when I write on my linux (with 2.1.2.4.1, but new beta makes it too): $rebol -wq aam.r mailik false 1: From [EMAIL PROTECTED] Mon Nov 1 14:11:21 1999 2: Date: Mon, 1 Nov 1999 15:02:08 +0100 (CET) $ well, why false when input isn't empty? How can I figure out if input is empty or isn't? next problem is whe I run it without -w: $rebol -q aam.r mailik false 1: 0 (CET) 2: From: Jan Strejcek [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: ugh -- Jan Strejcek [EMAIL PROTECTED] none none none none none none none none none none ...until ^C or something like this. what's even more strange is that $rebol -q aam.r mailik | more false 1: From [EMAIL PROTECTED] Mon Nov 1 14:11:21 1999 2: Date: Mon, 1 Nov 1999 15:02:08 +0100 (CET) $ and finished. Simply, redirectiong output makes difference!!! (also for new beta too) Why? Regards, Jan
[REBOL] 2.2 released
Some distributions of the released 2.2 have been posted... - jim
[REBOL] http server... Re:(3)
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 02, 1999 10:36 AM Subject: [REBOL] http server... Re:(2) Hi Kat, I don't know the precise answer to your question but will try to offer something. The lack of replies could be due to confusion over just what you are asking. Specifically that line "maskhextodns { ..." that you refer to, it doesn't look like any HTML I've seen. That's in your HTML file that you're trying to serve?? Doesn't. I downloaded several web pages, IE5 showed them fine from the web and from my server, and hung on them from my server. Other people using various non-Rebol web browsers http'd me, and read the files ok too. I typed this in IE5: http://localhost/Autism/Asperger's%20Syndrome%20and%20Making%20Sense.htm and this happens in the status window in the server: .. HTTPD is now ON .. - Connecting ip: 127.0.0.1 Filename req: e:\Autism\Asperger's Syndrome and Making Sense.htm .. 11/02/99 11:02:40pm Sending "e:\Autism\Asperger's Syndrome and Making Sense.htm" ; 185,462 bytes. .. - Connecting ip: 127.0.0.1 Filename req: e:\Autism\Asperger's Syndrome and Making Sense_files\background2.gif .. 11/02/99 11:02:40pm Sending "e:\Autism\Asperger's Syndrome and Making Sense_files\background2.gif" ; 2,656 bytes. .. .. 11/02/99 11:02:40pm Done sending "e:\Autism\Asperger's Syndrome and Making Sense_files\background2.gif" : 2,656 bytes. .. - Connecting ip: 127.0.0.1 Filename req: e:\Autism\Asperger's Syndrome and Making Sense_files\title.gif .. 11/02/99 11:02:40pm Sending "e:\Autism\Asperger's Syndrome and Making Sense_files\title.gif" ; 4,498 bytes. .. .. 11/02/99 11:02:40pm Done sending "e:\Autism\Asperger's Syndrome and Making Sense_files\title.gif" : 4,498 bytes. .. .. Transmission time: 1 sec. Speed: 4,498 bytes/sec. .. - Connecting ip: 127.0.0.1 Filename req: e:\Autism\Asperger's Syndrome and Making Sense_files\hubert.jpg .. 11/02/99 11:02:41pm Sending "e:\Autism\Asperger's Syndrome and Making Sense_files\hubert.jpg" ; 7,828 bytes. .. .. 11/02/99 11:02:41pm Done sending "e:\Autism\Asperger's Syndrome and Making Sense_files\hubert.jpg" : 7,828 bytes. .. .. Transmission time: 0 sec. Speed: bytes/sec. .. - Connecting ip: 127.0.0.1 Filename req: e:\Autism\Asperger's Syndrome and Making Sense_files\newaward.gif .. 11/02/99 11:02:41pm Sending "e:\Autism\Asperger's Syndrome and Making Sense_files\newaward.gif" ; 8,122 bytes. .. .. 11/02/99 11:02:41pm Done sending "e:\Autism\Asperger's Syndrome and Making Sense_files\newaward.gif" : 8,122 bytes. .. .. Transmission time: 0 sec. Speed: bytes/sec. .. - Connecting ip: 127.0.0.1 Filename req: e:\Autism\Asperger's Syndrome and Making Sense_files\mhnet11.gif .. 11/02/99 11:02:41pm Sending "e:\Autism\Asperger's Syndrome and Making Sense_files\mhnet11.gif" ; 4,332 bytes. .. .. 11/02/99 11:02:41pm Done sending "e:\Autism\Asperger's Syndrome and Making Sense_files\mhnet11.gif" : 4,332 bytes. .. .. Transmission time: 0 sec. Speed: bytes/sec. .. .. 11/02/99 11:02:41pm Done sending "e:\Autism\Asperger's Syndrome and Making Sense.htm" : 185,462 bytes. .. .. Transmission time: 1 sec. Speed: 185,462 bytes/sec. .. - Connecting ip: 127.0.0.1 Filename req: e:\Autism\Asperger's Syndrome and Making Sense_files\contents.gif .. 11/02/99 11:02:41pm Sending "e:\Autism\Asperger's Syndrome and Making Sense_files\contents.gif" ; 1,804 bytes. .. .. 11/02/99 11:02:41pm Done sending "e:\Autism\Asperger's Syndrome and Making Sense_files\contents.gif" : 1,804 bytes. .. - Connecting ip: 127.0.0.1 Filename req: e:\Autism\Asperger's Syndrome and Making Sense_files\whatismindblindness.gif .. 11/02/99 11:02:41pm Sending "e:\Autism\Asperger's Syndrome and Making Sense_files\whatismindblindness.gif" ; 3,001 bytes. .. .. 11/02/99 11:02:41pm Done sending "e:\Autism\Asperger's Syndrome and Making Sense_files\whatismindblindness.gif" : 3,001 bytes. .. - Connecting ip: 127.0.0.1 Filename req: e:\Autism\Asperger's Syndrome and Making Sense_files\examplesofmindblindness.gif .. 11/02/99 11:02:41pm Sending "e:\Autism\Asperger's Syndrome and Making Sense_files\examplesofmindblindness.gif" ; 3,254 bytes. .. .. 11/02/99 11:02:41pm Done sending "e:\Autism\Asperger's Syndrome and Making Sense_files\examplesofmindblindness.gif" : 3,254 bytes. .. - Connecting ip: 127.0.0.1 Filename req: e:\Autism\Asperger's Syndrome and Making Sense_files\aspergers.jpg .. 11/02/99 11:02:42pm Sending "e:\Autism\Asperger's Syndrome and Making Sense_files\aspergers.jpg" ; 29,608 bytes. .. - Connecting ip: 127.0.0.1 Filename req: e:\Autism\Asperger's Syndrome and Making Sense_files\thedevastatingeffects.gif .. 11/02/99 11:02:42pm Sending "e:\Autism\Asperger's Syndrome and Making Sense_files\thedevastatingeffects.gif" ; 3,141 bytes. .. .. 11/02/99 11:02:42pm Done sending "e:\Autism\Asperger's Syndrome and Making Sense_files\thedevastatingeffects.gif" : 3,141 bytes. .. .. 11/02/99 11:02:42pm Done sending
[REBOL] Re: Purpose of [REBOL] at the start of All subject lines sent to list@rebol.com
Hello, On 27-Oct-99, [EMAIL PROTECTED] wrote: Hi, One thing I find bothersome is the [REBOL]'s at the start of the headers. I use Outlook98 to read email, for many reasons that I don't what to debate :-) I like to use it's threaded message view(By Conversation Topic), but because of the way the subject headers are structured I can't. Could someone please explain to me why the [REBOL] is at the start and the Re:'s are at the end of the subject message? I don't want a flame war, just some understanding. As for the [REBOL], I like it, I can see at a glance which ML a mail is from (I'm on several), particularly if there was a problem in filtering to folders. For the Re:, it's location is actually a function of the various mailers. YAM on the Amiga puts it at the beginning of the subject after dropping the [REBOL], which SELMA puts back on the front Elliott
[REBOL] Re: Rethink - new real markets (was) Rebol website update :-) Re:(12)
Hello, On 28-Oct-99, [EMAIL PROTECTED] wrote: Hi Steve, What I've done is certainly NOT something one could slip into an application and have the full functionality of TCP/IP/SLIP (or PPP) for client and server that you seek. Sorry if I seemed to imply that. What I have done, mostly to see what could be done and to learn the raw elements of PPP/IP/UDP/TCP, was to program PARTS of these variously in VB, C and Assembly language and test them on a Win/PC, Linux and a PIC16C84. I began ---snip--- I think the small footprint, integrated networking, and powerful/flexible syntax of REBOL has attracted a number of us "low end" application people, in the hope that it might offer the best of many worlds for our applications. Russ PS -- Perhaps further discussion of this should be done off this list, as I'm not sure that many here are interested in these topics, and I think REBOL's position is now clear. Anyone interested may feel free to Email me directly. Well I thought it was interesting, even if I am 300-400 mails behind after our weekend trip to a Hamfest in St. Paul. Elliott
[REBOL] Re: Everything is relative... hmmm... Re:(2)
Hello, On 28-Oct-99, [EMAIL PROTECTED] wrote: relativity theory and REBOL, other than the word "relative". (Besides, as far as I remember, "Relative Expression-Based Object Language" was made up _after_ the name "REBOL" was decided upon...) I don't know about this, but I do remember reading about Carl and Lava before Rebol. Was this a simple name change or a change in the whole concept? Elliott
[REBOL] Re: epoch? Re:(2)
Hello, On 28-Oct-99, [EMAIL PROTECTED] wrote: While we're on the subject of optimization, how about this? now - 1-1-1970 * 86400 In Perl *shudder* and Unix, you can use the number of seconds from the Epoch (January 1, 1970) in programs. How can I do this in Rebol; i.e. get the number of seconds from the Epoch? I didn't try the intermediate one, but this, run several times, gives: now - 1-1-1970 * 86400 == 941500800 now - 1-1-1970 * 86400 == 941500800 now - 1-1-1970 * 86400 == 941500800 now - 1-1-1970 * 86400 == 941500800 now - 1-1-1970 * 86400 == 941500800 If we're talking seconds from epoch, why do these all give the same results when run a few seconds apart? Elliott
[REBOL] Re: Rebol website update :-) Re:(8)
Hello, On 26-Oct-99, [EMAIL PROTECTED] wrote: On 26-Oct-99, [EMAIL PROTECTED] wrote: Hey, I know, let's port REBOL to the C=64 and Apple ][ ;-) Sure, I just have to Scotch tape 4 6502s together and I'll have 32-bit, right? Yeah, and 256k RAM. Elliott
[REBOL] Re: Faxing in REBOL Re:(6)
Hello, On 27-Oct-99, [EMAIL PROTECTED] wrote: Andrew wrote: Rachid joked: I was just thinking about that yesterday. I was listening to my voicemail and I thought: "Wouldn't it be real easy to program it in Rebol? It could have it's own dialect." What's so funny? ^_^ Just use the upcoming REBOL/Command? find a speech synthesiser and C/C++ compiler and you're in business! For a speech synthesizer we could use the Amiga's internal synthesizer, no prob, just redirect Rebol strings to the Amiga 'say' command and we're done! If we forget about voice input, of course... I just thought Rebol would be really suited for it, no joke! =) For those of us that got it from OS 1.3 (or 2.0?). 3.0-3.1 never came with it, and I bet 3.5 doesn't either (or does Aminet have a full speech system rather than individual replacement parts?). Elliott
[REBOL] Everything is relative... hmmm... Re:(4)
[EMAIL PROTECTED] wrote: Hello, On 28-Oct-99, [EMAIL PROTECTED] wrote: relativity theory and REBOL, other than the word "relative". (Besides, as far as I remember, "Relative Expression-Based Object Language" was made up _after_ the name "REBOL" was decided upon...) I don't know about this, but I do remember reading about Carl and Lava before Rebol. Was this a simple name change or a change in the whole concept? Why should Carl change something he strongly believes in? LAVA stood for: Language for Audio Visual Applications??? IIRC, Carl was talking about similarity of names with Java. Now LAVA! is some Sound Blaster technology or what :-) Regards, -pekr- Elliott
[REBOL] Problems with parse
Hello! I'm having problems when I try to extract the URL and label in a bookmark file using the parse command. Could someone help me with this problem. It would also help if someone could explain the parse command in general as I have problems understanding the syntax. Best Regards, Peter Carlsson Peter CarlssonTel: +46 31 735 45 26 Saab Ericsson Space ABFax: +46 31 735 40 00 S-405 15 Göteborg Email: [EMAIL PROTECTED] SWEDENURL: http://www.space.se