to pair! bug
[1/14] from: rotenca::telvia::it at: 20-Apr-2002 14:08
This is ok:
>> to integer! "ww"
** Script Error: Invalid argument: ww
** Near: to integer! "ww"
This is the bug:
>> to pair! "ww"
== none
---
Ciao
Romano
[2/14] from: g:santilli:tiscalinet:it at: 20-Apr-2002 16:17
Hi Romano,
On Saturday, April 20, 2002, 2:08:48 PM, you wrote:
RPT> This is the bug:
>>> to pair! "ww"
RPT> == none
Well, for that matter:
>> to date! "ww"
** Script Error: Invalid argument: ww
** Where: halt-view
** Near: to date! "ww"
>> to time! "ww"
== none
which is rather inconsistent to me too. But maybe there's a reason
for that... Carl? Are you reading?
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[3/14] from: rotenca:telvia:it at: 21-Apr-2002 1:16
Hi, Gabriele
have you tryied all the datatypes? Pair and time are the only one?
---
Ciao
Romano
[4/14] from: g:santilli:tiscalinet:it at: 21-Apr-2002 11:59
Hi Romano,
On Sunday, April 21, 2002, 1:16:41 AM, you wrote:
RPT> have you tryied all the datatypes? Pair and time are the only one?
I didn't. But we can try:
(hmm, got a crash; seems like TO does not like some datatypes...
oh, maybe it was routine! let's avoid types we don't need to check)
>> str: ""
== ""
>> for ch #"^(00)" #"^(FE)" 1 [insert tail str ch]
== ""
>> datatypes: []
== []
>> foreach value second system/words [if datatype? get/any 'value [insert tail datatypes
value]]
== none
>> print datatypes
unset error datatype native action routine op function object struct
library port any-type any-word any-function number series any-string
any-block symbol word set-word get-word lit-word refinement none logic
integer decimal money time date char pair event tuple bitset string issue
binary file email url image tag block paren path set-path lit-path hash list
>> problem: reduce [routine! struct! library! port! any-type! any-word! any-function!
number! series! any-string! any-block! event! string!]
== [routine! struct! library! port! any-type! any-word!
any-function! number! series! any-string! any-block! event! string!]
>> foreach datatype datatypes [prin [mold datatype ": "] either error? res: try [to datatype
str] [print "Error."] [print ["Gives" type? :res]]]
unset! : Error.
error! : Error.
datatype! : Error.
native! : Error.
action! : Error.
op! : Error.
function! : Error.
object! : Error.
symbol! : Gives symbol
word! : Gives word
set-word! : Gives set-word
get-word! : Gives get-word
lit-word! : Gives lit-word
refinement! : Gives refinement
none! : Gives none
logic! : Gives logic
integer! : Error.
decimal! : Error.
money! : Error.
time! : Gives none
date! : Error.
char! : Error.
pair! : Gives none
tuple! : Error.
bitset! : Gives bitset
issue! : Gives issue
binary! : Gives binary
file! : Gives file
email! : Gives email
url! : Gives url
image! : Gives image
tag! : Gives tag
block! : Gives block
paren! : Gives paren
path! : Gives path
set-path! : Gives set-path
lit-path! : Gives lit-path
hash! : Gives hash
list! : Error.
To notice:
time! : Gives none
pair! : Gives none
And:
list! : Error.
while other block types did work (but returned an empty series,
maybe because confused by the null character).
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[5/14] from: rotenca:telvia:it at: 21-Apr-2002 21:37
Hi Gabriele
> list! : Error.
>
> while other block types did work (but returned an empty series,
> maybe because confused by the null character).
>> to-block to-string #"^(00)"
== []
>> length? to-block to-string #"^(00)"
== 0
But
>> to-block to-string #"^(01)"
== [-ç]
and
> to-block #"^(00)"
== [#"^@"]
---
Ciao
Romano
[6/14] from: rotenca:telvia:it at: 21-Apr-2002 21:34
Thank you Gabriele for the work.
> symbol! : Gives symbol
Interesting.
> none! : Gives none
Mhhhh, everything can become none?
> image! : Gives image
But always an image sized 0x0 and I do not know ho to change image/size, do
you know it?
---
Ciao
Romano
----- Original Message -----
From: "Gabriele Santilli" <[g--santilli--tiscalinet--it]>
To: "Romano Paolo Tenca" <[rebol-list--rebol--com]>
Sent: Sunday, April 21, 2002 11:59 AM
Subject: [REBOL] Re: to pair! bug
> Hi Romano,
> On Sunday, April 21, 2002, 1:16:41 AM, you wrote:
<<quoted lines omitted: 9>>
> == []
> >> foreach value second system/words [if datatype? get/any 'value [insert
tail datatypes value]]
> == none
> >> print datatypes
<<quoted lines omitted: 4>>
> binary file email url image tag block paren path set-path lit-path hash list
> >> problem: reduce [routine! struct! library! port! any-type! any-word!
any-function! number! series! any-string! any-block! event! string!]
> == [routine! struct! library! port! any-type! any-word!
> any-function! number! series! any-string! any-block! event! string!]
> >> foreach datatype datatypes [prin [mold datatype ": "] either error? res:
try [to datatype str] [print "Error."] [print ["Gives" type? :res]]]
> unset! : Error.
> error! : Error.
<<quoted lines omitted: 43>>
> maybe because confused by the null character).
>> to-block to-string #"^(00)"
== []
>> length? to-block to-string #"^(00)"
== 0
But
>> to-block to-string #"^(01)"
== [-ç]
and
[7/14] from: g:santilli:tiscalinet:it at: 22-Apr-2002 12:55
Hi Romano,
On Sunday, April 21, 2002, 9:34:48 PM, you wrote:
>> symbol! : Gives symbol
RPT> Interesting.
Yup. But I was never able to understand what it is, and why it is
available in system/words as IIRC Holger once said is an internal
thing only (like end!, context! etc.).
>> none! : Gives none
RPT> Mhhhh, everything can become none?
Once Jeff wrote something like: "this is a puzzle for you: what is
to-none useful for?". I was never able to solve the puzzle.
>> image! : Gives image
RPT> But always an image sized 0x0 and I do not know ho to change image/size, do
RPT> you know it?
Never tried. I think you can only make images from binaries with:
>> img: make image! [1x1 #{000000}]
== make image! [1x1 #{000000}]
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[8/14] from: rotenca:telvia:it at: 22-Apr-2002 18:31
Hi Gabriele
> >> none! : Gives none
> RPT> Mhhhh, everything can become none?
>
> Once Jeff wrote something like: "this is a puzzle for you: what is
> to-none useful for?". I was never able to solve the puzzle.
to none :-)
> >> image! : Gives image
> RPT> But always an image sized 0x0 and I do not know ho to change
image/size, do
> RPT> you know it?
>
> Never tried. I think you can only make images from binaries with:
>
> >> img: make image! [1x1 #{000000}]
> == make image! [1x1 #{000000}]
>> img: make image! "000000"
== make image! [0x0 #{3030303030}]
But 0x0...
---
Ciao
Romano
[9/14] from: rotenca:telvia:it at: 23-Apr-2002 10:00
Hi Gabriele,
> Once Jeff wrote something like: "this is a puzzle for you: what is
> to-none useful for?". I was never able to solve the puzzle.
What do you think about this:
probe context [none: 1 a: none b: to-none ""]
---
Ciao
Romano
[10/14] from: g:santilli:tiscalinet:it at: 23-Apr-2002 23:19
Hi Romano,
On Tuesday, April 23, 2002, 10:00:54 AM, you wrote:
>> Once Jeff wrote something like: "this is a puzzle for you: what is
>> to-none useful for?". I was never able to solve the puzzle.
RPT> What do you think about this:
RPT> probe context [none: 1 a: none b: to-none ""]
Hmm, that does not seem much more useful than defining:
none2: none
and then doing:
probe context [none: 1 a: none b: none2]
so, I don't know if that really solves the puzzle.
Jeeeeeeeff! Where are you?
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[11/14] from: rebol:optushome:au at: 25-Apr-2002 0:44
----- Original Message -----
From: "Gabriele Santilli" <[g--santilli--tiscalinet--it]>
To: "Romano Paolo Tenca" <[rebol-list--rebol--com]>
Sent: Wednesday, April 24, 2002 7:19 AM
Subject: [REBOL] Re: to pair! bug
> Hi Romano,
>
> On Tuesday, April 23, 2002, 10:00:54 AM, you wrote:
>
> >> Once Jeff wrote something like: "this is a puzzle for you: what is
> >> to-none useful for?". I was never able to solve the puzzle.
For converting none when a file is loaded??
>> d: load "none"
== none
>> type? d
== word!
>> none? d
== false
>> d: to-none d
== none
>> none? d
== true
Cheers,
Allen K
[12/14] from: holger:rebol at: 24-Apr-2002 15:05
On Mon, Apr 22, 2002 at 12:55:56PM +0200, Gabriele Santilli wrote:
> Once Jeff wrote something like: "this is a puzzle for you: what is
> to-none useful for?". I was never able to solve the puzzle.
I am not aware of that puzzle, or what Jeff had in mind, but here is
my guess: it lets you add code to an 'any clause without breaking
the 'any, e.g. if you want to call a sequence of functions until
one of them returns non-none/false, but also need to do some
calculations in between, you could use something like:
any [
func1
to-none count: count + 1
func2
to-none count: count + 1
func3
...
]
--
Holger Kruse
[kruse--nordicglobal--com]
[13/14] from: g:santilli:tiscalinet:it at: 25-Apr-2002 11:53
Hi Holger,
On Thursday, April 25, 2002, 12:05:17 AM, you wrote:
HK> any [
HK> func1
HK> to-none count: count + 1
HK> func2
HK> to-none count: count + 1
HK> func3
HK> ...
HK> ]
That seems useful, indeed! BTW, since we are at it, would that be
more efficient than:
any [
func1
(count: count + 1 none)
func2
(count: count + 1 none)
func3
...
]
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[14/14] from: holger:rebol at: 25-Apr-2002 11:21
On Thu, Apr 25, 2002 at 11:53:59AM +0200, Gabriele Santilli wrote:
> Hi Holger,
> On Thursday, April 25, 2002, 12:05:17 AM, you wrote:
<<quoted lines omitted: 16>>
> ...
> ]
I am not sure about execution time, but in terms of memory use it is
more efficient, yes, because it avoids additional block series.
--
Holger Kruse
[kruse--nordicglobal--com]
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted