Skip to content

A dirty demo to showcase `_` partial application syntax (PAS) and `--` call chain syntax (CCS)

License

Notifications You must be signed in to change notification settings

uniment/ChainingDemo.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTE

This demo is now officially dead; my ideas for chaining and underscores have moved into separate packages.

To see my latest ideas on chaining, check out MethodChains.jl.

To see my latest ideas on underscore partial application syntax, check out PartialFuns.jl.

Old readme below:

ChainingDemo.jl

This is some (buggy!) demo code to showcase my ideas expressed in this thread for partial application syntax (PAS) and call chain syntax (CCS).

To use,

] add https://github.com/uniment/ChainingDemo.jl

and

using ChainingDemo

You will now have the @demo_str macro loaded, which can be invoked like demo"(1,2)--(it[1]+it[2]^2)".

To see a bunch of examples, browse to the file ChainingDemo/src/demo_code_runthese.jl and hit SHIFT+ENTER on each line of code!

To see what the macro is doing (and hopefully you don't catch one of my many bugs):

julia> @macroexpand demo" (1,2,3)--(filter(isodd, _); map(_^2+2, _)) "
:(let it = (1, 2, 3)
      it = filter(isodd, it)
      it = map(Fix{(2,), 2}(^, 2) + 2, it)
  end)

julia> demo" (1,2,3)--(filter(isodd, _); map(_^2+2, _)) "
(3, 11)

About

A dirty demo to showcase `_` partial application syntax (PAS) and `--` call chain syntax (CCS)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages