Hi,
> If I understand your use of the term "evolving language" correctly,
> back in the 70's we used the term "extensible language" for the same
> thing (or something quite similar). That term implied that the
> programmer could:
>
> * add new syntactical structures (notation),
> * add new con
Hi Joel,
I am sorry I wrote my previous post in a way you felt a need to apologize.
The fact is, that I was sorry about it right after I sent it. I knew I
wasn't totally right about the non-terminating issue. The only problem of
your code WRT termination is, that it doesn't terminate for some tri
Hi,
I don't understand, why your mail didn't get through (I received your
previous mail normally).
> Hi, Ladislav.
>
> I'm replying through the Rebol list, because my ISP says:
>
> This Message was undeliverable due to the following reason:
>
> Your message was not delivered because the return
Well, the problem is, that you are trying to disobey the KISS rule. That
rule means, that your signed-if-for-dummies should do one thing and do it
well. I think, that it should execute the properly chosen block. It shoudn't
try to evaluate its first argument at any price, because supplying it is a
Hi,
a stupid example:
f: func [x [any-type!]] [1]
b: to paren! [to paren! [:f]]
ifs-for-dummies-who-play-with-fire b [positive: [print "positive"] negative:
[print "negative"] zero: [print "zero"]]
The result:
zero
== 1
Regards
Ladislav
> [EMAIL PROTECTED] wrote:
> >
> > Hi Joel,
> >
> >
Hi Joel,
I am not glad, that I must disappoint you, but see the following example:
a: 1
b: to paren! [to paren! [to paren! [to paren! [a: 0 - a
ifs-for-dummies b [negative: ["Negative"] zero: ["Zero"] positive:
["Positive"]]
== "Zero"
I think, you should read Exception #5 for Word Evaluatio
Hi Bo,
Compare:
Example #1:
a: [1 2]
remove back tail a
b: skip a 2
index? b
== 2
Example #2:
a: [1 2]
b: skip a 2
remove back tail a
index? b
** Script Error: Out of range or past end.
** Where: index? b
>From that I am concluding, That Rebol behaviour is inconsistent, because
both cases sh
Hi Rebols,
in the case anybody would like to have an as correct and general as possible
version of Ifs, here you are:
ifs: func [
{If positive do positive-block, zero do zero-block, negative do
negative-block}
[throw]
condition [number! char! money! time!]
positive-block [block!]
Hi Joel,
you wrote:
> Hello again, Ladislav,
>
> [EMAIL PROTECTED] wrote:
> >
> > Hi Joel,
> >
> > I knew about that issue, but considered the Throw attribute as
absolutely
> > necessary in this case...
> >
>
> Certainly! I've been reading a fascinating essay by Richard Gabriel on
the
> power (
Hi Joel,
I knew about that issue, but considered the Throw attribute as absolutely
necessary in this case (the chapter follows the one describing Throw/Catch
attributes AFAIR). You are right. To be correct, it should have been like
this:
ifs: func [
{If positive do block 1, zero do block 2,
Hi,
when testing the properties of Rebol strings I came to:
>> a: skip [1 2 3 4 5 6] 3
== [4 5 6]
>> index? a
== 4
>> b: head a
== [1 2 3 4 5 6]
>> remove back tail b
== []
>> b
== [1 2 3 4 5]
>> remove back tail b
== []
>> b
== [1 2 3 4]
>> remove back tail b
== []
>> b
== [1 2 3]
>> remove bac
A model of Rebol string implementation (written in Java):
class RebolStringStorage {
char [] storage;
int storageLength;
int stringLength;
}
class RebolString {
int position;
RebolStringStorage storage;
}
Regards
Ladislav
Hi List! Sorry for the length, but some may be interested, I hope...
Variables:
[Quote]
A variable refers to a specific value only within a defined context, such as
a block, a function, or an entire program.
[End Quote]
That seems to be in contradiction with:
>> probe block
[a a a]
== [a a a]
Hi,
Joel wrote:
> At this point, one would need to do similar tests for all REBOL
> datatypes to completely answer your question. The description
> of copy (with respect to the /deep refinement) leaves
> the impression that anything under the series! pseudotype
> would be a "referen
Hi Rebols,
...
> With regard to the specifics of buglists, knowledge-bases, and specs: I'm
for it. But help me out because I don't have the time or peoplepower to do
everything for everybody. Like I said: I've been focusing on YOU for four
years now. I've had no life, just you. Now, you've got
Hi Douglas,
a useful function, IMHO. I would suggest a more "goal oriented" approach
with the i-alt parameter:
i-alt [unset! block!] ; the alternate code to execute
; example code to be executed as alternate case
return either value? 'i-alt [do i-alt] [none]
Regards
Ladislav
> For your co
Hi,
[...snip...]
>
> I am confused as to why 'copy seems to be evaluating the words in the
block
> it's given. And also why it doesn't show up until after the function is
put
> together.
>
> BTW, here's a patch for 'function, to add 'throw-on-error around it, like
> 'does and 'func have:
>
> if n
Hi Andrew,
1)
zot1: make function! [
"Defines a user function with given spec and body."
[catch]
spec [block!] {Help string (opt) followed by arg words (and opt type and
string)}
body [block!] "The body block of the function"
][
throw-on-error [make function! spec body]
]
so
Example #1 (correct):
block: [1 / 0]
do block
Result:
** Math Error: Attempt to divide by zero.
** Where: 1 / 0
Example #2 (incorrect):
block: [1 / 0]
do/next block
Result:
** Math Error: Attempt to divide by zero.
** Where: do/next block
Regards
Ladislav
Hi,
I recently suggested my Rt (Referentially transparent) function, but
overlooked, that Joel wanted to have the first element of the path to be an
object (or a general Rebol value), not a Rebol word. Here is my next trial:
rt: func [
{
a referentially transparent way
to inv
Hi,
I am sure, I didn't explain the things as they should have been explained.
Here is the example, how the code could look:
Transpose: function [
[catch]
"Transposes Matrices"
Matrix [block!]
] [
Results Width Height Column
] [
throw-on-error [
Results: make block! W
Hi,
I don't think, that I can bring any theoretical reasons for preferring one
style over the other. I tried both. I must admit, that I liked the style
Andrew is evangelizing more and tried to use it exclusively. The difference
(for me) has shown itself when I wrote a script having six-page listi
Hi,
Andrew wrote:
>
> Why capitals? Here's the Transpose function again:
>
> Transpose: function [
> [catch]
> "Transposes Matrices"
> Matrix [block!]
> ][
> Results Width Height Column
> ][
> Results: make block! Width: length? Matrix/1
> Height: length? Matrix
>
Hi Joel,
> > > A set of higher order functions:
> > > Accum, Apply, Curry, Composition, Enum, Filter, Map, Mapper, Nargs,
> > Refined
> > > http://www.rebol.org/advanced/highfun.r
> > >
> >
>
> Well, actually, I do have one question (esp. to Ladislav and/or
> Allen) regarding style. I've noticed
Hi,
I am prepared to incorporate enhancements you suggest to
http://www.rebol.org/advanced/highfun.r
Cheers
Ladislav
BTW, an RT (Referentially Transparent) version of:
object/function/refinement1/.../refinementN arg1 ...argN
call can be written (using Refined from above URL) as follow
Hi,
Andrew wrote:
> Did you know? - 'Bind is stackable!
>
> I didn't - until I tried it. Have a look at the line:
> if all bind bind Filter 'File 'Header
>
> Unit: function ['Name [word!] Base-Directory [file!] Sub-Directory [file!]
> Filter [block!]] [Script Header] [
> error? try [
Hi,
example code:
word: use [a] [a: 11 'a]
get word
recycle
get word
CRASH!
Ladislav
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 28, 2000 12:31 AM
Subject: [REBOL] a GC bug of the second kind Re:(5)
> ptretter wrote:
> > Just wha
Hi,
although your question has a little in common with Rebol, my answers are as
follows:
1. It would be more precise to interleave each bit - ie. each binary digit -
as the smallest unit of information
2. in that case the bit - sort yields:
[0,0 2,2 1,5 5,1]
3. as you pointed out, the result
Well, let me throw in some thoughts.
I think, that the debate started to look more abstract than I prefer. My
comments are:
1) Rebol is IMHO designed with the runtime code accessibility in mind
(inspired by Lisp), so I do not think, there's an easy way to convert that
feature to its opposite.
2
Jeff already signaled, that List! and Hash! datatypes are being fixed. I
succeeded to track down the behaviour to the following:
h: make hash! 0
insert h copy "0123456789"
h
recycle
insert h copy "0123456789"
CRASH!
just in case you didn't know...
Regards
Ladislav
Hi Andrew,
no, that is not a bug for me (a feature). The real bug is, that you can use
my Hash! ADS implementation for Joel's original password file (22 lines
AFAIK), but it crashes Rebol (not error, simply crash, like GC bug) for his
huge password file (360,448 lines ).
If you are willing to te
Hi Joel,
You wrote:
> Ladislav's comes next (this is the second script he
> posted; the first one blew up on my box repeatedly).
Confused, I expected the SECOND script (the script using Hash! datatype) to
blow up - it looked to me like RT didn't succeed to implement of Hash!
datatype reliably, o
Hi,
there is a help, but you must use a stable sorting algorithm, eg. my
Merge-sort could do what you want (can send you my %msort.r privately).
Regards
Ladislav
> Based on the following:
>
> >> blk1
> == [8 6 4 2 0 3 7 5 1 9]
> >> sort/compare blk1 func [a b] [a < b]
> == [
Hi Joel,
I didn't succeed to run your benchmark (not enough memory error occurred),
so I modified it a bit:
Rebol []
file: home/passwords.txt
shells: copy make block! 5
countshell: func [sh [string!] /local shr] [
either none? shr: find shells sh [
append shells reduce [sh 1]
]
Hi Andrew,
there is a lot of cases, where your functions won't work as expected, eg.:
blk: copy []
associate blk [2] 3
associate? blk [2]
The other problem is, that your functions won't accept Any-type! values for
Key/Value
Regards
Ladislav
> Here's an implementation for an As
Hi Joel,
two notes:
1) I think that some posts on ADS missed one very important point - the
speed. The problem is, that Find (sequential search) may be a bottleneck for
some apps.
2) Select may be less general than Select/only sometimes.
Regards
Ladislav
Hi bobr,
what are the results of the code below and which version of Rebol you use?
-Ladislav
> At 09:09 PM 9/10/00 +0200, [EMAIL PROTECTED] wrote:
> >Hi bobr,
> >> - can it be done without creating a new instance?
> >
> >No.
>
>
> ok here is my latest method for extending an object in-situ.
Hi bobr,
you wrote:
> I have an existing dataase
> of saved objects which I wish to add fields to (IE add words:).
> I probably only want to add the words if I absolutely must
> in order to keep size down. I also may already
> have added a particular word to an object instance and dont wish to
>
Hi Rishi,
I think, that you are missing only complications here. What you are saying
is, that Math below is an instance of Object! datatype. You are right. You
are saying, that you would prefer it to be a class. But classes in a lot of
languages (except for C++, Java, ..., AFAIK) are instances of
Hi,
wrote:
> I'll point out quickly that what you're trying to do is generally
> considered a bad programming practice, i.e. referencing a variable
> internal to a function from its argument. A caller shouldn't need to know
> about and shouldn't really have direct access to variables local to a
Hi Elan,
you wrote:
> letter2: func [b] [
> foreach name ["Sue" "Sally"] [
> print bind b 'name
> ]
> ]
>
> Here BIND directs REBOL to associate all words contained in 'b with the
> "closest" context that contains the symbol name.
L:
I would recommend to change the wording:
{Bind assoc
Hi,
try this:
letter2: func [b] [foreach name ["sally" "sue"][print bind/copy b
'name]]
form: ["hi" name "welcome back"]
letter2 form
Regards
Ladislav
> >> letter2: func [b /local name] [foreach n ["sally" "sue"][ name: n print
reform reduce b] ]
>
> >> form
> == ["hi" name "we
Hi,
try this:
tries: 3
until [
set/any 'm try [write
ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there"]
tries: tries - 1
any [tries = 0 unset? get/any 'm]
]
Regards
Ladislav
> I am writing a script that will try 3 times to write a file and th
Hi Elan,
the problem has been solved by the function For2 (you can see it
at the end of the mail). Your solution (I call it For1) differs
here:
>> for1 i a: [1 2] tail a 1 [print mold i]
[1 2]
[2]
>> for2 i a: [1 2] tail a 1 [print mold i]
[1 2]
[2]
[]
Regards
Ladislav
> Hi Galt,
>
> it a
Hi,
> Ladislav,
>
> That is an impressive For function!
> your example of using
> >a: [1 2]
> >for s a tail a 1 [print s]
> as a test is very amusing bug, looks
> like an infinite loop on windows, just
> keeps printing newlines without ever ending.
>
> Just for kicks, I just tried this:
> >> for
Hi,
my copy of Windows 98 dials out whenever Rebol asks. No user
intervention needed. It depends on the settings of Win 98 IMHO.
Regards
Ladislav
- Puvodní zpráva -
Od: <[EMAIL PROTECTED]>
Komu: <[EMAIL PROTECTED]>
Odesláno: 30. srpna 2000 10:08
Predmet: [REBOL] Dialling Out
> Hi
Hi,
find/only C [2 3 4]
should work
> Supposedly find/only treats a series as a single value, but I am
not sure how this is done. I was interested in find the place in a
series at the place where a block is found:
>
> >> C: [ 1 [ 2 3 4] 5 6 ]
>
> >> find C "234" ; what I want to do
> >> fin
Hi,
what about:
forall: func [
"Evaluates a block for every value in a series."
[throw]
'word [word!] {Word set to each position in series and changed
as a result}
body [block!] "Block to evaluate each time"
/former
/head
/local fmr
][
if former [fmr: get word]
Hi,
being asked I try to explain my changes.
1. Thanks, Gabriele, I forgot to use one more Throw, but the
original is needed too. I used Throw attribute to make sure, that
any Return or Exit contained in code like:
f: does [ideal-looper elem indx [1 2 3] [exit]]
does what it should, ie. caus
Hi,
your explanation looks natural, but I am not sure, how it copes
with:
Example illustrating, that the same value and equality of Words
doesn't mean the same Binding (totally unnatural for human
languages and for some programming languages too):
blk: copy [a]
a: 11
b: make object! [append blk
Hi,
The difference:
a: [[1]]
b: copy a
c: copy/deep a
change first a 2
probe a
probe b
probe c
Regards
Ladislav
- Puvodní zpráva -
Od: <[EMAIL PROTECTED]>
Komu: <[EMAIL PROTECTED]>
Odesláno: 28. srpna 2000 16:33
Predmet: [REBOL] copy versus copy/deep
> As my example below shows,
Hi,
Galt:
> > I generally find that most of my knowledge of other computer
systems to
> gain insight into rebol is quite helpful and revealing. Even
having the
> context to say, this is like scheme or logo in rebol, but that
is like some
> other language, etc. is all helpful.
>
> > So, yes, it i
Hi,
just a small change:
ideal-looper: func [
[throw]
'element [word!]
'index [word!]
series [series!]
code [block!]
/local f i
] [
f: func reduce [element [any-type!] index] code
i: 1
while [i <= length? series] [f series/:i i i: i + 1]
]
Hi Elan,
I am not a native English speaker, but see some use for a
terminological change:
You wrote:
{{
It is simple to determine which words are bound to the context of
a
function. We must do a little more work to determine whether an
instance of
the word a is bound to the context of the objec
Hi,
my measurements are showing, that Rebol Bind is slower than it
could be. In the case of your interest I can help with that.
Regards
Ladislav
Hi,
you can do:
print read http://www.geocities.com/lmecir.geo/evaluation.txt
to read my "Rebol Values vs. Human Values" and
print read http://www.geocities.com/lmecir.geo/contexts.txt
to read "Words, Bindings and Contexts"
Regards
Ladislav
> The result is not what I expect. H
By accident, both Czech and Slovak "to" means English "it".
Regards
Ladislav
> >
> >
> > Does "to" have any special meaning in Czechoslovakian (I hope
I spelled
> that
> > right), pekr?
> >
>
> Probably the same as in Spaenglish ;-) (there are 2 (!)
languages, one
> Czech and one Slovakian.
> The best sollution would be to enhance "in" so you can not only
get words
> out of object's context, but also out of functions context.
>
> f: func [a] [a]
>
> f 2
>
> in :f 'a
> == a
>
> same? first second :f in :f 'a
> == true
>
> Good idea?
> Frank
>
Sure, copy it to feedback, please. I pref
Hi,
the following code was posted by me some time ago and the
principle was sent to feedback too. Here it is again:
protect 'secure
system/error/script/type: ""
system/error/script/expect-arg: [
(
change pick third :secure 3 reduce [word! block!]
secure allow
"I love
Hi Brian,
the problem is, that even the natives are mutable, as can be seen
in Mutable natives thread.
Regards
Ladislav
> I hate to be the bearer of bad tidings...
>
> First, the small security hole:
>
> I just found out that second returns the original
> code block when applied to a functi
Hi,
no "Dialect" notion can help you with your problem. (My personal
preferences are, that Rebol functions aren't "Rebol dialect",
because I think that there is a difference between a Rebol code in
a block and a Rebol function, which has got more attributes, than
Rebol code - see my Rebol functio
Hi,
how about:
block: ["a" "b" "c"]
code: [print member]
foreach member block [do bind code 'member]
The results:
a
b
c
Regards
Ladislav
> I am confused. Consider this small script:
>
> REBOL []
>
> block: ["a" "b" "c"]
> code: [print member]
> foreach member block [do code]
>
> Upon e
Hi,
back from holiday.
You might not notice, but Refined is a function defined in
www.rebol.org/advanced/highfun.r
It was my reaction to Michael's problem, but he pointed out, that
he didn't want to use it because of its overhead...
Regards
Ladislav
> Rooting around Rebol sources as the off
Interesting idea, Keith.
> Hi, I'm just wondering why this design choice was made:
>
> for pretty much any word that finds or picks, etc. a location
out of a
> series, for example:
>
> print find "here and now" "and"
>
> blk: [red 123 green 456 blue 789]
> print select blk 'red
> 123
>
> str: "R
Hi,
does anybody know a simpler way how to compute:
mod: func [
{compute a non-negative remainder}
a [number!]
b [number!]
/local r
] [
either negative? r: a // b [
r + abs b
] [r]
]
Regards
Ladislav
Hi Paul,
for more info see www.rebol.org/math/rounding.r
Regards
Ladislav
> Damn I thought I tried that. Thanks, I knew it was something
simple.
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 31, 2000 12:50 PM
> To: [EMAIL PROTECTED
Hi Zhang,
the problem is the GC bug. If the bug didn't exist, (self) is
unnecessary. As long, as the GC bug exists, (self) prevents the GC
from collecting O. (for more information you can read Words,
Bindings and Contexts thread)
Regards
Ladislav
>
> hi put up the question just in case i m
Hi,
you can use Recycle explicitly at some points of your script to
determine what is affected, for more info you can read Words,
Bindings and Contexts thread. Normally it could mean, that one of
your Contexts is already Garbage-collected, while you are trying
to use a Word it contained...
Regar
Hi,
the latest version (see below) is better (the generated rule can
be used recursively if needed):
A-B-rule: func [
{Generate an A-B parse rule}
A [block!] {A-rule}
B [block!] {B-rule}
/local o
] [
o: make object! [
A-rule: A
B-rule: B
res-rule: none
Hi Larry,
VERY interesting. Can't wait to see what you have done.
Regards
Ladislav
> Hi all
>
> Playing around with REBOL datatypes, I created a (slightly
perverse) puzzle.
> I made a block! referenced by 'blk which shows these properties
at the
> console:
>
> >> blk
> == []
> >> print blk
Hi,
try this: (but look out!) As long, as Rebol functions are CQSB
with DRP, there are problems with Rule-res word local to A-B-rule
function.
A-B-rule: func [
"Generate an A-B parse rule"
A [block!] {A-rule}
B [block!] {B-rule}
/local succeed fail rule-res
] [
[[B to end (ru
Hi, I think, that Parse has got a bug as in:
>> parse "a" [none skip]
== true
cc-ing to feedback. Here is a version of A-B-rule, that should
work reliably. Test it please.
A-B-rule: func [
"Generate an A-B parse rule"
A [block!] {A-rule}
B [block!] {B-rule}
/local o
] [
o: m
My apologies to everybody. The Make-object! and R-make-object!
functions shall be repaired (missing colon before Elem in append
words to word! :elem) The correct versions:
make-object!: func [
{make object! simulation}
spec [block!]
/local words result
] [
words: make block! 0
; Model of Use behaviour:
; ***
sim-use: func [
"Defines words local to a block."
words [block! word!] "Local word(s) to the block"
body [block!] "Block to evaluate"
/local context
] [
if word? words [words: reduce [words]]
; create the Context
cont
The last part was about the behaviour of Rebol Functions. The
present behaviour can be called "Computed Quasi Static Binding
with Dynamic Recursion Patch."
Interesting about the "Computed Quasi Static Binding" is, that it
can handle recursion even without the "Dynamic Recursion Patch",
as can be
Hi,
> HI Ladislav
>
> Very cool! Use of simulated behavior (implemented in REBOL) is
a concise
> and precise way of expressing one's thoughts about the workings
of REBOL
> functions. I find it much more informative than lengthy
attempts to
> describe in ordinary language how functions work.
>
>
Hi,
Gabriele:
> >Then the BIND function is called to bind
>
Elan:
> Metaphorically speaking? I have never seen the bind function
called during
> the construction of a function. If you source func and function,
you will
> find that neither of these mezzanine functions call bind. They
both use
>
Hi,
The discussed code:
f: func [f-arg] [
g: func [g-arg] [
print [g-arg f-arg global-word]
]
g "This is g's argument."
]
Gabriele:
> >So when F is created
> >the block:
> >
> > [
> >print [g-arg f-arg global-word]
> > ]
> >
> >gets bound to F's context; more prec
Hi Elan,
you wrote:
> (...)
> I conclude from Carl's comment that
> bind's intended behavior is to bind the block such that all
words that
> occur in the block behave as they would, if the block had been
defined in
> the context it is being bound to.
>
> I.e. if print [g-arg f-arg global-word] e
Hi,
> I was thinking in terms of function projection. Take a
> binary function (like + ), fix one of the arguments
> (5) and create a monadic (?) function that can be
> applied to say a vector. Sorry if all this seems like
> elementary stuff, I'm just starting with REBOL and
> exploring the poss
The following has been written:
> > Hi Ladislav, 15-Jul-2000 you wrote:
> >
> > >you are right, the problem is caused by a context
> manipulation -
> > >Use unsets your Middle every time it gets executed. My
> suggestion
> > >is to not use Use in recursive functions, while this problem
> > >doesn
Hi Brett,
the script can be found at http://www.rebol.org/advanced/highfun.r
Regards
Ladislav
> Hi Ladislav,
>
> I cannot seem to find the script highfun.r in either
www.rebol.com or
> www.rebol.org
> I have a copy and find it very useful. I suspect others would
too. So just
> wondering if
I see, that the fact, that my series didn't explain the behaviour
of functions WRT Recursion and Binding is a flaw. Here is the
continuation (a model of the behaviour):
; Model of Rebol function:
;
sim-function!: make object! [
; every function has got a Context
Me too.
> Hello [EMAIL PROTECTED]!
>
> On 25-Lug-00, you wrote:
>
> c> That looks like a bug. -Carl
>
> Hmm... do you have some little spare time to tell us how
contexts
> work? Isn't binding done word-by-word? Isn't hierarchy achieved
by
> multiple pass binding?
>
> You're confusing me, now.
Hi Volker,
no, the behaviour is correct. Try this:
unset 'b
a: make object! [b: none unset 'b if not value? 'b [b: "a bee!"]]
a/b
>
>
> [rebol[author: "Volker"]
>
> {seems 'make does no deep binding? without bug this
> should set 'b in object-context too (hopefully)?}
>
> unset 'b
> a: make ob
Hi Volker,
no problem, but I didn't receive it (why?)
Ladislav
>
> wrote
> [REBOL] Words, Bindings and Contexts. (5)
> which is of course
> (C) [EMAIL PROTECTED]
> :)
>
> sorry, Ladislav,
>
> must have thought Re's are now counted :)
> concentration..
>
> Volker
>
>
In the previous sections I answered some questions regarding
Contexts.
The lifetime Contexts:
*
The Global Context should last forever, Local Context have
indefinite extent, which should mean, that if there were no GC
bugs, they should last as long, as they are accessible
In the part 4 I forgot to introduce a special kind of Contexts:
f) Dangerous Contexts. Example:
f: func [x] []
special-context? first first :f
CRASH
I obviously cannot claim that Same-context? works in this case.
Now I supply another interesting function:
; actually, Thomas Jensen wa
Note: The last two sections (Context Hierarchy. Pardon?; "Context
hierarchy"? Aye, aye, sir!) were complicated and not very useful,
but they can be skipped.
What are Rebol Contexts?
*
Rebol Contexts are existing data, sometimes available to the user.
They are used int
Allow me to present a cleaned Same-context? function. Sorry for
any inconvenience due to reading the former - more complicated
implementation.
; this function can help us explore the Contexts, that aren't
directly available
same-context?: func [
{find out, if the given Words are the Words of
Rebol Contexts
**
Before introducing other properties of Bindings, I will try to
introduce Contexts.
Rebol Contexts are existing data, so we are not free to use any
definition of them. The "proof":
some Contexts are directly available:
Global Context is available as Rebol/Words
Hi Elan,
your Mental Model looks elaborated. The problem is, that it
doesn't describe the behaviour of Rebol 2.x correctly (no offense
meant). I could discuss it, but the problem is, that your Mental
Model's notions of "Context Table", "Value Bindings", "Currently
Active Context", "Effective Cont
Hi Rebols,
Mark Dickson wrote:
1. What contexts are?
2. Why are they important?
3. How are they determined i.e global or local ?
4. How, where & when are "new" context created ?
5. What is the lifespan of new context?
6. Why is it useful to know about this stuff ?
7. What productive use can be m
Gabriele wrote:
> Hi!
>
> It seems like I'm not getting all the messages from the REBOL
> lists (I often see replies to messages I haven't seen; I didn't
> get Carl's gels.r too). Someone has any idea if this might be a
> problem on my side or in SELMA?
>
> I'm going to check the archive to verif
Hi Rebols,
Brian wrote:
> Here's some REBOL pseudo-code of this (for block! spec):
> make-object: func [spec [block!] /local c o] [
> c: copy [self]
> foreach x spec [
> all [
> set-word? x
> none? find c (x: to-word x)
> insert tail c x
Hi Elan,
You wrote:
"During recursive calls, REBOL is using a dynamic binding for 'x,
which means that each instance of recfunc, called from within
recfunc recursively, has its own context in which 'x is bound to
the value that was passed to the recfunc instance."
I would like to divide the para
Hi,
> > I've been wondering what the reasoning behind REBOL's scoping
rules was for
> > awhile. In C, for instance, any variable that you declare in a
function is
> > "automatic" (that's what C calls them anyway :). They're
automatically local
> > to the function they're defined in, etc.
(...)
>
Hi,
> Hi Ladislav, 15-Jul-2000 you wrote:
>
> >you are right, the problem is caused by a context
manipulation -
> >Use unsets your Middle every time it gets executed. My
suggestion
> >is to not use Use in recursive functions, while this problem
> >doesn't get corrected.
>
> Judging from the natur
Hi,
see also www.rebol.org/math/rounding.r
> I needed a simple two decimal place round off function for a
script this
> evening.
>
> This is what I came up with:
>
> roundoff: func ["Rounds off to 2 decimal places" a][
> a: a * 100
> b: a - to-integer a
> a: to-integer a
>
Hi,
you can try
> parse page: read http://site [
> some [
> thru "=^"/" here: (insert back here "http://site")
> ]
> to end
> ]
> Hello.
>
> I once asked about this problem and it's partially solved
(thanks to
> everyone that helped me), but there
1 - 100 of 347 matches
Mail list logo