REBOL Oneliners
11–20 of 54 posts
Re: REBOL Oneliners
#12Re: REBOL Oneliners
#13Looks really interesting. Anyone able to get this to work on Catalina? I'm getting "bad CPU type in executable" for both the PPC and Intel versions.
PPC definitely won't work on Catalina. PPC support was dropped from macOS years ago. The Intel binary is 32-bit only. Catalina will only run 64-bit binaries. $ file rebol rebol: Mach-O executable i386
I lost access to so much cherished stuff that I am currently evaluating a switch to Ubuntu 20.04
Re: REBOL Oneliners
#14The idea of a one-liner is sort of silly when applied to functional programming. Every lisp expression, for example, no matter how long in editor space, is logically a single line.
I'd rather go through 5 lines of simple statements than try to decipher a "clever" one liner.
From the fine article : > Open a GUI, read web page, sent it as email
You really want to do that in one line ?
Re: REBOL Oneliners
#15The syntax looks kind of odd - it feels a bit like trying to read lisp without the parentheses. Seems like a very expressive language though based on the number of characters needed to get stuff done
Re: REBOL Oneliners
#16Re: REBOL Oneliners
#17The idea of a one-liner is sort of silly when applied to functional programming. Every lisp expression, for example, no matter how long in editor space, is logically a single line.
To me all (complex) one liners are bad : they're hard to read and they don't manage errors. I'd rather go through 5 lines of simple statements than try to decipher a "clever" one liner. From the fine article : > Open a GUI, read web page, sent it as email You really want to do that in one line ?
why would it be undesirable to write short code that can do that?
Re: REBOL Oneliners
#18Earlier quoted context omitted.
PPC definitely won't work on Catalina. PPC support was dropped from macOS years ago. The Intel binary is 32-bit only. Catalina will only run 64-bit binaries. $ file rebol rebol: Mach-O executable i386
Does anyone else think cutting off 32-bit support basically killed off what remained appealing about the Mac that differentiated it from being just a “desktop iOS iPad in the iCloud ecosystem”? I lost access to so much cherished stuff that I am currently evaluating a switch to Ubuntu 20.04
Re: REBOL Oneliners
#19Earlier quoted context omitted.
PPC definitely won't work on Catalina. PPC support was dropped from macOS years ago. The Intel binary is 32-bit only. Catalina will only run 64-bit binaries. $ file rebol rebol: Mach-O executable i386
Does anyone else think cutting off 32-bit support basically killed off what remained appealing about the Mac that differentiated it from being just a “desktop iOS iPad in the iCloud ecosystem”? I lost access to so much cherished stuff that I am currently evaluating a switch to Ubuntu 20.04
Must have just gotten lucky, but literally nothing stopped working when I migrated to a new Catalina machine. Ok I had to do some jimmying to get Keybase back, but that wasn't a 32/64-bit issue, that was weird kext permissions stuff.
Re: REBOL Oneliners
#20The syntax looks kind of odd - it feels a bit like trying to read lisp without the parentheses. Seems like a very expressive language though based on the number of characters needed to get stuff done
IIRC I read somewhere that Rebol is homoiconic but not sure.
foreach file load %./ [if not dir? file [write/binary join ftp://user:pass@example.com/ file read/binary file]]
Those two sets of [ ] are the block! datatype, which is an array-like type. "foreach" is a function that takes an identifier and two block!s ("load" returns a block!), executing the second for each one in the first.Quick example showing it:
>> something: [print val]
== [print val]
>> foreach val [1 2 3] something
1
2
3
>> append something [+ 3]
== [print val + 3]
>> foreach val [1 2 3] something
4
5
6
The second example in the oneliners kinda shows this as well, but I suppose it's not obvious without knowing more of the language. The outer block! is actually a separate dialect being passed to the layout function as data, that the layout function parses and handles. What's normally thought of as rebol is called the "do dialect", because that's how you run a block! as code: >> X: [print 1 + 2]
== [print 1 + 2]
>> do X
3
>> X/3
== +
>> X/3: to-word {*}
== *
>> X
== [print 1 * 2]
>> do X
2