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

World: r3wp

[Core] Discuss core issues

Jarod
26-Mar-2006
[3763]
what I do b: [a] and have it put value1 value2 value3 in b instead 
of a itself
ChristianE
26-Mar-2006
[3764]
you can do B: REDUCE[A], but if don't want to reduce you can also 
do sth. like B: [ ] APPEND B A
But I think what your looking for is sth. like
	>> a: [1 2 3] b: [ ]
	>> append/only b a
	>> probe b
	>> [ [ 1 2 3 ] ]
	>> clear a
	== [ ]
	>> probe b
	== [ [ ] ]
	>> append a 4 probe b
	== [ [ 4 ] ]
Jarod
26-Mar-2006
[3765]
why exactly is it called reduce also?
Geomol
27-Mar-2006
[3766]
Because it reduce the words to their values?
Anton
27-Mar-2006
[3767]
It reduces the expressions found within the block (and it returns 
the results in a new block).
Jarod
27-Mar-2006
[3768x4]
I am also perplexed why rebol doesn't have a substring function, 
sure even if you can create one with a few extra commands, it seems 
to me like most people don't want to have to invent a language, just 
to use the functionality that exists.
or I should rephrase that, to use functionality that exists in other 
languages
I hope rebol 3.0 has a substring function built in
even if source substring shows me the copy/part at stuff
Graham
27-Mar-2006
[3772]
A line in the sand has to be drawn somewhere.
Jarod
27-Mar-2006
[3773]
substring is far more intuitive for someone who hasn't used rebol 
before than copy/part at
Graham
27-Mar-2006
[3774]
Gregg has posted a dialected substring function.
Jarod
27-Mar-2006
[3775x5]
rebol's help also should have a see also at the bottom of commands, 
to direct attention to other rebol commands and functions of interest
the language as a whole feels very fragmented, I recognize the power 
of Rebol only because of its lispy nature, but I feel limited compared 
to a language like perl, because examples are far too scattered about, 
and the names for functions are often oddly named or sometimes the 
functionality exists but is so obscured that I never knew it was 
there at all in the first place
I hope more is done to actually document the language when 3.0 rolls 
out
and sure perl ain't the prettiest languages on earth, but it is well 
documented
for example, how could I take a date, and add 3 months or 3 weeks 
to the date?
yeksoon
27-Mar-2006
[3780]
a CPAN for Rebol?
Jarod
27-Mar-2006
[3781x5]
hmm, that is one idea, hehe
But I am actually talking thorough discussion and documentation of 
every nook and cranny and how to do basic things people want and 
need to do with the language
something along the lines of the rebol core manual, but more in depth
having to re-invent the functionality that other languages just give 
you is a serious pitfall if you ask me
that was one of the things that drove me crazy about lisp, yeah it 
is a powerful language, and yeah it is a programmable language, but 
to some degree the only way to do anything really useful in the langauge 
was to in essence program lisp to function similar to other languages 
you were already familiar with, or to in essence extend lisp with 
functionality it should have already had before you even started 
programming in it it
Graham
27-Mar-2006
[3786x3]
in some ways this might be considered an elitist atttitude on the 
part of the language writers.
If it's not there, write it yourself.
Better to have a way to point to mezzanines that implement the common 
functionality that people want.
Jarod
27-Mar-2006
[3789]
I dunno, I think that languages like java or .NET would be far less 
successful if people had to implement a majority of the class library 
by hand, anytime they wanted to take advantage of advanced functionality. 
There is just some functionality that people come to expect regardless 
of what higher level language they are coding in. And for a language 
that supposedly can be used to parse and manipulate text and data, 
not having a built in substring function is pretty crazy
Graham
27-Mar-2006
[3790]
Rambo your suggestion.
Jarod
27-Mar-2006
[3791x5]
that is my primary need or want to use rebol for, is to manipulate 
text. I like perl, but  love rebol's small footprint, if it can give 
me the same power of perl in a much smaller package, with a gui, 
that is all the better. I could potentially replace access and a 
lot of proprietary tools with a small rebol view application.
I like how rebol handles tagged data, xml, html, etc.
I am surprised save can't serialize rebol datastructures in xml formats
I dunno maybe I am being anal, or stupid, or just plain unreasonable. 
But this sort of irked me, when I found people offering a solution, 
and it was so simple as to have just been a part of the darn language 
from the beginning.
I hope more documentation on view itself also debuts
Graham
27-Mar-2006
[3796x2]
actually it was Jaime

substring: func [
    [catch]
    source [string!]
    spec [block!]
    /local start stop rule
][
    rule: [set start integer! '.. set stop integer!]
    unless parse spec rule [
        throw make error! "Invalid range spec."
    ]
    copy/part skip source start stop
]
this was in my response to my suggestion that we adopt a python type 
syntax for parts of series

substring "abcd" [2 .. 3]
Jarod
27-Mar-2006
[3798]
so skip is skipping into the string, then it is copying part of that 
string starting from that position to the end?
Ashley
27-Mar-2006
[3799]
Oddly enough, *I've* never needed substring type functionality in 
REBOL. Might be due to the fact that REBOL's multitude of datatypes 
reduces the need somewhat (i.e. in another language you may have 
to manipulate numbers / strings to / from dollar / date / time formats, 
whereas in REBOL I tend to convert via the to-* functions).
Jarod
27-Mar-2006
[3800]
well, one thing I've wondered is how to add weeks, months, years, 
etc. to dates
Graham
27-Mar-2006
[3801]
Jarod - yes.
Jarod
27-Mar-2006
[3802]
I like that function a bit more Graham, I basically think I understand 
what that is doig
Graham
27-Mar-2006
[3803]
the ".." is synatactic sugar.
Jarod
27-Mar-2006
[3804x4]
doing
having to write a function to do that is a pain, but I can probably 
live with it, knowing exactly what it is doing
I mean, all languages have quirks
hehe
Graham
27-Mar-2006
[3808]
I don't use substr much at all either .. but your complaint was one 
I also felt :)
Jarod
27-Mar-2006
[3809x4]
I mean, there are times when parse will work
but honestly, I could actually see parse having the ability to substring
I am surprised it doesn't
how can you do more with dates than just add days to them?