Vely logo install | documentation | examples | changelog
16.10.0 released May 10, 2023
write-fifo

Purpose: Write key/value pair into a FIFO list.

write-fifo <list> key <key> value <value>

write-fifo adds a pair of key/value pointers to the FIFO <list>, specified with string <key> and <value> (in "key" and "value" clauses, collectively called an "element").

It always adds elements to the end of the list. <value> is a pointer to any type, allowing storage of any kind of data.

Memory pointed by <key> and <value> must not go out of scope or be freed while FIFO is used - if necessary, store a copy (see copy-string for strings). This is because write-fifo does not make copies of <key> and <value>, rather only the pointers to those are stored.
Examples
new-fifo define nf
write-fifo nf key "mykey" value "myvalue"

See also
FIFO ( new-fifo   purge-fifo   read-fifo   rewind-fifo   write-fifo  )  SEE ALL (documentation)


Copyright (c) 2017-2023 Dasoftver LLC