GithubHelp home page GithubHelp logo

Support infix functions about alpaca HOT 8 CLOSED

alpaca-lang avatar alpaca-lang commented on July 26, 2024
Support infix functions

from alpaca.

Comments (8)

yurrriq avatar yurrriq commented on July 26, 2024 1

FWIW LFE uses #"" for binaries. Not sure if that'd be any good here.

from alpaca.

lepoetemaudit avatar lepoetemaudit commented on July 26, 2024 1

Good point - I missed those. I'll add - and ..

from alpaca.

j14159 avatar j14159 commented on July 26, 2024

Thanks for digging into this! I'd like something different than b"" for binaries as they're not just strings (initial bad idea is b{} but that's kind of gross maybe?) but otherwise I think it'd be nice to have the opportunity to jettison the notion of bif function AST nodes entirely.

from alpaca.

j14159 avatar j14159 commented on July 26, 2024

I think I'm getting hung up on overloading quotes for this but I don't have a particularly strong opinion and it's relatively easy to change I think so whatever works.

from alpaca.

lepoetemaudit avatar lepoetemaudit commented on July 26, 2024

What about triple angle brackets, i.e. <<< >>> - that keeps it closer to the original and it's easier to live losing that as a reserved symbol. It's true that the final decision can be postponed, though.

from alpaca.

j14159 avatar j14159 commented on July 26, 2024

Doesn't bother me. Or use a prefix here too? Maybe # is not permitted as an operator and is reserved for prefixing other things, e.g. #{} for maps, #<<>> for binaries. Not entirely convinced of the aesthetics there, I'd say roll with what you think looks good for now and we can argue the looks later :)

from alpaca.

lepoetemaudit avatar lepoetemaudit commented on July 26, 2024

Definitely - I think the binary change is going to be the easier aspect anyway.

So far I've based the list of allowed operators on OCaml's: https://caml.inria.fr/pub/docs/manual-caml-light/node4.9.html - # is not among them so we would be safe using that. This is what I'm using to match the operators:

OP = [!\?=<>@\^\|&~\+\*/\$%]

from alpaca.

j14159 avatar j14159 commented on July 26, 2024

OK, that suggests we'd still need some sort of BIFs for -, -., etc?

from alpaca.

Related Issues (20)

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.