The Shen CLOS: An object oriented capability for Shen

190 views
Skip to first unread message

Antti Ylikoski

unread,
Jul 1, 2018, 4:34:59 AM7/1/18
to Shen
I have been tinkering with creating an object oriented capability for
Shen.  Decided to post it in the group.

I made a way to bring the full underlying LISP CLOS capability to
Shen, using the LISP/Shen interface.  The two files that I attach are
examples of how to do this.

The file clos-example.lisp is an example from a well-known LISP
textbook.  (Winston, 1992)

The file clos.shen is the same program implemented with the LISP/Shen
interface, and how the CLOS usage is done.

After this, the Shen system has a full scale LISP CLOS capability.  Id
est, Shen has a full scale object oriented capability.

AJY


clos.shen
clos-example.lisp

Mark Tarver

unread,
Jul 1, 2018, 4:38:44 AM7/1/18
to Shen
Could you tell me what work you wish me to place in the OS library?

These two last programs I suppose?

Mark

Antti Ylikoski

unread,
Jul 1, 2018, 8:24:15 AM7/1/18
to Shen
Yes.  The two demos and examples.

And, I really should author a document concerning this one.  It would require some time.....

AJY
Finland

Antti Ylikoski

unread,
Jul 3, 2018, 10:51:40 AM7/3/18
to Shen
You can do the same action, as with the MasterMind.

Place those two files in the OS library in one .zip file.

A user of Shen will be able to use the Shen CLOS without a very detailed document file.  I wrote the comments in the program files with this in mind.

AJY
Finland

Robert Koeninger

unread,
Jul 3, 2018, 11:57:16 AM7/3/18
to Shen
Maybe this could be added to shen-libs? It doesn't have anything OO yet.

Antti Ylikoski

unread,
Jul 3, 2018, 12:11:04 PM7/3/18
to Shen
Yes, I agree.

Should I write a better demo to this end, or, however, write some document(s) concerning the Shen CLOS?

You can quite freely add this one to the shen-libs.

AJY
Finland

Antti Ylikoski

unread,
Jul 23, 2018, 2:42:58 AM7/23/18
to Shen
I have not been using extensively the GitHub.

How do I add these ones to the shen-libs?  I understand I must make a pull request?

AJY


tiistai 3. heinäkuuta 2018 18.57.16 UTC+3 Robert Koeninger kirjoitti:

Robert Koeninger

unread,
Jul 23, 2018, 10:49:04 AM7/23/18
to Shen
The shen-libs repo is at https://github.com/vasil-sd/shen-libs

Fork it to your profile (Fork in the upper right corner), I'd create a new branch off of master, add and commit your work to it, push it to your fork, open a PR to merge your branch on your fork to the master branch on the upstream repo.

I'd create a folder specifically for your CLOS work. Look at the other folders for an example of how to set up your module. The others contain a module.shen file, I'd make one with a the same format.

That's not the most exhaustive explanation. You can supplement it with a google search or I can offer more detail if needed.

I'm not sure who's going to merge the PR, Ramil (gravicappa) has merged the last few. I don't know how active he is.

Antti Ylikoski

unread,
Jul 31, 2018, 11:13:35 AM7/31/18
to Shen
The Shen CLOS repo is https://github.com/bluejay77/OO

I did not know how to make a pull request to join this one to the Shen libs repo.

Maybe the wizards here can and will do so.

Dr AJY
Finland

Robert Koeninger

unread,
Jul 31, 2018, 3:34:27 PM7/31/18
to Shen
I don't think you can open a PR from 1 repo to an unrelated repo. You would fork vasil-sd/shen-libs which would create bluejay77/shen-libs. After making changes in that repo (preferably on a new branch), you would open a PR from bluejay77/shen-libs back to vasil-sd/shen-libs. Then someone with the ability to merge into the vasil-sd repo could merge it.

Also, is that the right code in that repo? Those 2 files look like examples of using CLOS (CL's CLOS) from Shen, not the OO code I saw you had before. It wouldn't be "The Shen CLOS" if it was just CL-specific interop to CL-specific functionality. I thought you had a whole OO system in pure Shen working.

Antti Ylikoski

unread,
Aug 1, 2018, 7:02:00 AM8/1/18
to Shen
I had, and I still have, under development a Shen OO system for Shen,
written in Shen.  The code is there, and can be brought to the
completion, and can be uploaded in the GitHub.  I probably will do
this one.  This code is based on Paul Graham's book, and it mimics the
CL CLOS.  ("On Lisp", Ch 25 "Object-Oriented Lisp".)

I came, after that, to the conclusion that the best way to implement
the OO in Shen, is to bring the full scale CL CLOS to Shen.

This would bring the widest possible repertoire of OO capabilities to
Shen.  This one is my Plan #1.

But I probably will prepare and upload my Plan #2, the Shen OO written
in Shen, mentioned above.

Plan #3 was Mark's o-o.shen, this one can be used in implementing the
Plan #2.

(Plan #4 was Professor Patrick Henry Winston's CLOS.LISP converted
into Shen.)


yours, AJY
Finland

Robert Koeninger

unread,
Aug 6, 2018, 12:21:00 AM8/6/18
to Shen
I would want to include a pure Shen (not CLOS) OO system in the libs. If something is dependent on CLOS, it's only going to work in shen-cl, and break platform-independence.

We could also take inspiration from other OO systems to make a unique SHOS - like having multimethods that dispatch using the logic engine instead of types or a predicate function.

Neal Alexander

unread,
Aug 6, 2018, 1:01:31 AM8/6/18
to Shen
I spent a significant amount of time writing a type driven, non-deterministic (optionally deterministic via annotations, and optionally untyped) system for ad-hoc polymorphism similar to type classes and instances in Haskell, but (hopefully) more flexible.

It might get released sometime next year.

Antti Ylikoski

unread,
Aug 6, 2018, 2:10:33 AM8/6/18
to Shen
I will show what I have been doing.

This is something I have been making from Paul Graham.  It is not
finished.  It is in LISP.

Making the selfsame one in pure Shen is clearly not hard.  I think I
will do this one in pure Shen.  And the community will get the Shen OO
in the GitHub.

yours, AJY
Europe
object.lisp
Reply all
Reply to author
Forward
0 new messages