Git Product home page Git Product logo

Comments (4)

stchang avatar stchang commented on September 27, 2024

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              ║   ║                        ║
  ╠════════════════╬═══╬════════════════════════╣
  ║  000                 ║
  ╠════════════════╬═══╬════════════════════════╣
  ║a               ║ 0 ║     (let loop ([a a]   ║
  ║                ║   ║                [b b])  ║
  ║                ║   ║        (loop a b))     ║
  ╚════════════════╩═══╩════════════════════════╝) 

(f 'a 'b)

from pasterack.

stchang avatar stchang commented on September 27, 2024

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.

stchang avatar stchang commented on September 27, 2024

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.

stchang avatar stchang commented on September 27, 2024

fixed with 52c3f18

from pasterack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.