Creating a comma-separated list of space-separated lists — erroneus append() behavior
See original GitHub issueI’m trying to create a comma-separated list of space-separated lists with append()
.
I expect to get the following meta-list: ( (1 2), (3 4) )
.
The problem is that append()
breaks the first sub-list, producing ( 1, 2, (3 4) )
.
$meta-list: append( ((1 2)), (3 4), comma)
@warn $meta-list
// WARNING: 1, 2, 3 4
@warn nth($meta-list, 1)
// WARNING: 1
// Just to make sure:
@warn @warn nth( ( (1 2), (3 4) ), 1)
//WARNING: 1 2
Issue Analytics
- State:
- Created 10 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
sass - Creating a comma-separated list of space-separated lists
Okay, i got it. The solution is to create a blank list first. $meta-list: () $meta-list: append( $meta-list, (1 2), comma) $meta-list: ...
Read more >Comma Separated List - an overview | ScienceDirect Topics
If the server accepts the authentication, it will send a list (comma-separated values) of the “method names” that could fulfill the client's request...
Read more >change a space delimited list into a comma delimited list with ...
Solved: I am writing a macro that takes in a list and selects records from a dataset with those names. It will look...
Read more >3. Strings, lists, and tuples — Beginning Python Programming ...
A list containing no elements is called an empty list, and a tuple with no ... when specifiying a tuple, and only use...
Read more >Splitting, Concatenating, and Joining Strings in Python
If you guessed that .split() is an instance method because strings are a special ... that is used on lists: when you call...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yo dawg I heard you liked lists so we put a list in your list so can loop while you loop.
@lolmaus as @robwierzbowski pointed out, adding an extra set of parentheses doesn’t create an extra level of list nesting. Parentheses aren’t list delimiters; they just group order of operations.
($a)
is always the same as$a
.This is the expected behavior. From the documentation of
append
: