“Swift is the only language I could find with over 100 keywords”
11–20 of 26 posts
Re: “Swift is the only language I could find with over 100 keywords”
#12I don't think this is fair to Swift. Swift seems to have taken a view that the langauge will force you to be explicit about what you want. For example, the "indirect" keyword. Early Swift did not let you have recursive enums, apparently this can be something of a performance killer I guess was the reasoning. However they are really useful, so Swift added them. However rather than just automatically using an indirect…
Also better to trust the end used to decide what trade offs they want to make. For instance code that converts a user click to a database query, clean and understandable is more important than performance. If it takes 10ns or 10ms the user ain't going to know the difference.
Re: “Swift is the only language I could find with over 100 keywords”
#13And yet code in Swift is much cleaner than anything in Javascript. I say that having mostly written Swift & Javascript at my jobs and on the side.
Re: “Swift is the only language I could find with over 100 keywords”
#14I'm pretty sure Common Lisp has well over 100 keywords.
Re: “Swift is the only language I could find with over 100 keywords”
#15I'm pretty sure Common Lisp has well over 100 keywords.
Can you give some examples? IIUC there are builtins (macros/functions that couldn't be expressed in the language) but no keywords. There are lots of syntax elements that could be keywords like ' (quoting) but I am not aware of any true keywords.
From Wikipedia: "Some Lisp control structures are special operators, equivalent to other languages' syntactic keywords."
Re: “Swift is the only language I could find with over 100 keywords”
#16Re: “Swift is the only language I could find with over 100 keywords”
#17Re: “Swift is the only language I could find with over 100 keywords”
#18Earlier quoted context omitted.
Can you give some examples? IIUC there are builtins (macros/functions that couldn't be expressed in the language) but no keywords. There are lots of syntax elements that could be keywords like ' (quoting) but I am not aware of any true keywords.
All special forms (if, let, progv, etc...) are very similar to keywords in other languages. But there's only a couple dozen of them. From Wikipedia: "Some Lisp control structures are special operators, equivalent to other languages' syntactic keywords."
(You can't implement them all as macros, but IIRC there are disjoint built-in sets that can give you the full behaviour)