• 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: 20701 end: 20800]

world-name: r3wp

Group: Core ... Discuss core issues [web-public]
JaimeVargas:
4-Nov-2005
Brian depends on who is coding and for what purpose? But I am with 
you.
Gregg:
5-Nov-2005
Adding things like this to path notation hides a lot of compuational 
complexity. Sometimes that's a very good thing, and sometimes it's 
not. And consider what should happen in the case that "my-block/[2 
3]" refers to a two-dimensional array, or a block of name value pairs; 
what should the result be? Something like that fits very well in 
a dialect where the power is leveraged, and the domain is tightly 
constrained. That's where we get power and safety combined.
Graham:
5-Nov-2005
I suggest we just adopt the Python syntax for slicing strings, and 
accept that this is a dialect for handling string slicing, and not 
2 or more dimensional arrays.
Graham:
5-Nov-2005
And other one dimensional series.
Graham:
5-Nov-2005
Yes, and I presume that it is one of the X- type fields.
Gordon:
5-Nov-2005
Record: [a b c d e f g h i]
foreach mold Record SeriesBlock [
   print record
]

Can someone tell me how to define a block (as in Record) and then 
use that variable in the foreach loop?
Although the array has values, nothing is printed in the loop.

When I remove the 'mold' statement, 'Record' contains just one value 
('a') not 9 (a b c d e f g h i).
Gordon:
5-Nov-2005
I want to use two block arguments.  One for word (value that gets 
set each time) and of course the 'data' block.
Gordon:
5-Nov-2005
This traverses the datablock and sets each of the 9 values and prints 
them as a record.
Volker:
5-Nov-2005
me too, and wrong.
Gordon:
5-Nov-2005
Sunanda: Thanks for the example.  I'll play with your example and 
see what I can do.
Gordon:
5-Nov-2005
I want to be able to pass the function another value which equals 
the number of elements in a record and then do something like Record: 
array {Elements}
Sunanda:
5-Nov-2005
sort/skip --- I get you -- like it's not easy to sort on the 2-digit 
numbers here:
sort/skip [99 10 2       98 11 5        97 12 4] 3
But it is possible with /all and a parameter into the function
Gordon:
5-Nov-2005
Lots to think about and try.  Thanks a bunch guys for your help.
Graham:
6-Nov-2005
Seems however, that sex is 1 for female, and 0 for male for this 
to work ( being male confers a higher risk ).
DideC:
13-Nov-2005
Yes, you can "browse http://127.0.0.1:123456" and have a small server 
to send the page to the browser.
Volker:
16-Nov-2005
and at the end you have something linear, so you could use block! 
or list! ?
Volker:
16-Nov-2005
So not linear, but a tree. And you use blocks as lisp-pairs.
Volker:
16-Nov-2005
if i understand right, we could use a block for a lisp-pair, and 
'first and 'second for car/cadr ?
Volker:
16-Nov-2005
and a list (a b c) would look like
 [a [b [c nil] ] ]
Volker:
16-Nov-2005
cons: func[a b][ reduce[ first a  b  ] ]
 probe cons[a none] cons [b none ][c none]
== [a [b [c none]]]
and 
(cons 'a (cons 'b '(c)))
== (a b c)
JaimeVargas:
16-Nov-2005
>> cons [a b c] [d e]
This is a list of test from lisp.

> (cons 'a '())
(list 'a)
> (cons '() '())
(list empty)
> (cons '() 'a)
cons: second argument must be of type <list>, given empty and 'a
> (cons '(a b c) 'a)

cons: second argument must be of type <list>, given (list 'a 'b 'c) 
and 'a
> (cons '(a b c) '(d e))
(list (list 'a 'b 'c) 'd 'e)
Volker:
16-Nov-2005
I guess i represent lisp-nodes differnetly, and maybe wrong.
Volker:
16-Nov-2005
Hmm, no, there are atoms and lists. So i have to dig a bit deeper. 
then cons is really a 'reduce. but lisp has no lists with multiple 
elements, thats mold-sugar. WHile we have in rebol and your cons 
can deal with that.
Volker:
16-Nov-2005
(and it must be a copy, on several places)
JaimeVargas:
16-Nov-2005
I think. Very nice and short cons.
Volker:
16-Nov-2005
Maybe a set of lisp-porting-tools? In rebol itself i use more iteration 
and insert/append. No need for cons. In lisp its recursion and list-building, 
there it is helpfull.
Volker:
16-Nov-2005
And learn EoPL in discussions here :)
Volker:
16-Nov-2005
That EoPL looks interesting. got contents and foreword http://www.cs.indiana.edu/eopl/front.ps
. Like it.
Maarten:
17-Nov-2005
I got it, it is a hard book. I haven't gotten the time to get through 
it with my job and kids, but what I have done was well worth it. 
EopL and the "book with the dragons" by Aho et al about complier 
design are books that change your view on programming.
DideC:
23-Nov-2005
About request-date, I had reworked it for the "first" View 1.3 project 
(2 years ago). It use locales and some other enhancements. Just test-it 
directly :
Anton:
27-Nov-2005
Actions are like natives. They are built in and you can't make them 
yourself.
eFishAnt:
27-Nov-2005
Anton...I was afraid that would be the answer...course, maybe it 
works anyway...where a function! is used in the place of an action! 
(however, I dread there might be some side-effect if action! needs 
a context, and that context it needs is not provided by the function! 
substitute.
Graham:
27-Nov-2005
Volker, the parse rule occurs in a BEER callback .. and I need to 
change the parse rule depending upon which BEER function I am calling. 
 Of course, there are always workrounds one can set up, but was wondering 
if there was some way to relax the REBOL interpreter when building 
up dynamic code like this.
Graham:
27-Nov-2005
Seems the 'case statement is not in the encap from July last year 
and it's a native.
Anyone have source for a mezzanine case statement ?
Volker:
28-Nov-2005
No good ways. You can build a path and do that.
JaimeVargas:
28-Nov-2005
And have two singleton methods on the argument ref.
Graham:
30-Nov-2005
Is there a way to set and read windows environmental variables ?
Gabriele:
1-Dec-2005
>> get-env "APPDATA"

== {C:\Documents and Settings\Gabriele Santilli\Dati applicazioni}
Anton:
2-Dec-2005
You mean, you set a new user env variable, and rebol wasn't able 
to pick it up straight away ?
Anton:
2-Dec-2005
logout and login probably sufficient
RobertDumond:
2-Dec-2005
i'm running into a strange issue with the prerebolizer... it is taking 
a part of one line from my main rebol file and then a few blocks 
of another rebol file and overwriting another seemingly random rebol 
file with this data... has anyone run into this problem or have any 
idea what could be causing the problem?  i am using Preprossor 2.0.0
Pekr:
7-Dec-2005
I have one question regarding security - can actually rebol words 
be secured/protected? I noticed, when looking at get-net-info and 
trying to execute it, that get-reg is probably being unset internally 
after get-net-info gets executed. Isn't it sign rebol's security 
model is not sufficient?
Pekr:
7-Dec-2005
can I e.g. create word in context, which would be visible only in 
terms of such context? Being it value, function, whatever, prevented 
to be outputted by 'get, 'probe, 'print, 'source and other functions?
Volker:
7-Dec-2005
AFAIK not. 'protect is for debugging AFAIK.

But i can work secure if you use 'secure. The way is, as long as 
i dont touch user-data, i am secure. Thats why rebol has get-reg 
on startup, no user-code loaded, no harm possible. Before i touch 
user-code (or data), i tighten security as much as possible. unset 
dangerous words (if i am paranoid i disable "make struct!". I use 
secure to restrict file-access only where needed, disable shell and 
library, maybe network-access. A script/bug can not undo this things, 
and IMHO that is quite secure.
Volker:
7-Dec-2005
Henrik, copy/deep does not copy functions. and you have a function 
here, try mold/all instead of probe.
Gabriele:
7-Dec-2005
volker: it's just that TIME is bound to the object, and he's changing 
its value to that date...
Volker:
7-Dec-2005
i misunderstood, you can ignore that. mold molds functions like their 
sourcecode. mold/all molds functions specially, so that you see what 
a function and what only source is. Thought that would give a hint 
to the problem.
Pekr:
7-Dec-2005
Gabriele - encapsulation is kind of security. And in fact, if some 
code is encapsulated, or not being able to be called from outside 
of some context, it is kind of secure
Gordon:
8-Dec-2005
Nevermind.  
It turns out that if you use
FireName: to-file request-file/file "/C/Program Files/"
that it will split the path and name at the space.
OTOH if you use

Filename: to-file request-file/file "/C/Program Files/*" (note character 
after the path)

that this will work.  The character after the path can be any character.
Graham:
11-Dec-2005
Has anyone done anything in the way of a reporting dialect ( that 
gets converted to sql and executed ) ?
Rebolek:
12-Dec-2005
Because I'm writing scripts on more than one computer I need to sync 
files somehow. I can use flashdisk for synchronization, but USB is 
not always available or I forget my flashdisk at home, so it's not 
always the right option.

Or I can use ftp to upload and download files. But at the end I've 
got lots of different directories with different versions, because 
I have no intelligent file structure.

I was inspired by Google filesystems for win and lin so I decided 
to use some freemail (gmail preferably) for my scripts maintaing. 
Unfortunatly, Gmail needs some authentication, SSL or what and SSL 
under Rebol needs Command and Command needs 350$ to buy.

So I found another freemail provider that offers both non-authenticated 
SMPT and POP and therefore is OK for REBOL (btw. remeber the old 
REBOL example? send [luke-:-rebol-:-com] read http://www.rebol.com? Hard 
to do with all the authetications required today.) and I started 
coding.

The result is a small application called %rspace.r that can upload 
file to repository, download newest version from repository, or you 
can get list of all files in repository and finally, if you're happy 
with your script, you can publish it on www/ftp. All this with documentation 
in less than 6kB.

All you need is REBOL and mail account cappable of SMTP/POP without 
authentication. It's good to have an FTP account for publishing files 
but that's not required. If you do not have an mail account, I've 
set up one on seznam.cz, user 'rebolspace' and pass 'spacerebol' 
for testing this application (it's built in, so you can start testing 
right after download).

Remember, it's just alpha, does not have many features, but it works, 
I can write something here, update it there and have all the versions 
accesible from everywhere. It's written for REBOL scripts so with 
big projects it's going to be very slow and unusable, but for small 
project (and most REBOL scripts are really small) it's probably good.

So download it form http://krutek.info/rebol/rspace.r(stable) or 
http://rebolspace.sweb.cz/rspace.r(latest published version). 

WARNING: because [rebolspace-:-seznam-:-cz] is open account it won't be 
wise to use it ordinarily. Please, if you like it, set up your own 
account and use it instead of built-in one.
And remember: all suggestions and fixes are welcome.
MichaelB:
12-Dec-2005
find-deep: func [b [block!] o [any-type!]][
	forall b [

  either block? b/1 [return find-deep b/1 o][if b/1 = o [return b]]
	]
	none
]
z: find-deep [a b [c d [e] f]] 'e
probe z


Has somebody an idea why this is not working ? Find-deep is always 
return none, even though it finds the e in the inner block. Upon 
debugging the 'e is found and the inner block returned, but then 
one level up in the recursion only a none reaches the 'return after 
the find-deep invocation. Maybe I'm missing something very simple 
?
Volker:
12-Dec-2005
in such cases, try to print something between the forall and the 
none. I uess you will see that output multiple times.
Volker:
12-Dec-2005
forall: func [
    "Evaluates a block for every value in a series." 
    [catch throw] 

    'word [word!] {Word set to each position in series and changed as 
    a result} 
    body [block!] "Block to evaluate each time"
][
    throw-on-error [forskip :word 1 body]
]
Henrik:
12-Dec-2005
1.3.61 and 2.6.50 is somewhat older than 1.3.2. I think there are 
quite a lot of bugfixes in 1.3.2...
MichaelB:
12-Dec-2005
Yes, I'm right now just a little bit confused with the numbers anyway. 
I have to sets of icons, alphas and official and used the alphas 
for testing funcs and the like and thought they're at least as new/fixed 
as the official releases, but maybe my alpha isn't completely up-to-date 
either.
Anton:
13-Dec-2005
Yes, FORALL was modified very recently, and the return was a bug.
MichaelB:
13-Dec-2005
can somebody give me a quick rule, why the pick-path notation evaluates 
it's picked value and pick does not (and first...) (as it should 
be a shorthand for pick)
as in:
bl: [] 
append bl func [a][print a]
bl/1 "hello" ;evaluates the function
pick bl 1 "hello" 
first bl "hello"  ; both do not

I have to do an extra 'do - I'm just curious for a reason ?!
Geomol:
13-Dec-2005
The explanation might be, that it should be possible to get the function 
without evaluating it. You can do that with PICK or FIRST:
f: pick bl 1
f: first bl

Now if bl/1 worked the same way, you always had to add DO to get 
it evaluated. So my guess is, Carl desided, that wouldn't be too 
smart, and I agree. It's the same with objects. To call a method 
(a function) within an object, you just write:
o/some-func

No DO is needed in front of that. So using path notation to get to 
a function within a block or an object will evaluate the function.
MichaelB:
14-Dec-2005
Thanks for the answers. Maybe this should be noted somewhere especially 
- when I was searching for it, the only thing I found is in the documentation 
in the examples for unnamed functions. There only the path notation 
was used to extract and evaluate the functions immediately.

I agree that this evaluation is good to have and on purpose, just 
a bit too hidden for my taste (one again has to have quite some undestanding 
how Rebol works to have a resonable model for these things or a big 
memory) - as some other things in Rebol.
MichaelB:
14-Dec-2005
and I hope so :-)
MichaelB:
14-Dec-2005
I actually really think, that one of the problems Rebol has, especially 
for beginners and people from other languages, is that it's hard 
to have a small model in the head of how things work  and why, so 
that out of a small amount of knowledge most stuff can be infered, 
at least sometimes it's not too consistent. (I know belongs a bit 
into the steep vs. shallow vs. deep learning curve topic)
Geomol:
14-Dec-2005
Research suggest, that intelligence and memory are mutual exclusive. 
If you remember too much, it'll have a bad influence on your intelligence. 
On the other way, the ability to forget information will mean higher 
IQ. This is in agreement with, how Claude Shannon defined informatin 
in 1948 at Bell laboratories.

The trick is to remember only the absolutely crucial information 
and forget the rest. ;-)
MichaelB:
14-Dec-2005
Was it always like that, that make object! 'block didn't copy the 
block before and that one get's the real block used for creation 
also via third 'object ? I was a little bit surprised to be able 
to change the binding of the words in an object after creation - 
I thought this is not possible with objects - now if we only could 
extend objects ...
sqlab:
15-Dec-2005
I found that many times annoying, but it reflects the description.(
/tail and /all are mutually exclusive.
sqlab:
15-Dec-2005
only at the tail and the head
MichaelB:
15-Dec-2005
this is from the blog-chat: 

I liked Ladislavs function and just extended it a little bit: maybe 
bind would be nice like that - one can bind only the words one wants 
to and also only the types one likes, unless using plain, then all 
words of the same spelling get bound

old-bind: :bind

bind: func append copy third :bind [
	/only only-words [block! any-word!]
    /plain
    /local pos rule item
][
	if copy [words: copy words]
		
	either only [
		if any-word? only-words [only-words: reduce [only-words]]
    	if any-word? known-word [known-word: bind? known-word]

     if plain [forall only-words [change only-words to word! only-words/1]]

		parse words rule: [
			any [
				pos:
				set item any-word! (
					if any [
                	    all [plain find only-words to word! item]
                	    find only-words item
                	][
						item: old-bind :item known-word
						change pos :item
					]
				) | into rule | skip
			]
		]	
	][
		old-bind words known-word
	]	
]

f: g: h: i: 1
bl: ['f g h i]
c: context [f: 2 g: 3 h: 'hello]

bind/only bl c [f 'h]
get-values: [
	get to-word first bl
	get to-word second bl
	get to-word third bl
	get to-word fourth bl
]
probe reduce get-values

bind/only/plain bl c [f 'h]
probe reduce get-values

bind bl 'system
probe reduce get-values

bind/only bl c 'g
probe reduce get-values
MichaelB:
15-Dec-2005
the function has still some small problems: eg: doesn't return the 
newly bound block and might change with 'plain refinement the 'only-words 
block
BrianH:
16-Dec-2005
I have a simple question (I hope): What types does the hash! type 
hash? I recall it hashing strings, but does it hash words and other 
types as well? I'm wondering for what key types it would be useful 
to use a hash! to store the records. If the key type isn't hashed, 
there is no benefit over using blocks.
Volker:
16-Dec-2005
IIRC it hashes a lot now. And a benchmark is easy, fill a big block, 
search, if it is linear its hashed.
Pekr:
27-Dec-2005
more trouble comes with licensing of the server, if he want to encap 
it, and yet he wants to provide kind of cgi (plug-ins) to run rebol 
scripts - then he violates the license imo ...
Pekr:
27-Dec-2005
Ladislav - one more - can you imagine subinterpreter? e.g. you have 
kind of rebol interpreter master server in your school, then you 
have students, global context gets cloned for them and all they do 
they can do like in normal rebol, just that their scripts are executed 
in subcontext :-) hmm, maybe it would be easier to launch new interpreter 
for them anyway ... :-)
Pekr:
27-Dec-2005
I just came to the request by simply thinking about localisation 
and how it can be missued. E.g. "do you want your file to be deleted?" 
could be replaced by "Do you want to keep your file?" :-)
Ladislav:
27-Dec-2005
Right you are, the above is possible in English too and it may be 
considered a safety problem in some circumstances as I pointed out 
quite long ago.
Volker:
27-Dec-2005
(my volkswebserv.r is for debugging, to show errors and such in console. 
So i can live with that instability.
Pekr:
28-Dec-2005
well, I believe that rebol 3 will actually support modules, as it 
will be kind of main product release, which can afford new ideas 
here or there and new incompatibilities here or there, if done for 
good. The only question is of course the timing - Rebol 3 in two 
years? :-)
Volker:
29-Dec-2005
1) (paranoid): how do you handle buffer-overruns?

2) I could make a little script which takes the format string and 
explains it. If you get this into rebol :)
JaimeVargas:
29-Dec-2005
1) Buffer overruns seem to be protected by the GC. I try over run 
a very small buffer and I was uncessful.
JaimeVargas:
29-Dec-2005
The work above was mostly ladislave on the call-routine and the rest 
is mine. I will probably post it to rebol.org after a few changes 
and additions to make it work in all platforms. Maybe Carl will like 
to include it by default in rebol.
Sunanda:
3-Jan-2006
Extensive discussion on the merits and demerits of percent! here:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-thread.r?m=rmlZXTJ
Henrik:
3-Jan-2006
graham, the fact that it isn't there, kinda ruins my idea for implementing 
percent based widths in LIST-VIEW so that it's easy to discern between 
integers and percentages such as [50% 30%]. That's not so easy now, 
unless I do it the hokey way and use issue! or some other type to 
describe percent.
JaimeVargas:
4-Jan-2006
Both ctr1 and ctr2 have private state that can only be access through 
the defined interface.
JaimeVargas:
4-Jan-2006
BTW. Both ctr1 and ctr2 share the funcs defined in the CounterClass. 
With standard objects you don't need all this trickery but you receive 
a copy of the funcs.
Pekr:
6-Jan-2006
regarding security - can I somehow, for my client, generate .exe, 
which will have directly lowered security? We simply want to automate 
packing/upacking archives, to allow user to choose source and destination 
dir .... surely we don't want to answer security dialog each time 
...
Pekr:
6-Jan-2006
I mean - someone has incorrectly installed rebol and runs scripts 
by pressing enter in Total commander :-)
Volker:
6-Jan-2006
you can do 
  secure none
That asks on start and then all requesters etc are free.
Volker:
6-Jan-2006
(click and launch one of these half-baked test-script i mean)
MichaelB:
6-Jan-2006
Jaime: I checked your code above: first I thought it's not possible, 
then I thought wow, but I got one thing left that doesn't work:

You're using the 'class word to bind the code of the functions of 
an object later to the right object - this doesn't work, because 
'class is always bound to the function context and thus has the last 
object referenced - in your example no problem, because the code 
is the same - but with different code doesn't work anymore - maybe 
with one of the closures it would work - because 'class gets always 
bound to a new context (but I'm not sure yet whether I understand 
it right)

CounterClass2: context [
	d: 0
	bump2: does [d: d + 1]
	read2: does [d]
	bump-by2: func [inc][d: d + inc]
]

ctr1: make-instance CounterClass
ctr2: make-instance CounterClass2

ctr1/bump ctr1/bump ctr1/read
ctr2/bump2 ctr2/read2


fails, because at ctr1/bump, class is bound to object CounterClass2 
which has only bump2


so if this gets sorted out - it seams to be really difficult to access 
the hidden contexts (or impossible, because after invoking the function 
the contexts are gone)
JaimeVargas:
6-Jan-2006
While the private state vars are kept private, and current.
MichaelB:
6-Jan-2006
So we could make some rules how to make data completely invisible:

