Skip to content

Instantly share code, notes, and snippets.

@badcc
Created May 27, 2017 19:24
Show Gist options
  • Save badcc/a6c7231e471a3f4a514e3756cc871196 to your computer and use it in GitHub Desktop.
Save badcc/a6c7231e471a3f4a514e3756cc871196 to your computer and use it in GitHub Desktop.
Meta hax. I tried using __lt to get `#include<` but working but you can't compare table/userdata with strings. This is good enough.
local _ = function() end
local include=setmetatable({},{__call=function(b,c)local d=newproxy(true)local e=getmetatable(d)e.__len=function()print('You included:',c)end return d end})
_(
#include 'stdio.h',
#include 'test'
)
--> You included: stdio.h
--> You included: test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment