Q: how to modify the "immutable" environment and more with code.
We already have implicit variables like $nu
, $env
, etc. What if you could say which is mutable?
def bar [mutable env, mutable overlays, x, y] {
//...
$overlays
$env
}
# old style
def-env bar [] {
}
def bar [mutable env] {
}
Fernando's version
def foo [x, y]
uses mutable env, mutable overlays
{
# Pro: explicit syntax
# Con: Maybe too focussed on defs
}
def foo [x, y]
keeps env, overlay
{
}
def foo [x, y]
{
keeps env, overlay
let-env foo = bar
}
# extra signature part of the block
def foo [x, y] ![env, overlay] {
let-env foo = bar
}
if true ![env, overlay] {
foo
}
if foo {
@env
@overlays
# This would have the advantage of being part of the block
let-env BAR = "bar"
}
if 2 > 1 {|@env, @over, it| "foo" } else { "bar" }
updates env, overlay { foo a b c }
foo a b c @env @overlay
if @env 2 > 1 { "foo" } else { "bar" }
history
command to read with the same implementation from the same fileJT reports from the trenches hacking on jakt with AK. Frequent usage of some bash typical glyphs shows which value they can add in just quick typing.
&&
for shortcircuiting conditional execution only if the first part succeeds.
We already have the most important ones for history recalling !!
, !$
Maybe non goals 2>&1
>err,out>
Good decision criterion if we want to accept a bash feature: Is the muscle memory applied in a "I don't think about it" automatic fashion when typing quickly (e.g. one-line command), vs do I need to pause for a moment to solve a specific problem. Here reading and understanding it later is important and we might want to be explicit in our nushell world.
Handling of STDERR/STDOUT (https://github.com/nushell/nushell/pull/5608)
| complete
|&
as completely separate bash compatible syntax. Carrying stderr explicitlyDecision:
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing