@sebfumaster said:
@Matthew said:
That won't actually work, since each multiword line from [shell] is a list itself; shell is outputting a list of lists, from which list #n is desired. There is no list of lists (of symbols) native in Pd.
why would "casting" as a list not work? the reason it's there is to put the list selector on in order to get the right element (the 5th) from $5 because pd recognizes the list selector.
the reason the error occurs is in the case when the fifth element isn't present, which somelogic would fix.
otherwise it works, but i'm still curious why it wouldn't?
Did you run it? Your patch doesn't work because [ls -al( returns a series of lines, each line a series of words. Pd doesn't recognize the newline delimiter, only the space delimiter that makes the whole output look like just one long list, that happens to contain lines. There's no structure in Pd to say "5th line" or "fifth list", just "5th atom in a list" at best.Pd doesn't have data structures at all except for space-delimited list, whether of symbols or other atoms. It doesn't even have strings. It doesn't have any way to make more complex data structures, except the crazily complicated struct/template system that doesn't support runtime dynamic template construction, except perhaps by the ridiculous kluges for dynamic patching. Pd is a programming system, but it is not really a *metaprogramming* system, where runtime logic can change definitions. It's an object system with classes available for instantiation only by the programmer, not by the program.
That's why it's a pretty interesting music/performance system, but an extremely frustrating general programming system. Instead of "Pure-Data" it really could be called "No-Metadata".