Files
2012-02-21 01:15:00 -05:00

1 line
1.3 KiB
JSON

[{"user_id": 32737, "stars": [], "topic_id": 41197, "date_created": 1309883989.889472, "message": "If I understand correctly, in Arc/pg they use a bit of a hack to give functions a name... to be specific, it wraps functions in a `let`, which causes Racket to infer it's name. But Racket has a specific function that you can use to rename functions: procedure-rename.\n\nAnd I just tested it out, and it seems to work okay:\n\n> +\n#<fn:+>\n\n> (racket-procedure-rename + 'foo)\n#<fn:foo>\n\nBecause it's functional, procedure-rename returns a new procedure, so you would need to use this:\n\n(= + (racket-procedure-rename + 'foo))\n\nNo clue what the performance characteristics are, but I think this would work okay for giving global functions a name.", "group_id": 9739, "id": 1568708}, {"user_id": 32943, "stars": [], "topic_id": 41197, "date_created": 1309906047.5846889, "message": "Nice! Any clue how long procedure-rename has been around?", "group_id": 9739, "id": 1571173}, {"user_id": 32737, "stars": [], "topic_id": 41197, "date_created": 1309915548.3713319, "message": "No clue, just found it in the Racket docs: http://docs.racket-lang.org/reference/procedures.html?q=here%20doc&q=case&q=change%20directory&q=environment#%28def._%28%28lib._racket/private/base..rkt%29._procedure-rename%29%29", "group_id": 9739, "id": 1571994}]