Script Library: 1238 scripts
 

make-object.r

REBOL [ Title: "Make Object" Date: 3-Jul-2002 Name: 'Make-Object Version: 1.0.0 File: %make-object.r Author: "Andrew Martin" Purpose: { ^-^-Scans a Spec looking for set-word! inside them, ^-^-then stuffs them in the object spec with none. ^-^-} eMail: %Al--Bri--xtra--co--nz Web: http://valley.150m.com library: [ level: 'intermediate platform: none type: [tool] domain: none tested-under: none support: none license: none see-also: none ] ] make object! [ SetWords?: function [Spec [block!]][Words][ Words: make block! 10 foreach Value Spec [ any [ if all [ set-word? :Value not found? find Words :Value ][ append Words :Value ] if block? :Value [ append Words SetWords? Value Words: unique Words ] ] ] Words ] set 'Make-Object function [ {Scans a Spec looking for set-word! inside them, then stuffs them in the object spec with none.} Spec [block!] ][ SetWords ][ SetWords: SetWords? Spec if not empty? SetWords [ append SetWords none insert Spec SetWords ] make object! Spec ] ]
halt ;; to terminate script if DO'ne from webpage
Notes
  • email address(es) have been munged to protect them from spam harvesters. If you are a Library member, you can log on and view this script without the munging.
  • (Al:Bri:xtra:co:nz)