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

[REBOL] Re: Does REBOL cons?

From: Izkata::Comcast::net at: 15-Mar-2006 17:18

Mm, that does help me understand... Sorta. 'append calls 'insert, and no explicit call to 'copy, but 'insert is a native, so we can't look at it's source.... Unless someone who knows more about it replies, my best guess is that, if Rebol uses cons, 'insert does copy the second value before inserting it into the series.
>> source append
append: func [ {Appends a value to the tail of a series and returns the series head.} series [series! port!] value /only "Appends a block value as a block" ][ head either only [ insert/only tail series :value ] [ insert tail series :value ] ]
>> source insert
insert: native [ {Inserts a value into a series and returns the series after the insert.} series [series! port! bitset!] "Series at point to insert" value [any-type!] "The value to insert" /part "Limits to a given length or position." range [number! series! port! pair!] /only "Inserts a series as a series." /dup "Duplicates the insert a specified number of times." count [number! pair!] ]