GithubHelp home page GithubHelp logo

erlando's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

erlando's Issues

R16B support

Clearly erlando relies on pmods. Are you intending to release an R16B - compatible version in future?

use of parameterized modules?

The docs indicates the parameterized modules functionality is required but
that has been removed from Erlang (I believe) so what does that mean?
Is erlando non-functional nowadays?

eunit test run does not detect test failures

As per subject, if some tests are broken but you run 'eunit' wrapper (via rebar eunit for instance) the result of the run still says

All 3 tests passed.

This seems to happen because test:test/2 wrapper catches all errors (including badmatch) and converts them into error messages (or plain ok if the test has passed), but 'eunit' treats any return from test function as test success.

It is can be easily fixed though: See the commit in my branch

However this stil not quite "eunit-ing": the first error aborts the entire test module run so if there are some other failures they won't be reported untill the first one is fixed. So here is another way to run the existing tests va 'eunit': another commit on another branch. This way all the tests (22 at the moment) are extracted and run with 'eunit' which will report all the failures.

monad:sequence/2 evaluates 'Xs' from right to left?

Because it's using lists:foldr/3, sequence/2 is evaluating Xs from right to left?

sequence(Monad, Xs) ->
    lists:foldr(fun (X, Acc) ->
                        do([Monad || E <- X,
                                     Es <- Acc,
                                     return([E|Es])])
                end, Monad:return([]), Xs).

The syntax of cuts

Given how 'cut' works and the special cases for the syntactic nesting as mentioned in https://github.com/rabbitmq/erlando/blob/bug24025/README.md, it feels to me that the cut syntax should rather be wrapped in a special function call of the form cut(<Exp>) as it is the case with many other parse transforms.

To explain, let's reuse your example:

list_to_binary([1, 2, math:pow(2, _)]).

This, as the text says, would yield

list_to_binary([1, 2, fun (X) -> math:pow(2, X) end]).

and not

fun (X) -> list_to_binary([1, 2, math:pow(2, X)]) end.

If instead the syntax was cut(Expression), you could easily choose between

list_to_binary([1, 2, cut(math:pow(2,_))])

and

cut(list_to_binary([1, 2, math:pow(2, _)])). 

You could also increase the flexibility of patterns such as

 F = [1, _, _, [_], 5, 6, [_], _]
 [1, 2, 3, G, 5, 6, H, 8] = F(2, 3, 8),

Now possibly being

F = cut([1, _, _, [_], 5, 6, [_], _])
[1, 2, 3, [4], 5, 6, [7], 8] = F(2,3,4,7,8)

Which seems rather tedious to do with the current syntax.

Other advantages would include a better fit with currently existing parse transforms. The best example of this is for QLC, where instead of basing the parse transform on its context in order to do things, you simply wrap the list comprehension in a qlc:q(LC) call, or ets' fun2ms where you do ets:fun2ms(Fun). In this last case, it also allows the code to have special cases for shell functions (whose internal structure is more like abstract code) to be able to turn them into match specifications transparently.

Given the advice of some Erlangers on IRC, wrapping things in a cut(Exp) call also makes it easier to parse visually, denotes intent better, is more flexible and serves as a warning sign that magic is happening at this place (and it's not an error!). Without having too much experience with parse transform myself, I will make the audacious call that it might make things easier to parse in the first place for the parse transform, but I might well be wrong on that one, especially since the code has already been written.

Note that this view also aligns better with the Scheme implementation it is inspired by, given the scheme implementation uses a special (cut <exp>) syntax to wrap its use.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.