Profile cover photo
Profile photo
Luis Reis
285 followers
285 followers
About
Luis Reis's posts

Post has attachment

Hi,

What's the proper Dart idiom for functional programming such as this?

  var randomDate = function() {
    var start = new Date(1950, 0, 1).getTime(),
          end = new Date().getTime();

    return function () {
      return new Date(randomInt(start, end));
    }
  }();

I'm currently going with:

Function randomDateGenerator() {
  int start = new DateTime(1950, 0, 1).millisecondsSinceEpoch,
      end   = new DateTime.now().millisecondsSinceEpoch;

  return () => new DateTime.fromMillisecondsSinceEpoch(randomInt(start, end), isUtc: true);
}
var randomDate = randomDateGenerator();

But it's clearly not the same functional style.

Any ideas ? I've been reading the language spec and can't find any way to declare an anonymous function and use it right away.

Thanks!,
Luis

Hi guys, I've been looking for a dart implementation that I can use on a Raspberry Pi, I can't find it anywhere, nor, dart source downloads or similar.

Can you give me some directions ?

Thanks!,
Luis

Post has attachment
Hi!

I've found a way to declare class hierarchies with angular's module system, however, I'm not particularly proud of this code.

Can you take a look and share your opinion on this ?

EDIT: After reviewing this with +Marco Alves this solution seems to be the one: http://plnkr.co/edit/rNK8OR?s=6R98ww7jXjY85iDw&p=preview

Thanks!

Post has attachment
Luis Reis changed his profile photo.
Photo
Wait while more posts are being loaded