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

World: r3wp

[Core] Discuss core issues

BrianH
15-Jul-2010
[17591]
You are misunderstanding the difference between a "market" and a 
"target market". That ticket was a good idea though.
Gabriele
16-Jul-2010
[17592x2]
Brian: I insist that the "newbie" argument is silly at best, dangerous 
for the language at worst.
i also think that mold/all would be better for newbies than simple 
mold, but i guess that's a matter of opinion, since nodoby did any 
experiments with a group of newbies.
Graham
16-Jul-2010
[17594]
I think as a newbie I try mold .. when it doesn't work, i ask here 
and the gurus say, use mold/all :)
Henrik
16-Jul-2010
[17595]
rather than newbie, I use "the principle of least surprise"
Anton
16-Jul-2010
[17596]
Yep, I also think the "newbie" argument is bogus.
Carl
16-Jul-2010
[17597]
Oh my, more stuff to read!
Ladislav
16-Jul-2010
[17598]
Carl is trying to "undefine" ODD? EVEN? and COMPLEMENT for floating-point 
pairs. I guess, that nobody would really miss these functions for 
FP pairs. I even think, that ODD? and EVEN? are not used (of little 
use) for decimals as well. Any different opinions?
Carl
16-Jul-2010
[17599x4]
I think that I had some code somewhere that once used odd or even... 
but it's not important, because it is so rare, a person can convert 
to integer first if they want.
So, no problems. Added ROUND, which is more interesting.
Regarding all the above discussion regarding MOLD... there is an 
assumption, once that I do not believe.


The assumption is this: that any function of REBOL could ever produce 
the perfect output storage format for all data.


Or, stated another way: part of the design of building all applications 
that store persistent data is to build the storage formatters (savers) 
and storage loaders.


I don't think there's any way around this, because storage formats 
have specific requirements, such as speed of loading, indexing keys, 
resolution of references (words or other), construction of contexts, 
etc.
once = one, TTF (typing too fast)
Ladislav
16-Jul-2010
[17603x2]
Yes, I do agree with you, that is why I restricted my notes (or at 
least tried to) to just script preprocessing.
...and in that case we have the LOAD function, and its counterpart 
should be the SAVE/ALL function, not the SAVE function (that is essentially 
what I wanted to underline/document somewhere)
Carl
16-Jul-2010
[17605x3]
Yes, a good point.  But, and furthermore, even using LOAD instead 
of LOAD/all can be a problem for users due to its method of removing 
the outer block. An odd problem.
The biggest problem with programmers is that they expect programming 
to be symmetric in all dimensions, but it's not even symmetric in 
it's simplest of elements.


Language (that is "expression") is not based on a pure math, nor 
is the world in general.


And, as in the world of thermodynamics (which covers most things), 
many processes are not reversible.


The oil flows from the well into the ocean of the Gulf. The process 
does not work in reverse.
it's = its, TTF
Pavel
17-Jul-2010
[17608]
When trying to code D.J.Bernstein hashing function: forall key [hash: 
hash * 33 xor first key] I found that this simple notation is faster 
than traditional C like: forall key [hash: xor~ add shift hash 5 
hash first key]. (Note for real use it is necessary to shrink hash 
to 4 bytes.) seems shift and additioin is not faster than multiplication 
under Rebol?
Anton
17-Jul-2010
[17609]
The overhead of the Rebol interpreter is much greater than those 
fundamental instructions, so any savings in the fundamental instructions 
are swamped by the overhead of processing the rebol words.
Maxim
22-Jul-2010
[17610]
can anyone explain this strange lexical analysis error to me?:

>> +10: "test"
** Syntax Error: Invalid time -- +10:
** Near: (line 1) +10: "test"


+ is a valid word character symbol and +10 is not supposed to a valid 
integer (as opposed to -10)... but why does it see a time! type?
same on R2 & R3
PeterWood
22-Jul-2010
[17611]
Because of this ?

>> +10:23

== 10:23
>> type? +10:23

