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

World: r3wp

[Core] Discuss core issues

Gabriele
7-Dec-2005
[2894]
Petr: you're not talking about security, you're talking about encapsulation, 
i.e. making parts of your code unaccessible from other code.
Volker
7-Dec-2005
[2895]
Henrik, copy/deep does not copy functions. and you have a function 
here, try mold/all instead of probe.
Gabriele
7-Dec-2005
[2896x2]
volker: it's just that TIME is bound to the object, and he's changing 
its value to that date...
so even if copy/deep copied functions, he'd still get that result 
above.
Volker
7-Dec-2005
[2898]
Got it. was to hastily. good riddle :)
Henrik
7-Dec-2005
[2899]
volker, I don't get what serialization with mold/all does?
Volker
7-Dec-2005
[2900]
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.
Henrik
7-Dec-2005
[2901x2]
I don't think it's useful to solve my problem, but very interesting 
anyway, so I asked :-)
I'm actually looking for a way to get input data as a block:

[a: 1 b: 2 c: 3]

made into an object which is:

make object! [a: b: none c: does [something to make the c value]]

so I would get an object like this:

make object! [a: 1 b: 2 c: <return value from object function>]
Pekr
7-Dec-2005
[2903]
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
Gabriele
8-Dec-2005
[2904]
yes, but that is another level of security, where you trust some 
modules of a script but not others. i guess that will come with REBOL 
3
Pekr
8-Dec-2005
[2905]
Interesting question on ml:

join 'a 'b
== "ab"

type? join 'a 'b
== string!

Is that correct? Should not be a word instead?
Chris
8-Dec-2005
[2906x3]
My guess is that as word! values are not series! then join doesn't 
produce them...
In the same way that, eg.
>> join 1 2
== "12"
>> join true false
== "truefalse"
Gordon
8-Dec-2005
[2909x2]
How do you include a space in a directory name for Request-file/file?
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.
Louis
8-Dec-2005
[2911]
What is the correct code for ftp to a site when the user id is [john-:-smith]?
Sunanda
8-Dec-2005
[2912]
Something like:
read [scheme: 'ftp user: "[john-:-smith]" pass: "****" host: "_____"]
Louis
8-Dec-2005
[2913]
Many thanks, Sunanda.  My debt to you keeps piling up!
Davide
9-Dec-2005
[2914x2]
Hi all, I'm trying to read from a newsserver, what's wrong ?

>> p: open/lines tcp://news.aioe.org:119
>> first p

== {200 aioe.org InterNetNews NNRP server INN 2.4.3 (20050923 snapshot) 
ready (posting ok).}
>> insert p "LIST"
>> first p
** Script Error: Out of range or past end
** Near: first p
Every command that I send seems produce nothing:

>> insert p "GROUP net.unix-wizards"
>> print copy p
none
Graham
9-Dec-2005
[2916]
try the nntp scheme.
Davide
9-Dec-2005
[2917]
I'm already using nntp scheme, but it become slow because it reads 
first all message id from the group in port/locals/message-block

In large groups accessing the msgs list is very slow as you can see 
here:

http://www.ddmind.com/modules.php?name=gdp_rforum&ng=it.sport.calcio.milan
(works only in IE :-))
Izkata
9-Dec-2005
[2918]
>> p: open/lines tcp://news.aioe.org:119
>> first p

== {200 aioe.org InterNetNews NNRP server INN 2.4.3 (20050923 snapshot) 
ready (posting ok).}
>> insert p "LIST^/" ;;note the newline
>> first p
== {215 Newsgroups in form "group high low flags".}

Don't ask me why - I don't think it should need it, either...
Graham
9-Dec-2005
[2919]
because you've used open/lines ...
Davide
9-Dec-2005
[2920x2]
Here, using newline does not work, it works only using no-wait refinement:

REBOL []

p: open/lines/no-wait tcp://news.aioe.org:119
wait p
print copy p

insert p "GROUP it.test"
wait p
print copy p
I remember that insert func is syncronous when used in a port opened 
without no-wait refinement. Time to read again the core manual :-) 
. Thanks anyway
Graham
11-Dec-2005
[2922]
Has anyone done anything in the way of a reporting dialect ( that 
gets converted to sql and executed ) ?
Graham
12-Dec-2005
[2923]
I'm thinking of allowing the program to execute rebol sql dialect 
as is .. except I would prevent actions such as alter, drop, delete, 
insert .. ie. only allow selects.  Any danger in that?  I don't think 
it contravenes the license ...
Rebolek
12-Dec-2005
[2924]
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
[2925]
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
[2926]
Could forall have a bug with return? IIRC some versions had one. 
then the 'forall traps the return.
MichaelB
12-Dec-2005
[2927]
this might be, as I really was trying to find a mistake, but it didn't 
make sense
Volker
12-Dec-2005
[2928]
1.3.2.4.2 returns "[e]"
MichaelB
12-Dec-2005
[2929x2]
ok thanks, I gonna try it
1.3.61.3.1 didn't work, but the new official releases did
Volker
12-Dec-2005
[2931]
in such cases, try to print something between the forall and the 
none. I uess you will see that output multiple times.
MichaelB
12-Dec-2005
[2932]
2.6.50.3.1 also didn't work .... I have to be more careful with the 
different versions I guess
Volker
12-Dec-2005
[2933x2]
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]
]
http://www.rebol.net/cgi-bin/rambo.r?sort=1&limit=1&cmd=Search&id=&pattern=forall
MichaelB
12-Dec-2005
[2935]
you're right the versions differ pretty much when doing a 'source 
on 'forall
Henrik
12-Dec-2005
[2936]
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
[2937]
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.
DideC
12-Dec-2005
[2938]
See http://www.rebol.net/cgi-bin/rambo.r?id=3925&
Volker
12-Dec-2005
[2939]
currently 1.3.2 is the newest version. but because no rebcode it 
gets a 0.0.-59 added.
Anton
13-Dec-2005
[2940]
Yes, FORALL was modified very recently, and the return was a bug.
MichaelB
13-Dec-2005
[2941]
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
[2942]
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.
Volker
13-Dec-2005
[2943]
Functions in paths must be executed because of objects. Pick is used 
for data, evaluating there would lead to surprises.