Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Slashdot REBOL mention

From: lmecir:mbox:vol:cz at: 31-Oct-2001 1:08

> Define Dialect, please?!? > > Thanks!! > Ammon
Just a trial, OK? Example #1 The C printf dialect. The string s="%s" surely has got a different meaning than usual if used as a format string for the printf function in the C language. The format string is understood as a formatting language sentence in that case. Conclusion: we can find a dialect in C (a C "sublanguage"). Similar dialects are not the C language specialty. Their usefulness lies in the fact, that they are better suited for a particular purpose than the main language is. More examples: * switch in C - see the meaning of the 'case word * cycle blocks *- 'continue has different meaning in nested cycles e.g. * printf formatting strings * macro directives (#include #ifdef ...) * etc Example #2 Rebol PARSE function. Let's have a block: block: [copy result telephone] If we simply DO this block, we are evaluating the COPY function that should set 'result to refer to a copy of TELEPHONE. If we instead use block as a parse rule, BLOCK would have totally different meaning. Namely, 'result would be set to a copy of a part of PARSE INPUT argument that would satisfy the TELEPHONE subrule. The difference isn't that big, but it is only natural, that 'copy should always communicate similar meaning, isn't it? There is a whole lot of native Rebol dialects, examples: * blocks treated as code can communicate totally different meanings than the same blocks treated as data * DO versus REDUCE versus COMPOSE - different handling of the contents of their BLOCK arguments * IF versus DO - DO always handles BLOCK argument as CODE, the behaviour of IF depends on the condition (treat BLOCK as data, or evaluate it?) * block as the SPEC argument of MAKE OBJECT! * block as the SPEC/BODY argument of the FUNC function * the VID * etc The existence of dialects doesn't distinguish these languages. The real difference is, that we can define our own REBOL dialects (using PARSE e.g.), while we cannot define our own C dialects without changing the language specification. A "buzzword" that communicates this meaning is, that REBOL is a language with meta-circular semantics. This feature makes the language much more communicative than any other language not having this feature is. HTH Ladislav