Skip to content

Code snippets - self documenting. #3

@johanley

Description

@johanley

When PS parses your proc def's, it strips out all unnecessary white space. You can't recover the exact string of the proc from the proc.

It would be neat idea if PS could document itself, so to speak.

str -> doc-and-def -> 1. store str in a dict entry -> 2. change the string from literal to executable (or use the 'token' operator?).

OR: maybe temporarily change the def of def, to do the same. Would that interfere with 'bind'?

/doc-and-def as a new proc. It def's, but as a side-effect it stores the original string of the proc's body. Its input needs to be a string.

/blah ({.....}) def-and-doc

To doc the proc, you look up the string stored in step 1..
Use the /name of the proc as a key.
'cvn' converts a str to a /name, if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions