Discussion:
[dart-misc] static context passing implemented! (in Swift)
tatumizer-v0.2
2015-12-15 19:54:48 UTC
Permalink
Somebody remembers this discussion?
https://groups.google.com/a/dartlang.org/forum/#!searchin/misc/context$20tatumizer/misc/5rM931f5XOk/5QAn-R2HvLAJ

I was learning Swift the other day, and I couldn't believe my eyes: the
feature is there! Though not in a general form as we discussed, but
still... it's the same idea.
Example:

func DLog(message: String,
file: String = __FUNCTION__,
function: String = __FILE__,
line: Int = __LINE__,
column: Int = __COLUMN__)
{ println("\(file) : \(function) : \(line) : \(column) - \(message)") }


All those ugly-looking parameters __FUNCTION__, __FILE__ etc are macros. Values are propagated from calling context.
No way to know whether Swift came up with the idea independently, or it read our discussion (a bit unlikely), or maybe it stole it from some third party, but the fact remains:
the feature is in Swift and not in dart.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Loading...