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

World: r3wp

[Core] Discuss core issues

Brett
16-May-2006
[4485]
Maxim, re http-post. Are you talking about a bug in the http scheme? 
You seem to be implying something structural. Is the issue fixed 
in the new versions of REBOL or still present?
Joe
17-May-2006
[4486]
Brett, bcc is set to none by default so it doesn't cause any issues. 
If the field is set and exported as part of the header, the mail 
transfer agent will remove it
Maxim
17-May-2006
[4487]
yes the scheme had issues with content lenghts.  and I needed to 
post in 1.1 which is not handled directly by the scheme AFAICT.
Rebolek
19-May-2006
[4488]
I though I've got it working but it was a mistake. I'm still not 
able to use /skip refinement on files succesfully. Does anybody now, 
if it's possible to OPEN or READ file from some offset? I saw some 
bug filled in RAMBO two years ago :(((
Volker
19-May-2006
[4489x2]
p: open file
p: skip p 123
data: copy p
IIRC
open/seek
Rebolek
19-May-2006
[4491x2]
so /skip refinement is good for what?
I cannot use copy/part in this case :(
Volker
19-May-2006
[4493]
/skip : Backward compatibility. It helps with resume through http 
AFAIK.
Rebolek
19-May-2006
[4494]
So how can I succesfully write read/binary/part/skip ?
Volker
19-May-2006
[4495]
write %test.txt "123456789"
p: open/seek %test.txt
p: at p 4
probe copy/part p 4
Rebolek
19-May-2006
[4496]
Thanks
Geomol
19-May-2006
[4497]
Do I need reduce/deep? Example:
x: 0.123
v: reduce/deep [ [- x 1.0 1.0] [0.0 0.0 0.0] ]

v should now hold: [ [-0.123 1.0 1.0] [0.0 0.0 0.0] ]
But reduce don't have a /deep refinement, and if I do:
v: reduce [ [- x 1.0 1.0] [0.0 0.0 0.0] ]

those inner blocks ain't reduced. Is there another easy way? I don't 
wanna have REDUCE inside the block.
Volker
19-May-2006
[4498]
compose/deep ? Also a reduce-deep would be a few lines.
Geomol
19-May-2006
[4499]
Yeah, I guess. compose/deep require parens inside the block. I could 
make a reduce-deep function, but that'll hit performance. REDUCE 
is native. Should reduce/deep be part of REBOL 3 maybe?
james_nak
19-May-2006
[4500]
For sure.
Volker
19-May-2006
[4501]
You need a lot performance?
Geomol
19-May-2006
[4502x2]
I'm using this feature in the OpenGL API, I'm working at. Maybe I 
could do a late reduce, when accessing the inner blocks.
Volker, yes I need all the performance, I can get for this.
james_nak
19-May-2006
[4504]
Is there a time when one doesn't want inner blocks to be reduced?
Volker
19-May-2006
[4505x2]
 I don't wanna have REDUCE inside the block.

 Is that only inconveniert, or would it really make problems? Maybe 
 some kind of automatic rewriting could help?
James,  parse-rules inside a block?
james_nak
19-May-2006
[4507x3]
Yep. You're right.
I was just thinking how this particular behavior has caused me some 
trouble in the past but I see why they did it that way.
You would think  there would be a "complete" reduce parameter though 
that just works the way one would think it would.
Volker
19-May-2006
[4510]
Would rebcode be an option? Or a dll for some datastructures?
Geomol
19-May-2006
[4511]
Volker, a rebcode version will probably make sense later, but I'm 
under OSX right now, where the rebcode is an old version.
Volker
19-May-2006
[4512]
I doubt  i find a good idea, so if i am boring just say stop.

Would it work to flatten the datastructure? /skip instead of nested 
blocks? Tehn 'reduce would work.
Geomol
19-May-2006
[4513]
Well, that could work. But the situation is, that the datastructure 
is made by the user, so it should be as straight-forward as possible. 
Example of a structure:

vdata: [	
	[- X 0.0 Z] [X 0.0 Z] [- X 0.0 - Z] [X 0.0 - Z]	
	[0.0 Z X] [0.0 Z - X] [0.0 - Z X] [0.0 - Z - X]	
	[Z X 0.0] [- Z X 0.0] [Z - X 0.0] [- Z - X 0.0]
]


I think, I'll do a late REDUCE of the inner blocks, when I access 
them. But thanks for your ideas! :-)
Volker
19-May-2006
[4514x2]
You could also "compile" the users data into something else one time, 
and have a better format in the loops?
But if it works for now go on with the funnier stuff :)
Geomol
19-May-2006
[4516]
You see, the C version of that structure is this:

static GLfloat vdata[12][3] = {	
   {-X, 0.0, Z}, {X, 0.0, Z}, {-X, 0.0, -Z}, {X, 0.0, -Z},	
   {0.0, Z, X}, {0.0, Z, -X}, {0.0, -Z, X}, {0.0, -Z, -X},	
   {Z, X, 0.0}, {-Z, X, 0.0}, {Z, -X, 0.0}, {-Z, -X, 0.0} 
};

And I want something similar, so users don't confused too much.
Volker
19-May-2006
[4517]
Makessense.
james_nak
19-May-2006
[4518]
Are the users going to enter such an array as above?
Geomol
19-May-2006
[4519x2]
I already have some OpenGL examples from the red book of OpenGL running 
in REBOL syntax. It's funny to see those examples in REBOL with the 
minor syntax. :-) I have no real idea of performance yet, I need 
heavier examples for that.
james, no C syntax. I'm making a REBOL version of the OpenGL API 
with REBOL syntax. Users will be able to use normal REBOL and call 
OpenGL functions (with REBOL syntax).
james_nak
19-May-2006
[4521]
Thanks. And right now, it's the variables (x,y,z) reduction that 
is the problem?
Geomol
19-May-2006
[4522x3]
yes
To give you an idea.
Instead of doing this in C:

	glClear (GL_COLOR_BUFFER_BIT);

	glColor3f (1.0, 1.0, 1.0);
	glBegin (GL_POLYGON);
		glVertex3f (0.25, 0.25, 0.0);
		glVertex3f (0.75, 0.25, 0.0);
		glVertex3f (0.75, 0.75, 0.0);
		glVertex3f (0.25, 0.75, 0.0);
	glEnd ();

	glFlush ();

You can do this in REBOL:

	glClear GL_COLOR_BUFFER_BIT

	glColor3f 1.0 1.0 1.0
	glBegin GL_POLYGON
		glVertex3f 0.25 0.25 0.0
		glVertex3f 0.75 0.25 0.0
		glVertex3f 0.75 0.75 0.0
		glVertex3f 0.25 0.75 0.0
	glEnd

	glFlush
Those are functions, so you can mix it with other REBOL words, like 
loops or whatever.
james_nak
19-May-2006
[4525x2]
so something like glBegin GL_POLYGON
		glVertex3f 0.25 0.25 0.0
		glVertex3f 0.75 0.25 0.0
		glVertex3f 0.75 0.75 0.0
		glVertex3f 0.25 0.75 0.0
	glEnd

Gets turned into
vdata: [	
	[- X 0.0 Z] [X 0.0 Z] [- X 0.0 - Z] [X 0.0 - Z]	
	[0.0 Z X] [0.0 Z - X] [0.0 - Z X] [0.0 - Z - X]	
	[Z X 0.0] [- Z X 0.0] [Z - X 0.0] [- Z - X 0.0]
]
Without the vars of course.
JaimeVargas
19-May-2006
[4527]
John, Is your opengl api rendering in a rebol window or face?
Geomol
19-May-2006
[4528x2]
The commands are sent to a C program (task), that'll execute the 
OpenGL code. So the C program owns the window, not REBOL.
Jaime, the answer to your question is: no.
Geomol
20-May-2006
[4530x3]
james, no. It's from 2 different programs. The datastructure is just 
used in one example. Some OpenGL commands take pointers to datastructures 
as a parameter.
You can see the full example here: http://home.tiscali.dk/john.niclasen/OpenGL/GLClient.html

First you have the C source, and below that the REBOL source, that'll 
do the same thing. I first thought about putting a REDUCE in, where 
vdata is defined, but I've changed my mind. The glVertex3fv function 
has to reduce it's argument.
And that of course doesn't work. The datastructure has to be like 
this in REBOL:

vdata: [	
	[- X 0.0 Z] [X 0.0 Z] [- X 0.0 (- Z)] [X 0.0 (- Z)]	
	[0.0 Z X] [0.0 Z (- X)] [0.0 (- Z) X] [0.0 (- Z) (- X)]	
	[Z X 0.0] [(- Z) X 0.0] [Z (- X) 0.0] [(- Z) (- X) 0.0]
]


Maybe it's time to make a new group about this. I'm not home the 
rest of the day (beer festival going on), but I should have something 
for others to try out tomorrow (those who's interested).
Volker
20-May-2006
[4533]
enblock (reduce deblock data) 3

Some meazzines i use sometimes. But they are meazzines, if speed 
reeally is  an issue..
Geomol
20-May-2006
[4534]
I could use NEGATE in stead of unary minus though. hmm