== time!
Maxim
22-Jul-2010
[17612]
but why is + associated to time?  10:23 is lexically valid there's 
no need for + there, or is there a situation where it is required?


I know that + is required when its preceded by a date... but on its 
own, this looks like it should be changed.

funny since I'd say that +10:23 is the Invalid time string.
BrianH
22-Jul-2010
[17613x2]
+ is a special-cased word character symbol, not a regular one. It 
+ is at the beginning of a sequence of numbers, it is treated as 
part of a number. If a number has a : in it, it is treated as a time.
It + is -> If + is
PeterWood
22-Jul-2010
[17615]
Also note:
>> -10:23
== -10:23
>> type? -10:23
== time!
Maxim
22-Jul-2010
[17616]
ok ... did a bit more inspection in the mean time and I get it now. 
 might be nice to put this somewhere in the datatype documentation...
BrianH
22-Jul-2010
[17617]
Yup, same reason. There was a lot of blog/ticket-comment/chat about 
this recently for R3, and what was revealed applies to R2 as well. 
Though the precedences and rules have been tweaked for R3.
Maxim
22-Jul-2010
[17618]
Am I wrong in remembering a version where +10 was an invalid token?
BrianH
22-Jul-2010
[17619]
There is a CureCode ticket requesting that documentation, though 
it is syntax documentation, not datatype.
Maxim
22-Jul-2010
[17620]
yeah, but my associative mind needs to know syntax related information 
based on a datatype, not the other way round  ;-)
BrianH
22-Jul-2010
[17621]
Syntax precedence rules affect more than one datatype by their nature, 
so it should be better for the documentation of the affected datatypes 
to link to the syntax documentation.
Maxim
22-Jul-2010
[17622]
yep... that's what I meant by association  :-D
BrianH
22-Jul-2010
[17623]
If you read what I've been writing today, you'd understand why I 
am paying so much attention to organization of information :)
Graham
23-Jul-2010
[17624]
foreach allows you to step through a single series one at a time. 
 So, how would you step thru more than one series at a time?

a: [ n elements ]
b: [ n elements ]

foreach [ ofa ofb ] reduce [ a b ] [

] 

?
Andreas
23-Jul-2010
[17625x3]
foreach [ofa ofb] join a b [...]
Aehem, nevermind.
use amartin's interweave or gabriele's nforeach
Graham
23-Jul-2010
[17628]
nforeach?? where is this?
Andreas
23-Jul-2010
[17629]
http://www.rebol.it/giesse/utility.r
Graham
23-Jul-2010
[17630x2]
ahh... ok
I also found the relevant mailing list thread
Andreas
23-Jul-2010
[17632]
http://www.mail-archive.com/[rebol-list-:-rebol-:-com]/msg18660.html
Graham
24-Jul-2010
[17633]
Anyreason why this can't be the default behaviour of 'foreach?
Gabriele
24-Jul-2010
[17634]
the one here might be newer (i don't remember and i didn't check 
:P): http://www.colellachiara.com/soft/libs/utility.r
Graham
24-Jul-2010
[17635]
they're both copyright 2003 and one is dated 2004, and the other 
more documented version is dated 2005  !
Gregg
24-Jul-2010
[17636]
The most common case is iterating over a single block, so the current 
behavior makes sense. And while breaking compatibility is sometimes 
helpful in the long run, I hate to think how much code would break 
by changing FOREACH now. FOR, on the other hand, is not widely used 
IIRC, and I've said before I thought it would benefit from being 
a dialected func. Still, we can make our own under a new name and 
then campaign for it.
Graham
24-Jul-2010
[17637x2]
I guess my suggestion is that the current behaviour is for a single 
block, but it should be able to generalise *without* creating a new 
function.
In the same way 'for does ... where there is a skip counter from 
1 .. n
Gabriele
25-Jul-2010
[17639]
graham, i think you underestimate how hard it is to generalize FOREACH. 
:) the only thing i can think of is adding a /multi refinement or 
something like that, but then the way you pass arguments is not optimal.
Graham
25-Jul-2010
[17640]
But it's not impossible right?  :)