Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

Not sure what you mean with that first question:

 readxml["<tag><a>abc</a>. </tag>"]
({"tag":"tag","attr":{},"children":({"tag":"a","attr":{},"children":("abc")},". ")})

Square brackets are needed when indexing a data structure or calling a function, like the built-in function "show". They are not needed for primitive operators like "count".

The "join" operator applied to two lists pairs up corresponding elements from each list; among other things this can be useful for formatting together multiple columns:

 ("Apple","Cherry","Onion") join 11,22,33
(("Apple",11),("Cherry",22),("Onion",33))
 (list "%s: %i") format ("Apple","Cherry","Onion") join 11,22,33
("Apple: 11","Cherry: 22","Onion: 33")

I don't know if you've seen it already, but there's a fairly similar podcast-fetcher example that ships with Lilt: https://github.com/JohnEarnest/Decker/blob/main/examples/lilt/podcasts.lil

Thanks! I had not seen the sample podcast script - I will have a read and compare to my own code.

For the first question, a simpler reproduction is readxml[" "] (ie a single space). It looks like it produces (" ?").

The 'join' operator is exactly what I was looking for - thank you.

Ah, I see the problem. Patched that edge case in readxml[].