Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions exercises/practice/accumulate/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Hints
# Instructions append

You'll need to use the [uplevel](https://tcl.tk/man/tcl8.6/TclCmd/upvar.htm)
and [upvar](https://tcl.tk/man/tcl8.6/TclCmd/upvar.htm) commands for this
exercise.
## Hints

You'll need to use the [uplevel](https://tcl.tk/man/tcl8.6/TclCmd/upvar.htm) and [upvar](https://tcl.tk/man/tcl8.6/TclCmd/upvar.htm) commands for this exercise.
2 changes: 2 additions & 0 deletions exercises/practice/anagram/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions Append

## Implementation

You must return the anagrams in the same order as they are listed in the candidate words.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Implementing functions for the `expr` command
# Instructions append

## Implementing functions for the `expr` command

Some of these tests require you to create new functions for the `expr` command.
Read the Tcl [mathfunc](https://www.tcl-lang.org/man/tcl8.6/TclCmd/mathfunc.htm)
documentation to learn how.
Read the Tcl [mathfunc](https://www.tcl-lang.org/man/tcl8.6/TclCmd/mathfunc.htm) documentation to learn how.
5 changes: 3 additions & 2 deletions exercises/practice/dot-dsl/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# DOT Language Spec
# Instructions append

## DOT Language Spec

Although the DOT language has a [formal specification][DOT-spec], the tests for this exercise do not expect the full specification to be implemented.

The Tcl wiki has [some notes about domain-specific languages][DSL-wiki].

[DOT-spec]: https://www.graphviz.org/doc/info/lang.html
[DSL-wiki]: https://wiki.tcl-lang.org/page/domain-specific+language

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Resources
# Instructions append

The Tcl Wiki entry on [Errors management](https://wiki.tcl-lang.org/page/Errors+management)
is useful for this exercise.
## Resources

The Tcl Wiki entry on [Errors management](https://wiki.tcl-lang.org/page/Errors+management) is useful for this exercise.
6 changes: 4 additions & 2 deletions exercises/practice/gigasecond/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# placeholder
# Instructions append

To solve this exercise in Tcl, you'll need to use [the `clock` command][clock]
## Implementation

To solve this exercise in Tcl, you'll need to use [the `clock` command][clock].

[clock]: https://www.tcl-lang.org/man/tcl8.6/TclCmd/clock.htm
22 changes: 15 additions & 7 deletions exercises/practice/list-ops/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
# The Tcl `apply` command
# Instructions append

## The Tcl `apply` command

The test cases may look confusing.
You are expected to implement this:

The test cases may look confusing. You are expected to implement this:
```tcl
set myList {alpha beta gamma delta}
listOps::filter $myList {{word} {expr {[string length $word] == 4}}
```

Why does that last argument have so many braces?

Recall that the `proc` command is defined as:

```tcl
proc procName argList body
```

Tcl has an `apply` command:

```tcl
apply func ?arg1 arg2 ...?
```
this "func" is a two element list `{argList body}` that is essentially an
anonymous proc (or "lambda"). The `apply` command invokes that anonymous
proc, passing it the arguments it needs.

this "func" is a two element list `{argList body}` that is essentially an anonymous proc (or "lambda").
The `apply` command invokes that anonymous proc, passing it the arguments it needs.

As an example, these are equivalent:

```tcl
# using proc
proc myReverse {str} {return [string reverse $str]}
Expand All @@ -33,7 +41,7 @@ puts [apply {{str} {string reverse $str}} "Hello, World!"]
set func {{str} {string reverse $str}}
puts [apply $func "Hello, World!"]
```

Using `apply` makes it simpler to pass around blocks of code.

Ref: [`apply`](https://tcl.tk/man/tcl8.6/TclCmd/apply.htm),
[`proc`](https://tcl.tk/man/tcl8.6/TclCmd/proc.htm).
Ref: [`apply`](https://tcl.tk/man/tcl8.6/TclCmd/apply.htm), [`proc`](https://tcl.tk/man/tcl8.6/TclCmd/proc.htm).
4 changes: 3 additions & 1 deletion exercises/practice/zebra-puzzle/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Tcl Packages
# Instructions append

## Tcl Packages

This is the first exercise to include a pre-written package.
Note the presence of the file `pkgIndex.tcl` and the inclusion of the current directory in the `auto_path` variable.
Expand Down
7 changes: 5 additions & 2 deletions exercises/practice/zipper/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Scope
# Instructions append

You'll find a Tree class already implemented for you. Your task is to write the Zipper class.
## Scope

You'll find a Tree class already implemented for you.
Your task is to write the Zipper class.
Loading