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

World: r3wp

[All] except covered in other channels

GiuseppeC
27-Jan-2008
[2571]
1) In one of my script I have had an "OUT OF MEMORY ERROR" in a situation 
where you normally don't exect such error and don't check about it. 
Is there a way to raise an exception automatically and give control 
to the exception handler you have written ?
Geomol
27-Jan-2008
[2572x2]
Can TRY be used in that situation?
Like in:

>> if error? try [4 / 0] [print "There was an error!"]
There was an error!

I'm not sure, if that catch out of memory errors.
GiuseppeC
27-Jan-2008
[2574x2]
Yes but when this error arised (during a read/lines operation) I 
asked myself if the "OUT OF MEMORY" error could accur in situations 
like function definition, object creations and so on. You don't expect 
an error expecially in the first scenario.
(first scenario: function definition)
Geomol
27-Jan-2008
[2576]
Yes, it a bit different from "normal" errors in REBOL. I haven't 
got much experience with out of memory situations. Can you test it 
somehow, if it'll work?
GiuseppeC
27-Jan-2008
[2577]
I can't reproduce the out of memory error at function definition 
bur teh question remains.
Geomol
27-Jan-2008
[2578]
Yes, good question, also regarding the new version of REBOL. I'll 
take it up with Carl and the other developers.
GiuseppeC
27-Jan-2008
[2579x3]
For the second question you should wait, my  distant syster as called 
me.
Here I am again.
Second question: if I have a word with a value, could I attach a 
method to it ? 

for example: myword: 10 and I want  a method myword.increment or 
myword/increment.
Geomol
27-Jan-2008
[2582x4]
You would probably use an object for that in REBOL:

>> myword: make object! [value: 10 inc: does [value: value + 1]]

And then use paths to get the value and use inc:

>> myword/value
== 10
>> myword/inc
== 11
>> myword/value
== 11
You can also do it in a block:


>> myword: reduce ['value 10 'inc does [myword/value: myword/value 
+ 1]]
== [value 10 inc func [][myword/value: myword/value + 1]]
>> myword/value
== 10
>> myword/inc
== 11
>> myword/value
== 11
>> myword
== [value 11 inc func [][myword/value: myword/value + 1]]
With the block way, you can also get the value by:

>> myword/2
== 11
because the actual value is at the second position in the block.
Gregg
27-Jan-2008
[2586]
On the constructor question, another way to do it is to define your 
object spec, and include initialization code in that.


>> o-spec: [time: none set-time: does [time: now/precise]  set-time]
== [time: none set-time: does [time: now/precise] set-time]
>> probe o1: context o-spec
make object! [
    time: 27-Jan-2008/11:07:00.875-7:00
    set-time: func [][time: now/precise]
]
>> probe o2: context o-spec
make object! [
    time: 27-Jan-2008/11:07:04.5-7:00
    set-time: func [][time: now/precise]
]
Henrik
28-Jan-2008
[2587]
welcome Derek :-)
SteveT
28-Jan-2008
[2588]
welcome Derek - at last someone newer than me ;-/
btiffin
1-Feb-2008
[2589]
I've started a Qwiki in Qtask for the 2008 user.r rebol of the year 
awards.  The rotties.

Single category so far;  roty. 
Nominations to date;

Ashley Trüter


I'll pull the list over every month or so.   Drop a note in user.r 
if you want to nominate someone; or better yet, drop me a note for 
an invite to the user.r project on Qtask and update the Qwiki directly.
Sunanda
1-Feb-2008
[2590]
Language design discussion involving REBOL as an example:

(Personally, I think it's hard to *write* code if you don't know 
how many parameters a function takes. But maybe that's just me)
http://www.alh.net/newlisp/phpbb/viewtopic.php?p=11623#11623
Gregg
1-Feb-2008
[2591]
And it misses the point that REBOL is more than a functional programming 
language. Besides, couldn't you just use parens everywhere if you 
want? :-)
Anton
1-Feb-2008
[2592]
Interesting discussion.
Reichart
3-Feb-2008
[2593]
Is there a good example of a simple vector rendering/drawing demo 
in REBOL?

I have been thinking about a tool I want to make that allows me to 
track things around my house.  The problem with CAD programs is that 
they are designed to "create", not to record.


