IO fertig, trick mit module name in first julia cell

This commit is contained in:
2024-06-04 17:57:12 +02:00
parent fb58c51aa2
commit 8e83a18cd0
8 changed files with 210 additions and 128 deletions

View File

@@ -2,14 +2,21 @@
engine: julia
---
# Funktionen und Operatoren
```{julia}
#| error: false
#| echo: false
#| output: false
using InteractiveUtils
import QuartoNotebookWorker
Base.stdout = QuartoNotebookWorker.with_context(stdout)
myactive_module() = Main.Notebook
Base.active_module() = myactive_module()
# https://github.com/JuliaLang/julia/blob/master/base/show.jl#L516-L520
# https://github.com/JuliaLang/julia/blob/master/base/show.jl#L3073-L3077
```
# Funktionen und Operatoren
Funktionen verarbeiten ihre Argumente zu einem Ergebnis, das sie beim Aufruf zurückliefern.
@@ -305,7 +312,7 @@ f(.2)
["a", "list", "of", "strings"] .|> [length, uppercase, reverse, titlecase]
```
## Die `do`-Notation
## Die `do`-Notation {#sec-do}
Eine syntaktische Besonderheit zur Definition anonymer Funktionen als Argumente anderer Funktionen ist die `do`-Notation.