Code Monkey home page Code Monkey logo

Comments (4)

spy16 avatar spy16 commented on June 4, 2024 1
  1. * I thought of making all special forms have this actually but haven't done that yet. I was thinking of having an alias in lisp code for these special forms that add some documentation also (since no doc string is added from go code. So fn* would be pure go form and fn would be wrapped version with documentation. Idea taken from clojure)
  2. fn* and macro* define a anonymous function and macro respectively. defn and defmacro define a function and bind It to a name in the root scope. macro* might go away.
  3. & is for variadic arguments similar to clojure. After & there can be only one arg which will be assigned the list of all remaining arguments.
  4. SpecialForm has a special treatment in List.Eval(). I might merge SpecialForm into Fn to reduce number of types. This is the intermediate parse step I was talking about.

from sabre.

spy16 avatar spy16 commented on June 4, 2024

@lthibault Macro support has been added in 83f8103
. It's not well tested yet. But seems to work 😄 . Do try it out and let me know when you get a chance.

from sabre.

lthibault avatar lthibault commented on June 4, 2024

@spy16 Very cool!

I've had a look, but I'm not sure what kind of useful feedback I can give, as I'm not very knowledgable in the nuances of macro systems (or lisp in general, for that matter).

In lieu of a thoughtful critique, here's a list of questions that popped into my mind as I was reading. Some of these are probably very basic.

  1. What does the terminating-* convention signify? I'm familiar with the meaning of the "earmuffs" convention (e.g. *ns*), but not of e.g. let*.

  2. What is the relationship between macro*, fn, defn and defmacro?

  3. What is the meaning of &, and where is it defined? (e.g.: (def defn (macro* defn [name & fdecl] ...)

  4. What's the rationale behind the SpecialForm type versus binding a user-defined native Go type to a scope?

In general, I think I'm looking for some insight into the design choices at play. Understanding intent will help use this correctly.

from sabre.

lthibault avatar lthibault commented on June 4, 2024

Makes sense, thanks for the explanation! This all seems sensible and I don't see anything missing.

I'm currently integrating the changes to Sabre in my project, after which I'll start focusing on the language. I'm certain I'll have some feedback at this point (albeit from the trenches!)

from sabre.

Related Issues (17)

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.