Added: 3 years ago
From: SturmDarkblade
Views: 2,854
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (3)

Sign In or Sign Up now to post a comment!
  • Isn't this just a macro system?

  • Looks interesting... just one question: how does your language handle this?

    let (foo ?a) => (id 1)

    let (?a bar) => (id 2)

    (foo bar)

  • I gave it a bit of thought, but I couldn't think of any good way to hash them correctly. So I just go through the list of functions from the top to the bottom. So the one that is defined first will be the one that is evaluated.

  • Good fun! I am actually not sure this kind of "power" is useful or more useful than normal macros but it is fun to invent esolangs. I actually had a very similar idea to this with patterns rather than functions or variables. But my syntax was rather awkward:

    yours:let (foo ?a) = (bar ?a)

    mine:foo x1 means bar x1

    I was going for making a language that was essentially English, and grammatical. But it is impractical for when you pass a "function" another function the English becomes meaningless.

  • With pattern matching, one could easily define a crude english-like language. For example:

    let (if ?a then ?b else ?c) => (if ?a ?b ?c)

    or a 'english map' like:

    let (map the pattern ?a across the list ?b) => (map ?a ?b)

    To make the english make sense in a larger context, you could define specialized pattern such as:

    let (?a and then reverse) => (reverse ?a)

    So you could write stuff as:

    ((map the pattern double across the list (test scores)) and then reverse)

    Almost english ;-)

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more