How to make a reference to existing object from object name in string ?

Discussion in 'Rebol' started by elenay, Oct 3, 2010.

  1. elenay

    elenay New Member

    object-a: make object! [
    value: 15

    object-name: "object-a"

    I would like to make a reference to object-a with the object-name value.

    ref-to-object: ????

    ref-to-object/value: 20

    probe object-a
    make object! [
    value: 20

    Thanks in advance for your help.
  2. Graham

    Graham Developer Staff Member

    In REBOL, code is data, and data is code.

    So, we have your data "object-a" which can be transformed to code using the 'do dialect

    object-name: do "object-a"
  3. elenay

    elenay New Member

    So simple !

    Thanks Graham

Share This Page