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

to-path and append?

 [1/8] from: tim::johnsons-web::com at: 23-Aug-2003 13:33


Hello REBOLS: I'm trying to append elements from one block to another, whilst make the elements into a path
>> test-this: [input type name value]
== [input type name value]
>> to-path test-this
== input/type/name/value ; yep, so far so good
>> test-more: []
== []
>> append test-more to-path test-this
== [input type name value] ; say what? I expected (hoped for) ; [input/type/name/value] what have I done wrong? Thanks! tj -- Tim Johnson <[tim--johnsons-web--com]> http://www.alaska-internet-solutions.com http://www.johnsons-web.com

 [2/8] from: AJMartin:orcon at: 24-Aug-2003 10:27


Hi, Tim. You wrote:
> >> append test-more to-path test-this > == [input type name value] ; say what? I expected (hoped for) > ; [input/type/name/value] what have I done wrong? >> help insert
USAGE: INSERT series value /part range /only /dup count DESCRIPTION: Inserts a value into a series and returns the series after the insert. ;...
>> type? test-more
== block!
>> series? test-more
== true 'Append and 'insert simply return the series they were given as the first value. That series value is the block! value referred to by 'test-more. What you want is an empty path! value for the 'series argument to 'append. Something like this:
>> test-more: remove to path! [to] >> test-this: [input type name value]
== [input type name value]
>> append test-more to-path test-this
== input/type/name/value And if you want the result in a block:
>> test-more: remove to path! [to] >> reduce [append test-more to-path test-this]
== [input/type/name/value] I hope that helps! Andrew J Martin ICQ: 26227169 http://www.rebol.it/Valley/ http://valley.orcon.net.nz/ http://Valley.150m.com/

 [3/8] from: tim:johnsons-web at: 23-Aug-2003 15:05


Hey Andrew: Yes, that does it! Thanks for putting me on the right path :-). tj * A J Martin <[AJMartin--orcon--net--nz]> [030823 14:34]:
> Hi, Tim. > You wrote:
<<quoted lines omitted: 34>>
> To unsubscribe from this list, just send an email to > [rebol-request--rebol--com] with unsubscribe as the subject.
-- Tim Johnson <[tim--johnsons-web--com]> http://www.alaska-internet-solutions.com http://www.johnsons-web.com

 [4/8] from: g:santilli:tiscalinet:it at: 24-Aug-2003 10:53


Hi Tim, On Saturday, August 23, 2003, 11:33:42 PM, you wrote:
>>> append test-more to-path test-this
TJ> == [input type name value] ; say what? I expected (hoped for) TJ> ; [input/type/name/value] what have I done wrong? You have to use APPEND/ONLY (a path! is like a block, so without /ONLY you insert its elements, not the path! itself). Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/

 [5/8] from: tim:johnsons-web at: 24-Aug-2003 9:11


* Gabriele Santilli <[g--santilli--tiscalinet--it]> [030824 01:02]:
> Hi Tim, > On Saturday, August 23, 2003, 11:33:42 PM, you wrote:
<<quoted lines omitted: 3>>
> You have to use APPEND/ONLY > (a path! is like a block, so without
Aha! I've learned something new. Thank you!
> /ONLY you insert its elements, not the path! itself). > Regards,
<<quoted lines omitted: 5>>
> To unsubscribe from this list, just send an email to > [rebol-request--rebol--com] with unsubscribe as the subject.
-- Tim Johnson <[tim--johnsons-web--com]> http://www.alaska-internet-solutions.com http://www.johnsons-web.com

 [6/8] from: andrew:martin:colenso:school at: 25-Aug-2003 8:15


I wrote:
> What you want is an empty path! value for the 'series argument to
'append. Or like this:
> remove to path! [to] >> make path! 0 >> clear 'foo/bar
== Some alternative empty path! values. Andrew J Martin Attendance Officer & Information Systems Trouble Shooter Colenso High School Arnold Street, Napier. Tel: 64-6-8310180 ext 826 Fax: 64-6-8336759 http://colenso.net/scripts/Wiki.r?AJM http://www.colenso.school.nz/ DISCLAIMER: Colenso High School and its Board of Trustees is not responsible (or legally liable) for materials distributed to or acquired from user e-mail accounts. You can report any misuse of an e-mail account to our ICT Manager and the complaint will be investigated. (Misuse can come in many forms, but can be viewed as any material sent/received that indicate or suggest pornography, unethical or illegal solicitation, racism, sexism, inappropriate language and/or other issues described in our Acceptable Use Policy.) All outgoing messages are certified virus-free by McAfee GroupShield Exchange 5.10.285.0 Phone: +64 6 843 5095 or Fax: +64 6 833 6759 or E-mail: [postmaster--colenso--school--nz]

 [7/8] from: tim:johnsons-web at: 24-Aug-2003 14:39


* Andrew Martin <[andrew--martin--colenso--school--nz]> [030824 12:30]:
> I wrote: > > What you want is an empty path! value for the 'series argument to > 'append.
I'm always enlightened by you guys. Andrew, stayed tuned. I'm in the process of writing a subroutine that takes both standard and user defined keywords and types to build dynamic forms. I'll be using 'ML underneath. I hope you all can help me to make it fairly portable - IOWS my schema, which I developed in python using dictionaries and the HtmlGen uses both user-defined types (like "date" which translates to 3 select lists) and user-define keywords like 'req 'lj 'rj' 'llabel, 'rlabel plus keyword/type validation. It works pretty well in python and I hope to make it slicker in rebol. More tomorrow. tim
> Or like this: > > remove to path! [to]
<<quoted lines omitted: 22>>
> To unsubscribe from this list, just send an email to > [rebol-request--rebol--com] with unsubscribe as the subject.
-- Tim Johnson <[tim--johnsons-web--com]> http://www.alaska-internet-solutions.com http://www.johnsons-web.com

 [8/8] from: andrew:martin:colenso:school at: 25-Aug-2003 10:46


Sounds neat, Tim! I'm looking forward to seeing it. Andrew J Martin Attendance Officer & Information Systems Trouble Shooter Colenso High School Arnold Street, Napier. Tel: 64-6-8310180 ext 826 Fax: 64-6-8336759 http://colenso.net/scripts/Wiki.r?AJM http://www.colenso.school.nz/

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted