Hacker News new | past | comments | ask | show | jobs | submit login

Even for string?

Why not define a LinkedList constant?




Yes, in WL strings are commonly used in a matter similar to enums in other languages.

The thing to keep in mind is that WL is based on symbolic replacement. You normally wouldn't define that kind of function as taking in a parameter (i.e., CreateDataStructure[x_] := ...), rather you'd define it for each case separately (i.e., CreateDataStructure["LinkedList"] := ...).


Well.. if constants were a thing you could probably also pattern match them.


It's a constant string :P




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: