World: r3wp
[Rebol School] Rebol School
older newer | first last |
BrianH 11-Apr-2006 [233x4] | Currently, object! and function! types have contexts associated with them, and some natives (such as USE) create contexts internally as part of their operation. |
Anton, my explanation above does cover the same word in different contexts. Contexts don't really contain words (except as values in the value slots). You can think of a context as a hash full of references to symbols and a block (of the same length) that contains the value slots corresponding to those symbols. A word is just a value that points to a context, and another word can point to another context, even if both words also point to the same symbol. | |
Peter, series values are really a pointer to the series data and an offset. When you assign a series value to a word, that pointer and offset are copied into the value slot that is currently associated with that word (until it is bound to another context). The actual series data pointed to is unchanged, though. | |
An integer value like 4 is actually contained in the value slot rather than pointed to by it, so when you insert a 4 in a block or assign one to a word, it is copied into the new value slot. Value types like this are called immediate values. | |
Pekr 11-Apr-2006 [237x2] | I think that it would be good to have visual drawing - sentences as "symbol that is pointed to by a word" is kind of abstract for newbies. And what bothers newbies? When the series is unique and not shared. I know cases where I better use 'copy, because I am not really sure, what rebol will do ... |
I don't know single person, who would not run into troubles because of that ... I once even saw Carl's script, where changing border of one button changed them all ;-) | |
BrianH 11-Apr-2006 [239] | I agree about the pictures. Too bad AltME uses variable length fonts, or I could do ASCII art. It's a good thing that denismx already told us that he is familiar with C++, so I don't have to explain what I mean by a pointer or a string here. |
Pekr 11-Apr-2006 [240] | I know, nothing against what you describe, I just wanted to point out to possible troubles and mistakes by newbies, and am trying to find out, how to avoid it .... |
BrianH 11-Apr-2006 [241x2] | I just hope he can translate for his students. |
Perhaps we need to make a REBOL-in-REBOL, if only for the sake of teaching. | |
denismx 19-Apr-2006 [243] | I'm starting to sort the concepts out, cross-referencing several explanations. I will have to tone down the explanations for my students, obviously. But to do so, the teacher needs to have a very good grasp of the language so as not to make faulty reprensentations that would work small scale, but not later on when some students progress further in the language. |
Maxim 19-Apr-2006 [244x2] | I find its hard to get people to "grasp" REBOL. in the sense that they we all just see a different syntax twist at first. |
The single most helpfull sweeping statement for me was "code IS data" | |
denismx 19-Apr-2006 [246x5] | The document "Rebol Essentials" starts with an explanation of value, word and block. Seems to be a good starting point. Haven't looked at how it introduces the syntax of system words later on. That is a crucial part. I want to find a subset of the 400 Rebol words that sould and can be learned first, giving the beginner a useful and powerful subset of instructions to start programming significant small apps. |
Yes Maxim. But that is to mystical for teaching purposes. | |
Actually, since Von Neuman, code is treated as data. You load it into memory and process is as a special kind of data. | |
... so it's a long time ago that this concept is around. | |
I remember writing a program in Pascal that modified itself either in memory or rewriting itself on disk with variations. | |
Maxim 19-Apr-2006 [251x2] | not exactly what I meant. |
there is no "code" in rebol. | |
JaimeVargas 19-Apr-2006 [253x2] | Maxim thats not completely true. What you want to say is that you can manipulate code as it was data at runtime, and the modifications will affect the program next time there is an eval. |
eval are trigger by function evaluation, do, reduce, parens and few others. | |
Maxim 19-Apr-2006 [255] | damn... I'd like to continue here... but I must run off :-( |
denismx 19-Apr-2006 [256x2] | In fact, in any programming language, code is just data that is executable. Some languages allow that the code-data be processed as any other date. Rebol is not the only one. And I do not believe that this is it's main characteristic. The fundamental characteristic of Rebol is that it is a language for exchanging data over networks, be it information (data) or programs (code) so that is can be used and executed (if code is passed) on any computer connected to the network. |
For this to be possible, the language needs to be able to interpret new code passed to it, naturally. | |
JaimeVargas 19-Apr-2006 [258] | Yes denismx, but that is not the only approach possible. Erlang passes byte code, and it is very good at distributed computing, same with Termite. |
denismx 19-Apr-2006 [259x2] | What is amazing is that the interpreter is so small and yet permits so much. |
Of course... | |
JaimeVargas 19-Apr-2006 [261] | It has to do with the careful mapping of datatypes to literals. |
denismx 19-Apr-2006 [262] | The small footprint, u mean? |
JaimeVargas 19-Apr-2006 [263] | That is a forte of Rebol, it avoids data prickling or serialization which it is require in other languages. |
denismx 19-Apr-2006 [264] | ic |
JaimeVargas 19-Apr-2006 [265x2] | Regarding small footprint I think this is just proper coding, and avoidance of bloat. |
mzscheme interpreter is only 300K in my system. So it is not unheard off. | |
denismx 19-Apr-2006 [267x3] | I'm sure there is a lot of that. But then again, 256K for the core seems very small. |
ic | |
and Basic was pretty small too. Guess I'm getting to used to bloated stuff with the years :-) | |
JaimeVargas 19-Apr-2006 [270x4] | Yes. |
Most interpreter machines are small. What makes the big is all the libraries and IDEs that they add to them. | |
Going home now. Keep enjoing rebol. | |
Before I go this is the shortest intro to scheme and functional programming that I had found. It will get you up to speed in this model in one day http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html | |
denismx 19-Apr-2006 [274] | I will look into it Jaime. Tks. Although I am doubtfull my solution to devising a "better" way to teach Rebol is in getting a better mastery of functional programming, I may be wrong. So I'll follow your lead. |
JaimeVargas 20-Apr-2006 [275] | Functional programming demystifies a lot imho. |
denismx 21-Apr-2006 [276x3] | I'm sure it does, but my impression is that I don't have any problem with that concept. I programmed in Logo and Prolog (for teaching purposes, not commercialy). The idea that I can build Rebol statements in blocks and evaluate them, all at runtime, does not phase me. But I'm always willing to learn more of anything. It never hurts (much). |
The question I am asking myself now, in my exploration of Rebol, is: What is the smallest subset of predefined Rebol words that will empower a student to build significant small applications. | |
If this set is small enough (400 words is way to large), say 15 to 30 words, then this would be a good starting point for teaching purposes (18-20 year olds with no previous experience in programming). | |
Anton 21-Apr-2006 [279] | That leads me to wonder if I could produce a histogram of all the rebol words in my codebase. But "rebol words" is kind of hard to define, so it would not give a precise result. I think individual frequency analysis of some actual rebol apps would lead to a nice collection of functions. |
[unknown: 9] 21-Apr-2006 [280] | Then a genus tree, since many words are just subtle variations. |
Maxim 21-Apr-2006 [281] | ball part figure, I'd say basic I/O and core series handling. |
Allen 22-Apr-2006 [282] | Rather than choosing a subset of words to learn first, choose the task instead, the required subset will then be fairly obvious. |
older newer | first last |