Comments (4)
*
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. Sofn*
would be pure go form andfn
would be wrapped version with documentation. Idea taken from clojure)fn*
andmacro*
define a anonymous function and macro respectively.defn
anddefmacro
define a function and bind It to a name in the root scope. macro* might go away.&
is for variadic arguments similar to clojure. After&
there can be only one arg which will be assigned the list of all remaining arguments.- 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.
@lthibault Macro support has been added in 83f8103
. It's not well tested yet. But seems to work
from sabre.
@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.
-
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*
. -
What is the relationship between
macro*
,fn
,defn
anddefmacro
? -
What is the meaning of
&
, and where is it defined? (e.g.:(def defn (macro* defn [name & fdecl] ...
) -
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.
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)
- Support for metadata on symbols and collections
- Member access for Go types from Sabre HOT 12
- Moving Slang to separate repository HOT 2
- Support goroutine invocation HOT 4
- Refactor Value interface HOT 2
- Macro expansion mutates original list
- FYI: Clojure implemented in Go
- how to implement comments HOT 6
- golang package and test best practice HOT 8
- export more internal functions from specials.go HOT 11
- Sabre Experience Report HOT 11
- Invoke on List type
- Migrate parens standard library to sabre HOT 3
- Archive Sabre HOT 1
- Cannot build with GO111MODULE=1 HOT 8
- Dynamic namespace similar to Clojure HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sabre.