Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6678727fafc290c1269bb2a32927b2f523ce8ee6
Ticket: f8bc8efdf547eb8ddd92218ee1f8d91d0e0b4937
Tutorial lesson 15 uses listName inconsistently with lappend/linsert/lreplace
User & Date: neirbowj on 2016-08-24 00:03:17
Changes

  1. comment changed to:
    The command signatures for lappend, linsert, and lreplace are presented in Lesson 15 of the tutorial ("Adding & Deleting members of a list") as follows.
    
    lappend listName ?arg1 arg2 ... argn?
    linsert listName index arg1 ?arg2 ... argn?
    lreplace listName first last ?arg1 ... argn?
    
    The latter should read like this instead.
    
    linsert list index arg1 ?arg2 ... argn?
    lreplace list first last ?arg1 ... argn?
    
    According to the tutorial, the following interactive session should set `otherlist` to `{{one} {oneandahalf} {two} {three} {four}}`, return `two` from the corresponding `lindex` command, set `replacementlist` to {{one} {two} {tres} {cuatro}}`, and return `cuatro` from the corresponding `lindex` command.
    
        % set mylist [list one two three]
        one two three
        % lappend mylist four
        one two three four
        % lindex $mylist 3
        four
        % set otherlist [linsert mylist 1 oneandahalf]
        mylist oneandahalf
        % lindex $otherlist 2
        % set replacementlist [lreplace mylist 2 3 tres cuatro]
        mylist tres cuatro
        % lindex $replacementlist 3
        %
    
  2. icomment:
    Edited title and description to cover `lreplace` too.
    
  3. login: "neirbowj"
  4. mimetype: "text/plain"
  5. title changed to:
    Tutorial lesson 15 uses listName inconsistently with lappend/linsert/lreplace