Skip to content

Instantly share code, notes, and snippets.

@DexterHaslem
Created February 28, 2016 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DexterHaslem/eff3d3b95675e2541cf6 to your computer and use it in GitHub Desktop.
Save DexterHaslem/eff3d3b95675e2541cf6 to your computer and use it in GitHub Desktop.
#lang racket
(struct fix-tag (tag contents))
(define fix-soh (string (integer->char 01)))
(define (compute-checksum tags)
1)
;; creates tag string with SOH attached
(define (create-tag id contents)
(string-append (string-join (list id contents) "=") fix-soh))
(define (create-msg tags)
(let ([msg-partial (string-join tags fix-soh)]
[msg-checksum (compute-checksum tags)])
(string-append msg-partial fix-soh)))
(define test-msg (string-join '("8=FIX4.2." "10=341") fix-soh))
test-msg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment