5 ms·
This is all very well if you have a friendly, high level scripting language like Ruby, but I'm definitely glad I don't have to write a C compiler where function
by TheBoff 13y ago
This is all very well if you have a friendly, high level scripting language like Ruby, but I'm definitely glad I don't have to write a C compiler where functions can take arbitrary blocks of code.
- swift 13y agoApple took care of it for you: http://en.wikipedia.org/wiki/Blocks_(C_language_extension) http://en.wikipedia.org/wiki/Blocks_(C_language_extension)
- rat87 13y ago> In an appropriately powerful language, it could be a function call. > This is all very well if you have a friendly, high level scripting language like Ruby, but I'm definitely glad I don't have to write a C compiler where functions can take arbitrary blocks of code. That's a surprisingly good setup because in Smalltalk(one of ruby's main ancestor languages) if/else is a method which takes a block closure. a ifTrue: [ l log: 'a is true'] ifFalse: [ 'a is false'] while in ruby if else is a syntatic construct if a l.log ('a is true') else l.log ('a is false') end probably more for perceived clarity/comfortability then speeds sake.