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

AltME groups: search

Help · search scripts · search articles · search mailing list

results summary

worldhits
r4wp4382
r3wp44224
total:48606

results window for this page: [start: 21101 end: 21200]

world-name: r3wp

Group: Core ... Discuss core issues [web-public]
Maxim:
16-May-2006
http is supposed to be handled in rebol, yet I had to rewrite my 
own http-post function to talk to a webservice operating only in 
http1.1 of which rebol had a lot of trouble handling.  yet the service 
was compliant and rebol was not.
Maxim:
16-May-2006
make send more stupid so we assume/expect less of it.  and make a 
proper email function which handles most common useage like a mail 
client does it.
Volker:
16-May-2006
Try seek, and then use 'skip etc. IIRC that works. (needs the newer 
rebols)
Joe:
16-May-2006
Anton, yes bcc is a blind copy. Gabriele explains it better than 
I did.  I found it very easy to code the new send function with the 
snippet above . The trick is to compose the right header and then 
send the message to both the to and bcc recipients. The MTA does 
remove the bcc field so the to: recipient or even the bcc: recipient 
do not have a bcc header field
Brett:
16-May-2006
It does seem that the bcc issue is caused by the presence of bcc 
in system/standard/email. Perhaps send could raise an error if it 
finds bcc set - and or - remove bcc from system/standard/email.
Joe:
17-May-2006
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
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.
Geomol:
19-May-2006
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
You could also "compile" the users data into something else one time, 
and have a better format in the loops?
Geomol:
19-May-2006
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.
Geomol:
19-May-2006
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
Thanks. And right now, it's the variables (x,y,z) reduction that 
is the problem?
Geomol:
20-May-2006
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.
Geomol:
20-May-2006
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).
Geomol:
20-May-2006
Volker, I've solved the reduce problem, and it makes sense now. The 
C function glVertex3fv takes a pointer to it's data as a parameter. 
I do the same thing in REBOL (using a block), and I then reduce it 
inside the REBOL function glVertex3fv itself.
Geomol:
20-May-2006
That way the block can hold variables, that'll change, and only when 
the function is called, the block is reduced to values.
Geomol:
20-May-2006
One window with OpenGL output and another window with REBOL buttons 
etc. to control the thing.
Volker:
20-May-2006
I thought to use it for rendering too. Two modes rebol only with 
controls, or without 3d-card. and textures etc with real gl.
Volker:
20-May-2006
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
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.
Anton:
21-May-2006
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.
Volker:
21-May-2006
mixing case/no-case comparisons can give surprises, and till now 
i nevernoticed that extra rules. good to know.
Volker:
21-May-2006
I dont look into the internallies all the time ;) On some occasions 
i am lazy and expect similar things to work similar.
Joe:
22-May-2006
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 ?
Joe:
22-May-2006
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
Joe:
22-May-2006
I think the above explains the problem domain. Imagine pages with 
lots of tags and that you don't want to clutter the emit-page function 
with lots of template variables neither want to compose the function 
given that if is a normal function where you do have other normal 
local variables. I am looking for ideas on how to approach this
Joe:
22-May-2006
I want the easiest possible approach i.e. you create an html file 
and define the tags like in the example above template:
Joe:
22-May-2006
and then you collect with a function the list of tags that you've 
created and then in a function you go and define dynamically all 
those tags as variables i.e. title: func-title "xyz" ...
Joe:
22-May-2006
I want to use the power of bind and contexts to make sure this works
Anton:
22-May-2006
Or wait... you want a context to keep all your template variables 
in:
	template: context [title: introduction: cost: none]
then unset all the variable in the template:
	unset bind next first template template

Your function references words in the template and receives an error 
for the first one which is unset.
	f: func [template][do bind [?? title] template]
	f template
	** Script Error: title has no value
	** Where: ??
	** Near: mold name: get name
but works fine when they have values:
	template/title: "hello"
	f template
	; ==> title: "hello"
Joe:
22-May-2006
I get script error: self has no value and I get the same error if 
I set a and b after bind in function f
Ladislav:
22-May-2006
Here my understanding would be that a and b are not
set in that context 
and the result is an error.

 - right, neither 'a nor 'b exists in the function context, therefore 
 they remained global
