Show newer

@rythur Nope, the frizz is inherent. Thankfully, we don't get humidity here. Compared to many other places, summers here are quite pleasant. Slightly envious of Florida's thunderstorms, which are rare here.

@rythur This is nine months of the year in Portland. We don't bother with umbrellas.

My card game Siva Afi: The Fireknife Dance of Samoa has cards for the River of Fire technique, where you spin the knife fast enough to fling a line of fuel onto the ground.

The realtor who left everybody a business card and a box of sparklers is going to wake up in a cold sweat in the middle of the night when she remembers that all fireworks are illegal in the city.

(Yes, sparklers are among the least dangerous fireworks and the landscape happens to be significantly less crispy than this time last year, but the joke stands.)

<Holds up finger to discouraged student>

You mean you can't move objects with your mind *yet*.

Normal languages like Java and Python let you make arrays of arrays and lists of lists. Composition is one of the great ideas of computer science.

, on the other hand, has special names and syntax for each level.

All same type? One dimension is a vector, two is a matrix, three is an array.

> 1:3
[1] 1 2 3
> matrix(1:9, nrow=3)
[,1] [,2] [,3]
[1,] 1 4 7
[2,] 2 5 8
[3,] 3 6 9
> array(1:27, dim=c(3, 3, 3))
, , 1

[,1] [,2] [,3]
[1,] 1 4 7
[2,] 2 5 8
[3,] 3 6 9

, , 2

[,1] [,2] [,3]
[1,] 10 13 16
[2,] 11 14 17
[3,] 12 15 18

, , 3

[,1] [,2] [,3]
[1,] 19 22 25
[2,] 20 23 26
[3,] 21 24 27

Lists allow for different types within the same structure (although I don't use them in the example below). The display syntax does not scream consistency or concision:

> a = list(x=1, y=2)
> a
$x
[1] 1

$y
[1] 2

> list(a, a)
[[1]]
[[1]]$x
[1] 1

[[1]]$y
[1] 2

[[2]]
[[2]]$x
[1] 1

[[2]]$y
[1] 2

> list(list(a, a), list(a, a))
[[1]]
[[1]][[1]]
[[1]][[1]]$x
[1] 1

[[1]][[1]]$y
[1] 2

[[1]][[2]]
[[1]][[2]]$x
[1] 1

[[1]][[2]]$y
[1] 2

[[2]]
[[2]][[1]]
[[2]][[1]]$x
[1] 1

[[2]][[1]]$y
[1] 2

[[2]][[2]]
[[2]][[2]]$x
[1] 1

[[2]][[2]]$y
[1] 2

(Yes, that last monstrosity is a display of a three dimensional list containing *eight numbers*.)

It's like reading old math texts, where statements are in paragraphs instead of symbols and there is special terminology for rhombuses and surjections and "summing to unity". How about we just cut to the chase and use Roman numerals?

@data_science

Discussing concatenating lists in , *The Art of R Programming* notes parenthetically that "It's odd that setting `recursive` to `TRUE` gives a *nonrecursive* list."

YES THAT IS ODD.

@data_science

@rythur @data_science Well, I'm looking for the rules, and things like this stick out.

If you like that sort of thing, you'll love Gary Bernhardt's Wat video:

destroyallsoftware.com/talks/w

@rythur @data_science What's odd is that, between the two different ways of making a list element null, one leaves the null in the list, while the other removes it and shortens the list.

If you replace an element of an list with NULL, it shortens the list.

Well, sometimes.

> a = list(1, 2, 3, 4, 5)
> b = list(8, NULL, 10)
> length(a)
[1] 5
> a[2:4] = b
> length(a)
[1] 5
> a
[[1]]
[1] 1

[[2]]
[1] 8

[[3]]
NULL

[[4]]
[1] 10

[[5]]
[1] 5

> a[3] = NULL
> length(a)
[1] 4

@data_science

I have the same objection to that I do to heavy historical tabletop wargames: too many special case exceptions.

> m = matrix(1:6, nrow=3)
> m
[,1] [,2]
[1,] 1 4
[2,] 2 5
[3,] 3 6
> a = c(1, 2)
> b = c(1)
> dim(m[a,])
[1] 2 2
> dim(m[b,])
NULL
> dim(m[b,, drop=FALSE])
[1] 1 2

@data_science

Show older
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.