Jump to content

length-invert** (works with ties)

Recommended Posts

;;; FUNCTION: for some coding-cases i needed THIS function, to keep the OMN-notation 
;;; and not to change to RATIO (otherwise i got strange results in NOTATION because the "ties are gone")

(defun length-invert** (length-val)
  (append (compress (list '- length-val))))


;;; new => keeps OMN
(length-invert** (car '(q e4 mp)))
=> -q

; in this case i wanted to keep the format with tie
(length-invert** (car '(3q_q e4 mp)))
=> -3q_q

;;; original => changes to ratio
(length-invert (car '(q e4 mp)))
=> -1/4

; no tie here! i was in trouble :-)
(length-invert (car '(3q_q e4 mp)))
=> -1/3


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Terms of Use Privacy Policy