Ladislav:
22-May-2006
It looks, that we don't know what exactly you want to accomplish, 
and it is a bit hard to guess. Could you be more specific?
Joe:
22-May-2006
I am using linux and the clipboard doesn't worked so I typed the 
code
Joe:
22-May-2006
Ladislav, thank your help. I wanted to ask you about this via the 
mailing list and I did send the message earlier this morning but 
the mailing list is down. Please bear with me and I will provide 
the details. I think the solution you provided is exactly what I 
was looking for but I might be missing some detail. I am studying 
your code right now and will be more specific in a few minutes
Joe:
22-May-2006
IPls let me know if this example is not clear. What I want is to 
catch the case where tag3 is not set and throw an error This is useful 
where the tags are set in a large function and there are many tags
Anton:
22-May-2006
No, that's right. Contexts cannot be extended with new words (at 
this time).  I would pass a context to your function with the template 
and all the words in it. This context will have to be built at the 
beginning.
Gregg:
22-May-2006
It's still not clear to me what the real goal is. i.e. where values 
come from and how eval-template may be reused without giving it some 
parameters to guide it.
Pekr:
22-May-2006
Today I reread the blog, and I was not comfort with the idea that 
simple bind should auto-extend context ... maybe just my internal 
feeling, dunno .... just wanted to state opinion of less experienced 
reboller :-)
Joe:
22-May-2006
What I've been using in the past is different versions of eval-template 
for each template and I found the typical bug to be when missing 
a local given that the templates are evaluated multiple times
Anton:
22-May-2006
After extracting the words you need to convert them all to set-words 
and put them in a spec block, eg:
spec: copy []
foreach word words [append spec to-set-word word]
append spec none
; now you can create the context using the spec
the-context: context spec
; now unset each word in the context, etc..
Ladislav:
22-May-2006
I just thought, that you wanted to have a function accepting and 
processing templates
Joe:
22-May-2006
Yes, my problem is an error handling problem. So far the template 
blocks are global, and I want to have functions that can build the 
templates without actually passing the template as a parameter
Gregg:
22-May-2006
If we could step back and look at the problem, without implementation 
details, it would help me to understand.
Gregg:
22-May-2006
Why not just use FUNCTION with your existing code body and spec; 
make eval-template funcs on the fly?
Joe:
22-May-2006
there are three approaches so far: 1) building function everytime 
with locals (anton/gregg) 2) template object (anton) and 3) lfunc
Joe:
22-May-2006
I am going to code this using lfunc for the simplicity it brings 
and see what I learn Thanks all
Anton:
22-May-2006
(if your templates are not changing, the corresponding template objects 
can be made once and reused many times).
Anton:
22-May-2006
make-template-context: func [
	template
	/local words spec
][
	words: remove-each val to-block template [tag? val]

	spec: words
	forall spec [spec/1: to-set-word spec/1]
	append spec none

	context spec	
]

eval-template: func [
	template-ctx
	code
	/local err
][

 unset bind next first template-ctx template-ctx  ; unset all words 
 in the context
	do bind code template-ctx  ; do the code

	; Check if any tags were not set

 if find next second template-ctx unset! [ ; were any tags not set 
 ?
		print "Some tags were not set!"
		foreach word next first template-ctx [
			if not value? in template-ctx word [
				print [word "is unset!"]
			]
		]
	]
]

; now test


template: "<html><head><title> title </title></head><body>tag1 tag2 
tag3</body></html>"

template-context: make-template-context template

eval-tags: [
	title: "web page"
	tag1: "tag1"
	tag2: "tag2"
	tag3: "tag3"
]


eval-template template-context eval-tags  ; <- this sets all expected 
tags and is ok

eval-template template-context [] ; <- this doesn't set any tags 
so will complain and show all unset tags
Frank:
22-May-2006
Clipboard on linux :   ctrl-v  in altme and middle mouse button in 
a text editor, it works for me
BrianH:
23-May-2006
Use find/only and your path! will be found.
BrianH:
23-May-2006
When searching in a string type for any string type, the type is 
converted. Same for block types. And path! is a block type.
Ashley:
23-May-2006
Don't know whether this has been discussed / RAMBOed yet, but I think 
a smarter reduce (either a refinement or another word) which could 
handle:

	reduce [now then]

