[REBOL] AW: [REBOL] Dialecting...Stack Overflow ?! Re:(4)
Nitish wrote: > I am interested in the dialect you have written... There's a complete package, incorporating Robert Muench's enhancements from this page: http://openip.org/html/ow_overview.html or directly from: http://openip.org/html/rebol_html.zip The first page has some examples which can be helpful. Caution! This is version one of my HTML dialect. Not the bleeding edge version which only runs on REBOL/View. Andrew Martin Still fiddling... ICQ: 26227169 http://members.xoom.com/AndrewMartin/ -><-
[REBOL] AW: [REBOL] Dialecting...Stack Overflow ?! Re:(3)
Hello there, Andrew I am interested in the dialect you have written and I have downloaded it. I think I need Nest.r >> do %html.r Script: "HTML" (24-Oct-1999) ** Script Error: Include has no value. ** Where: Include %Nest.r NumericEntity: func [Number [integer!] /NoSemicolon] I did not find it at the rebol.org archive. Please post that also. Regards Nitish [EMAIL PROTECTED] http://www.loka.net/ -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, 16 February 2000 20:38 To: [EMAIL PROTECTED] Subject: [REBOL] AW: [REBOL] Dialecting...Stack Overflow ?! Re:(2) Jean wrote: > So if I use a block within a block I need reduce to tell rebol to evaluate the embedded block. > But why do I need rejoin in this case ? >join "" [reduce block1 ""] > also worked as I tried it. > Theoretically, >rejoin ["" block1 ""] > should work,too. The Rebol doc says: >Rejoin: Reduces and joins a block of values. Unfortunately, not quite correct as you interpret. The 'rejoin reduces and joins this block: ["" block1 ""] NOT this block: block1 Here's a nicer way: rejoin [ "" reduce block1 ] Note the empty string. This returns a string, and uses REBOL native tag values. Of course what we really, really want is: print HTML/Dialect [ Head [ Title "HTML/Dialect Title" ] Body [ "Body Attributes" ][ H1 Title center "Body Contents" Br "Time is:" now/time ] ] Note the use of the word 'head, the interesting uses of the word 'title, _optional_ inclusion of tag attributes, and the inclusion of REBOL functions/words. This version of my HTML dialect is very, very close to completion. Andrew Martin REBOlutionary solutions... ICQ: 26227169 http://members.xoom.com/AndrewMartin/ -><- begin 600 WINMAIL.DAT M>)\^(B0(`0:0" `$```!``$``0>0!@`(Y 0```#H``$(@ <` M& ```$E032Y-:6-R;W-O9G0@36%I;"Y.;W1E`#$(`0V ! `"`@`"``$$ MD 8`= $```$0`P``, (+``\.``(!_P\!.P`` M``"!*Q^DOJ,0&9UN`-T!#U0"`&QI``$P`0```!$G M;&ES=$!R96)O;"YC;VTG``(!"S !% ```%--5% Z3$E35$!214)/ M3"Y#3TT``P``.0`+`$ Z`0```!X`]E\!#P```&QI+\!'@!P``$^ M4D4Z(%M214)/3%T@05%K_F=L=(1UF M#4N%E;8`4950Q3,``!X`'@P!!0```%--5% `'@`?# $/ M``@0`0```&4```!( M14Q,3U1(15)%+$%.1%)%5TE!34E.5$5215-4141)3E1(141)04Q%0U193U5( M059%5U))5%1%3D%.1$E(059%1$]73DQ/041%1$E4251(24Y+24Y%141.15-4 M4D1/)4A434Q2``(!"1 !#@8```H&``";"@``3%I&=8X&6G8#``H` M0A@(!$`=AL@=]\%$ ) "? 9X!C (!G0' /09&]W;@D` M80$`&K&\="X9%!T!&$ +@&L=`9YN"> :L ? &H N"O!4 ;`@EP!N$N!;!G&>"*51D44BJ "Q$0P+$# M8(<:0!N0$@0Q-B M.1)Z3P409PN !T %T >0<_YA*I Y$QD6."0UXPLQ."8R M:2,0-#0!0#=P,3B., % #- \LV(@1@-A6CH,@V(182$@0@400+AX='(S@ 6@ M,Y!Z*;#@4TU44#H^WRNV/> W!F ",#Y'5PF 'W!S9"QA>1B0..%&+B!R=3D* MP'D@`= ]0$0Q.C-R.$%W5&\^1S=P&H! BRX4!:!M07AU8FH;@8$^1UM214)/ M3"K0;$%7(A!(ED0;5 N 9ZHN2G!3`9!C'S!/'"#&<@[P'9 @/R$'\"<`_R*@ M(V4['S@T-W0/!@NG&2/^2B]@`Z <4#@Q/D @- 8`EQ@@!I =`74O@6$@`F#^ M;TK1`_ >\E&7'U4)<18`O1L@=!@A%_$N!%/B9272O2V@91D4&P(K,"H`9!WR M)U'#'E4@D$)U!4!W:.=$(""Q4Q=J;QK1&M,$`/0@8R]R/QD:()!:T5C3U"(\ M(D(^(H!;4X51P_HQ6U$O6X0KNR"0,%(<0/T%L&L:H25Q'M$(@1X96@R^5!A0 M!; 10 W@!T!L0U#[6@]8M5M;9UQ_8BPR< A@]FP:L%ZR+%/P,(!A,DNQSU22 M'8 IH#H@>7-05UK1_S%@6-(B$#%@4Z($(!S26-);:@%1M6]1("73TH7X!W@>TX'8'2_&W B)(M'C<-\G74Y0@1P:T0@>UTBD/-!`D %$&+O5Z ' MD(]>>UU(=("-PW*\_U/ &C*2)0A0&C$",),N/P"?D5T'8HFB(H EH'L1JP)QA0'> 8D!L"&B8_2D&$9)XK*1$;<&(5 M7V_M!3!I`B '0%\:$24!`)#_`B">$SHP+9&2MH04GU2C">](HQD4*7*B8G,T MT)ZA:\#W@K1+$:,V;40@(D(;-Z?D_T-1J?)9D D`+X%3\!D41M'_"U!AD0(@ M,)L8M 70"L!*,?\Q!4BQ"D"B8T01,'"N9&O $TIP&75#42(0,C8R_#(W..!. MP!DD%I(T2 > JRGR:\!X9P!M1L(O&+2/K60UH#?2-< M`"N "" &``# 1@`VA0```0$`'@`L@ @@ M!@``P ```$8`-X4```$!`!X`+8 (( 8` M`, ```!&`#B%```!`0`>`#T``04```!213H@ .``,`#33]-P``5'*% ` end
[REBOL] AW: [REBOL] Dialecting...Stack Overflow ?! Re:(2)
Jean wrote: > So if I use a block within a block I need reduce to tell rebol to evaluate the embedded block. > But why do I need rejoin in this case ? >join "" [reduce block1 ""] > also worked as I tried it. > Theoretically, >rejoin ["" block1 ""] > should work,too. The Rebol doc says: >Rejoin: Reduces and joins a block of values. Unfortunately, not quite correct as you interpret. The 'rejoin reduces and joins this block: ["" block1 ""] NOT this block: block1 Here's a nicer way: rejoin [ "" reduce block1 ] Note the empty string. This returns a string, and uses REBOL native tag values. Of course what we really, really want is: print HTML/Dialect [ Head [ Title "HTML/Dialect Title" ] Body [ "Body Attributes" ][ H1 Title center "Body Contents" Br "Time is:" now/time ] ] Note the use of the word 'head, the interesting uses of the word 'title, _optional_ inclusion of tag attributes, and the inclusion of REBOL functions/words. This version of my HTML dialect is very, very close to completion. Andrew Martin REBOlutionary solutions... ICQ: 26227169 http://members.xoom.com/AndrewMartin/ -><-
[REBOL] AW: [REBOL] Dialecting...Stack Overflow ?! Re:(2)
Andrew wrote: > 'head is also the name of word used a lot by REBOL. Have a look at the source for 'append, and you will see why. Jean wrote: > using a reserved word is not a good idea, right ?! 'head is not reserved. It can be replaced like virtually all words in REBOL. It's just that a lot of other software relies on 'head returning the head of a series. 'head and other words with all ready defined meanings/value in REBOL, are becoming magical. Have a look at my %html.r at: http://www.rebol.org I've blazed a trail there into the HTML dialect that you're looking for. My latest work on the HTML dialect requires REBOL/View with the new parse block capability. Andrew Martin ICQ: 26227169 http://members.xoom.com/AndrewMartin/ -><-
[REBOL] AW: [REBOL] Dialecting...Stack Overflow ?! Re:
> -Ursprüngliche Nachricht- > Von: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] > Gesendet am: Dienstag, 15. Februar 2000 19:41 > An: [EMAIL PROTECTED] > Betreff: [REBOL] Dialecting...Stack Overflow ?! Re: > > Hi Jean, > > that's a funny one. > > join uses append. append uses the REBOL functio head to return the series > it appended to at its head. > > You redefine head to be > > >head: func [block2] [join "" [block2 ""]] > > So, what happens is whenever join is called within your functions, > eventually head is called (the intention is to call REBOL's predefined > head!) and instead of REBOL's head function your head function is called, > which in turn does a join, which leads to calling head ... and you have > happily constructed an infinite loop. :-) > > If you rename head to something else: > > html-head > > then you script runs (with problems), producing > > >> do %myhtml.r > Script: "Untitled" (none) > html-head title Titel body Das ist ein Text ! > >> > > Note that the next problem you encounter is that you get title Titel > instead of your intended and you get body Das ... > instead of your intended > > The reason you get this is that you pass the block [title "Titel"] etc. and > therefore title is not reduced. You need to use rejoin in your functions > and - because the block you are passing to html consists of two embedded > blocks, the html-head block and the body block - you need to use an > additional reduce in addition to rejoin. Now the thing returns: > > >> do %myhtml.r > Script: "Untitled" (none) > title Titel Das ist ein Text ! > > and the complete, slightly modified code is: > > REBOL [] > ;definition part > > html: func [block1 ] [rejoin ["" reduce block1 ""]] > html-head: func [block2] [rejoin ["" block2 ""]] > body: func [block3] [rejoin ["" block3 ""]] > title: func [block4] [rejoin ["" block4 ""]] > > ;test part > a: html > [ > html-head > [ > title "Titel" > ] > body > [ > "Das ist ein Text !" > ] > ] > print a > > ;- Elan >> [: - )] Thanks a lot. Now it works :) So if I use a block within a block I need reduce to tell rebol to evaluate the embedded block. But why do I need rejoin in this case ? join "" [reduce block1 ""] also worked as I tried it. Theoretically, rejoin ["" block1 ""] should work,too. The Rebol doc says: Rejoin: Reduces and joins a block of values. ciao, Jean
[REBOL] AW: [REBOL] Dialecting...Stack Overflow ?! Re:
> -Ursprüngliche Nachricht- > Von: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] > Gesendet am: Dienstag, 15. Februar 2000 17:15 > An: [EMAIL PROTECTED] > Betreff: [REBOL] Dialecting...Stack Overflow ?! Re: > > 'head is also the name of word used a lot by REBOL. Have a look at the > source for 'append, and you will see why. using a reserved word is not a good idea, right ?! Thanks, Jean
[REBOL] Dialecting...Stack Overflow ?! Re:
Hi Jean, that's a funny one. join uses append. append uses the REBOL functio head to return the series it appended to at its head. You redefine head to be >head: func [block2] [join "" [block2 ""]] So, what happens is whenever join is called within your functions, eventually head is called (the intention is to call REBOL's predefined head!) and instead of REBOL's head function your head function is called, which in turn does a join, which leads to calling head ... and you have happily constructed an infinite loop. :-) If you rename head to something else: html-head then you script runs (with problems), producing >> do %myhtml.r Script: "Untitled" (none) html-head title Titel body Das ist ein Text ! >> Note that the next problem you encounter is that you get title Titel instead of your intended and you get body Das ... instead of your intended The reason you get this is that you pass the block [title "Titel"] etc. and therefore title is not reduced. You need to use rejoin in your functions and - because the block you are passing to html consists of two embedded blocks, the html-head block and the body block - you need to use an additional reduce in addition to rejoin. Now the thing returns: >> do %myhtml.r Script: "Untitled" (none) title Titel Das ist ein Text ! and the complete, slightly modified code is: REBOL [] ;definition part html: func [block1 ] [rejoin ["" reduce block1 ""]] html-head: func [block2] [rejoin ["" block2 ""]] body: func [block3] [rejoin ["" block3 ""]] title: func [block4] [rejoin ["" block4 ""]] ;test part a: html [ html-head [ title "Titel" ] body [ "Das ist ein Text !" ] ] print a At 04:46 PM 2/15/00 +0100, you wrote: >Hi , > >I tried to learn th. about writing dialects. So I did the following code, to >begin with. >I exspected it to putput the following: > >TitelDas ist ein Text >! > >but I got an error msg of type: stack overflow , though I had increased >stack to 3.000.000 Bytes. > >Here's my program: > > >REBOL [] >;definition part >html: func [block1] [join "" [block1 ""]] >head: func [block2] [join "" [block2 ""]] >body: func [block3] [join "" [block3 ""]] >title: func [block4] [join "" [block4 ""]] >;test part >a: html >[ > head > [ > title "Titel" > ] > body > [ > "Das ist ein Text !" > ] >] >print a > > > > <> > >Attachment Converted: "c:\eudora\attach\myhtml.r" > ;- Elan >> [: - )]
[REBOL] Dialecting...Stack Overflow ?! Re:
'head is also the name of word used a lot by REBOL. Have a look at the source for 'append, and you will see why. If you have a look at my %HTML.r script on http://www.rebol.org, or from http://openip.org, you'll see my early approach to writing a HTML dialect, using a similar method. Andrew Martin Who's up bright and early downloading the Windows Platform SDK. It's only taken all night so far! :-) ICQ: 26227169 http://members.xoom.com/AndrewMartin/ -><- - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, 16 February 2000 4:46 AM Subject: [REBOL] Dialecting...Stack Overflow ?! > Hi , > > I tried to learn about writing dialects. So I did the following code, to begin with. > I expected it to output the following: > > TitelDas ist ein Text > ! > > but I got an error msg of type: stack overflow, though I had increased stack to 3.000.000 Bytes. > > Here's my program: > > > REBOL [] > ;definition part > html: func [block1] [join "" [block1 ""]] > head: func [block2] [join "" [block2 ""]] > body: func [block3] [join "" [block3 ""]] > title: func [block4] [join "" [block4 ""]] > ;test part > a: html > [ > head > [ > title "Titel" > ] > body > [ > "Das ist ein Text !" > ] > ] > print a > > > > <> >