Programming By Contract for Python

2023-02-25 Thread Thomas Passin
I just learned something new that may be of interest to some devs.  There 
are a few packages that add Programming By Contract to Python.  In 
particular, iContract:

https://github.com/Parquery/icontract

If you have not heard of this approach, it was introduced in the Eiffel 
language in the late 1980s.  From Wikipedia:

"It prescribes that software designers should define formal 
, precise and verifiable 
interface specifications for software components 
,
 
which extend the ordinary definition of abstract data types 
 with preconditions 
, postconditions 
 and invariants. These 
specifications are referred to as "contracts", in accordance with a conceptual 
metaphor  with the 
conditions and obligations of business contracts."

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/a87d091c-ad97-4e74-a75f-42b2dd2151a6n%40googlegroups.com.


Re: Thumb-nail Explanation Of Leo

2023-02-25 Thread Thomas Passin
My last post was deleted for some reason.  

"*Literate Programming with Directed Acyclic Graphs (dag)" - *well, yes, 
but it's a very limited subset of what Leo can do.

"*Use Leo, the Literate Editor with Outlines, to program with directed 
acyclic graphs, along with section-references, @others, and clones." *- 
Well, yes, but a newcomer will not have any idea about what those terms 
mean or how they might be useful.

More and more I've been using Leo in different ways that are not 
programming-related at all.  I have a bookmark manager application - it's a 
set of scripts that runs in Leo - and I use that almost every day.  I have 
a zettel-kasten (we discussed that subject a year or two ago) and a related 
geneology app run by scripts that run in Leo, nothing to do with 
programming.  I sometimes write first drafts of documentation (not Leo 
documentation) in it before converting them to Libre Office .odt files.  I 
keep notes and time records for my small software consulting effort.  I 
wrote and maintain a Sphinx document that explains a software system of 
mine for other developers.  And so on.

I have come to realize that under it all, Leo helps us to create, modify, 
and otherwise work with the structure of documents that are base on plain 
text.  What's especially different about Leo is that it can help us surface 
structure that is otherwise hidden or implicit in a text file.  That's what 
we are doing when we break some text down into subtrees, when we use named 
sections and @others subtrees - we are imposing our ideas of a document's 
structure onto what would otherwise be a flat text file.  That's what we 
are doing when we create the source for a Sphinx document - we design the 
structure, make it manifest in the form of Leo subtrees, and write the 
content in Leo nodes located in those subtrees.  We are creating structured 
content with flat, plain-text files.

Literate Programming? Structured content.  Leo's source code?  Structured 
groups of plain-text yet structured files.  My bookmark manager? Structured 
collections of plain-text nodes, made useful by some Python programming.

Adding and maintaining structure and content - that's what Leo is all about.


-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/98159e04-b4c9-4e52-b50d-ef4cb17f2163n%40googlegroups.com.


Re: Software for recording yourself doing a demo: 'obs studio'

2023-02-25 Thread Edward K. Ream
On Sat, Feb 25, 2023 at 3:03 PM Félix  wrote:

> After talking with Edward about how it would be nice to see small videos
> of actual usage of Thomas main software project, GF4, he suggested me to
> post info about the software I used to make the demo for LeoInteg:
> https://youtu.be/SYwlfdEukD4?t=12
>
> On windows I use the open-source/free software called '*obs studio*'


I've just watched your demo and downloaded obs studio.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS0hDDxTi3-Dcn3XEBbsiOFHO_zMsJz%3DAR3rzF8Q7%3DFPHA%40mail.gmail.com.


Re: Thumb-nail Explanation Of Leo

2023-02-25 Thread Edward K. Ream
On Saturday, February 25, 2023 at 2:57:25 PM UTC-6 Félix wrote:

I also struggled a bit to write a concise and short explanation of what Leo 
is/does in the text introductions I wrote for LeoInteg and LeoJS... 

... 

the way I resume Leo as briefly as I can at the top of the readme for those 
projects is : 



*Literate Programming with Directed Acyclic Graphs (dag)Break your code 
down into sections structured as an outline, to derive or parse back your 
filesLeo is a fundamentally different way of using and organizing data, 
programs and scripts.*

... and in the 'welcome screen' of LeoInteg I wrote: 

*Use Leo, the Literate Editor with Outlines, to program with directed 
acyclic graphs, along with section-references, @others, and clones.*


Thanks, Félix, for these descriptions. I don't usually refer to literate 
programming (LP) when talking about Leo because some people have had 
negative opinions about LP. Perhaps those opinions have changed.

Yes, there was lots to admire about LP ca. 1985. But imo Leo redefines LP:

- First, I dislike the narrative model of documentation. Imo, documentation 
is a reference, not a novel.
- Second, outline nodes provide space for as many comments, literate or 
not, as anyone could want.
- Third, outline structure plus clones is better than any index.

Also, Leo isn't an acronym, although sometimes I say it means Leonine 
editor with outlines :-)

Otoh, your description is accurate and concise. You may have a better sense 
of whether LP has become a bad word :-)

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/9bd3f0de-f85e-4161-9d8a-42b309d0a4f2n%40googlegroups.com.


Software for recording yourself doing a demo: 'obs studio'

2023-02-25 Thread Félix
After talking with Edward about how it would be nice to see small videos of 
actual usage of Thomas main software project, GF4, he suggested me to post 
info about the software I used to make the demo for 
LeoInteg: https://youtu.be/SYwlfdEukD4?t=12

On windows I use the open-source/free software called '*obs studio*'

Hope this inspires people to make small video demos of their projects! :)

Félix

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/df30b7bf-6edd-44c7-9c20-4aedb684dda4n%40googlegroups.com.


Re: Thumb-nail Explanation Of Leo

2023-02-25 Thread Félix
I also struggled a bit to write a concise and short explanation of what Leo 
is/does in the text introductions I wrote for LeoInteg and LeoJS... 

I enjoyed reading both of your posts! :)

If it can bring you some inspiration, the way I resume Leo as briefly as I 
can at the top of the readme for those projects is : 



*Literate Programming with Directed Acyclic Graphs (dag)Break your code 
down into sections structured as an outline, to derive or parse back your 
filesLeo is a fundamentally different way of using and organizing data, 
programs and scripts.*

... and in the 'welcome screen' of LeoInteg I wrote: 

*Use Leo, the Literate Editor with Outlines, to program with directed 
acyclic graphs, along with section-references, @others, and clones.*

Félix
On Saturday, February 25, 2023 at 3:06:50 PM UTC-5 Geoff Evans wrote:

> This reminds me of something I posted in 2012 (!)  It takes its starting 
> point not from what Leo is, but from the sorts of things people might want 
> to use and program a computer for in the first place which, for many of us, 
> have very little to do with editing.  Here is is again:
>
> 
>
> I should start by saying that I use Leo daily and wouldn't now consider 
> starting any project lasting more than a week without it. I'm immensely 
> grateful to Edward and the community of collaborators for creating and 
> polishing it. Two things prompt me nevertheless to write. First, I have 
> a strong feeling that there are ways I could be using it better, to make 
> my life even easier, if only I could manage to break into them; secondly, 
> Edward asks from time to time something like "Why isn't everybody using 
> Leo and what would it take to convert more people?" Maybe the following 
> will be a contribution. 
>
> When I started programming in Python a couple of years ago, and started 
> learning about object-oriented principles, one that struck me especially 
> was "Program to the interface, not the implementation." (It often takes 
> me a while to remember this when I'm working; but it always makes things 
> better when I do.) My "Aha" moment a couple of months ago came when I 
> realized that this wasn't true only of programming -- the same principle 
> applies to writing as well. Papers that jump right in to telling me what 
> the author did don't work nearly as well as those that start with the 
> reader and what s/he might care about and how the author proposes to 
> help with that. 
>
> [Isn't it interesting that the maxim I quoted above disobeys itself, 
> because 
> it refers to the implementation in a computer program whereas the 
> real interface is the general act of communication and the primacy of the 
> receiver over the transmitter.] 
>
> So I envisage a tutorial starting as follows (sketch only): 
>
> Suppose you have a project that entails using some data, doing some 
> computations, and writing up the results. If you want to easily: 
>
> -- work on / store / contemplate the project as a unified whole 
> [Leo manages all relevant files in one outline] 
>
> -- see and work on one small part in its context 
> [Leo is an outliner] 
>
> -- copy thoughts, results from one context to another 
> [clones] 
>
> -- switch between interactive and batch processing 
> [iPython interface] 
>
> -- produce nice printed (literate?) documentation for those who don't 
> use Leo or don't do all their work glued to a computer screen 
> [rst3? noweb? Fweb? maybe little sample batch files with all the 
> required steps?] 
>
> -- ??? 
> [scripting] 
> And here I'm stuck: Leo documentation assures me that scripting is an 
> amazingly powerful answer, but doesn't tell me what questions I might 
> like to ask, or what needs I might have, that it is an answer to. It 
> simply tells me what to do if I already know why I want to. 
>
> -- Here is where the community may want to contribute ways Leo has made 
> their working lives easier and more productive, by meeting existing needs 
> or wishes that had nothing intrinsically to do with Leo. 
>
> I envisage this as complementing the existing tutorial in leodocs. It 
> may provide an entrance that a different class of potential user would 
> find attractive. Or maybe I just need someone to gently point me to 
> where what I am suggesting already exists ;-) 
>
> Cheers, geoff evans
>
> ---
>
> Major offshoots in the last decade (e.g.ViewRendered) suggest further 
> examples of "if you want to easily ..." that people who use and understand 
> them could provide.
>
> Confession:  Most of what I used to do with Leo I now do with Jupyter 
> notebooks.  This is partly because my collaborators are more likely to know 
> and use it,
> but also possibly because the documentation tends to take it for granted 
> that a feature is valuable so all that is necessary is to show me how (but 
> not why)
> to use it.
>

-- 
You received this message because you are su

Re: Thumb-nail Explanation Of Leo

2023-02-25 Thread Geoff Evans
This reminds me of something I posted in 2012 (!)  It takes its starting 
point not from what Leo is, but from the sorts of things people might want 
to use and program a computer for in the first place which, for many of us, 
have very little to do with editing.  Here is is again:



I should start by saying that I use Leo daily and wouldn't now consider 
starting any project lasting more than a week without it. I'm immensely 
grateful to Edward and the community of collaborators for creating and 
polishing it. Two things prompt me nevertheless to write. First, I have 
a strong feeling that there are ways I could be using it better, to make 
my life even easier, if only I could manage to break into them; secondly, 
Edward asks from time to time something like "Why isn't everybody using 
Leo and what would it take to convert more people?" Maybe the following 
will be a contribution. 

When I started programming in Python a couple of years ago, and started 
learning about object-oriented principles, one that struck me especially 
was "Program to the interface, not the implementation." (It often takes 
me a while to remember this when I'm working; but it always makes things 
better when I do.) My "Aha" moment a couple of months ago came when I 
realized that this wasn't true only of programming -- the same principle 
applies to writing as well. Papers that jump right in to telling me what 
the author did don't work nearly as well as those that start with the 
reader and what s/he might care about and how the author proposes to 
help with that. 

[Isn't it interesting that the maxim I quoted above disobeys itself, 
because 
it refers to the implementation in a computer program whereas the 
real interface is the general act of communication and the primacy of the 
receiver over the transmitter.] 

So I envisage a tutorial starting as follows (sketch only): 

Suppose you have a project that entails using some data, doing some 
computations, and writing up the results. If you want to easily: 

-- work on / store / contemplate the project as a unified whole 
[Leo manages all relevant files in one outline] 

-- see and work on one small part in its context 
[Leo is an outliner] 

-- copy thoughts, results from one context to another 
[clones] 

-- switch between interactive and batch processing 
[iPython interface] 

-- produce nice printed (literate?) documentation for those who don't 
use Leo or don't do all their work glued to a computer screen 
[rst3? noweb? Fweb? maybe little sample batch files with all the 
required steps?] 

-- ??? 
[scripting] 
And here I'm stuck: Leo documentation assures me that scripting is an 
amazingly powerful answer, but doesn't tell me what questions I might 
like to ask, or what needs I might have, that it is an answer to. It 
simply tells me what to do if I already know why I want to. 

-- Here is where the community may want to contribute ways Leo has made 
their working lives easier and more productive, by meeting existing needs 
or wishes that had nothing intrinsically to do with Leo. 

I envisage this as complementing the existing tutorial in leodocs. It 
may provide an entrance that a different class of potential user would 
find attractive. Or maybe I just need someone to gently point me to 
where what I am suggesting already exists ;-) 

Cheers, geoff evans

---

Major offshoots in the last decade (e.g.ViewRendered) suggest further 
examples of "if you want to easily ..." that people who use and understand 
them could provide.

Confession:  Most of what I used to do with Leo I now do with Jupyter 
notebooks.  This is partly because my collaborators are more likely to know 
and use it,
but also possibly because the documentation tends to take it for granted 
that a feature is valuable so all that is necessary is to show me how (but 
not why)
to use it.

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/65fd0504-2985-4dd1-9b1c-80b728ae5cd2n%40googlegroups.com.


Re: Thumb-nail Explanation Of Leo

2023-02-25 Thread Thomas Passin
On Saturday, February 25, 2023 at 12:11:31 PM UTC-5 I wrote:

Leo is notoriously to explain to people.  Most attempts start out something 
like "It's  a text editor, an IDE, oh, yes, a PIM, and so much more".  The 
listener is not very enlightened.


That should have read  "Leo is notoriously hard to explain to people".

Sorry for the typo.

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/acff54ab-b3e7-4051-bfca-c9e02558c520n%40googlegroups.com.


Thumb-nail Explanation Of Leo

2023-02-25 Thread Thomas Passin
Leo is notoriously to explain to people.  Most attempts start out something 
like "It's  a text editor, an IDE, oh, yes, a PIM, and so much more".  The 
listener is not very enlightened.

I've been bugged by this, so I have been working on refining the Leo's 
purpose and key concepts.  I'd like to share what I have so far, and hope 
that between us we can distill it even more clearly.

"Leo helps you create, edit, and understand the structure and contents of
collections of plain-text documents.

Plain-text documents can include text editor files, source code for program 
and documentation, and any other content that can be written as plain text, 
such as ReStructuredText, Markdown, .dot files that represent graph 
diagrams, to-do lists, and so on.

Structure includes both the arrangement of groups of related files, and 
structure that is important but rarely visualized in ordinary text files.

Leo's key concepts include a tree-like organization, nodes that contain the 
textual content, external files that can be contained as subtrees, and 
scripts that can add or change Leo's behaviors."

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/4d683b36-1813-46bc-8cd6-9cbdfdf29c16n%40googlegroups.com.