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

World: r3wp

[Core] Discuss core issues

Geomol
20-May-2006
[4545x2]
Thanks! Actually I map from the pointer function glVertex3fv to glVertex3f, 
which takes it parameters as values, but that should be no problem. 
(I can't send a pointer to another task over tcp.)
What contests? What 3d-engine? :)
Volker
20-May-2006
[4547x3]
with /viewtop: rebol/contest/i-rebot.r
(I suddenly have name-blackouts) That great tutotial-writer has a 
little demo how to use the  engine IIRC.
http://musiclessonz.com/rebol_tutorial.html#section-21.9
Geomol
20-May-2006
[4550x2]
Yes, it should be possible to call my OpenGL functions from an engine 
like that. That's the sort of things, I'm going to use this for. 
Only thing is, that the OpenGL window is inside a C execute, so you 
can't put REBOL controls (view stuff) in there. But you can then 
just have 2 windows.
One window with OpenGL output and another window with REBOL buttons 
etc. to control the thing.
Volker
20-May-2006
[4552x2]
I thought to use it for rendering too. Two modes rebol only with 
controls, or without 3d-card. and textures etc with real gl.
I think of a world ingl, with lots of models. and for editing a model 
can be picket into the rebol-window. (much smaller, rebol can handle 
that.) But maybe overkill and better concentrate on gl-integration?
Geomol
20-May-2006
[4554x2]
We'll see, how fast this thing I'm building will be. I hope to be 
able to use it like you think of - having a world with lots of 3D 
stuff and be able to walk around and change things.
... all controlled from REBOL.
Henrik
20-May-2006
[4556]
like in Jurassic Park!
Anton
21-May-2006
[4557x2]
I have just managed to patch FTP handler so it creates subdirectories 
recursively as needed. So code like this, which would fail before 
if the directory didn't exist, now works:
write ftp://user:[pass-:-server-:-dom]/my-dir/test "hello"
I'm announcing this because it took me a bloody long time.

You could fairly easily do your own recursive make-dir at the usual 
rebol level, but since the recursive mkdir is done inside the handler, 
the overhead of opening/closing/initializing ports is avoided.
Phew!  I'll publish that after some more cleaning and testing.
Geomol
21-May-2006
[4559]
Isn't this a bit funny?

>> "x" = "X"
== true
>> #"x" = #"X"
== false

But luckily it works in e.g. SWITCH:

>> switch #"x" [#"X" [print "x found"]]
x found

Maybe
#"x" = #"X"
should be true in REBOL3?
Anton
21-May-2006
[4560x2]
SWITCH is implemented using SELECT without the /case refinement, 
therefore it's case insensitive.
It's possible to add a /case refinement to the SWITCH....
Geomol
21-May-2006
[4562x2]
Makes sense, but should #"x" = #"X" be true? Comparing strings like 
"abc" = "AbC" is true.
Ah, maybe not. E.g. #"a" = 97 is true. #"A" = 97 is false. I suppose, 
this is the best behaviour.
Anton
21-May-2006
[4564x3]
Yes, char! is more close to integer....
Note:
>> "x" == "X"
== false
That's the more strict-equal, which turns off the case-insensitive 
equality of strings.
Volker
21-May-2006
[4567x2]
I would expect chars to compare like strings, but maybe that breaks 
things now.
mixing case/no-case comparisons can give surprises, and till now 
i nevernoticed that extra rules. good to know.
Anton
21-May-2006
[4569x3]
Better to keep the simple behaviour we have now with char equality, 
I think.
Anyone processing strings from different code-pages would be driven 
crazy by case-insensitive char compare.
Look at this ticket, "'select with a char! is not consistent":
http://www.rebol.net/cgi-bin/rambo.r?id=4046&
Volker
21-May-2006
[4572]
its not about simple, its about expected. a char is a char is no-case 
by default evrywhere, "=", 'parse, 'find, to-char - no wait.
Anton
21-May-2006
[4573]
(parse converts chars to strings internally..)
Volker
21-May-2006
[4574]
I dont look into the internallies all the time ;) On some occasions 
i am lazy and expect similar things to work similar.
Anton
21-May-2006
[4575x3]
But you could be right. At least there is scope for moving the simple 
equality test to strict-equal ==
Well, now is the time to lobby for such changes in Rebol 3.
That's a pretty fundamental operation, so we want to fix that in 
place pretty early.
Volker
21-May-2006
[4578x2]
Agreed.
What is the best way to distingisch text/binary files? list of suffixes 
for "is text, everything else binary", "is binary, evwerything else 
text"? Other ideas?
Geomol
21-May-2006
[4580]
- Read a part of the file. If every byte is ASCII (or 8-bit), it's 
text, else it's binary. This is only a good guess, of course!

- Many types of files have some header information right at the start 
of the file. Make a list of those headers. (I think, this is the 
way, many datatypes works in Amiga OS.)
Volker
21-May-2006
[4581]
Good ideas.
Geomol
21-May-2006
[4582]
You can also study the UNIX command: file
http://unixhelp.ed.ac.uk/CGI/man-cgi?file
You can probably find source for this command somewhere.
Anton
21-May-2006
[4583]
Gosh, the name of that unix command is really disturbing.
Joe
22-May-2006
[4584]
Hi,

I am a bit confused with bind and context

e.g.

blk: [a b] a: 1 b: 2
f: func [/local res][ 
res: bind/copy 'blk res 
probe reduce res
]

>> f
== [1 2]

Here my understanding would be that a and b are not
set in that context and the result is an error.

Apart for understanding the current behaviour, what I
want to accomplish is the behaviour that results in an
error.

I have a program where I set a lot of variables within
a function but I don't want to set all of them as
local, because it's repetitive and I sometimes miss a
few so I'd like declare them as local using a block
with all the variable names. 

Also, when I reduce the block I should get an error if
some of the variables have not been set independently
of whether any of these variables is set in the global
context.

Any ideas how to accomplish this ?
Anton
22-May-2006
[4585x4]
yep, hang on.
>> a: 1 b: 2
== 2
>> vars: [a b]
== [a b]

>> f: func compose [/local res (vars)][bind vars 'res reduce vars]
>> f
== [none none]

>> f: func compose [/local res (vars)][bind vars 'res a: 100 reduce 
vars]
>> f
== [100 none]
The vars block is composed into the function when it is created, 
but after that, vars is independant of the function, so it will be 
up to you to ensure they are consistent.
But I am wondering for what purpose you need this functionality.
Joe
22-May-2006
[4589x2]
but I want the vars to be unset! not none! so that it throws an error
also, f is normally a large standard function that I can not create
Anton
22-May-2006
[4591x3]
Function locals are set to none for you every time they are called.
They used to be left unset! but after a discussion years ago it was 
decided that it was more handy to set them to none.
What do you mean a large standard function ? example ?
Joe
22-May-2006
[4594]
I am using this for message composition, templates, etc.. So imagine 
you have a template: "<html><head> title </head><body> body </body></html>" 
but with many more tags and then you have a large funtction emit-page 
that generates many tags and when you generate the page you want 
to make sure that you've generated all the tags and if you missed 
some then you get an error