• 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
r4wp124
r3wp1200
total:1324

results window for this page: [start: 1 end: 100]

world-name: r4wp

Group: #Red ... Red language group [web-public]
Endo:
29-Feb-2012
I'm sure Doc will answer this question as: "Red/System is for low 
level system programming, no need to implement blocks unless we need 
it while writting Red".  :)
I think blocks etc. is for Red not for Red/System.
Pekr:
5-Mar-2012
AGG/Cairo/Skia is the only solution acceptable for me, unless proven 
otherwise.
DocKimbel:
15-Jun-2012
Flattr: yes, and I have received at least one donation on it, but 
can't retrieve it unless I accept to pay a monthly fee. I understand 
the logic behind it, but don't find it very handy.
DocKimbel:
10-Jul-2012
Structs are always passed and manipulated by reference. You should 
be able to return struct! (unless there's a bug).
DocKimbel:
16-Aug-2012
So it should be: system/alias/gtk-window! unless there are bugs (I 
think we haven't tested mixing aliases with namespaces).
ACook:
16-Aug-2012
(Unless you just mean keywords, with predictable meanings.)
Pekr:
23-Aug-2012
No, I mean the source code file ... but not sure it matters. E.g. 
for R3, I had difficulcy running some scripts, unless I re-saved 
the source file to UTF8. Some strange chars appeared in the console 
and apps crashed
DocKimbel:
15-Sep-2012
I would very much like to have a console, but it is not doable at 
this point (unless someone has a bright idea?). We'll add one as 
soon as possible.
Henrik:
22-Sep-2012
Pekr, yes, exactly one thing I'm missing about the current error 
system. Also currently user error strings are difficult to localize 
unless you use your own scheme, when displaying the error.
DocKimbel:
22-Sep-2012
Line numbers: there are complicated and costly to handle in a REBOL-like 
language at runtime. The experimentation I did in Red/System confirms 
it. I'm not sure I will add them to Red unless we can come up with 
an efficient solution.
Henrik:
23-Sep-2012
ok, Trello is probably not useful, unless there is a plugin.
Pekr:
30-Sep-2012
big change in their paradigm. And the one, which fits imo REBOL. 
IIRC Carl always wanted some stronger storage option to load/save 
blocks. IIRC Rebin was needed? He once was considering adding SQLite, 
but found it too big. IMO it would be good if we used SQLite for 
Red, to standardise. I doubt we can find more efficient, powerfull, 
and cross-platform tool with the right licence? Of course more efficient 
solution might be done by pure Red facitilities, but unless we need 
really extra efficient solution, why to reinvent the wheel?
DocKimbel:
2-Oct-2012
Too late for changing the URL (unless Bas puts a redirection).
DocKimbel:
14-Oct-2012
Also, for direct GPU access, it will only be doable for GPU that 
have all the required specification published (unless drivers provides 
the right API already).
BrianH:
17-Oct-2012
Doc, would you consider it sufficient to have a license that doesn't 
require that the license be included with (like MIT code) or distributed 
with (like BSD code) the product? The Apache license only requires 
that the license be given to the recipient - it hoesn't specify how 
- and it doesn't even require a copyright reference be included unless 
the product is distributed in source form. I'm just trying to determine 
the extent that you'll be able to include Apache-licensed code in 
Red, or how much this factor matters to you.
Kaj:
17-Oct-2012
Brian, where do you get that the Apache licence doesn't require a 
copyright reference be included unless the product is distributed 
in source form?
BrianH:
19-Oct-2012
Ah, but the interface is too simple to need an IDL - make command! 
will do. The extra stuff is for system integration, which is only 
needed when you are doing port schemes, dialects, anything that you 
wouldn't expect to be cross-language compatible anyways, unless you 
explicitly implement a compatible system model. If you're just exporting 
functions then you can implement a simple IDL just by interpreting 
the (cooincidentally the same) module spec code with a very limited 
IDL dialect processor if no Red script wrapper is found.
DocKimbel:
31-Oct-2012
Question for everyone: I was thinking since a while to publish on 
red-lang.org the donations I get, including donator names (unless 
they want to remain anonymous). Is that ok? Are they best practices 
for doing that?
BrianH:
2-Nov-2012
That can deal with the series! type, unless you have an internal 
reason to have it be a real type.
BrianH:
2-Nov-2012
You'd likely need to use two 64bit registers unless you use SSA or 
something.
Andreas:
15-Nov-2012
If you wish to allow index computation for series not positioned 
at the head, allowing index 0 is actually quite sensible, unless 
you want to make index computation particularly error prone.
BrianH:
15-Nov-2012
PICK0 or PICK-0 might do. Definitely not ELECT, since the kind of 
selection that is done in elections is not related to the type done 
when you "pick" something. In US English there is a colloquial term 
"pick out of a lineup", which relates to series in a way that noone 
would think of the term "elect" (unless they are convinced that all 
politicians are crooks). PICK and POKE are from Basic, old-school 
tech terms that are more closely related to assembly instructions 
than they are to any high-level operation.
DocKimbel:
16-Nov-2012
the most sane way to make a decision here is to come up with use 
cases,


I can't agree more. What I am wondering is: have rebolers ever hit 
that specific issue (0 gap producing a calculation error) at least 
once? My feeling is that it is an extremely rare error case (but 
a nasty one) that could have been mitigated by just making PICK raise 
an error on 0.


Now, you could also say that you should never iterate over a series 
using indices. But, then why have PICK at all?


Right, IMHO, you shouldn't iterate over a series using indices, unless 
you have a good reason for it. In the general case, people should 
use "navigational" functions to walk through a series. PICK is ok 
as long as you don't PICK on 0.
Andreas:
17-Nov-2012
Please move the discussion whether "0 exists" elsewhere. REBOL's 
integer! corresponds to integers and includes 0. Unless you want 
to change that as well, that's a fact we have to live with.
BrianH:
19-Nov-2012
Doc, refinements slow down functions unless the optimizer can resolve 
them staticly. If compatibility is a value, it's worth mentioning 
that REBOL doesn't have such an optimizer, so it is stuck with the 
same situation that you have when you can't know whether the refinement 
will be used ot not (see APPLY). Separate functions are better in 
this case.
Arnold:
23-Nov-2012
I see the bad side. Alias shoul dnot have that big an impact unless 
an alias was designed on purpose into the language. For instance 
a support a complete spanish/chinese version for educational purposes?
DocKimbel:
30-Nov-2012
Unless you want to boycot Linux users and prevent them from using 
your Red-based product because you don't like Linux? :-)
DocKimbel:
4-Dec-2012
It is in my plans since the beginning to support internal profiling 
feature for Red, though I was thinking about processing them in the 
IDE mainly. In the Red/System v2 specs, I have already made some 
provision for low-level profiling of native functions.


I know about DTrace but never used it. I would need to study how 
it implements probe points to see if same technic could be used internally.


Currently, it would be quite easy to add a profiler to Red layer, 
it would just need to extend the stack/mark*, stack/unwind* and stack/unroll 
function to collect the data. But as we have other high-priority 
features to implement first, it will probably wait a few months (unless 
someone wants to implements it, I would be glad to give the basic 
hints on how to achieve it easily).
Steeve:
7-Dec-2012
I cut my script and got the same error with just the following:

Red []
;*** Bottom-up-heapsort ***
heapify: func [s start len comp /local step sav inc][
	inc: 0
	sav: s/:start
	;-- search terminal leaf.
	step: start
	while [len > step: 2 * step][
		++ inc
		unless comp s/(++ step) s/:step [-- step]
	]
	either step = len [++ inc][step: shift step -1]
	;-- bottom-up, search insertion point
	loop inc [
		unless comp s/:step sav [break]
		step: shift step -1
		-- inc
	]
	;-- bottom-up swap
	loop inc [						;-- chain swap
			s/:step: also sav sav: s/:step
			step: shift step -1
	]
	s/:step: sav
]
DocKimbel:
8-Dec-2012
What are the biggest downsides to having Red/System remain case-insensitive? 
That is, what does case sensitivity buy us?


Good question. I think it doesn't buy us anything nor does it remove 
us any useful feature. Actually, I think that as long as you are 
consistent in the way you name your identifiers (variables, functions, 
contexts,...), you are case-neutral. So, having Red/System case-sensitive 
wouldn't change anything for me and I guess it would be the same 
for others.


Anyway, I prefer to keep it case-insensitive for now, for the sake 
of consistency with Red, unless I really need to change it.
BrianH:
3-Jan-2013
As I mentioned in Rebol School (and elsewhere earlier), issues can 
be made to behave like strings to a certain extent even if they're 
words. To do that in compiled code you'd need to keep their spellings 
around though, unless you resolve all of those function calls statically 
(which you would be able to because issues would be immutable).
Kaj:
16-Jan-2013
Arnold, Red/System has been ready for writing code for at least a 
year. Red is only getting to that stage now, so that's why I have 
been working in Red/System. My 6502 emulator is a major self-contained 
work in Red/System, but there's also the issue of communicating with 
the outside world. Unless you write your own operating system, the 
way to do that is by binding to the existing operating system
Kaj:
1-Feb-2013
Red []

#include %GTK/GTK.red

view/title [
	text: area
	button "Do" [
		unless any [
			none? script: get-area-text text
			empty? script
			empty? code: load script
			unset? result: do code
		][
			prin "== "
			probe result
		]
	]
	button "View" [
		all [
			script: get-area-text text
			not empty? script
			not empty? code: load script
			view code
		]
	]
	button "Quit" close
] "Red GTK+ IDE"
Pekr:
7-Feb-2013
Bo - R/S is low level - mostly a wrapper to C to enable Red like 
syntax. It will not contain stuff to open files and do more advanced 
things imo, unless you link to some library and create a wrapper 
for such a purpose. I am too eagerly waiting for Red to get more 
advanced stuff. I think, that once Doc finishes the interpreter stuff 
ec., he is back to objects/ports, and then networking/files IO will 
come and more fun begins :-)
Pekr:
5-Mar-2013
Doc - I was quite surprised with your argumentation. I really don't 
know, if we are so much in an IT, but are you guys serious, that 
for normal user, in order to just give some tool a try, such user 
should use systems like Fossil or Git? I find myself competent enough, 
but unless new Windows client appeared, it was just nightmare to 
get things going, especially if one does not feel the need to understand 
all that pull/push etc. stuff.
Pekr:
5-Mar-2013
As for creating R/S specific site - I am not sure, how much time 
it would take to create, but unless we are able to adress devices 
like Arduino, Android devices, BeagleBoard(Bone), RaspberryPi, I 
would postpone such a solution imo ....
BrianH:
7-Mar-2013
Pekr: "That is understandable, but it almost feels like a push - 
either do it R3 way, or it is your bug :-)"


Not always. R3 isn't done yet either. Remember, we're still catching 
up with a 2-year backlog of pending design changes. Some of its design 
experiments have turned out to be bad ideas for reasons that weren't 
known at first, or in some cases discovered by Red. So sometimes 
R3 is the one that needs fixing, and much sooner because R3 is going 
to get to 3.0 long before Red's design is set.


There are real advantages for Red and R3 to declare that incompatibility 
in comparable situations should be considered a bug, especially then 
it comes to syntax, and sometimes when it comes to semantics (ie 
indexing). But I don't assume that either R3 or Red in in the right. 
More often these incompatibilities are a sign of things that haven't 
been fully thought through, and once they are it could be R3 or Red 
that needs fixing, or in some cases both.


But, in the scale of history, Red is much earlier on in its design 
process than R3 is. R3 is more towards the end, closer to release. 
So that means that any changes that might break the *core* semantics 
or syntax of user code need to be made very soon, before 3.0 comes 
out and sets the standard. Red can afford to make those changes later 
because it isn't anywhere near the point of standardization. So if 
there are design flaws in R3 that might be comparable to something 
that would affect Red, they need to be fixed earlier in R3 (not by 
the Red people unless they're into that). And it would be useful 
for Red if people would participate in the R3 design discussions 
for stuff that would affect Red too because Red would benefit from 
the discussions regardless of compatibility, and also benefit from 
being compatible with the results.
Group: Ann-Reply ... Reply to Announce group [web-public]
MaxV:
25-Sep-2012
However, when people think of “selling software”, they usually imagine 
doing it the way most companies do it: making the software proprietary 
rather than free.


So unless you're going to draw distinctions carefully, the way this 
article does, we suggest it is better to avoid using the term “selling 
software” and choose some other wording instead. For example, you 
could say “distributing free software for a fee”—that is unambiguous.
Janko:
25-Sep-2012
I don't think in general licence of a language (tool to make a product) 
affects licence of product (or libraries), unless the product is 
the langauge/vm..? but IANAL
Pekr:
25-Sep-2012
simply put - you can't use libraries with GPLed code, statically, 
nor dynamically, unless you open up all your app ...
BrianH:
25-Sep-2012
OS libraries and R3 libraries are both libraries. However, with GPL2 
they make an exception for linking to OS libraries even if they're 
closed source. With GPL3 they extended that exception to libraries 
that come with a runtime or VM, like Java, .NET, or closed-source 
REBOL. The exception doesn't go the other way though: It's not allowed 
to link to GPL'd libraries with closed code.


Ladislav, the runtime library is used to implement the interpreters, 
and includes the interpreters for that matter, but it's still a library. 
The DO interpreter really doesn't do a lot; it resolves the op and 
path syntax and dereferences words, but everything else is done by 
the functions of the runtime library, which your code is bound to 
at runtime. But for the good news, it's at runtime, so afaict the 
GPL doesn't require you to release your source because of that binding, 
as long as you load the source at runtime, which you pretty much 
have to do at the moment for scripts.


Encapping is a trick, but you can handle that with some limitations. 
Extensions will need to be GPL 2, and that means that they can't 
be used to wrap closed-source libraries unless they were included 
with the operating system you're running on. Encapping regular scripts 
and modules is semantically iffy, but you could handle that with 
a FAQ entry that explicitly says that loading a R3 script doesn't 
count as linking, even if you bind the words to GPL'd values. The 
same FAQ entry would apply to scripts in files, databases, whatever.
BrianH:
26-Sep-2012
Here is the FSF FAQ entry relating to interpreters and their libraries: 
http://www.gnu.org/licenses/gpl-faq.html#IfInterpreterIsGPL

Pretty much the whole entry is applicable. The first paragraph would 
apply to data passed to DO, PARSE, DELECT, DO-COMMANDS, or other 
dialect processors.


The second paragraph would definitely apply to extensions, and could 
apply to built-in functions unless we get an exception like GCC's; 
or we could get a FAQ entry declaring that the functions built into 
R3 are "part of the interpreter" rather than "library code", despite 
R3's actual system model. Note that PARSE's built-in operations are 
more unambiguously "part of the interpreter", and the same could 
be said for other similar dialects.


The last two paragraphs apply to mezzanine code and embedded modules. 
If they are GPL'd and your code uses them, it would be affected.
BrianH:
26-Sep-2012
It is common to use this FAQ entry as a way to make GPL extensions 
that wrap proprietary components: http://www.gnu.org/licenses/gpl-faq.html#WindowsRuntimeAndGPL


Developers commonly put links on their web site to the vendor's web 
site to download the DLL. However, it's iffy with GPL2 because the 
actual exception is worded like this:

However, as a special exception, the source code distributed need 
not include anything that is normally distributed (in either source 
or binary form) with the major components (compiler, kernel, and 
so on) of the operating system on which the executable runs, unless 
that component itself accompanies the executable.


Read literally, it would exclude runtime libraries that aren't bundled 
with the OS. It's more unambiguously OK with GPL3.
Ladislav:
27-Sep-2012
...could apply to built-in functions unless we get an exception like 
GCC's;

 - again, wrong. The built-in functions are related to the functionality 
 of the program, which is unrestricted. The problem with GCC (why 
 there is the need for the exception) is that the functions needing 
 the exception are the ones provided and statically linked in the 
 extra libraries.
Gregg:
4-Dec-2012
Thanks Arnold. You should probably remove all my ** comments, unless 
others want to compare the original, and see what I changed, and 
why.
BrianH:
29-Dec-2012
The block of headers is not screened for dups and currently could 
use a little screening for unnamed columns (it would be better to 
return none rather than an empty word). Fortunately, they don't matter 
in your code unless you want them to.
Bo:
4-Jan-2013
>> do http://development.saphirion.com/experimental/oneliner-prime-numbers.r

** Access error: cannot open: tcp://development.saphirion.com:80 
reason: -12
** Where: open open unless sync-op either read
** Near: open conn port
Bo:
4-Jan-2013
I got a slightly different message when I tried it with 3G instead 
of WiFi, for some reason:


>> do http://development.saphirion.com/experimental/oneliner-prime-numbers.r

** Access error: cannot open: tcp://development.saphirion.com:80 
reason: -12

** Where: open open unless sync-op either read either read-decode 
case load -apply-do
** Near: open conn port
NickA:
5-Jan-2013
Speed function crashed on my Huawei M865C:

Access error: cannot open %tmp-junk.txt   reason: -3
Where:  write unless do foreach speed? 

Near:  write file: %tmp-junk.txt  "" tmp: make string! 32000 * 5 
ins...
Arnold:
18-Jan-2013
But indeed I do think for such relative simple algorithms you would 
not use calling of C functions unless you want speed etc.

@Kaj, I heard you ;) That would be on http://static.red-lang.org/red-system-specs.html
about section 14.1 examl=ple using malloc I guess. I have very limited 
time off atm :(
Pekr:
13-Feb-2013
well then,  I consider Saphirion's work being a de-facto standard 
nowadays, unless Carl reappears actively reviewing new stuff ...
Arnold:
13-Feb-2013
Well to me it looks like there is just way too much happening to 
follow it all. Then one github repository for R3 is enough unless 
you really need another one to test and fool around with completely. 
The source being on Github is nice because I now have a copy, but 
it hinders me to contribute because I do not have the time nor the 
will to find out how to contribute changes, and when I tried I found 
it puzzling enough, so I decided it is too much trouble for now and 
to only look at the sources and not to contribute. (This goes for 
the Red github situation as well).
BrianH:
13-Feb-2013
Unless you mean a plan for business adoption :)
BrianH:
27-Feb-2013
Unless you worked for Qtask in 2008 and met me at the company meeting 
in December, then no. The only other people in the community who 
have met me in person are my own recruits. I've talked to Carl and 
Bo on the phone though.
BrianH:
27-Feb-2013
Right at the point when it became appropriate for me to go to devcons, 
they stopped holding them in USA and I stopped having the money to 
travel outside USA. So unless my financial situation changes, or 
someone sponsors me, or visits me, then noone will meet me
BrianH:
8-Mar-2013
Pekr, unless this is a huge rehash that you don't want to repeat, 
could you let me know which View engine proposal you're talking about? 
I don't do GUI stuff so it's been a while since I caught up with 
current events. In the !R3-GUI group if that's appropriate.
Group: Rebol School ... REBOL School [web-public]
GrahamC:
24-Apr-2012
has anyone written parse rules for phone numbers?   I need to setup 
a set of rules for international numbers, local numbers, cell numbers, 
1800 etc for use in asterisk and prevent users from making toll calls 
unless authorise
GrahamC:
24-Apr-2012
( we use 2 numbers for the first group unless it's cellular  when 
it's 3 or 4 )
Endo:
8-May-2012
by the way, LOAD will detect if the argument is an image. So there 
may no need TO-IMAGE.


unless attempt [immagine/image: load news/immagine] [immagine/image: 
load-image %default.png]
JohnM:
16-May-2012
Sunanda: Thanks again for issuing the World invitation. Everyone 
thanks for the continuing help.


I have read the cited document, but it just leaves me with more questions.

Is the following literal?

cgi-string: read-cgi
cgi-block: decode-cgi cgi-string
cgi-obj: make object! cgi-block 


 That is to say should I type exactly that? Or is cgi-string for example 
 a theoretical variable assignment that I could call anything? Are 
 they all proper commands, or is any part of that just for example 
 purposes?  I am thinking I should copy and paste it verbatium. I 
 am also thinking I mispelt verbatum.


 I am stuck with GET. Does this mean I can leave out some code that 
 makes up for  not knowing if the original data is POST vs GET? These 
 are hypothetical questions for better long term learning. I for now 
 will go with the idea that everything is as straight fowarrd as it 
 seems. I know that my GET stream will have "trnEmailAddress" in it 
 which is a field that will contains an email address.


 So will the following  generate a random number, extract the address 
 and email the same random number to that email address?

token: random/seed now/percise

cgi-string: read-cgi
cgi-block: decode-cgi cgi-string
cgi-obj: make object! cgi-block 


send trnEmailAddress rejoin [ "Thank you. Your number is" token "." 
]


 Graham: Thank you for the extra info on GUID, but Windows is not 
 involved here. I realize that random number generating really isn't 
 unless you have a monkey throwing darts at a numbered board. Regardless 
 extra effort to 
make a number unique is useful and your advice appreciated. 


 I do not think the corner cases will come up and the people who control 
 the original form assured me that web page issues warnings if the 
 form is not filled out correct which should help. I do realize that 
 people are idiots, systems are not fool proof, etc. What I am saying 
 is my basic needs are basic and I should be OK so I am not fretting 
 over those examples. It is great though to know the solutions are 
 out there when I need them.

 Tahnks.
Arnold:
19-May-2012
Another thing, I want to make an 'application' using REBOL that plays 
an mp3, an mp3 with a story for kids and I want to display the pictures 
from the book depending on maybe a timer(file) so the pictures are 
displayed acoording to the storyline. This also could be a helping 
aid for making presentations. 

I do not want to binary save my mp3 in the source of the application 
or in any other rebol-script so I just want to use the mp3 file and 
not convert it.

Furthermore I do not want an external app to be started unless it 
can be done under the hood and/or it can be controlled by my app 
because the presentation could be paused by the user. Any ideas where 
and how to start such script.
GrahamC:
20-May-2012
odbc drivers for windows can only be used with the rebol/view, the 
gui build, unless you paid for a rebol/command sdk
PeterWood:
21-Jun-2012
Arnold: I believe that Rebol/View uses Windows Codepages under Windows, 
MacRoman on OS X and ISO-8859-1 on  Linux. Sadly this means it only 
really supports true ASCII characterrs cross platform unless you 
manage encoding your self.
Henrik:
26-Jun-2012
NP. I don't usually mess around with iterated faces unless I really 
need to, so I have some standard styles for lists that abstracts 
this stuff away.
Endo:
8-Aug-2012
I wrote a run length encoding function, may be useful for someone 
else too:

rle: func ["Run length encode" b /local v r i j] [
	v: 1 r: copy []
	j: next i: b
	unless empty? b [
		until [
			either all [not tail? j equal? first i first j] [
				v: v + 1 j: next j
			] [
				append r reduce [v first i] v: 1 i: ++ j
			]
			tail? i
		]
	]
	r
]
BrianH:
8-Aug-2012
The replacement for IF (condition) would be something like this: 
(cont: unless condition [[end skip]]) cont
BrianH:
8-Aug-2012
For old versions of R2, you might want to change IF STRICT-NOT-EQUAL? 
to UNLESS STRICT-EQUAL?. There used to be a bug in STRICT-NOT-EQUAL? 
in R2, but I forget how far back it was fixed, one of the last couple 
versions.
BrianH:
9-Aug-2012
Two rules it is then. This doesn't crash, and is optimized for strings 
while we're at it. It's probably slower when doing blocks than Doc's, 
but it handles all datatypes:

rle: func [s [series!] /local out emit pos1 pos2 cont][
	out: make block! 1
	emit: [(repend out [offset? :pos1 :pos2 first :pos1])]
	parse/case/all :s pick [[
		any [pos1: skip (cont: first :pos1) any cont pos2: emit]
	] [
		any [
			pos1: unset! any unset! pos2: emit |
			pos1: skip some [
				end pos2: emit break |
				pos2: unset! :pos2 emit break |
				pos2: skip (

     cont: unless strict-equal? first :pos1 first :pos2 [[end skip]]
				) cont |
				pos2: emit break
			]
		]
	]] any-string? :s
	out
]


It also works around the strict-not-equal? bug in pre-2.7.7 R2, and 
using FIRST instead of path access is another speedup in R2 (path 
access is faster in R3).
BrianH:
9-Aug-2012
Change the repend to chained inserts and it gets noticably faster, 
due to less mezzanine overhead:

rle: func [s [series!] /local out emit pos1 pos2 cont][
	out: make block! 2

 emit: [(out: insert/only insert out offset? :pos1 :pos2 first :pos1)]
	parse/case/all :s pick [[
		any [pos1: skip (cont: first :pos1) any cont pos2: emit]
	] [
		any [
			pos1: unset! any unset! pos2: emit |
			pos1: skip some [
				end pos2: emit break |
				pos2: unset! :pos2 emit break |
				pos2: skip (

     cont: unless strict-equal? first :pos1 first :pos2 [[end skip]]
				) cont |
				pos2: emit break
			]
		]
	]] any-string? :s
	head out
]
BrianH:
9-Aug-2012
If you follow the /into option standard you can do chained calls 
to RLE too:


rle: func [s [series!] /into out [any-block!] /local emit pos1 pos2 
cont][
	unless into [out: make block! 2]

 emit: [(out: insert/only insert :out offset? :pos1 :pos2 first :pos1)]
	parse/case/all :s pick [[
		any [pos1: skip (cont: first :pos1) any cont pos2: emit]
	] [
		any [
			pos1: unset! any unset! pos2: emit |
			pos1: skip some [
				pos2: unset! :pos2 emit break |
				pos2: skip (

     cont: unless strict-equal? first :pos1 first :pos2 [[end skip]]
				) cont |
				pos2: emit break
			]
		]
	]] any-string? :s
	either into [:out] [head :out]
]
BrianH:
9-Aug-2012
R3 version, same /into option:


rle: funct ["Run length encode" s [series!] /into output [any-block!]] 
[
	unless into [output: make block! 2] x: none

 r: either any-block? :s [qr: copy [quote 1] [(qr/2: :x) any qr]] 
 [[any x]]
	parse/case :s [any [pos1: set x skip r pos2: (

  output: reduce/into [subtract index? :pos2 index? :pos1 :x] :output
	)]]
	either into [:output] [head :output]
]
BrianH:
9-Aug-2012
Sorry, same unset problems, have to use POKE:


rle: funct ["Run length encode" s [series!] /into output [any-block!]] 
[
	unless into [output: make block! 2] x: none

 r: either any-block? :s [qr: copy [quote 1] [(poke qr 2 :x) any qr]] 
 [[any x]]
	parse/case :s [any [pos1: set x skip r pos2: (

  output: reduce/into [subtract index? :pos2 index? :pos1 :x] :output
	)]]
	either into [:output] [head :output]
]
BrianH:
10-Aug-2012
In mezzanine style:

decode-rle: func [
	"Decode a run length encoded block"
	rle [any-block!] "Block of [integer value]"

 /into "Insert into a buffer instead (returns position after insert)"
	output [series!] "The output buffer (modified)"
	/local x
] [
	unless into [
		x: 0  foreach [i v] :rle [x: x + :i]  output: make block! x
	]

 foreach [i v] :rle [output: insert/only/dup :output get/any 'v :i]
	either into [:output] [head :output]
]


Instead of testing for strict format compliance of the input block, 
it uses get-words to keep people from sneaking in functions and then 
passes the length value to + and INSERT/dup, counting on the type 
tests of those functions to do the screening for us.
BrianH:
10-Aug-2012
decode-rle: func [
	"Decode a run length encoded block"
	rle [any-block!] "Block of [integer value]"

 /into "Insert into a buffer instead (returns position after insert)"
	output [series!] "The output buffer (modified)"
	/local x
] [
	unless into [
		x: 0  output: make block! forskip rle 2 [x: x + :rle/1]
	]
	forskip rle 2 [output: insert/only/dup :output :rle/2 :rle/1]
	either into [:output] [head :output]
]
BrianH:
11-Aug-2012
Here's a version of my last one above, but with Steeve's trick adapted 
to make a /compare option. It defaults to its old case-sensitive 
behavior.

rle: func [
	"Run length encode to series of [length value]"
	s [series!] "The series to encode"

 /into {Insert into a buffer instead (returns position after insert)}
	output [any-block!] "The output buffer (modified)"
	/compare "Comparator function for equvilance"
	comparator [any-function!]
	/local x r qr b e
] [
	unless into [output: make block! 2] x: none
	r: case [
		compare [[any [e: if (apply :comparator [:x :e/1]) skip]]]
		any-string? :s [[any x]]
		'else [qr: copy [quote 1] [(poke qr 2 :x) any qr]
	]
	parse/case :s [any [b: set x skip r e: (
		output: reduce/into [offset? :b :e :x] :output
	)]]
	either into [:output] [head :output]
]
BrianH:
11-Aug-2012
Whoops, forgot a bracket:

rle: func [
	"Run length encode to series of [length value]"
	s [series!] "The series to encode"

 /into {Insert into a buffer instead (returns position after insert)}
	output [any-block!] "The output buffer (modified)"
	/compare "Comparator function for equvilance"
	comparator [any-function!]
	/local x r qr b e
] [
	unless into [output: make block! 2] x: none
	r: case [
		compare [[any [e: if (apply :comparator [:x :e/1]) skip]]]
		any-string? :s [[any x]]
		'else [qr: copy [quote 1] [(poke qr 2 :x) any qr]]
	]
	parse/case :s [any [b: set x skip r e: (
		output: reduce/into [offset? :b :e :x] :output
	)]]
	either into [:output] [head :output]
]
BrianH:
11-Aug-2012
Unless you make it so it treats integers specially. This would slow 
down the encoder and decoder, but reduce the compressed size.
Maxim:
5-Sep-2012
here, the field's action compares the field when pressing tab/enter, 
and will close the window when its not empty.


until [view layout [fld: field [unless empty? face/text [unview]]] 
not empty? fld/text]
Steeve:
5-Oct-2012
; Sorry Ladislav I've stolen your idea one should avoid catch/throw 
interferences

; As an extra (also your idea ?), f/recur and recur are now both 
allowed.

rfunc: func [[catch] spec [block!] body [block!] /local ctx fun][
    ctx: bind? take second fun: throw-on-error [
        func append copy spec /recur reduce ['recur body]
    ]
    insert second :fun reduce [

        quote #[function! [[throw] ctx args 'fun body /local ret][

            if :ctx/recur [ctx/recur: ctx throw/name second ctx 'recur]
            ctx/recur: :fun
            while [true][
                set/any 'ret catch/name [return do body] 'recur

                unless all [value? 'ret block? :ret same? ctx last ret][
                    throw/name get/any 'ret 'recur
                ]
                set/any args ret
            ]
        ]]

        ctx (bind head remove back tail to-block form first ctx ctx) :fun
    ]
    :fun
]
Steeve:
5-Oct-2012
; Ladislav I can't see if you posted new code (WTF Altme)

; So I've tried your idea one should avoid catch/throw interferences

; As an extra (also your idea ?), f/recur and recur are now both 
allowed.

rfunc: func [[catch] spec [block!] body [block!] /local ctx fun][
    ctx: bind? take second fun: throw-on-error [
        func append copy spec /recur reduce ['recur body]
    ]
    insert second :fun reduce [

        quote #[function! [[throw] ctx args 'fun body /local ret][

            if :ctx/recur [ctx/recur: ctx throw/name second ctx 'recur]
            ctx/recur: :fun
            while [true][
                set/any 'ret catch/name [return do body] 'recur

                unless all [value? 'ret block? :ret same? ctx last ret][
                    throw/name get/any 'ret 'recur
                ]
                set/any args ret
            ]
        ]]

        ctx (bind head remove back tail to-block form first ctx ctx) :fun
    ]
    :fun
]
Steeve:
5-Oct-2012
; Ladislav I can't see if you posted new code (WTF Altme)

; So I've tried your idea one should avoid catch/throw interferences

; As an extra (also your idea ?), f/recur and recur are now both 
allowed.

rfunc: func [[catch] spec [block!] body [block!] /local ctx fun][
    ctx: bind? take second fun: throw-on-error [
        func append copy spec /recur reduce ['recur body]
    ]
    insert second :fun reduce [

        quote #[function! [[throw] ctx args 'fun body /local ret][

            if :ctx/recur [ctx/recur: ctx throw/name second ctx 'recur]
            ctx/recur: :fun
            while [true][
                set/any 'ret catch/name [return do body] 'recur

                unless all [value? 'ret block? :ret same? ctx last ret][
                    throw/name get/any 'ret 'recur
                ]
                set/any args ret
            ]
        ]]

        ctx (bind head remove back tail to-block form first ctx ctx) :fun
    ]
    :fun
]
Steeve:
5-Oct-2012
This time it's really really my final version T_T
- Both f/recur and recur allowed
- Catch/throw interferences ok.

NB: The code would be simpler in R3 since several workarounds are 
used to correct misbehaviors of object related natives of R2.

Also the lack of the reflexive capability for a function to read 
its own context in a easy way is definitivly a huge miss.

(On can't create anonymous functions without analysing their specs 
first. What a pain)

One would need a reserved word holding the context (like SELF for 
objects).

These shortcomings are making the code too much obfuscated and huge 
for my taste.
I hope it will be corrected in R3..

rfunc: func [
    [catch] spec [block!] body [block!] 
    /local ctx args call-tail
][
    ctx: bind? first second throw-on-error [
        func spec: append copy spec /recur [recur]
    ]
    args: bind head remove back tail to-block form first ctx ctx
    call-tail: func ['word] compose/deep [
        set/any [(args)] second bind? word 
        throw/name (ctx) 'recur
    ]
    ctx/recur: func spec reduce [:call-tail 'recur]
    func spec reduce [
        quote #[function! [
            [throw] 'recur 'call-tail ctx args body /local ret
        ][
            if get/any recur [call-tail :recur]
            set recur get in ctx 'recur
            while [true][
                set/any 'ret catch/name [return do body] 'recur
                unless all [value? 'ret same? :ret ctx][
                    throw/name get/any 'ret 'recur
                ]
                set/any args second ctx
            ]
        ]]
        'recur :call-tail ctx args body
    ]
]
Kaj:
10-Oct-2012
#! /usr/bin/env r2
REBOL []

here: what-dir

program: dirize clean-path here/../../../cms/files/program/PowerMezz

do program/mezz/module.r

load-module/from program

module [
	imports: [
		%mezz/trees.r
		%mezz/load-html.r
		%mezz/html-to-text.r
	]
][
;	print mold-tree load-html read http://osslo.nl/leveranciers

	make-dir %data

	for id 1 169 1 [
		print id

  page: load-html read join http://osslo.nl/leveranciers?mod=organization&id=
  id


  content: get-node page/childs/html/childs/body/childs/div/childs/3/childs/2

		body: get-node content/childs/table/childs/tbody
;		print form-html/with body [pretty?: yes]
;		print mold-tree body

;		item: get-node body/childs/10/childs/2
;		print form-html/with item [pretty?: yes]
;		print mold-tree item
;		print mold item

		record: copy ""
		short-name: name: none

		unless get-node body/childs/tr/childs/th [  ; Missing record
			foreach item get-node body/childs [

    switch/default type: trim get-node item/childs/td/childs/text/prop/value 
    [
					"Logo:" [

;						if all [get-node item/childs/2/childs/1  get-node item/childs/2/childs/1/childs/1] 
[
;							repend record

;								['icon tab tab tab tab		get-node item/childs/2/childs/a/childs/img/prop/src 
 newline]
;						]
					]
					"Naam:" [
						if get-node item/childs/2/childs/1 [
							repend record

        ['name tab tab tab tab		name: trim/lines html-to-text get-node item/childs/2/childs/text/prop/value 
         newline]
						]
					]
...					"Adres:" [

      unless empty? trim/lines html-to-text form-html/with get-node item/childs/2 
      [pretty?: yes] [
							street: get-node item/childs/2/childs/1/prop/value
							place: get-node item/childs/2/childs/3/prop/value

							number: next find/last street #" "
							street: trim/lines html-to-text copy/part street number

							unless empty? street [
								repend record ['street tab tab tab tab	street newline]
							]
							unless empty? number [
								repend record ['number tab tab tab tab	number newline]
							]
							unless place/1 = #" " [
								where: find  skip place 5  #" "

        repend record ['postal-code tab tab tab	copy/part place where  newline]

								place: where
							]
							unless empty? place: trim/lines html-to-text place [
								repend record ['place tab tab tab tab 	place newline]
							]
						]
					]
					"Telefoon:" [

      unless #{C2} = to-binary trim/lines html-to-text form-html/with get-node 
      item/childs/2 [pretty?: yes] [
							repend record

        ['phones tab tab tab tab	trim get-node item/childs/2/childs/text/prop/value 
         newline]
						]
					]
					"Website:" [

      if all [get-node item/childs/2/childs/1  get-node item/childs/2/childs/1/childs/1] 
      [
							repend record

        ['websites tab tab tab		trim get-node item/childs/2/childs/a/childs/text/prop/value 
         newline]
						]
					]
					"E-mail:" [

      if all [get-node item/childs/2/childs/1  get-node item/childs/2/childs/1/childs/1] 
      [
							repend record

        ['mail-addresses tab tab	trim/all get-node item/childs/2/childs/a/childs/text/prop/value 
         newline]
						]
					]
					"Profiel:" [

      unless #{C2} = to-binary trim/lines html-to-text form-html/with get-node 
      item/childs/2 [pretty?: yes] [
							repend record [
								'description newline
									tab replace/all

          trim html-to-text form-html/with get-node item/childs/2 [pretty?: 
          yes]
										"^/" "^/^-"
									newline
							]
						]
					]
				][
					print ["Onbekend veld: " type]
				]
			]
			write rejoin [%data/
				replace/all replace/all replace/all any [short-name name]
					#" " #"-"
					#"/" #"-"
					#"." ""
				%.txt
			] record
		]
	]
]
MarcS:
12-Oct-2012
so unless you're certain (!) that that won't occur, better to be 
safe and copy?
BrianH:
11-Mar-2013
So unless you have a way for rebol-patches to perform a retrofit 
of an existing R2 version with a new native function using cross-platform 
code, we're going to need not only the mezz patch for the past and 
the native for future R2 releases (if any).
PatrickP61:
7-May-2013
I'm using 2.100.111 and no REQUEST-DIR, unless it was added in a 
later version
PatrickP61:
7-May-2013
So here is my code that is giving me some trouble:

file-list:	[]

read-dir:	func	[
	dir	[file!	]
	] [
	foreach file read dir [
		file: either dir = %./ [file] [dir/:file]
		append file-list file
		if dir? file [
			read-dir file
	]	]	]

inp-dir: request-dir/path	what-dir 

unless inp-dir [ask	">>> No directory selected, cannot proceed  (Enter)" 
 quit ]
cd :inp-dir


read-dir inp-dir		; <-- does not work as expected, must use cd and 
what-dir instead
;read-dir what-dir
new-line/all file-list on
print mold file-list
GrahamC:
27-May-2013
Chris is in Peru at present .. don't expect any answers soon.  Unless 
you talk to him on SO chat
Group: Databases ... group to discuss various database issues and drivers [web-public]
BrianH:
22-Mar-2012
Here is the code I use to load your ODBC extension, which patches 
it after load:

; Load and patch the ODBC extension
odbc: import/no-user %odbc.dll
unless 'case = pick body-of :system/schemes/odbc/actor/open 10 [

system/schemes/odbc/actor/open: func [port [port!] /local result] 
bind [
	port/state: context [access: 'write commit: 'auto] 

 result: open-connection port/locals: make database-prototype [] case 
 [
		string? select port/spec 'host [ajoin ["dsn=" port/spec/host]]
		string? select port/spec 'target [port/spec/target]
		'else [cause-error 'access 'invalid-spec port/spec]
	]

 all [block? result lit-word? first result apply :cause-error result] 
	port
] odbc
]
Pekr:
21-Jul-2012
After some time, I gave a try to the Sqlite DB. It kind of improved 
in some areas, even locking, so it is even more useable in concurrent 
environment. However - it still uses per file lock, and although 
it uses just milliseconds to lock the file, I have a problem with 
one aproach I am trying to take, and hence maybe the Sqlite is not 
right DB for my purpose, or my aproach is not correct. The reason 
why I wanted to use sqlite DB is, that it is easily movable to other 
target, and its performance is fine for even semi heavy solutions. 
I don't want to be dependant upon the some kind of "server", which 
stores its files who knows where, and to which I don't have proper 
access in cgi environment, unless I am a DB admin or server admin 
...
Group: Web ... Anything related to the WWW [web-public]
GrahamC:
28-Sep-2012
not sure why you want read/custom for unless you're altering the 
header contents
Group: #Red Docs ... How should Red be documented [web-public]
Andreas:
4-Dec-2012
Gregg: unless you actually want to push changes to your fork on Github, 
there's usually no need to maintain a "fork" on Github.
Pekr:
12-Jan-2013
Kaj - sounds like sure thing but also news for me :-) AFAIK you and 
Doc were not much interested in bringing View to Red. Well, unless 
you mean DRAW equivalent done using different engine ...
Group: !REBOL3 ... General discussion about REBOL 3 [web-public]
Andreas:
22-Dec-2012
Unless you already are invested in tools one way or the other, I'd 
go with Markdown these days.
Arnold:
23-Jan-2013
? He owns the domain rebol.com doesn't he? So he gets all emailaddresses 
with that domain. Unless he assigns someone else one of those emailaddresses 
it is his. So he might not be using it anymore or somebody else is 
using it now?
BrianH:
24-Jan-2013
Regardless if email addresses are munged in the rebol.org archives, 
don't post real email addresses in a web-public group unless you 
are attempting to test spam filters.
BrianH:
28-Feb-2013
It's actually pretty easy to see how they managed it. It was:

- A multi-language IDE (not a programming language, people already 
get those for free)
- With a GUI with an emphasis on modern graphic design (pretty!)
- With a fancy demo (more pretty!)

- With an initial focus on programming languages and development 
platforms that are already popular (built-in customer base)


Powerful IDEs are some of the only development tools that people 
are still willing to pay money for (i.e. Visual Studio). Most people 
can't choose what language they write in, but they more often can 
choose their IDE. And for crappy-but-IDE-friendly languages, an IDE 
can make all the difference in your productivity. They're not as 
helpful for really powerful extensible languages like Rebol or Perl, 
unless the language is so bad that just about anything would help 
(Perl). Plus, since an IDE is an end-user app you can afford to GPL 
it, since the only stuff built on it are add-ons - that doesn't work 
for programming languages unless they have a clear distinction between 
user code and built-in code that is distinct enough to not violate 
the GPL distinctions, because most of the competition is permissive 
- and without the GPL restrictions there is nothing to sell, so there 
is no business model to get a return on investment.


It's nice to point to other open source projects and say "See! We 
could have done that!" but unless those are comparable projects their 
success isn't comparable either.
BrianH:
28-Feb-2013
Oh, LiveCode specifically makes the apps you make with it GPLv3 unless 
you buy the commercial version. Education market...
Scot:
28-Feb-2013
I suppose I might be able to drum up some more, but not unless they 
can own it.
NickA:
28-Feb-2013
Unless the guys at your table have more :)
1 / 1324[1] 2345...1011121314