The concept is so different in fact that a graphical interface is 
only needed as confirmation.  Input is actually better if done "descriptively"


For example, I would rather simply measure something (like the outside 
of the house, by simply writing down every surface length, and every 
"turn").

A rectangle might be something like:

45' 10, R 10, R 10, R 10

Where the first line heads off 45 degrees (0 = North)


Then it is a matter of naming objects, and tagging them (better than 
layers, so you can display things based on tags, like "Electrical", 
"Plumbing", etc.)
Brock
3-Feb-2008
[2594]
Interesting idea Reichart
Gabriele
4-Feb-2008
[2595]
Reichart, i think it should be easy to do. (Especially in R3 :)
Gregg
4-Feb-2008
[2596x2]
Sounds a lot like turtle graphics in Logo.
And if you have a GPS you can import and parse data from, you can 
be the turtle. :-)
Reichart
4-Feb-2008
[2598]
Agreed, this is easy, I was just hoping to look at something already 
done, perhaps even by Richard...

The cool thing is this could be saved in XML, and be compatible with 
other systems then.


The important thing is that no CAD system I know of lets you easily 
build an object, (even like a little JBox) by telling it that it 
is x distance from the corner of some other object.  This is the 
key to logging things around a house.

I want to build a really powerful way to triangulate on a point.
Pekr
4-Feb-2008
[2599x3]
uh, I don't remember the product I liked, but it working in some 
non-traditional "cad" way ...
http://www.homeplanpro.com/
well, generally I googled "cad house"
Carl
4-Feb-2008
[2602x4]
Just stopping by to say hello.  Yes, it's been a while. Sorry about 
that.  R3 has had me far out to sea - especially the Unicode changes 
of recent.
Note I have not had time to read any of the above messages (in this 
group or others).  So, if there is something important for me to 
read, let me know.
(Put a note in the Carl Only group.)
(No... created new group: Carl Links - drop a note there. Thanks!)
Gregg
4-Feb-2008
[2606]
I did a very crude and basic Logo/turtle system. So it's a very doable 
concept.
Reichart
4-Feb-2008
[2607x2]
Pekr, thanks, but again, that is a Planner, I'm looking for the opposite. 
 The house alrady exists, I'm just logging.  This is a concept that 
does not really exist as a product, (but should).  Every time you 
update a wire, or install a new sink, etc. you need to log just that 
one object.
Gregg, does it use AGG?
Pekr
4-Feb-2008
[2609x2]
Reichart - IIRC those system exist, but I only once met enterprise 
level one. Thosoe are called "facility" management. They go down 
to invoices - you can look and see what particular wire type goes 
thru your house, etc - http://www.xanadu.cz/apps/fmflash/fmatweb.asp
can't remember some other products, I never saw it working in real-life. 
I just knew one consultant who did this kind of stuff and we had 
some chat about it.
Gregg
4-Feb-2008
[2611]
It's just REBOL, Reichart, so it uses AGG on newer releases. It just 
generates DRAW commands.
Reichart
5-Feb-2008
[2612x2]
Which REBOL script do you think would be the best to start with?
You know......................after much thought, what I might just 
do is write a simple ML to SVG converter.

It would be almost a 1:1 command set (in fact mostly what I would 
be doing is translating offsets).

The ML would be clean, while the emiter would allow a browser to 
be the viewer.

http://en.wikipedia.org/wiki/Scalable_Vector_Graphics
Gregg
5-Feb-2008
[2614x2]
I would get Cyphre's opinion on that. Mine is old, and nothing to 
write home about, but the turtle graphcis concept seems to be a very 
close match with what you're after.
Maybe SVG has pathing commands that are close. I don't know.
Henrik
5-Feb-2008
[2616]
doesn't the SHAPE command in DRAW basically do this?
Reichart
5-Feb-2008
[2617]
Henrik, It may, I have never played with DRAW.  I'm old, so I still 
think in PS (Post Script).

I'm in a conference now with Richard, and will talk to him as well.

I always like to ask around just to test teh waters.


I'm going to be curious if SVG is going to catch on.  It is a crappy 
way to store vectors
Graham
5-Feb-2008
[2618]
Doubt it ... now that Adobe own Macromedia
Henrik
5-Feb-2008
[2619x2]
SVG has been around for a long time, but is very wide spread in the 
open source community now.
but commercially not much.