Check-in [96cdaa7bf6]

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Untabify for consistent indentation
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | minor change
Files: files | file ages | folders
SHA3-256: 96cdaa7bf66087cd6d6a0868f74445480f735ab322482a1e892a45124263be1e
User & Date: dkf 2018-05-19 10:49:14
Context
2018-05-19
10:51
Added comment to highlight a (minor) syntactic feature check-in: 3a4f7e4abc user: dkf tags: trunk
10:49
Untabify for consistent indentation check-in: 96cdaa7bf6 user: dkf tags: trunk, minor change
10:48
Added an example check-in: e6ade010a0 user: dkf tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tip/500.md.

   275    275   Again, note that creation IDs are _always_ system-allocated and are _never_
   276    276   guaranteed to be unique between interpreters, either in multiple processes or
   277    277   in the same thread or process; they are only ever locally unique.
   278    278   
   279    279   # Example
   280    280   
   281    281       oo::class create LabelEqual {
   282         -		constructor {label} {
   283         -			set [my varname label] $label
   284         -		}
          282  +        constructor {label} {
          283  +            set [my varname label] $label
          284  +        }
   285    285           private {
   286         -		    variable label
   287         -			method getLabel {} {
   288         -			    return $label
   289         -			}
   290         -		}
   291         -		method equals {other} {
   292         -			expr {$label eq [$other getLabel]}
   293         -		}
   294         -	}
          286  +            variable label
          287  +            method getLabel {} {
          288  +                return $label
          289  +            }
          290  +        }
          291  +        method equals {other} {
          292  +            expr {$label eq [$other getLabel]}
          293  +        }
          294  +    }
   295    295   
   296         -	oo::class create Evaluated {
   297         -		superclass LabelEqual
   298         -		# Poorly chosen variable name! Happens too easily in real life
   299         -		variable label
   300         -		constructor {expression} {
   301         -			next $expression
   302         -			set label [expr $expression]
   303         -		}
   304         -	    method value {} {
   305         -			return $label
   306         -		}
   307         -	}
          296  +    oo::class create Evaluated {
          297  +        superclass LabelEqual
          298  +        # Poorly chosen variable name! Happens too easily in real life
          299  +        variable label
          300  +        constructor {expression} {
          301  +            next $expression
          302  +            set label [expr $expression]
          303  +        }
          304  +        method value {} {
          305  +            return $label
          306  +        }
          307  +    }
   308    308   
   309         -	set expr1 [Evaluated new {1 + 2 + 3}]
   310         -	set expr2 [Evaluated new {3 + 2 + 1}]
   311         -	puts "one is two? [$expr1 equals $expr2]"
   312         -	# Prints: one is two? 0
   313         -	puts "one=[$expr1 value] two=[$expr2 value]"
   314         -	# Prints: one=6 two=6
   315         -	puts [info vars [info object namespace $expr1]::*]
   316         -	# Prints something like: {::oo::Obj13::11 : label} ::oo::Obj13::label
   317         -	catch {$expr2 getLabel} msg
   318         -	puts $msg
   319         -	# Prints: unknown method "getLabel": must be destroy, equals or value
          309  +    set expr1 [Evaluated new {1 + 2 + 3}]
          310  +    set expr2 [Evaluated new {3 + 2 + 1}]
          311  +    puts "one is two? [$expr1 equals $expr2]"
          312  +    # Prints: one is two? 0
          313  +    puts "one=[$expr1 value] two=[$expr2 value]"
          314  +    # Prints: one=6 two=6
          315  +    puts [info vars [info object namespace $expr1]::*]
          316  +    # Prints something like: {::oo::Obj13::11 : label} ::oo::Obj13::label
          317  +    catch {$expr2 getLabel} msg
          318  +    puts $msg
          319  +    # Prints: unknown method "getLabel": must be destroy, equals or value
   320    320   
   321    321   # Implementation
   322    322   
   323    323   See the [`tip-500` branch](https://core.tcl.tk/tcl/timeline?r=tip-500).
   324    324   
   325    325   # Copyright
   326    326   
   327    327   This document has been placed in the public domain.