semantics/first-order-beginner-funs.rkt
#lang racket

(require "first-order.rkt")
(require "strings.rkt")
(require (prefix-in bsl: "beginner-funs.rkt"))

;; Numbers
(provide (rename-out [bsl:e e]
                     [bsl:pi pi]))
(make-first-order-and-provide [* bsl:* *]
                              [+ bsl:+ +]
                              [- bsl:- -]
                              [/ bsl:/ /]
                              [< bsl:< <]
                              [<= bsl:<= <=]
                              [= bsl:= =]
                              [> bsl:> >]
                              [>= bsl:>= >=]
                              [abs bsl:abs abs]
                              [acos bsl:acos acos]
                              [add1 bsl:add1 add1]
                              [angle bsl:angle angle]
                              [asin bsl:asin asin]
                              [atan bsl:atan atan]
                              [ceiling bsl:ceiling ceiling]
                              [is_complex bsl:is_complex is_complex]
                              [conjugate bsl:conjugate conjugate]
                              [cos bsl:cos cos]
                              [cosh bsl:cosh cosh]
                              [current_seconds bsl:current_seconds current_seconds]
                              [fo:denominator bsl:denominator denominator]
                              [is_even bsl:is_even is_even]
                              [exact_to_inexact bsl:exact_to_inexact exact_to_inexact]
                              [is_exact bsl:is_exact is_exact]
                              [exp bsl:exp exp]
                              [expt bsl:expt expt]
                              [floor bsl:floor floor]
                              [gcd bsl:gcd gcd]
                              [imag_part bsl:imag_part imag_part]
                              [inexact_to_exact bsl:inexact_to_exact inexact_to_exact]
                              [is_inexact bsl:is_inexact is_inexact]
                              [integer_to_string bsl:integer_to_string integer_to_string]
                              [integer_sqrt bsl:integer_sqrt integer_sqrt]
                              [is_integer bsl:is_integer is_integer]
                              [fo:lcm bsl:lcm lcm]
                              [fo:log bsl:log log]
                              [fo:magnitude bsl:magnitude magnitude]
                              [make_polar bsl:make_polar make_polar]
                              [make_rectangular bsl:make_rectangular make_rectangular]
                              [max bsl:max max]
                              [min bsl:min min]
                              [modulo bsl:modulo modulo]
                              [is_negative bsl:is_negative is_negative]
                              [number_to_string bsl:number_to_string number_to_string]
                              [is_number bsl:is_number is_number]
                              [numerator bsl:numerator numerator]
                              [odd bsl:is_odd is_odd]
                              [is_positive bsl:is_positive is_positive]
                              [quotient bsl:quotient quotient]
                              [random bsl:random random]
                              [is_rational bsl:is_rational is_rational]
                              [real_part bsl:real_part real_part]
                              [is_real bsl:is_real is_real]
                              [remainder bsl:remainder remainder]
                              [round bsl:round round]
                              [sgn bsl:sgn sgn]
                              [sin bsl:sin sin]
                              [sinh bsl:sinh sinh]
                              [sqr bsl:sqr sqr]
                              [sqrt bsl:sqrt sqrt]
                              [sub1 bsl:sub1 sub1]
                              [tan bsl:tan tan]
                              [is_zero bsl:is_zero is_zero])

;; booleans
(make-first-order-and-provide [boolean_equal bsl:boolean_equal boolean_equal]
                              [is_boolean bsl:is_boolean is_boolean]
                              [is_false bsl:is_false is_false]
                              [not bsl:not not])

;; symbols are unnecessary

;; lists
(provide (rename-out [bsl:null null]))
(make-first-order-and-provide [fo:append bsl:append append]
                              [fo:cons bsl:cons cons]
                              [fo:eighth bsl:eighth eighth]
                              [fo:empty? bsl:is_empty is_empty]
                              [fo:fifth bsl:fifth fifth]
                              [fo:first bsl:first first]
                              [fo:fourth bsl:fourth fourth]
                              [fo:length bsl:length length]
                              [fo:list bsl:list list]
                              [fo:list-ref bsl:list_ref list_ref]
                              [fo:make-list bsl:make_list make_list]
                              [fo:member bsl:member member]
                              [fo:null? bsl:is_null is_null]
                              [fo:remove bsl:remove remove]
                              [fo:rest bsl:rest rest]
                              [fo:reverse bsl:reverse reverse]
                              [fo:second bsl:second second]
                              [fo:seventh bsl:seventh seventh]
                              [fo:sixth bsl:sixth sixth]
                              [fo:third bsl:third third])

;; posns
(make-first-order-and-provide [fo:make-posn bsl:posn posn]
                              [fo:posn? bsl:is_posn is_posn])

;; characters (unnecessary)

;; strings
(make-first-order-and-provide [fo:string-contains string_contains string_contains]
                              [fo:explode bsl:explode explode]
                              [fo:variable bsl:format format]
                              [fo:implode bsl:implode implode]
                              [fo:int->string bsl:int_to_string int_to_string]
                              [fo:make-string bsl:make_string make_string]
                              [fo:replicate bsl:replicate replicate]
                              [fo:string->number bsl:string_to_number string_to_number]
                              [fo:string->alphabetic bsl:string_is_alphabetic string_is_alphabetic]
                              [fo:string-append bsl:string_append string_append]
                              [fo:string-ci<=? bsl:string_ci_leq string_ci_leq]
                              [fo:string-ci<? bsl:string_ci_lt string_ci_lt]
                              [fo:string-ci=? bsl:string_ci_equal string_ci_equal]
                              [fo:string-ci>=? bsl:string_ci_geq string_ci_geq]
                              [fo:string-ci>? bsl:string_ci_gt string_ci_gt]
                              [fo:string-length bsl:string_length string_length]
                              [fo:string-lower-case? bsl:string_is_lower_case string_is_lower_case]
                              [fo:string-numeric? bsl:string_is_numeric string_is_numeric]
                              [fo:string-ref
                               bsl:string_ref
                               string_ref]
                              [fo:string-upper-case?
                               bsl:string_is_upper_case
                               string_is_upper_case]
                              [fo:string-whitespace? bsl:string_is_whitespace string_is_whitespace]
                              [fo:string<=? bsl:string_leq string_leq]
                              [fo:string<? bsl:string_lt string_lt]
                              [fo:string=? bsl:string_equal string_equal]
                              [fo:string>=? bsl:string_geq string_geq]
                              [fo:string>? bsl:string_gt string_gt]
                              [fo:is_string bsl:is_string is_string]
                              [fo:substring bsl:substring substring])

;; misc
(provide (rename-out [bsl:eof eof]))
(make-first-order-and-provide [fo:eof-object? bsl:is_eof_object is_eof_object]
                              [fo:equal? bsl:equal equal]
                              [fo:equal~? bsl:approx_equal approx_equal]
                              [fo:error bsl:error error]
                              [fo:exit bsl:exit exit]
                              [fo:identity bsl:identity identity])