Giter Club home page Giter Club logo

Comments (7)

davazp avatar davazp commented on May 20, 2024

It is fine as you described. We handle forward references, so it should not arise issues. If the functions are related, then they probably would goto a specific file better, (e.g: list.lisp, string.lisp, sequence.lisp) etc.

For non-trivial functions, consider to define it prefixed with !, so we can test it easily from CL without recompiling. Then, you can define an alias like (fset 'foo #'!foo). In fact, I think we should suggest a convention and do the conversion automatically.

The conventions are very open yet, but feel free to add the HACKING file with your experience if you like. We will change it as new conventions come.

from jscl.

orodley avatar orodley commented on May 20, 2024

It is fine as you described. We handle forward references, so it should not arise issues. If the functions are related, then they probably would goto a specific file better, (e.g: list.lisp, string.lisp, sequence.lisp) etc.

Cool, that sounds good.

In fact, I think we should suggest a convention and do the conversion automatically.

Sounds like a good idea. Maybe I could define some macros like !defun and !defmacro in boot.lisp which do this? Or are you thinking of searching the package for functions named using this convention and aliasing them all at once just before export?
The former would probably be easier, and we have intern, string and subseq at that point so it should be doable.

The conventions are very open yet, but feel free to add the HACKING file with your experience if you like. We will change it as new conventions come.

Okay, I'll add it at some point. It's a good thing to have, even if there's not much in it, as people can add stuff to it as it occurs to them.

from jscl.

orodley avatar orodley commented on May 20, 2024

Although of course !defun wouldn't be defined in the CL implementation you were testing with... I'm not sure, do you have any ideas?

from jscl.

orodley avatar orodley commented on May 20, 2024

Nevermind, I just noticed that utils.lisp is loaded by host and target. I'll define the macros in there.

from jscl.

davazp avatar davazp commented on May 20, 2024

You can define the macro conditionally to be the ordinary defun on the host.

But I think it is the second approach. We would use !read for example in the code. If you load it in CL, it does not collide and you can use it. But just before finishing bootstrap, we would look for and rename prefixed functions.

There is a issue however, we actually store the macros in their list representation and dump them with the environment. But it would break if a macro use some ! prefixed function. Therefore, we should compile properly the macros into the output file, which is the right thing on the other hand.

So, by now let us forget it, but I will open a ticket in order not to forget it.

from jscl.

orodley avatar orodley commented on May 20, 2024

Okay. So, for now I should just define functions normally, without the ! prefix? And then once you've made the requisite changes to how macros work we can change them to use the ! prefix?

from jscl.

davazp avatar davazp commented on May 20, 2024

For now do what is more comfortable for you, do not worry too much about it. If you want to prefix your functions, define an alias manually. !proclaim in boot.lisp is doing this, for example.

from jscl.

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.