I might go to hell for comparing C++ templates to Lisp macros, but the line `class sorter : binary_function<product,product,bool> {` is basically mapping `first_argument_type` and `second_argument_type` to `product`, and the result_type to `bool`. So it returns a boolean, depending on if the first parameter's second part is bigger than the second parameter's second part.

`pair<string,int> = make_pair("hi", 10)` is just like a `("hi" . 10)` in Scheme.

Follow

This was meant to be a reply to @m455 but I have forgotten how to Mastodon. Sorry. Also funny that you mention it looks like Java because Java's `Map<String,Integer>` syntax is borrowed from C++ and implemented totally differently, but I also used it first in Java so I know what you mean. It's familiar but different.

Sign in to participate in the conversation
Tiny Tilde Website

ttw is the unofficial Mastodon instance of tilde.town. We're only smol, but we're friendly. Please don't be a dick.