added scheme and kotlin to code_search
This commit is contained in:
24
crates/g3-core/examples/test_code/Example.kt
Normal file
24
crates/g3-core/examples/test_code/Example.kt
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.example
|
||||
|
||||
class Person(val name: String, val age: Int) {
|
||||
fun greet() {
|
||||
println("Hello, I'm $name")
|
||||
}
|
||||
|
||||
fun getAge(): Int {
|
||||
return age
|
||||
}
|
||||
}
|
||||
|
||||
interface Greeter {
|
||||
fun sayHello()
|
||||
}
|
||||
|
||||
fun main() {
|
||||
val person = Person("Alice", 30)
|
||||
person.greet()
|
||||
}
|
||||
|
||||
fun add(a: Int, b: Int): Int {
|
||||
return a + b
|
||||
}
|
||||
24
crates/g3-core/examples/test_code/example.rkt
Normal file
24
crates/g3-core/examples/test_code/example.rkt
Normal file
@@ -0,0 +1,24 @@
|
||||
#lang racket
|
||||
|
||||
(define (greet name)
|
||||
(printf "Hello, ~a!\n" name))
|
||||
|
||||
(define (add x y)
|
||||
(+ x y))
|
||||
|
||||
(define (factorial n)
|
||||
(if (<= n 1)
|
||||
1
|
||||
(* n (factorial (- n 1)))))
|
||||
|
||||
(struct person (name age) #:transparent)
|
||||
|
||||
(define (person-greet p)
|
||||
(printf "Hello, I'm ~a\n" (person-name p)))
|
||||
|
||||
(greet "World")
|
||||
(displayln (add 5 3))
|
||||
(displayln (factorial 5))
|
||||
|
||||
(define alice (person "Alice" 30))
|
||||
(person-greet alice)
|
||||
Reference in New Issue
Block a user