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

World: r3wp

[Core] Discuss core issues

Henrik
6-Oct-2006
[5510]
Ladislav posted on 18. sep.: do you like this: any [1 true] ; == 
1 ?

I have a variant: any [false none] ; == none


Would it make more sense to return FALSE? It seems to me that FALSE 
should have precedence over NONE.
Gregg
6-Oct-2006
[5511]
False and none are treated the same in many cases, so I think it's 
fine the way it is; otherwise you have to consider all the other 
cases as well.
Henrik
6-Oct-2006
[5512]
well:

pick [do-this do-that] false ; == does 'do-that

pick [do-this do-that] none ; == error

This came from a function where I had a refinement:

f: func [/act] [
	pick [do-this do-that] act
]


You can't do that, since /act is none. Sure you can then use EITHER, 
if do-this and do-that are not necessarily in one block, but you 
couldn't extend the existing code with:


>> pick [do-this do-that] any [act false] ; == still none, which 
gives error

So you have to use something less clean like:

>> pick [do-this do-that] any [act 2]
Rebolek
6-Oct-2006
[5513]
you can do
>>pick [do-this do-that] found? any]
Ladislav
6-Oct-2006
[5514]
I pulled out the question, sorry, it was a misread at my side
Rebolek
6-Oct-2006
[5515]
argh, again:

>>pick [do-this do-that] found? act
Ladislav
6-Oct-2006
[5516]
I am content with it as it is
Henrik
6-Oct-2006
[5517]
rebolek, thanks. as long as there is a way to discern between none 
and false with one function
Ladislav
6-Oct-2006
[5518]
some interesting block "quirks":

    block1: #[block! [a b] -1] none
    block2: #[block! [a b] 4] none
    mold/all block1 ; == "#[block![a b]-1]"
    mold/all block2 ; == "#[block![a b]4]"
    index? block1 ; == -1
    index? block2 ; == 3
    length? block1 ; == 4
    length? block2 ; == 0
Maxim
6-Oct-2006
[5519x2]
all and any are extremely capable as they are.  and I  don't see 
why they should change.  all and any are NOT boolean operations, 
they are program flow just like if and either.
'ANY on returns a non false or non none value.  it does not return 
such a value from the block itself. if you specify only none and 
false value, it effectively assumes all is bad and returns none.


'ALL is the same, but will only return a value unless one value equates 
to false or none (in which case it considers the block a failure 
and returns its own value, not the value from the block itself).
Robert
9-Oct-2006
[5521]
Gab, the same applies for:

This doesn't look very consisten to me:

>> to-integer none
== 0
>> to-decimal none
** Script Error: Invalid argument: none
** Where: to-decimal
** Near: to decimal! :value
Gabriele
9-Oct-2006
[5522]
yes, i agree. i think other cases like that have been pointed out 
in the past.
Ladislav
9-Oct-2006
[5523x2]
I don't know how INDEX?/XY works. Help, please.
(is it meant for IMAGE! datatype?)
Rebolek
9-Oct-2006
[5525]
Ladislav: it seems so:

>> n: make image! 100x100
== make image! [100x100 #{
000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000...
>> n: skip n 300
== make image! [100x100 #{
000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000...
>> index?/xy n
== 0x3
Ladislav
9-Oct-2006
[5526]
thanks
Rebolek
9-Oct-2006
[5527]
I'm curious, if there's also some function for setting position in 
image! - something like AT/xy
Anton
9-Oct-2006
[5528]
There is:
>> at logo.gif 12x10
== make image! [100x24 #{
7C7C7CF5F5F5FEFEFEFEFEFEB5B5B5020202020202020202020202020202
020202020202BDBDBDFEFEFEFEFEFEF5F5F5A5A5A59B...
Rebolek
9-Oct-2006
[5529]
Ah, thanks

>> index?/xy at logo.gif 12x10
== 12x10
Louis
9-Oct-2006
[5530]
mail: read pop://user:[pass-:-mail-:-example-:-com]


How should the above line be written when the user name is an email 
address?
PeterWood
9-Oct-2006
[5531x2]
You should find the answer here: http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-topic-index.r?i=mail
or here: 

http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-thread.r?m=rmlFSJQ
Louis
10-Oct-2006
[5533x2]
Thank you, Peter!
Problem: no matter which email client I use, only 8 emails can be 
downloaded. On the 9th email the client locks up. What can I do about 
this? I am expecting some very important email.
PeterWood
10-Oct-2006
[5535x3]
Try dowloading DideC's excellent delete-mail program - http://membres.lycos.fr/didec/rebsite/delete-emails/delete-emails3.0.0.html
It will let you look at the headers of the mail in your mailserver's 
inbox.
You can delete messages that are causing problems before you dowload 
them.
Louis
10-Oct-2006
[5538]
Thanks, Peter. I'll try that and let you know what happens.
PeterWood
10-Oct-2006
[5539]
There''s a more up-to-date version at http://membres.lycos.fr/didec/rebsite/delete-emails/delete-emails.r
Louis
10-Oct-2006
[5540x7]
Some code is missing in DideC's script.
Whoops. Didn't see your post in time.
Error message says the site might be down.
No. It opens now.
I'm not having much sucess today. I downloaded it, but it dies instantly 
when I try to fetch my mail.

Erro Signature
AppName: rebol.exe	 AppVer: 1.3.2.3	 ModName: rebol.exe
ModVer: 1.3.2.3	 Offset: 00031983
That is a windows error message, and just the first part of it.
Is that script working for anyone else? I mean that version of the 
script?
PeterWood
10-Oct-2006
[5547]
I run version 3.1.1 with Rebol 1.2.10
Louis
10-Oct-2006
[5548]
I'm running: REBOL/View 1.3.2.3.1 5-Dec-2005 Core 2.6.3

I'll see if I have an older version on my harddrive somewhere.
PeterWood
10-Oct-2006
[5549]
I also downloaded the latest version and got a similar error on 1.3.2.
Anton
11-Oct-2006
[5550]
Louis, try this:

do http://anton.wildit.net.au/rebol/util/preview-mail/preview-mail.r
Oldes
11-Oct-2006
[5551x2]
Script: "view-message" (2-Aug-2006)
connecting to: anton.wildit.net.au
** Script Error: Cannot use path on none! value
** Where: open-window
** Near: win-pos: prefs/data/win-pos
if all [block? win-pos main-pos: win-pos/main]
system/version == 1.3.2.3.1
Anton
11-Oct-2006
[5553x3]
Thank you Oldes. It looks like the problem is that somewhere there 
is an assumption that the prefs have loaded from disk. Hang on...
Ok, bug fixed.  Try again, Louis.
(The script is now one word shorter - I love bug fixes like that. 
:)
PeterWood
11-Oct-2006
[5556]
I managed to get a working copy of Didec's delete-emails to Louis 
by pasting it in a private message. It seems to have allowed him 
to resolve his problem.
Anton
11-Oct-2006
[5557]
Ok, very good.
Louis
11-Oct-2006
[5558]
PeterWood and Anton, many thanks! It turned out that one of my children 
sent me a file with many huge photos. The very slow dialup connection 
I have here in Indonesia could not (or perhaps is designed to not) 
handle it. I was able to delete the file and all is well, except 
that now I can't look at the photos, at it cost me two days trying 
to solve the problem. I probably could not have solved it at all 
without you guys.
Ladislav
13-Oct-2006
[5559]
User poll