Comments (4)
Variables are properly tokenised in Murex so they don't need to be quoted. This solves problems like spaces in file names. So in your example ${ out "a z" }
is treated as a single string "a z"
.
If you want to expand variables to cover multiple parameters then you need the @
sigil instead. For example:
foobar = %[a, z]
cat @foobar
Similarly, sub-shells also support the different sigils:
cat @{ %[a, z] }
It's worth noting that @{ out "a z" }
will still be interpreted as "a z"
because you're outputting a string with a space in (ie the output of out
is a single line string rather than an array).
from murex.
This point is touched on in: https://murex.rocks/tour.html#sub-shells but I could do with making that clearer.
It looks like I copied the $
doc but forgot to change it for @
🤦 https://murex.rocks/parser/array.html
I do also plan on writing some dedicated documentation for sub-shells too
from murex.
D'oh! I see now this was largely a failure on my part to read/understand the relevant docs. Thanks for the help.
from murex.
@tiymat I think this is a failure of the docs not being clearer.
from murex.
Related Issues (20)
- Can't assign variables starting with a numeric value in an expression HOT 1
- Panic when evaluating an expression that adds a number to an array HOT 3
- Variable does not get replaced in assignment expression HOT 10
- Comparing two arrays or two maps with `==` causes a panic HOT 2
- Creating an empty array with fails: `%[]` HOT 5
- Missing parenthesises in error message
- Should parenthesis inside array and object creators be parsed as expressions? HOT 1
- Review and document experimental like `~~` operators
- Document experiemental merge pipe: `~>` HOT 1
- Deprecate `@[]` range syntax
- Deprecate `tread`
- Should `~` error if username not found? HOT 2
- Empty string check broken for some variables HOT 2
- nil pointer error in `alter --merge`
- Can't redirect output to file that has been read from HOT 2
- sub-shells handled inconsistently inside object builders
- statements exec as expressions when first parameter begins with `=`
- escape builtins should use `IsMethod()` instead of `Parameters.Len()`
- escape builtins should follow the `escape` prefix like list builtins do HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from murex.