|
Pages: [1]
|
 |
|
Author
|
Topic: Order of operations problem? (Read 206 times)
|
|
mhillmer
|
Trying to understand blocks and data formats, I try this in the console:
btime: [12:00]
if first btime > now/time [ print "before noon" ]
results in: ** Script Error: Expected one of: block! - not: time! ** Where: halt-view ** Near: if first btime > now/time
However, this: if now/time < first btime [ print "before noon" ]
Works just fine.
However, this also works: if btime/1 > now/time [ print "nefore noon" ] (this also works with the btime/1 and now/time reversed)
Seems to me that all of these statements should work, since: type? first btime time! type? now/time time! type btime/1 time!
are all true statements... unless I'm missing something about the way Rebol is handling the order of operations?
Matt
|
|
|
|
|
Logged
|
|
|
|
|
Gabriele
|
Infix operators cannot be smart enough to figure out by themselves what you want them to do. You need to use: if (first btime) > now/time [print "before noon"] because, otherwise, REBOL sees it as: if first (btime > now/time) [print "before noon"]
|
|
|
|
|
Logged
|
|
|
|
|
|
Pages: [1]
|
|
|
 |