flurine_lambda 0.9.3

  • Readme
  • Changelog
  • Installing
  • 63

A library for Dart developers.

Created from templates made available by Stagehand under a BSD-style license.

Usage #

A simple usage example:

import 'package:lambda/flurine_lambda.dart';

const TIME = 'tm';
const CONCAT = 'cc';

void main() async {
  Handler.registerMany({
    CONST: () => ConstHandler(),
    TIME: () => TimeHandler(),
    CONCAT: () => ConcatHandler(),
  });
  await Vein.init();
  final lambda = Lambda.parse('\$tm(2)\$');
  await lambda.execute();
  lambda.vein.listen(onData);
}

void onData(data) {
  print(data);
}

In above formula : #

- 'tm' is Lambda keyword,
- 2 (integer) is argument which is handled by [TimeHandler] 
- whole lambda should be wrapped between $ sign.
- handlers should be registerd first.

Here whole data is processed behind single Isolate (here [Vein]) which should be initialized first.

I don't where you can use this library or an idea like this but here it is.

class TimeHandler extends Handler {

  @override
  Future compute() async {
    return DateTime.now().second;
  }

  @override
  Duration get repeatingDuration => Duration(seconds:params.last);
}

class CounterHandler extends Handler {

  @override
  Duration get repeatingDuration => null;

  int begin, end, step,current;

  @override
  set params(List params) {
    this.params = params;
    begin = params[0];
    end = params[1];
    step = params[2];
    current = params[3];
  }

  @override
  Future compute() async {
    if (current == null || current > end) current = begin;
    int temp = current;
    current = current + step;
    return temp;
  }
}

class ConcatHandler extends Handler{

  @override
  Duration get repeatingDuration => null;

  @override
  Future compute() async{
    return params.join();
  }

}

0.9.2 #

  • Added Example in README file

0.9.1 #

  • Package renamed due to conflicts

0.9.0 #

  • Initial version, created by Stagehand

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flurine_lambda: ^0.9.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flurine_lambda/flurine_lambda.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
32
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
87
Overall:
Weighted score of the above. [more]
63
Learn more about scoring.

We analyzed this package on May 30, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.2
  • pana: 0.13.8-dev

Health issues and suggestions

Document public APIs. (-1 points)

78 out of 78 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/vein/vein.dart. (-1.99 points)

Analysis of lib/src/vein/vein.dart reported 4 hints:

line 23 col 9: DO use curly braces for all flow control structures.

line 25 col 9: DO use curly braces for all flow control structures.

line 38 col 9: DO use curly braces for all flow control structures.

line 117 col 7: DO use curly braces for all flow control structures.

Format lib/flurine_lambda.dart.

Run dartfmt to format lib/flurine_lambda.dart.

Format lib/src/lambda/extras/interceptor.dart.

Run dartfmt to format lib/src/lambda/extras/interceptor.dart.

Fix additional 8 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/lambda/extras/middleware.dart (Run dartfmt to format lib/src/lambda/extras/middleware.dart.)
  • lib/src/lambda/handlers/handlers.dart (Run dartfmt to format lib/src/lambda/handlers/handlers.dart.)
  • lib/src/lambda/lambda.dart (Run dartfmt to format lib/src/lambda/lambda.dart.)
  • lib/src/lambda/parser/keywords.dart (Run dartfmt to format lib/src/lambda/parser/keywords.dart.)
  • lib/src/lambda/parser/lambda_parser.dart (Run dartfmt to format lib/src/lambda/parser/lambda_parser.dart.)
  • lib/src/lambda/parser/parser.dart (Run dartfmt to format lib/src/lambda/parser/parser.dart.)
  • lib/src/lambda/parser/token.dart (Run dartfmt to format lib/src/lambda/parser/token.dart.)
  • lib/src/vein/flow.dart (Run dartfmt to format lib/src/vein/flow.dart.)

Maintenance suggestions

The package description is too short. (-8 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Homepage URL is insecure. (-5 points)

Update the homepage field and use a secure (https) URL.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and flurine_lambda.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
petitparser ^3.0.2 3.0.4
Transitive dependencies
meta 1.1.8
Dev dependencies
pedantic ^1.8.0
test ^1.6.0