Core

Summary
Core
(mosh)
Functions
fasl-writeWrite obj to binary port with Fast Loading binary format.
timeshow time-usage
fasl-readRead a object from binary port with Fast Loading binary format.
hashtable-for-eachApply proc for each (key value) pair in hashtable.
bytevector-for-eachApply proc for each byte in bytevector.
string-splitSplit text with delimiter and return result as list.
call-with-string-ioConvenient string I/O procedure.
file->stringRead string from a file filename.
file->listRead S-Expressions from a file filename.
formatFormat arg … according to string.
current-directoryReturns current directory as string
set-current-directory!Set current directory.

(mosh)

Summary
Functions
fasl-writeWrite obj to binary port with Fast Loading binary format.
timeshow time-usage
fasl-readRead a object from binary port with Fast Loading binary format.
hashtable-for-eachApply proc for each (key value) pair in hashtable.
bytevector-for-eachApply proc for each byte in bytevector.
string-splitSplit text with delimiter and return result as list.
call-with-string-ioConvenient string I/O procedure.
file->stringRead string from a file filename.
file->listRead S-Expressions from a file filename.
formatFormat arg … according to string.
current-directoryReturns current directory as string
set-current-directory!Set current directory.

Functions

fasl-write

Write obj to binary port with Fast Loading binary format.

Prototype

(fasl-write obj port)

Parameters

objobject to write.
portbinary output port.

Returns

unspecified.

See Also

fasl-read

time

show time-usage

Prototype

(time (fib 3))

Parameters

exprexpression.

Returns

unspecified.

fasl-read

Read a object from binary port with Fast Loading binary format.

Prototype

(fasl-read port)

Parameters

portbinary input port.

Returns

object.

See Also

fasl-write

hashtable-for-each

Apply proc for each (key value) pair in hashtable.

Prototype

(hashtable-for-each proc hashtable)

Parameters

proc(lambda (key value) ...).
hashtableHash table.

Returns

unspecified.

bytevector-for-each

Apply proc for each byte in bytevector.

Prototype

(bytevector-for-each proc bv)

Parameters

proc(lambda (value) ...).
bvbytevector.

Returns

unspecified.

string-split

Split text with delimiter and return result as list.

Prototype

(string-split text delim)

Parameters

textstring to split.
delimdelimiter charactor

Returns

splitted result list.

call-with-string-io

Convenient string I/O procedure.

Prototype

(call-with-string-io str proc)

Parameters

strstring
proc(lambda (in out) ...)

Returns

output-string.

Code

(define (call-with-string-io str proc)
     (receive (out get-string) (open-string-output-port)
       (let ([in (open-string-input-port str)])
         (proc in out)<br>
         (get-string))))

file->string

Read string from a file filename.

Prototype

(file->string path)

Parameters

pathpath to file.

Returns

Whole file content as string.

file->list

Read S-Expressions from a file filename.

Prototype

(file->list path)

Parameters

pathpath to file.

Returns

List of whole S-Expressions.

format

Format arg … according to string.

Prototype

(format port string . args)
(format string . args)

Parameters

portoutput port.  #t for (current-output-port) and #f for string-output.
stringformat string.
argsarguments for format string

Examples

(format #t "one is ~d" 1)
(format #t "my name is ~a" "Higepon")
(format #t "my name is ~s" "Higepon")
(format (current-error-port) "my name is ~s" "Higepon")
(format "(+ ~d ~d) => ~d" 1 2 3)

Returns

unspecified or string.

(assoc-ref mosh-list mosh) (alist->eq-hash-table mosh interaction) (ungensym mosh)

current-directory

Returns current directory as string

Prototype

(current-directory)

Returns

current directory.

See Also

set-current-directory!

set-current-directory!

Set current directory.

Prototype

(set-current-directory! path)

Parameters

pathPath to directory.

Returns

unspecified.

See Also

Read a object from binary port with Fast Loading binary format.
Write obj to binary port with Fast Loading binary format.
Set current directory.
Close