Git Product home page Git Product logo

Comments (10)

attila-lendvai avatar attila-lendvai commented on May 5, 2024 3

in my experience, a reasonably self-restrained use of anaphoric macros makes the code more readable.

from chrysalisp.

vygr avatar vygr commented on May 5, 2024 1

I also learnt from looking at (aand) that I need to fix the (and) and (or) macros in ChrysaLisp to work with 0 paramaters ! So thanks for that.

from chrysalisp.

vygr avatar vygr commented on May 5, 2024

I'd have to understand what it was first ;)

from chrysalisp.

no-identd avatar no-identd commented on May 5, 2024

See https://en.wikipedia.org/wiki/Anaphoric_macro :)

from chrysalisp.

no-identd avatar no-identd commented on May 5, 2024

And also:
http://common-lisp.net/project/anaphora/

from chrysalisp.

no-identd avatar no-identd commented on May 5, 2024

As well as here: https://common-lisp.net/project/anaphora/anaphora.html

from chrysalisp.

vygr avatar vygr commented on May 5, 2024

OK, yes I can see the benefit to having some of these macros around. But I also have some reservations, in part due to how ChrysaLisp does things, and in part due to my own personal bias.

I clearly already have source where I regularly need to keep the result of the test (or part of it) around for later use if the test turns out to be true, and I find myself doing things like:

(if (defq it (...))
(do-somthing-that-needs-it ...))

Most often in (cond) statements. And yes it's a bit of a pain, so would be nice to have a generic way of doing this.

However, I have never used (let), despite it being in the boot.inc file ! (boo, hiss, from the scope purists..) and tend to use (defq it) so as not to push another scope, and suffer the penalty of slowing access to variables by another scope (we are talking small overhead here, but there is some).

In the (acond) case you are also making every clause take the extra hit for a (let) even if only one or a few clauses make use of the convenient 'it' within that clause ?

So I feel a little conflicted on the use of these things. But don't object to them either as they are rather convenient.

As they are something a user can decide to use or not, with I would hope understanding the consequences of using them, I think it would be worth providing some of them.

from chrysalisp.

no-identd avatar no-identd commented on May 5, 2024

So I feel a little conflicted on the use of these things.

I feel the same way, and it seems that @tokenrove, @nikodemus, @attila-lendvai, @Ferada, @brianqq, @noctuid et al. (Couldn't find everyone's Github handle — sorry :)) also feel that way:

https://common-lisp.net/project/anaphora/anaphora.html

Extensive use of anaphoric macros is not good style, and probably makes you go blind as well — there's a reason why Anaphora claims to be from Hell.

Hence the question mark in the issue title. :)

I also learnt from looking at (aand) that I need to fix the (and) and (or) macros in ChrysaLisp to work with 0 paramaters ! So thanks for that.

Glad to hear that!

from chrysalisp.

no-identd avatar no-identd commented on May 5, 2024

Oh btw. — you might like this book by Paul Graham, made available by @daviddrysdale:

http://www.lurklurk.org/onlisp/onlisp.html

from chrysalisp.

vygr avatar vygr commented on May 5, 2024

I moved the anaphoric file over to class/lisp/anaphoric.inc. If folks want to include them and use them or add more of them, that's where they live.

Thanks.

from chrysalisp.

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.