Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Case comparison?

 [1/8] from: rotenca::telvia::it at: 16-Oct-2001 13:14


Hi Gregg,
> << but what does it means to uppercase an image? >> > > Curses! I had to know. > > It subtracts 32 from the individual R, G, or B values if they are 97 or > higher (lowercase range +). Although a value of 255 converts to 159 (i.e. 96 > is subtracted).
A new great effect for view! :-)
> --Gregg >
--- Ciao Romano

 [2/8] from: hallvard:ystad:helpinhand at: 14-Oct-2001 21:09


http://www.rebol.com/docs/dictionary.html#8227395 states: String-based datatypes are considered equal when they are identical or differ only by character casing (uppercase = lowercase). Use == or find/match/case to compare strings by casing. But then:
>> a-string: "STRING"
== "STRING"
>> type? first next a-string
== char!
>> (first next a-string) = #"t"
== false
>> (first next a-string) = #"T"
== true Is char! not considered a string-based datatype? ~H

 [3/8] from: joel:neely:fedex at: 14-Oct-2001 16:30


Hi, Hallvard, Hallvard Ystad wrote:
> But then: > >> a-string: "STRING"
<<quoted lines omitted: 6>>
> == true > Is char! not considered a string-based datatype?
To the best of my knowledge, no. String-based datatypes include those whose values are really strings with special semantics, such as URLs, filenames, and email addresses, AFAIK. -jn- -- ; sub REBOL {}; sub head ($) {@_[0]} REBOL [] # despam: func [e] [replace replace/all e ":" "." "#" "@"] ; sub despam {my ($e) = @_; $e =~ tr/:#/.@/; return "\n$e"} print head reverse despam "moc:xedef#yleen:leoj" ;

 [4/8] from: hallvard:ystad:helpinhand at: 15-Oct-2001 10:58


Joel Neely skrev (Sunday 14.10.2001, kl. 23.30):
>Hi, Hallvard, > >[...] >String-based datatypes include those whose values are really >strings with special semantics, such as URLs, filenames, and >email addresses, AFAIK.
Ah, that's of course (computer) logical. I was thinking human logical: of course characters are a sort of strings... Anyway, thanks for clearing it up. ~H

 [5/8] from: joel:neely:fedex at: 15-Oct-2001 6:21


Hi, Hallvard, Hallvard Ystad wrote:
> Ah, that's of course (computer) logical. I was thinking human > logical: of course characters are a sort of strings...
I still periodically have to figure out which kind of logic to use... ;-) In a related vein:
>> uppercase "foo"
== "FOO"
>> uppercase %foo
== %FOO
>> uppercase http://foo.com/
== HTTP://FOO.COM/
>> uppercase [foo--foo--com]
== [FOO--FOO--COM]
>> uppercase #"a"
** Script Error: uppercase expected string argument of type: any-string. ** Where: uppercase #"a" -jn- -- ; sub REBOL {}; sub head ($) {@_[0]} REBOL [] # despam: func [e] [replace replace/all e ":" "." "#" "@"] ; sub despam {my ($e) = @_; $e =~ tr/:#/.@/; return "\n$e"} print head reverse despam "moc:xedef#yleen:leoj" ;

 [6/8] from: rotenca:telvia:it at: 15-Oct-2001 15:24


Hi, Joel
> I still periodically have to figure out which kind of logic to > use... ;-) In a related vein: > > >> uppercase "foo" > == "FOO" > >> uppercase %foo > == %FOO
I find very useful these kind of tables in the core userguide, but what does it means to uppercase an image? Table 5-10. String Types String! Character strings Binary! Byte strings Tag ! HTML and XML tags File! File names URL! Internet uniform resource locators Email! Email names Image! Image data Issue! Sequence codes --- Ciao Romano

 [7/8] from: greggirwin:mindspring at: 15-Oct-2001 13:16


<< but what does it means to uppercase an image? >> Curses! I had to know. It subtracts 32 from the individual R, G, or B values if they are 97 or higher (lowercase range +). Although a value of 255 converts to 159 (i.e. 96 is subtracted). --Gregg

 [8/8] from: d4marcus:dtek:chalmers:se at: 16-Oct-2001 21:01


On Mon, 15 Oct 2001, Gregg Irwin wrote:
> << but what does it means to uppercase an image? >> > It subtracts 32 from the individual R, G, or B values if they are 97 or > higher (lowercase range +). Although a value of 255 converts to 159 (i.e. 96 > is subtracted).
Which in practice means, if you view an uppercased image, you may notice a strange kind of posterizing effect. :-) Marcus ------------------------------------ If you find that life spits on you calm down and pretend it's raining

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted