• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r4wp

[!REBOL3] General discussion about REBOL 3

Maxim
29-Jun-2013
[2676x4]
doesn't seem to like being called from make
ah,   that's why   ">NUL:"    added....      so for the record... 
its not only Win7 which needs it... XP also seems to require it.
yay... got it to work  :-)
anyone got the recipe to enable graphics?
Kaj
30-Jun-2013
[2680]
You'll need the source from Saphirion
Robert
5-Jul-2013
[2681]
IIRC some started to write a formal grammar for Rebol3. Is there 
anything available to look at?
Andreas
5-Jul-2013
[2682]
At least two efforts come to mind:
https://github.com/rebolsource/rebol-syntax
http://reb4.me/r/rebol
Robert
5-Jul-2013
[2683]
Thanks.
Bo
7-Jul-2013
[2684x2]
Hmmm...interesting behavior.  I am trying to use R3 to act as a TCP 
server on Linux-ARM.  Here's a code snippet:

	if probe port? prt: wait [1 camsrv][
		probe cmd: copy prt
		call/wait reform [cmd "> cmdout.txt"]
		insert prt probe read cmdout.txt
		close prt
	]


The probe at the top returns 'false when there is no TCP activity, 
but it returns "TCP-event accept" when there is, and then it just 
sits there.  Escape (ESC) and CTRL-C will not break out of R3 at 
that point.  CTRL-C just outputs "[escape]" each time it is pressed, 
but doesn't escape.
Even

	sudo kill <pid>

doesn't kill it.  It just puts another "[escape]" on the line.
Maxim
7-Jul-2013
[2686]
wow that's a nasty bug.
Bo
7-Jul-2013
[2687]
But my real problem is that the line

	probe cmd: copy prt


never outputs anything, even after the "TCP-even accept" line is 
printed.  Even if I put a 'print statement as the first line of the 
'if block, nothing is printed.  So that leads me to believe that 
there is a problem right at the

	probe port? prt: wait [1 camsrv]

that locks up R3 hard.
Maxim
7-Jul-2013
[2688]
a bug worthy of a hackathon session at ReCode ?
Bo
7-Jul-2013
[2689]
I think there may be too many topics for hackathons. :-)
Andreas
8-Jul-2013
[2690]
Bo, see my reply on SO chat:

http://chat.stackoverflow.com/transcript/message/10446555#10446555
Gabriele
8-Jul-2013
[2691]
R3 does not use COPY and INSERT on ports, it uses READ and WRITE 
instead, but also, it is always async, so something like the above 
will not work.
Bo
8-Jul-2013
[2692]
Gab and Andreas: Thanks for your feedback!  I'd never done server 
programming with R3 and I forgot it was asynch by default.
Josh
9-Jul-2013
[2693x7]
Is there an equivalent to Henrick's list-view in R3-gui?
text-table
I have a couple questions about how to deal with actors and I think 
an example will illustrate it best.
Trying to modify use click actions on a text-table to affect filtering 
on another text-table:

ind: [
	[1 "Jones" "Tom"]
	[2 "Smith"	"William"]
	[3 "Jones" "Stephen"]
]

eve: [
	[1 "Arrival"  "Wearing a red hat"]
	[1 "Departure" "No hat"]
	[2 "Lunch" "Salmon Sandwich"]
	[1 "Dinner" "Pasta"]
	[2 "Departure" "Red shirt"]
]

view [

 tt1: text-table 600x400 ["ID" #1 70 "Last Name" #2 200 "Given Name" 
 #3 200 ] ind on-focus [
		print face/name
	]

 tt2: text-table 600x400 ["ID" #1 70 "Event" #2 150 "Description" 
 #3 300] eve
]
My goal is when i click on tt1 that the ID number on that row will 
set the filtering on tt2 to show only events with that ID #
Question 1:   on-focus only deals with the first click on that whole 
face, so it's the wrong actor.  Do i need to modify the actor of 
an individual row? or am I just using the wrong actor?
Question 2:  I'm unsure how to set the filter for tt2.  If I try 
(stole this code from probing the facet):

		tt2/facet/filter: make map! [
			1 [value = 1]
		]

it says I cannot access the facet
AdrianS
9-Jul-2013
[2700]
Josh, there's an r3-gui group that might be a more appropriate place 
to ask.
Josh
9-Jul-2013
[2701]
whoops, yes, will move over
Gregg
15-Jul-2013
[2702]
@BrianH, I searched CureCode, but couldn't find any notes from you 
on SPLIT, other than one that said you think it needs a rewrite.
Josh
20-Jul-2013
[2703x3]
bug?

v: 5
a: compose/deep [(v) q]
reduce a
nevermind, i understand
q is bound to quit
Geomol
22-Jul-2013
[2706x3]
Cyphre wrote 2-Apr 2013 22:03:
For those interested in the 
alpha-channel change": ..."


It's a good change to get the alpha-channel 'right' or similar to 
most other standards. Have there been thoughts about including the 
alpha-channel with the RGB values, so it becomes RGBA, which we know 
from OpenGL and other places?

From my R3 console:

>> i: make image! [1x1 #{01020304}]
== make image! [1x1 #{
010203
}]


The alpha values seems to be left out. (It might have changed in 
newer versions.) Setting the pixel will include alpha values:

>> i/1: 1.2.3.4
== 1.2.3.4
>> i
== make image! [1x1 #{
010203
} #{
04
}]


But it seems, the alpha channel is separate from RGB values. Why 
not always have the alpha channel, and include it with the RGB values, 
so we have: [1x1 #{01020304}]
And related: have there been thoughts about setting origin of images 
in the lower left corner instead of upper left? When I use REBOL 
to draw graphs (of scientic values), I always find myself flipping 
the y-axis. Putting origin in lower left should make such code easier. 
Textures in OpenGL has origin in lower left.
*scientific*
Cyphre
22-Jul-2013
[2709x2]
Geomol, some notest regarding alpha channel:

The alpha values seems to be left out.

I'ts not left out..that's only the way "mold" of image! datatype 
works. So I the image have "fully transparent" alphachannel it is 
just not shown by mold to make the output more readable.

But it seems, the alpha channel is separate from RGB values.

The alphachannel is always present in the image! datatype (ie. internally 
it's always 4 components = 32bit bitmap). Again it's just the way 
"molding" of the datatype displays the content.


AFAIK You can construct the image! with alphachannel in various ways 
for example:

separated alpha:

>> i: make image! [2x2 #{0102030405060708009A0B0C} #{11121314}]
== make image! [2x2 #{
0102030405060708009A0B0C
} #{
11121314
}]

same example but the RGBA compoments together:

>> i: to image! #{0102031104050612070809130A0B0C14}
== make image! [4x1 #{
0102030405060708090A0B0C
} #{
11121314
}]

>> i/size: 2x2
== 2x2

>> i
== make image! [2x2 #{
0102030405060708090A0B0C
} #{
11121314
}]

>>

Same way you can get the values in different form:

>> i/rgb
== #{0102030405060708090A0B0C}

>> i/alpha
== #{11121314}

>> to binary! i
== #{0102031104050612070809130A0B0C14}


For more I'd suggest you read the image! datatype docs here: http://www.rebol.com/docs/image.html

AFAIK The docs were written for R2 but should hold pretty much also 
for R3.
Regarding the "origin" of coordinates. IIRC this was discussed many 
times. In the end the decission was to have it the "non scientific" 
way. Also you can always apply transformation matrix in draw dialect 
to have your coordinates as needed.
Geomol
22-Jul-2013
[2711]
Thanks, C.!
Endo
31-Jul-2013
[2712x2]
f: does [2]
;on R3
>> reduce/only [a f] none
== [1 make function! [[][2]]]
;On R2
>> reduce/only [a f] none
** Script Error: Invalid argument: f

Is it a bug on R2?
a: 1 ;for sure..
Geomol
31-Jul-2013
[2714]
Looks like a bug in R2 to me.


It's interesting, that the word for the function is reduced to the 
function, but not evaluated. An alternative could be, that the word 
isn't touched, if it represents a function. I'm not familar with 
what practical challenges, that lead to this refinement for REDUCE. 
I've never used it myself.
Endo
31-Jul-2013
[2715:last]
An alternative could be, that the word isn't touched
You can do that like
>> reduce/only [a f] [ f ] ;this doesn't touch to F
== [1 f ]

But this is not only for functions of course.