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

World: r3wp

[I'm new] Ask any question, and a helpful person will try to answer.

DKnell
20-Jun-2010
[3687]
interesting, i'm just wondering whether I should be experimenting 
with r2 or r3.  What do I focus on?  Sorry for this frequently asked 
question.  is there any eta on ReBrowse?
Henrik
20-Jun-2010
[3688]
no ETA on rebrowse. it will be quite a while before R3 is done. if 
you want a "complete" experience, you can focus on R2. R3 is the 
cutting edge, where development happens, but it's incomplete.
DKnell
20-Jun-2010
[3689]
Ok, I shall explore r2 fully then and keep an eye on r3 development
DKnell
21-Jun-2010
[3690]
I guess what I'm trying to avoid is spending a lot of time learning 
something in r2 which is obsolete/redundant or majorly different 
in r3.  I suppose I could try running the various r2 demos and one 
liners under r3 and learn for myself the syntax differences.
Henrik
21-Jun-2010
[3691]
It may not matter that much, but for my case that may come from years 
of using R2 and I find it easy to switch between the two. The differences 
are mainly in dialects, ports, graphics, and extensions, while the 
rest of the language is more fine tuned and more functions are available. 
Syntax differences: There are very few basic differences here.
Graham
21-Jun-2010
[3692x2]
I'd suggest also sticking to r2
R3 has been in development now for 4 years and still there is no 
beta
DKnell
21-Jun-2010
[3694]
Yes that makes sense.  It was the words i read that "r3 was a complete 
rewrite of r2" that made me question whether it was worth learning 
all parts of r2
Graham
21-Jun-2010
[3695]
There would be nothing wasted by learning r2
DKnell
21-Jun-2010
[3696x2]
great, r2 it is then.  I've been passively watching the rebol project 
for a while now, years in fact.  I'm now keen to 'at last' throw 
time at it , learn it all and start programming in it
ok, simple r2 problem i'm having.  the cli window  is closing as 
soon as the script ends when i run the simple demos via the viewtop. 
 Any way to force the cli window to remain open - besides adding 
a "press any key" context to end of each script..  I'm using xp at 
the moment I swear the window use to remain open - but maybe I am 
confused with my linux rebol experiences..
Graham
21-Jun-2010
[3698]
right click on the demo and load into the editor to see the source.
DKnell
21-Jun-2010
[3699]
Graham, are you you using the xp rebol/view ? try the hellowworld.r 
 script in beginner,  left click the file, the script runs, but the 
cli/output window does not stay open.
Henrik
21-Jun-2010
[3700]
there may be a quit command in the script, so the script will close 
the console no matter what.
DKnell
21-Jun-2010
[3701x2]
no there is no quit command.   actually i've run a few scripts which 
have halt at the end, and that keeps the output window open
Thinking about this, it's only natural for any output console window 
to close after script execution.  For running the demos via viewtop 
though, it would be nice to either have the script wait at the end, 
ask for user entry, or maybe have a permanent viewtop console window.
Henrik
21-Jun-2010
[3703]
where exactly is this beginner folder?
DKnell
21-Jun-2010
[3704]
using rebol view, I am exploring public/library/ scripts/level/beginner
Henrik
21-Jun-2010
[3705]
ok, that script needs a HALT at the end.
DKnell
21-Jun-2010
[3706]
so does age.r and many others
Henrik
21-Jun-2010
[3707x4]
well, Yeksoon needs to alter them :-)
I think the point there was that you have an open console, and then 
DO those scripts from that console. That has the intended effect.
>> do http://www.rebol.org/library/scripts/helloworld.r
connecting to: www.rebol.org
Script: "Great Computer Language Shootout : hello" (27-Sep-2005)
hello world
When you launch them from the viewtop, a separate process is created.
DKnell
21-Jun-2010
[3711]
Well I'm just a typical new user trying out the demos from viewtop. 
 I know there's a few ways to execute code
AdrianS
21-Jun-2010
[3712]
David, you might also want to look at the r2-forward script by BrianH 
- it's intended to retrofit a good amount of the newer R3 functionality 
into R2. You can dowload that using R3 chat.
BrianH
21-Jun-2010
[3713]
Most of R2/Forward was added to R2 itself with the 2.7.7 release. 
The rest was added to 2.7.8 (release pending). There are some limits 
as to what R3 functionality can be retrofitted into R2, but you'd 
be surprised. Also, look at the source - it's also meant to serve 
as documentation about differences between R3 and R2, although it 
can be a bit on the advanced side here and there.
AdrianS
21-Jun-2010
[3714]
Brian, what's the intent wrt delect? With Carl's most recent wiki 
page describing commands, it seems that a fair amount of  delect's 
parsing power (optional, out of order args) won't be available using 
these - is delect going to remain?
BrianH
21-Jun-2010
[3715]
It's unknown at this point whether DELECT will remain: The command-processing 
functionality of DELECT has been moved into DO-COMMAND. I'm guessing 
that DELECT will end up being a preprocessor that generates DO-COMMAND 
blocks; the wiki you mentioned says that a similar preprocessor is 
run on Draw blocks before they are sent to DO-COMMAND (the "For special 
draw dialects..." paragraph).
Davide
21-Jun-2010
[3716]
How can I convert money to a number or a char ?

>> to integer! $1
** Script Error: Invalid argument: $1.00
** Near: to integer! $1.00

>> to char! $65
** Script Error: Invalid argument: $65.00
** Where: halt-view
** Near: to char! $65.00
BrianH
21-Jun-2010
[3717]
Easy answer: Use R3.
Hard answer: To string and back.
>> to-decimal next mold $1
== 1.0
Maxim
21-Jun-2010
[3718]
decimal/money not being convertible to one another is a strange ommission 
in R2
BrianH
21-Jun-2010
[3719x2]
>> to-integer next mold $1
== 1
We did a really thorough revamp of conversion in R3. And doing the 
same in R2 would be comparable in scope.
Graham
21-Jun-2010
[3721]
>> $12.34 / $1.00
== 12.34
Maxim
21-Jun-2010
[3722]
good catch!
Graham
21-Jun-2010
[3723x2]
>> $65 / $1
== 65.0
Easy answer: Use divide :)
BrianH
21-Jun-2010
[3725]
Great way to exploit a terrible bug for the benefit of all! :)
Graham
21-Jun-2010
[3726]
This is math ... not a bug
Maxim
21-Jun-2010
[3727]
yes exactly.
BrianH
21-Jun-2010
[3728]
The type conversion is a bug. The math is the benefit.
Maxim
21-Jun-2010
[3729x3]
if you divided by a decimal, then it should return a money type. 
  which it does.
no its very consistent.... how many dollars in 65 dollars?   one... 
  not one dollar.
6 dollars divided by 2 is  3 dollars... not 3
Graham
21-Jun-2010
[3732]
What are you saying max?
Ladislav
21-Jun-2010
[3733x2]
You can also use First and Second
(in R2)
Graham
21-Jun-2010
[3735x2]
Second .. true
much better ..