r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Core] Discuss core issues

Gabriele
9-Jul-2007
[8442]
and to me it looks like you have the argument already.
Pekr
10-Jul-2007
[8443]
'attempt seems not to be able to catch file reading error. What am 
I doing wrong? Should I use if not error? try [] instead?
Rebolek
10-Jul-2007
[8444]
What do you mean Pekr, it seems OK to me:
>> attempt [read %no-file]
== none
Pekr
10-Jul-2007
[8445]
Rebolek - well, try to attempt [data: read/binary %some-larger-file] 
.... unplug your usb flash when file is being read ....
Rebolek
10-Jul-2007
[8446]
Then buffer the reading.
Pekr
10-Jul-2007
[8447]
yes, I know I could do that, but why read, as a native, is not catched 
when inside of attempt?
Louis
10-Jul-2007
[8448]
Does anyone remember the command for converting a binary file to 
a string so it can be sent by email?
Pekr
10-Jul-2007
[8449x3]
enbase/base?
read/binary should be ok ....
or just - why to care? use send/attach ...
Louis
10-Jul-2007
[8452x2]
Pekr, enbase/base is not what I had in mind. It was a special command 
that did not need a refinement, if I recall correctly.
I'm wanting to send a bunch of huge files to my son. I used this 
command awhile back to convert the files to text, then used compress 
to greatly shrink their size. Unfortunately I accidentally erased 
the source file for my script, and now can't remember the name of 
the command.
Graham
10-Jul-2007
[8454]
compress creates a binary file
Louis
10-Jul-2007
[8455x2]
Graham, sorry for the delay in communucating. The electricity went 
off here, and with it the Internet.
What I want to do in convert a binary file to a string.
Jerry
10-Jul-2007
[8457]
>> blk: [ delete none ]
== [delete none]
>> type? blk/1
== word!
>> type? blk/2
== word!  
;
; none is not of the none! type, unless it's been evaluated. 
; none is so-called indirect value in the REBOL/CORE doc at
; http://www.rebol.com/docs/core23/rebolcore-4.html
;
; In http://www.rebol.net/r3blogs/0034.html, 
; there is a so-called "Scant Evaluation"
;
>> obj: construct [ n: none d: delete ]
>> type? obj/d
== word!
>> type? obj/n
== none! 
; 
; WHY obj/n IS NOT OF THE WORD! TYPE ???
; The "Scant Evaluation" should not evaluate none here.
Louis
10-Jul-2007
[8458]
in headers (and in the construct function) both word lookup and function 
evaluation are disabled, but set-word (assignment) is not.
Jerry
10-Jul-2007
[8459]
Louis, I knew that. My question is ... why none (a word!, not a none!) 
is evaluated in this case. It should not. Notice that none is a word!. 
it has to be evaluated to become a none! That's why Carl called it 
"indirec value" in the REBOL/Core doc.
Louis
10-Jul-2007
[8460x2]
I see what you mean. The actuality seems to contradict those documents.

>> obj: construct [ n: none d: delete ]
>> probe obj
make object! [
    n: none
    d: 'delete
]


It seems that only potentially dangerous evaluation is prevented, 
and not all evaluation.


Scant Evaluation: A minimal form of evaluation used for headers and 
other data blocks that do not allow any level of deep evaluation.
  Perhaps the evaluation of none is not considered "deep."
Pekr, this is what I was looking for (I think): http://www.rebol.net/cookbook/recipes/0048.html


This seems to be related to what you were trying to tell me and I 
just didn't realize it.  Anyway thanks for your help!
Graham
10-Jul-2007
[8462x2]
http://www.rebol.net/cookbook/recipes/0026.html


This recipe says that a binary file is being sent.  I wonder how 
this works because the content type is url encoded, but there is 
not url encode function as a mezzanine by default.
And i don't think that rebol supports octet stream as content type.
Louis
10-Jul-2007
[8464]
Jerry, I found this:


The CONSTRUCT function will perform evaluation on the words TRUE, 
FALSE, NONE, ON, and OFF to produce their expected values. Literal 
words and paths will also be evaluated to produce their respective 
words and paths. For example:


    obj: construct [
        a: true
        b: none
        c: 'word
    ]


The obj/a value would be logical TRUE, obj/b would be NONE, and obj/c 
would be WORD.

file:///C:/SDK/docs/changes.html
Jerry
11-Jul-2007
[8465x5]
Louis, For TRUE, FALSE, NONE, I can understand ( however, it's not 
consistent ). But ... even ON and OFF? Why not YES and NO. ...
>> obj: construct [ a: on b: yes ]
>> probe obj
make object! [
    a: true
    b: 'yes
]
>> yes
== true
>> no
== false
>> on
== true
>> off
== false
Nothing should be evaluated in CONSTRUCT, except SET-WORD!, which 
is an inconsistency.


NONE, TRUE, FALSE, ON, and OFF are not SET-WORD!, but they are evaluated 
in CONSTRUCT, which is another inconsistency in an inconsistency.


YES and NO are not evaluated in CONSTRUCT, which is yet another inconsistency 
in another inconsistency in an inconsistency.

Inconsistency is no good.
I am not trying to be captious. I am trying to write some REBOL 3.0 
tutorial in Chinese. For now, I am working on the evaluation part. 
That's why I am so paranoiac on this. : )
Gabriele
11-Jul-2007
[8470x2]
Jerry, this is a "feature" of construct. the words NONE, TRUE and 
FALSE are converted to the respective values. it is done to allow 
construct to work correctly when /all is not used with mold.
in general, it is much better to use mold/all instead, but i know 
construct can give you headaches if you really want to have a word 
in there.
Rebolek
11-Jul-2007
[8472]
Gabriele so why TRUE and ON are evaluated, while YES is not?
Gabriele
11-Jul-2007
[8473x2]
bug?
actually, i don't think on should be evaluated. mold would never 
produce it.
Gregg
12-Jul-2007
[8475]
I wish there *were* an option to mold it. Sometimes I really want 
to use on/off or yes/no in files.
Henrik
16-Jul-2007
[8476]
my bitset creation skills are a bit rusty. how do I create a bitset 
that means 'anything but #" "' ?
Dockimbel
16-Jul-2007
[8477]
all-but-white-space: complement charset " "
Henrik
16-Jul-2007
[8478]
forgot about charset... thanks
Louis
17-Jul-2007
[8479]
How can I prevent a window from popping up when I have set security 
to none?
BrianH
17-Jul-2007
[8480x2]
Set it on the command line.
rebol -s args
Louis
17-Jul-2007
[8482x7]
Brian, thanks. I forgot to say that this is a script on XP operating 
system. I have the following line in the target field of a shortcut:

C:\.Alkitab\ftp-backup.r -s allow

But the window still pops up.
Hummm, I see that I have it after the script, instead of after rebol.
C:\Program Files\rebol\view\rebol.exe -s allow C:\.Alkitab\ftp-backup.r
 doesn't work either.
C:\Program Files\rebol\view\rebol.exe C:\.Alkitab\ftp-backup.r -s
  doesn't work either.
OK, I copied rebol to the same directory as the script, and now this 
works:

C:\.Alkitab\rebol.exe ftp-backup.r -s
Now, I have just one more problem to solved to be in business. I 
need the script to be run automatically in the background every 10 
minutes, then exit, but windows scheduled tasks can be run no more 
frequently then once a day.
What is the best solution for this problem?
ICarii
17-Jul-2007
[8489x3]
-> Properties -> Advanced -> set to every 10 minutes..
inside the scheduled task..
give it a daily end time and you're away laughing :)