Comments (4)
another example: http://pasterack.org/pastes/47
#lang unstable/2d racket/base
(require unstable/2d/match)
;(: f : Integer Integer -> Integer)
(define (f x y)
#2dmatch
╔════════════════╦═══╦════════════════════════╗
║ y ║ 0 ║ (and b 1) ║
║ x ║ ║ ║
╠════════════════╬═══╬════════════════════════╣
║ 0 ║ 0 ║ 0 ║
╠════════════════╬═══╬════════════════════════╣
║a ║ 0 ║ (let loop ([a a] ║
║ ║ ║ [b b]) ║
║ ║ ║ (loop a b)) ║
╚════════════════╩═══╩════════════════════════╝)
(f 'a 'b)
from pasterack.
Suggestion from @takikawa: http://pasterack.org/pastes/66105
Welcome to Racket v6.1.1.6.
-> (parameterize ([read-accept-lang #t] [read-accept-reader #t]) (read))
#; ()
#lang at-exp racket
@+[1 2]
'(module anonymous-module racket (#%module-begin (+ 1 2)))
from pasterack.
The suggestion works for the eval part.
For the typesetting part, can throw everything from the paste (including #lang
, with custom readers, and leading comments) into codeblock
. But the issue is getting the for-label
links, which requires manually parsing both the #lang
and the additional requires.
01/09Fri17:17 < stchang> asumu: thanks that works for the eval part, but i
think i still have to do some manual #lang parsing in
order to get scribble to typeset and link it properly
01/09Fri17:18 < asumu> stchang: oh blargh, right
01/09Fri17:18 < stchang> specifically, i think i need to manually parse the
#lang and the requires
01/09Fri17:18 < asumu> But then can you use codeblock or whatever it's called
to handle non-sexp readers?
01/09Fri17:18 < stchang> yeah there's "code"
01/09Fri17:19 < stchang> which accepts a #:lang argument
01/09Fri17:19 < stchang> but i would still have to parse out the string to pass
as that argument
01/09Fri17:19 < stchang> and i have to extract requires, so i can do a
for-label require
01/09Fri17:21 < stchang> asumu: hmm, actually, you're right about codeblock
01/09Fri17:21 < stchang> i can just give everything, including the #lang to
codeblock
01/09Fri17:21 < stchang> but that doesnt handle the for-label requires
01/09Fri17:22 < asumu> Oh hum, right it doesn't link
01/09Fri17:22 < asumu> Can you just use your current rendering if you can
detect #lang racket (or similar) but use codeblock
otherwise?
01/09Fri17:23 < stchang> yes maybe that would work
01/09Fri17:23 < asumu> Oh are you saying the for-label requires still needs you
to parse the #lang?
01/09Fri17:23 < stchang> yes, right now i parse the #lang and include it in a
for-label require
01/09Fri17:23 < stchang> as well as the other requires
01/09Fri17:24 < stchang> but you're right, there's not reason why i cant just
keep what im already doing
01/09Fri17:24 < stchang> except for the leading comment issue
from pasterack.
fixed with 52c3f18
from pasterack.
Related Issues (20)
- filter out pastes based on ip using known spammer lists HOT 2
- Feature Request: Add API HOT 1
- Pasterack fails to run module+ in splicing-let
- Pasterack does not work with threads
- Three sections, pasted code, parse errors, eval output HOT 1
- support #lang datalog
- support external packages?
- Submitting paste without captcha and js disabled results in servlet error
- Notify #racket channel option causes error in irc-bot
- need an API to enable posting pastes directly from DrRacket with Script-Plugin
- Please add the racket topic to this repo HOT 1
- 2htdp/image raises error HOT 1
- Feature Request: Add searchbar
- Accessing raw code? HOT 11
- Pasterack breaks for this program HOT 1
- Better capthca needed HOT 1
- use latest racket (8.2)
- allow choosing racket version
- failing to load HOT 2
- Add oEmbed / OpenGraph tags for description, image HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pasterack.