instead of requiring:

	reduce [now 'then]

or

	compose [(now) then]


would make writing dialects a lot easier as unset! is rarely a legitimate 
value within a dialect (i.e. I'd like to reduce blocks before parsing 
and words without a value should just be left as is).
Ashley:
23-May-2006
Something like:

reduce2: make function! [
	block [block!]	"Block to reduce"
	/deep		"Reduce nested blocks"
	/local blk

 "Evaluates a block of expressions, skipping words without a value, 
 and returns a block."
] [
	blk: copy []
	foreach word block [
		either block? word [
			either deep [
				insert/only tail blk reduce2/deep word
			] [insert/only tail blk word]
		] [insert tail blk either value? word [do word] [word]]
	]
	blk
]


>> reduce2 [red x now now/date (1 + 1) [red x now now/date (1 + 1)]]

== [255.0.0 x 24-May-2006/13:12:14+10:00 24-May-2006 2 [red x now 
now/date (1 + 1)]]

>> reduce2/deep [red x now now/date (1 + 1) [red x now now/date (1 
+ 1)]]

== [255.0.0 x 24-May-2006/13:12:26+10:00 24-May-2006 2 [255.0.0 x 
24-May-2006/13:12:26+10:00 24-May-2006 2]]


but as a native! and able to handle funcs with args (e.g. reduce2 
[print "hi"]).
Geomol:
24-May-2006
REBOL keeps surprise us again and again! :-)
JaimeVargas:
24-May-2006
Ashley, but reduce/only doesn't perform according to your  initial 
spec "Evaluates a block of expressions, skipping words without a 
value, and returns a block."
>> reduce/only [now then]
** Script Error: then has no value
Cyphre:
25-May-2006
Ashley: reduce /only -- Only evaluate words and paths, not functions
So the results you are getting above seems logicalto me.
Gabriele:
25-May-2006
Ashley, the idea is that in parse, when you get to something you 
want to evaluate, you set a marker and use do/next. like in volker's 
example. my compile-rules provided  a way to do this automatically 
:)
Volker:
25-May-2006
It has its purposes without side-effects. And you can have side-effects 
in the parens too, eg a do/next ;)
Oldes:
30-May-2006
ah it's easy as well, just using make-dir... I'm reboling so many 
years and still am so suprised how simple it can be:-)
Sunanda:
30-May-2006
If you don't explicitly set the file permissions (under UNIX-deriviatives 
mainly) to precisely what you mean them to be, then they *may* be 
set to something other than what you wanted. That applies to all 
files and folders.
http://www.rebol.com/docs/words/wset-modes.html

I'm not suggesting your patch does something wrong.....Just that 
it may not do what someone expects.
Joe:
30-May-2006
can anybody provide a simple example to explain copy and copy/deep 
behaviour ? thanks
Oldes:
31-May-2006
and this one as well: ** User Error: Cannot open a dir port in direct 
mode
Anton:
31-May-2006
Ok, I recommend to use open and close the port *not* in direct mode, 
just to create the directory.
Then, try opening your port in direct mode to do the write.
Oldes:
31-May-2006
and I think, this should be enough: thru "tcp 550" to end
Oldes:
31-May-2006
lines 81 and 107
Anton:
31-May-2006
(I mean, what's the name and version of the FTP server ?)
Gordon:
2-Jun-2006
Hello;
  I'm getting an
   "Internal Error: No more global variable space
     Where: to-word
** Near: to word! :value"


 when i run a program that after reading a file into memory, it then 
 does a character by character parse of the file and writes any words 
 that it finds to a new file.  The code that seems to be causing a 
 problem is this:

    Write/Append OutFileNameFull reduce [to-word WordStr newline]   


It gets through about 1.5 MB before it "runs out of global variable 
space".


Why is it running out of global variable space when there is only 
the one variable (to-word WordStr)?
Gordon:
2-Jun-2006
Thanks but WordStr is a string and I need it to be a word type.
Gordon:
2-Jun-2006
Actually, you are right.  Thanks Oldes.  I was able to write it all 
to the file then read it back in and parse it into 'words' without 
using 'to-word'.
Gabriele:
5-Jun-2006
note that r3 will make it easier to create non-bound words (i.e. 
symbols) for the cases when you want to use words as symbols (dialects, 
data, etc) and not variables. anyway, as anton says, i don't think 
anyone would ever really need more than 8k distinct words, so when 
you get that error it means that probably you are doing something 
wrong :) (ah, and given that contexts are extensible in r3, i expect 
the 8k word limit to go away)
JaimeVargas:
14-Jun-2006
Thx, Ingo and Volker, what I was looking for is SYSTEM/OPTIONS/PATH
BrianW:
14-Jun-2006
and for the public record, at least part of my answer is:

raw-str: mold real-str
BrianW:
14-Jun-2006
How about going the other way? Turning newlines into ^/ characters 
and so on?
BrianW:
14-Jun-2006
and again I answer my own bloody question:

replace/all (mold real-text) "^/" "^^/")


Guess I don't actually start thinking for myself until I ask the 
question somewhere that I can look dumb ;)
james_nak:
15-Jun-2006
Thanks Anton. Yep, right after I wrote that I said to myself  "Self, 
why don't you try  'd: make c [ ]'"  and it works...and it is in 
the docs on objects. Duh. Thanks.
Robert:
16-Jun-2006
This is IMO inconsistent and should be changed:

>> ? for
USAGE:
    FOR 'word start end bump body

DESCRIPTION:
     Repeats a block over a range of values.
     FOR is a function value.

ARGUMENTS:
     word -- Variable to hold current value (Type: word)

     start -- Starting value (Type: number series money time date char)

     end -- Ending value (Type: number series money time date char)

     bump -- Amount to skip each time (Type: number money time char)
     body -- Block to evaluate (Type: block)

(SPECIAL ATTRIBUTES)
     catch
     throw
>> a: 2.0
== 2.0
>> for test 1 a 1 [print test]
** Script Error: for expected end argument of type: integer
** Near: for test 1 a 1
>> number? a
== true


