Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change aliases to use rename-out. #18

Closed
wants to merge 12 commits into from
Closed

Change aliases to use rename-out. #18

wants to merge 12 commits into from

Conversation

bkc39
Copy link
Collaborator

@bkc39 bkc39 commented Oct 10, 2015

Like it says, we change the manually defined aliases to use rename-out. Looks ready to merge. I just haven't tested if the contracts also inherit when you do rename-out. Conditional on that being true, this is good to go.

@bennn
Copy link
Owner

bennn commented Oct 10, 2015

Contracts do not inherit.

#lang racket/base

(module a racket/base
  (require racket/contract/base)
  (define (f x) x)
  (provide (contract-out (f (-> integer? integer?)))
           (rename-out (f funsafe)))
)

(require 'a)

(f 2)
;(f "2") ;; Contract error
(funsafe 2)
(funsafe "2")

I would rather do the renaming in an interface file. In bessel.rkt just export one name. Then make a file private/numerics/functions.rkt or just numerics.rkt and:

  • (require "bessel.rkt")
  • (rename-out ...)

@bkc39
Copy link
Collaborator Author

bkc39 commented Oct 14, 2015

Not sure why it says its failing?

(λ  bkc39 . racket/mechanics) (λ b . aliases) λ cd ..
(λ  bkc39 . cs/racket) λ raco pkg update mechanics/
Updating:
  mechanics
Uninstalling to prepare re-install of mechanics
Re-installing mechanics
raco setup: version: 6.2.1 [3m]
raco setup: installation name: 6.2.1
raco setup: variants: 3m
raco setup: main collects: /Applications/Racket v6.2.1/collects
raco setup: collects paths:
raco setup:   /Users/bkc39/Library/Racket/6.2.1/collects
raco setup:   /Applications/Racket v6.2.1/collects
raco setup: main pkgs: /Applications/Racket v6.2.1/share/pkgs
raco setup: pkgs paths:
raco setup:   /Applications/Racket v6.2.1/share/pkgs
raco setup:   /Users/bkc39/Library/Racket/6.2.1/pkgs
raco setup: links files:
raco setup:   /Applications/Racket v6.2.1/share/links.rktd
raco setup:   /Users/bkc39/Library/Racket/6.2.1/links.rktd
raco setup: main docs: /Applications/Racket v6.2.1/doc
raco setup: --- updating info-domain tables ---
raco setup: --- pre-installing collections ---
raco setup: --- installing foreign libraries ---
raco setup: --- installing shared files ---
raco setup: --- compiling collections ---
raco setup:  deleting /Users/bkc39/Documents/cs/racket/mechanics/private/kernel/compiled/express_rkt.dep
raco setup:  deleting /Users/bkc39/Documents/cs/racket/mechanics/private/kernel/compiled/express_rkt.zo
raco setup:  deleting /Users/bkc39/Documents/cs/racket/mechanics/private/kernel/compiled/generics_rkt.dep
raco setup:  deleting /Users/bkc39/Documents/cs/racket/mechanics/private/kernel/compiled/generics_rkt.zo
raco setup:  deleting /Users/bkc39/Documents/cs/racket/mechanics/private/kernel/compiled/types_rkt.dep
raco setup:  deleting /Users/bkc39/Documents/cs/racket/mechanics/private/kernel/compiled/types_rkt.zo
raco setup: --- parallel build using 4 jobs ---
raco setup: 3 making: <pkgs>/mechanics
raco setup: 3 making: <pkgs>/mechanics/coverage
raco setup: 3 making: <pkgs>/mechanics/coverage/assets
raco setup: 3 making: <pkgs>/mechanics/coverage/private
raco setup: 3 making: <pkgs>/mechanics/coverage/private/kernel
raco setup: 3 making: <pkgs>/mechanics/coverage/private/numerics
raco setup: 3 making: <pkgs>/mechanics/coverage/private/numerics/functions
raco setup: 3 making: <pkgs>/mechanics/coverage/private/numerics/integer
raco setup: 3 making: <pkgs>/mechanics/coverage/scribblings
raco setup: 3 making: <pkgs>/mechanics/coverage/scribblings/numerics
raco setup: 3 making: <pkgs>/mechanics/coverage/scribblings/numerics/functions
raco setup: 3 making: <pkgs>/mechanics/coverage/scribblings/numerics/integer
raco setup: 3 making: <pkgs>/mechanics/private
raco setup: 3 making: <pkgs>/mechanics/private/display
raco setup: 3 making: <pkgs>/mechanics/private/kernel
raco setup: 3 making: <pkgs>/mechanics/private/numerics
raco setup: 3 making: <pkgs>/mechanics/private/numerics/functions
raco setup: 3 making: <pkgs>/mechanics/private/numerics/integer
raco setup: 3 making: <pkgs>/mechanics/scribblings
raco setup: --- creating launchers ---
raco setup: --- installing man pages ---
raco setup: --- building documentation ---
raco setup: 3 skipping: <pkgs>/custom-load/custom-load.scrbl
raco setup: 2 skipping: <pkgs>/cover/cover/scribblings/cover.scrbl
raco setup: 3 running: <pkgs>/mechanics/scribblings/mechanics.scrbl
raco setup: rendering: <pkgs>/mechanics/scribblings/mechanics.scrbl
raco setup: --- installing collections ---
raco setup: --- post-installing collections ---

Seems to build fine for me..

@bkc39
Copy link
Collaborator Author

bkc39 commented Oct 14, 2015

Finally! looks like this is up to date. If this is good to you let'd do it to it.


(rename-out
[Rf Carlson-elliptic₁]
[Rf Carlson-elliptic-1]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make all the ascii versions be fn_N?

Mostly, I want to be consistent. But also I think underscores are better than hyphens or nothing at all.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? The scmutils versions all use fnN with no underscore in bessel and fn-N in elliptic. I only have it this way for consistency.

@bennn
Copy link
Owner

bennn commented Oct 14, 2015

k that is all. Consistent ascii names and a plea for provide/api.

@bkc39
Copy link
Collaborator Author

bkc39 commented Oct 14, 2015

Ok. Is this what you meant by consistent names?

For the provide/api let's do that in a separate issue, #26. Let's keep this one for just the renaming.

@bennn
Copy link
Owner

bennn commented Oct 14, 2015

No, this isn't really what I meant with the names.

I think we should give one ascii equivalent for names like bessj₁ and Carlson-elliptic₁. In the original PR, these functions each had one ascii equivalent, but it was bessj1 for the former and Carlson-elliptic-1 for the other. I didn't like how only one name had a hyphen before the number.

(Now there's multiple names for each.)

@bennn
Copy link
Owner

bennn commented Aug 25, 2017

b18b0e7

@bennn bennn closed this Aug 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants