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

A BUILD dialect

 [1/2] from: lmecir::mbox::vol::cz at: 7-Apr-2003 7:47


Hi all, comment [ ; COMPOSE isn't very comfortable ; Example: ; having a: [block a] ; to obtain something like [[[block a] (f: fail) | (f: none)] f] ; we have to write the following description ; for COMPOSE: probe compose/deep [ [ (reduce [a]) ([(f: fail) | (f: none)]) ] f ] ; Example written using BUILD probe build [ [ only a (f: fail) | (f: none) ] f ] ] build: function [ {Builds a block. More comfortable, than COMPOSE} block [block! paren!] ] [result value position] [ result: make block length? :block parse block [ any [ 'insert position: ( set/any [value position] do/next position insert tail result get/any 'value ) :position | 'only position: ( set/any [value position] do/next position insert/only tail result get/any 'value ) :position | set value block! ( insert/only tail result build :value ) | set value paren! ( insert/only tail result build :value ) | set value skip ( insert/only tail result get/any 'value ) ] ] result ] Regards -Ladislav

 [2/2] from: lmecir:mbox:vol:cz at: 7-Apr-2003 13:05


Hi all, Graham put the dialect at the RiT site and I expanded the description and made it compatible with the older versions of the interpreter: http://www.compkarori.com/cgi-local/vanilla.r?selector=display&snip=build+dialect Regards -Ladislav