It should be possible to use decimal! as well. The interpreter should 
implicitly convert it to an integer!
Robert:
16-Jun-2006
The docs state number! and not integer!
BrianH:
16-Jun-2006
The type of the start and end variables must be the same. If you 
look at the source of for, you will see that it throws that error 
when they are not.
BrianH:
17-Jun-2006
Robert, although 1 and 1.0 are both numbers, they are not the same 
type in REBOL. Sure, they can be converted, but unless you do so 
they aren't. It would be simpler to just rewrite your example to 
this:

>> a: 2.0
== 2.0
>> for test 1.0 a 1 [print test]
1.0
2.0


and not have the type mismatch I was talking about. Unfortunately 
REBOL doesn't have type signiatures that are powerful enough to specify 
that these two parameters need to be the same type, so that constraint 
has to be enforced in the code.
BrianH:
17-Jun-2006
Oldes, a builtin read-thru would require Core to be installed rather 
than just copied somewhere, just like it does with View - view-root 
is set during installation. Still, all of the *-thru functions are 
written in REBOL, so they can be copied and adapted to your purposes 
quite easily.
Volker:
17-Jun-2006
And i dont like to rely on user.r . personal preference.
Volker:
17-Jun-2006
and having a %public/alongside my /core-script work quite well for 
me.
Volker:
17-Jun-2006
i like to poitn peoples to install rebol and run a little launch-script 
i send them.
BrianH:
17-Jun-2006
No, rebol.r used to contain the feedback function and so was included 
in the Core package. It is not written automatically. You can keep 
control of it if you want.
Volker:
17-Jun-2006
and have that run without problems.
BrianH:
17-Jun-2006
It was supposed to be that global settings were contained in rebol.r 
and user-specific or local settings in user.r, but it never worked 
that way with Core because REBOL only looked for the location of 
those files once for both, rather than once for each, so you couldn't 
put user.r in a user-specific place and keep rebol.r is a global 
place. VIew does it right with version 1.3 though.
Robert:
18-Jun-2006
Cool... I had this idea with the comparators too but not to use pick 
and the level as the selector. Cool stuff!
Pekr:
26-Jun-2006
I am not sure I can meet with such situation in real-life :-) I just 
got asked by Bobik. The thing was, that in sqlite date field there 
can be invalid date. Now I am not sure how is the conversion done, 
if via string, but if you simply type such invalid date in console, 
it can't be recovered, and that is my objection in general ...
DideC:
26-Jun-2006
To be executed, a script is loaded in a whole. So each values is 
loaded/binded and your error appears at this time, not while the 
expression is evaluated.
Pekr:
26-Jun-2006
anyway ... I don't like current state, that is all. I even don't 
know consequences, just a feeling :-) Maybe Carl could give us his 
opinion, if it is bug or not, and if not, if this is desirable behavior 
...
Pekr:
26-Jun-2006
hmm, help me to imagine, how does interpreter internally works? So 
let's simplify it - it reaches 280.250.250 tuple. It tries to parse 
it. It eventually recognises it as a tupple, otherwise it would not 
return "Invalid tuple", no? But then it finds invalid values ... 
why just doesn't it recognise, it is part of 'try block and does 
not throw error, which would be catchable?
Volker:
26-Jun-2006
if load cant handle something, it is helpless. it does not know something 
is inside a try-block. it only knows it has loaded a lot of words 
already and the followingtext is not right.
Volker:
26-Jun-2006
maybe some datatype "weird" with the original string and a type-suggestion? 
but then you get problems with ambiguities.
Graham:
26-Jun-2006
quick question ... I have a number of simple objects that I create 
on the web server and then send back to client in molded format.
Volker:
26-Jun-2006
Pekr, the only thing to know is that all code is loaded and checked 
for syntax, and then executed. and before execution 'try has no real 
meaning, it could be"the" 'try, or a local or style or something. 
when 'do does the code it does no longer know the original source. 
So 'load has to report errors on its own.
Volker:
26-Jun-2006
Btw rebol cheats and uses a calendar ;)>> 29-feb-2004
== 29-Feb-2004
>> 29-feb-2005
** Syntax Error: Invalid date -- 29-feb-2005
** Near: (line 1) 29-feb-2005
Volker:
26-Jun-2006
No, thats the basic equpment of a god loader. pda and such ;)
Volker:
26-Jun-2006
Hmm, shifting would be nice. I use them for version-numbers and colors, 
so i dont need rotation. but getting at thepart with the os would 
help. What usage benefits from rotation?
DideC:
26-Jun-2006
As a comment, try "29/02/2006" in Excel and it will give you a nice 
"text" value, not a date value.
Don't expect 'load to make this kind of choice !
21101 / 4860612345...210211[212] 213214...483484485486487