soegaard / infix Goto Github PK
View Code? Open in Web Editor NEWInfix expression for Racket
License: The Unlicense
Infix expression for Racket
License: The Unlicense
i try to use the code:
#lang at-exp racket
(require infix)
(define txt "2+2")
@${ txt } or ($ "txt")
but the output it's the string "2+2" and not the evaluation @${2+2} or ($ "2+2") -> 4
it is posible to use a string as argument of $ to be evaluated as i need?
In programs like this:
#lang at-exp racket/base
(require infix)
(define x0 0)
(define v 5)
(define dt 1)
@${x@"0" + v*dt}
Because direct string escapes are handled specially by the at-exp reader, this expands directly to ($ "x0 + v*dt")
, so it thinks the v
and the dt
are 3 characters before where they are.
If I have this program in DrRacket:
#lang at-exp racket
(require infix)
(let ([a '(1 1)] [b '(2 3)] [+ (λ (a b) (map + a b))])
@${a+b})
And then I right-click on the a in @${a+b}
then the check-syntax arrow points the the right thing, but the menu pops up with an option saying rename +
, then if I proceed to rename it to, say -
, then it changes it to:
(let ([- '(1 1)] [b '(2 3)] [- (λ (a b) (map + a b))])
@${--b})
In other words, it renames both a
and +
to -
.
Do you have any idea what could be causing this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.