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

World: r3wp

[Core] Discuss core issues

BrianH
17-Jun-2006
[4878]
Yeah, something like that. Maybe system/user/sandbox or something. 
For that matter, system/user/home should be set to something useful 
on Windows, like %userprofile% or better yet %appdata%.
Anton
17-Jun-2006
[4879]
Oldes, Volker, I put into my rebol/core  user.r  file:
	view-root: dirize clean-path system/options/home/../view
	user-prefs: context [debug: none] ; fake user-prefs
	vbug: func [msg [block! any-string!] /local dbg][
	    if not dbg: user-prefs/debug [exit]
	    msg: head insert remold msg "view "
	    either file? dbg [write/append dbg msg] [print msg]
	]

along with the source to these functions:
	path-thru
	exists-thru?
	read-thru
	load-thru
	read-net
BrianH
17-Jun-2006
[4880]
For that matter Volker, you could set view-root to the standard sandbox 
directory like this:
view-root: join to-rebol-file get-env "APPDATA" "REBOL"
Volker
17-Jun-2006
[4881x2]
Yes, but then i get security-questions.
And i dont like to rely on user.r . personal preference.
BrianH
17-Jun-2006
[4883x2]
Yeah, those security questions.
As for relying on user.r, I prefer rebol.r for things like this.
Volker
17-Jun-2006
[4885]
On the plugin-side it can never be secure enough ;)
Anton
17-Jun-2006
[4886]
Hmm... should check that out.
Volker
17-Jun-2006
[4887]
and having a %public/alongside my /core-script work quite well for 
me.
BrianH
17-Jun-2006
[4888]
Sure, why not (don't answer that).
Anton
17-Jun-2006
[4889]
I try to stay out of user.r because rebol installer has its way with 
it. I suspect rebol.r is also in the same category. You could lose 
your changes. Therefore I prefer to redirect to another script where 
all this action occurs.
Volker
17-Jun-2006
[4890]
i like to poitn peoples to install rebol and run a little launch-script 
i send them.
BrianH
17-Jun-2006
[4891]
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
[4892]
and have that run without problems.
BrianH
17-Jun-2006
[4893]
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.
Graham
18-Jun-2006
[4894x4]
set-net [ "[carl-:-rebol-:-com]" smtp.rebol.com ]
should return an error ... but it doesn't.
as this happens
** User Error: ESMTP: Invalid command
** Near: insert smtp-port reduce [from reduce [addr] message]
Robert
18-Jun-2006
[4898x2]
Anton, why do the actual numbers for FOR matter? The thing is, those 
numbers are of type decimal! as my app has to use decimal! values 
for calculation.
Has someone a nice function to extract tuples by level? For example:
	1.0.0
	1.1.0
	1.2.0
	2.0.0
	2.1.0


I just need all 1st level tuples, than only the second level tuples 
etc.
Volker
18-Jun-2006
[4900]
tup: 1.2.3
i: 2
probe tup/:i
; ?
Robert
18-Jun-2006
[4901x3]
I need the function to return only 1.0.0, 2.0.0 or 1.1.0, 1.2.0, 
2.1.0
All tuples that have a specific level set.
I'm just playing around with a multiplier pattern like zero? (1.0.0 
* 0.1.1). This works expect for the 3rd level.
Anton
18-Jun-2006
[4904x7]
Robert, I was just wondering what actually triggered your initial 
question.
I thought perhaps we could refactor your original code to use WHILE 
or REPEAT etc..
I'm not arguing with your main point, which seems to be that the 
current behaviour of FOR is uncomfortable in this respect. (Or is 
it deficient ?)
Robert, how about this ?
tuples-of-level: func [level tuples /local compare][
	result: copy tuples
	remove-each tuple result [
		repeat n length? tuple [
			compare: get pick [<> =] n > level
			if compare 0 tuple/:n [break/return yes]
		]
	]
]

; test
blk: [1.0.0 1.1.0 1.2.0 2.0.0 2.1.0]

tuples-of-level 1 blk  ;== [1.0.0 2.0.0]
tuples-of-level 2 blk  ;== [1.1.0 1.2.0 2.1.0]
tuples-of-level 3 blk  ;== []
tuples-of-level 0 blk  ;== []
This version should scale better.
tuples-of-level: func [level tuples /local compare][
	result: copy []
	foreach tuple tuples [
		if repeat n length? tuple [
			compare: get pick [<> =] n > level
			if compare 0 tuple/:n [break/return no]
			yes
		][append result tuple]
	]
	result
]
Robert
18-Jun-2006
[4911]
Cool... I had this idea with the comparators too but not to use pick 
and the level as the selector. Cool stuff!
Anton
18-Jun-2006
[4912]
:)
Rebolek
22-Jun-2006
[4913]
Has anybody noticed problems with files that have "%" in name?
Anton
22-Jun-2006
[4914x3]
Yes, can't open them in WinXP.
No, yes you can.
read %"Hi%there.txt"     <-- this filename works
Rebolek
22-Jun-2006
[4917]
yes, but load mold %"Hi%there.txt" does not
Anton
22-Jun-2006
[4918]
>> load mold "Hi%there.txt"
== "Hi%there.txt"

what version of rebol, what os ?
Rebolek
22-Jun-2006
[4919]
1.3.2 on WXP
Anton
22-Jun-2006
[4920]
no, sorry, you're right. I missed the initial %
Rebolek
22-Jun-2006
[4921]
I think % should be automatically translated to %25 (like space is 
translated to  ) to prevent these problems
Anton
22-Jun-2006
[4922]
It does not mold into a loadable string. --> RAMBO.
Rebolek
22-Jun-2006
[4923]
OK, I'll post it
Anton
22-Jun-2006
[4924]
Note also this bug!  http://www.rebol.net/cgi-bin/rambo.r?id=3189&
Rebolek
22-Jun-2006
[4925x2]
well, that's really strange. see this >>
>> load mold to file! "[s-:-a]"
** Syntax Error: Invalid email -- %[s-:-a]
** Near: (line 1) %[s-:-a]
>> load mold to file! "[aas-:-df]"
== ª[s-:-df]
everything in range from "aa@.." to "ff@.." produces the second result
Anton
22-Jun-2006
[4927]
Add this information with the link to #3189 to your report. They 
should insert it into the original bug report.