a) all words to be used later have to be used indirect via words 
in the function (like the traversing of the objects words via [foreach 
w next first 'object ... ]

b) if that's not possible the words used in the function (if they 
expose any context) have to be cleaned by a use which doesn't return 
the context


b) is actually the really smart thing to me - the 'use and the returning 
of the new context in 'use - so one can't catch the 'use context 
and get the words with the usual means
JaimeVargas:
6-Jan-2006
Good job. The property lost will be the ability  to change a class 
method and propagating the new behaviour to all instances at the 
same time.
Volker:
6-Jan-2006
I have access to global context, can patch functions there (which 
you use - or?) and traverse everything. Hmm, could clone all meazines 
and never return. then the only reference is from the stack, which 
is not traversable.
MichaelB:
6-Jan-2006
behavior change: you mean by copying the code and hiding it in a 
'use ?
JaimeVargas:
6-Jan-2006
Well ObjC allows you to bind to anything and instrospect anything. 
So I think is all is good.
Volker:
6-Jan-2006
The object-part is quite smalltalk afaik. Only they skip the bytecode-interpreter 
and "inline" the calls to c.
Volker:
6-Jan-2006
I think that is no big problem. If you give code-control, you are 
doomed anyway. Hmm, could be used to have a password to login and 
destroy it reliable.

The secure way is to launch an external process to run user-code 
IMHO. Add 'secure unset 'struct! and hope there are no overflowes. 
Should be pretty save.
Volker:
6-Jan-2006
Not completely - the code still needs access to the global context. 
if you bind every word in an own context and put selected functions 
there, it would work. Still tricky, for example 'second can not be 
exposed, else you get the functions body. I may forget other issues.
Volker:
6-Jan-2006
Do you know how to do cgi-style-calls in c? where c and rebol communicate 
thru kind of bidirectional pipeline?
MichaelB:
6-Jan-2006
Another thing that would interest me, is how is the speed impact 
when using your above function, now even with closures - I mean the 
closure function copies everything on invocation and also make-instance 
itself binds everytime anew?
Pekr:
13-Jan-2006
... and convert between those ...
20701 / 4860612345...206207[208] 209210...483484485486487