draegtun
Joined 18 years ago
Joined 18 years ago
Even Ruby's trailing blocks syntax are an homage to Perl's block list subroutines:
# first Ruby example in article
users.select { |u| u.admin? }.map(&:email)
# using Perl's block list
map {$_->email} grep {$_->is_admin} @users; $hash1->{key1}{key2}
And if `hash1` was a hash (instead of a hashref) then it's just this: $hash1{key1}{key2}
The `%{}` de-reference you mention later is only when you have an operation that requires a hash, for eg: keys %{$hash1{key1}}
And for kstrauser example later in Python... hash1["hash_name"]["array_name"][3]
the equivalent in Perl would be... $hash1{hash_name}{array_name}[3]
I find having {} & [] as lookup keys for their types is not only more explicit but also safer/correct. # perl
my $x = do {
…
5
};
;; Rebol/Red
x: do [
…
5
]I remember comparing Tcl/Tk with Rebol/View - https://news.ycombinator.com/item?id=7069311
- Definitional Scoping / Rebol actually does not have scoping at all - https://stackoverflow.com/q/21964110/12195
- Bindology - https://en.wikibooks.org/wiki/Rebol_Programming/Advanced/Bin...
I totally agree and more so on ballards.
The hairs on my back of my neck always stand up when I hear I Keep A Close Watch (especially the M:FANS version [1], but the original Helen of Troy version is also great [2] and there's plenty of wonderful live versions).
[1] https://youtu.be/d7wBvyrao8I [2] https://youtu.be/LoggPfL3dLU
Or even one line :)
Factor...
: unless ( ? quot -- res ) swap [ drop ] [ call ] if ; inline
Rebol/Red... unless: func [expr block] [either expr [] block]I've seen it mentioned on Rebol chatter that Crockford approached Carl Sassenrath (creator of Rebol) to open-source & use Rebol prior to creating JSON. So having a Javascript literal wasn't on Crockford's mind at that point.
NB. Rebol was closed sourced until 2012.
user: [name: "John Doe" birth-date: 1970-01-01 account-balance: $1000.01]
[1] https://en.wikipedia.org/wiki/RebolA fly on the wall video of the 1st album [1] recording sessions was posted couple of years ago [2] which includes bits where you can see Sylvian/Sakamoto working together.
1: https://en.wikipedia.org/wiki/Brilliant_Trees
2: The Berlin Sessions - https://youtu.be/v-X36Xi8i58
And Factor and many implementations of Lisp too!
blog - http://transfixedbutnotdead.com
work - http://www.draegtun.com
twitter - http://twitter.com/draegtun
LinkedIn - http://www.linkedin.com/in/draegtun
github - https://github.com/draegtun
cpan - https://metacpan.org/author/DRAEGTUN