Data update

This commit is contained in:
Ingy döt Net 2025-08-11 18:05:26 -07:00
parent 4d5544505c
commit 4924dd0264
3073 changed files with 55820 additions and 4408 deletions

View file

@ -0,0 +1 @@
set mylist { item1 item2 item3 }

View file

@ -0,0 +1 @@
set furniture "chair table lamp sofa bed desk"

View file

@ -0,0 +1,5 @@
set paths [split "/sbin:/bin:/usr/bin:/usr/local/bin:$home/bin" ":"]
foreach p $paths {
puts "$p"
}

View file

@ -0,0 +1,2 @@
set A {}
set B [list]

View file

@ -0,0 +1 @@
set var 5 ;# ($var is the string "5", or the integer 5 , or a list with one item {5} )

View file

@ -0,0 +1,5 @@
set len [llength "Apples Oranges"] ;# 2
set len [llength {Apples Oranges}] ;# 2
set fruit { apples oranges cherries bananas}
set len [llength $fruit]
puts stdout "($len) : $fruit"

View file

@ -0,0 +1,10 @@
# The ''lindex'' command returns a single item at a given index of a list
set c [lindex $fruit 2] ;# "cherries" (0-based index)
# The ''lrange'' command returns a given range of items from a list, as a new list.
set A [lrange $fruit 0 2] ;# {apples oranges cherries} (list)
# An empty list is not necessarily an empty string:
set var { } ;# $var => " ", but [llength $var] => 0

View file

@ -1,13 +0,0 @@
;# not recommended:
set mylistA {apple orange} ;# actually a string
set mylistA "Apple Orange" ;# same - this works only for simple cases
set lenA [llength $mylistA]
puts "$mylistA : $lenA"
# better: to build a list, use 'list' and/or 'lappend':
set mylistB [list apple orange "red wine" {green frog}]
lappend mylistB "blue bird"
set lenB [llength $mylistB]
puts "$mylistB : $lenB"