| [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] |
You are right that Perl lacks (or discourages) certain things from other languages, so maybe the feature-rich distinction isn't so important as the TIMTOWDI distinction. Many languages try to do everything with one or two key tools. Because Perl borrows tools from so many other languages, I still question whether it has its own accent.
You can look unfamiliar with a language without having another language's accent. Of the things you list, throwing things in a hash might be one that is distinctively Perl-tinged — something that might make someone who reviews your code say, "You're trying to write Perl in Mumble!"
Caution: Contents may have been coded under pressure.
| [reply] [Watch: Dir/Any] |
(define print display)
(define $scalar 9)
(define @arr #(4 3 2))
(define %hash '((a . 1) (b . 2)))
(define (main args)
(print (+ $scalar (vector-ref @arr 1)))
(newline)
(print (assoc 'b %hash)))
Macros to turn @arr[1] into (vector-ref @arr 1)) are left as an exercise to the reader. | [reply] [Watch: Dir/Any] [d/l] [select] |