Skip to content

Style guide for std.<language>? #23

Description

@dospunk

A style guide for implementing the standard library would be helpful, especially specifying a way to make variables and functions that are not currently in std.c or std.go.

For example, I'm working on a TypeScript backend right now. One thing I'm working on implementing is the ability to choose between printing with console.log or printing to an HTML element. Right now I've implemented this by putting these lines at the top of std.ts

const OAK_TS__PSEUDO_CONSOLE = document.getElementById("oak-out");

function OAK_TS__PRINT(x: any){
	if(OAK_TS__PSEUDO_CONSOLE) OAK_TS__PSEUDO_CONSOLE.innerHTML += x;
	else console.log(x);
}

I guess this is also my proposal for naming these functions/variables. OAK_<file extension of the language>__<name of function or variable>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationquestionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions