simply scheme 第二章 练习

 

Exercises

Use the functions program for all these exercises.

2.1 In each line of the following table we’ve left out one piece of information. Fill inthe missing details.

 

 

function

 arg 1

 arg 2

 result

word

 now

 here

 nowhere

sentence

 now

 here

 (now here)

first

 blackbird

 none

 b

first

 (blackbird)

 none

 blackbird

+

 3

 4

 7

every

 first

 (thank you girl)

 (hank ou irl)

member?

 e

 aardvark

 #F

member?

 the

 (the days)

 #t

keep

 vowel?

 (i will)

 (i)

keep

 vowel?

 不会

 eieio*

last

 ()

 none

 not in domain

every

 last

 (honey pie) 

 (y e)

keep

 vowel?

 taxman

 aa

 

 

 

2.2 What is the domain of the vowel? function?

所有的字母

 

2.3 One of the functions you can use is called appearances. Experiment with it, and then describe fully its domain and range, and what it does. (Make sure to try lots of cases. Hint: Think about its name.)

定义域:单个字母、数字 值域:0,1

2.4 One of the functions you can use is called item. Experiment with it, and then describe fully its domain and range, and what it does.

定义域:正整数,字符串 值域:单个字符  结构返回字符串的第i个字符

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值